interface FargateServiceAttributes
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.FargateServiceAttributes |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#FargateServiceAttributes |
Java | software.amazon.awscdk.services.ecs.FargateServiceAttributes |
Python | aws_cdk.aws_ecs.FargateServiceAttributes |
TypeScript (source) | aws-cdk-lib » aws_ecs » FargateServiceAttributes |
The properties to import from the service using the Fargate launch type.
Example
declare const cluster: ecs.Cluster;
// Import service from EC2 service attributes
const ec2ServiceFromAttributes = ecs.Ec2Service.fromEc2ServiceAttributes(this, 'Ec2ServiceFromAttributes', {
serviceArn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service',
cluster,
});
// Import service from EC2 service ARN
const ec2ServiceFromArn = ecs.Ec2Service.fromEc2ServiceArn(this, 'Ec2ServiceFromArn', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
// Import service from Fargate service attributes
const fargateServiceFromAttributes = ecs.FargateService.fromFargateServiceAttributes(this, 'FargateServiceFromAttributes', {
serviceArn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service',
cluster,
});
// Import service from Fargate service ARN
const fargateServiceFromArn = ecs.FargateService.fromFargateServiceArn(this, 'FargateServiceFromArn', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
Properties
| Name | Type | Description |
|---|---|---|
| cluster | ICluster | The cluster that hosts the service. |
| service | string | The service ARN. |
| service | string | The name of the service. |
cluster
Type:
ICluster
The cluster that hosts the service.
serviceArn?
Type:
string
(optional, default: either this, or serviceName, is required)
The service ARN.
serviceName?
Type:
string
(optional, default: either this, or serviceArn, is required)
The name of the service.

.NET
Go
Java
Python
TypeScript (