-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerRelated to Amazon Elastic ContainerbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortin-progressThis issue is being actively worked on.This issue is being actively worked on.p1
Description
When I use fromFargateServiceAttributes() to import an existing FargateService, its returned object doesn't has correct fargate service name if I use serviceArn as attribute, whereas passing serviceName attribute to the function returns object with correct service name.
Reproduction Steps
const importedFargateService =
ecs.FargateService.fromFargateServiceAttributes(
this,
"imported-fargate-service",
{
// serviceArn: cdk.Fn.importValue(
// `${this.project_code}-FargateServiceArn`
// ),
//serviceName: cdk.Fn.importValue(
// `${this.project_code}-FargateServiceName`
//),
cluster: importedCluster,
}
);
new cdk.CfnOutput(this, "importedFargateServiceName", {
value: importedFargateService.serviceName,
});
new cdk.CfnOutput(this, "importedFargateServiceArn", {
value: importedFargateService.serviceArn,
});
new cdk.CfnOutput(this, "importedFargateClusterName", {
value: importedFargateService.cluster.clusterName,
});
new cdk.CfnOutput(this, "importedFargateClusterArn", {
value: importedFargateService.cluster.clusterArn,
});
What did you expect to happen?
CloudFormation outputs should give correct FargateService name.

What actually happened?
FargateService name is the same as cluster name.

Environment
- **CDK CLI Version : 1.122.0 **
- Framework Version: aws-cli/2.2.6 Python/3.8.8 Windows/10 exe/AMD64 prompt/off
- Node.js Version: 14.17.0
- OS : Windows 10
- **Language (Version): TypeScript (4.3.5) **
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerRelated to Amazon Elastic ContainerbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortin-progressThis issue is being actively worked on.This issue is being actively worked on.p1