Skip to content
v2.277.0

ExternalServiceAttributes Struct ​

The properties to import from the service using the External launch type.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';

declare const cluster: ecs.Cluster;
const externalServiceAttributes: ecs.ExternalServiceAttributes = {
  cluster: cluster,

  // the properties below are optional
  serviceArn: 'serviceArn',
  serviceName: 'serviceName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs

# cluster: ecs.Cluster

external_service_attributes = ecs.ExternalServiceAttributes(
    cluster=cluster,

    # the properties below are optional
    service_arn="serviceArn",
    service_name="serviceName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;

Cluster cluster;

ExternalServiceAttributes externalServiceAttributes = ExternalServiceAttributes.builder()
        .cluster(cluster)

        // the properties below are optional
        .serviceArn("serviceArn")
        .serviceName("serviceName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;

Cluster cluster;

var externalServiceAttributes = new ExternalServiceAttributes {
    Cluster = cluster,

    // the properties below are optional
    ServiceArn = "serviceArn",
    ServiceName = "serviceName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var cluster Cluster

externalServiceAttributes := &ExternalServiceAttributes{
	Cluster: cluster,

	// the properties below are optional
	ServiceArn: jsii.String("serviceArn"),
	ServiceName: jsii.String("serviceName"),
}

Properties ​

clusterIClusterclusterIClusterclusterIClusterClusterIClusterClusterIClusterrequired#
The cluster that hosts the service.
serviceArnoptionalstringservice_arnoptionalstrserviceArnoptionalStringServiceArnoptionalstringServiceArnoptional*string#
The service ARN.

Default: either this, or serviceName, is required

serviceNameoptionalstringservice_nameoptionalstrserviceNameoptionalStringServiceNameoptionalstringServiceNameoptional*string#
The name of the service.

Default: either this, or serviceArn, is required