-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(ecs): fromServiceAtrributes service ARN formatting #18137
Comments
Hi @tobytipton, Thanks for reporting this. The problem was already reported in issue #16634. |
Thank you for being so on top of this @jumic, the assist is very much appreciated. I am going to close this as a duplicate, and poke on getting that PR merged. 🎉 🚀 |
|
AWS has changed the [ARN format for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). Currently, CDK doesn't return the correct values/ARNs if the new ARN format is used in ECS. Changed methods: - `Ec2Service.fromEc2ServiceAttributes()` - `Ec2Service.fromEc2ServiceArn()` - `FargateService.fromFargateServiceAttributes()` - `FargateService.fromFargateServiceArn()` The logic automatically detects whether the old or new format is used. The format cannot be recognized automatically for tokenized values. Therefore the feature flag `ECS_ARN_FORMAT_INCLUDES_CLUSTER_NAME` is introduced, which controls whether the old or the new format should be used. In `Ec2Service.fromEc2ServiceAttributes()` and `FargateService.fromFargateServiceAttributes()` an ARN is created. In these methods the feature flag be considered to construct the ARN in the correct format. Closes #16634. Closes #18137. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
AWS has changed the [ARN format for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). Currently, CDK doesn't return the correct values/ARNs if the new ARN format is used in ECS. Changed methods: - `Ec2Service.fromEc2ServiceAttributes()` - `Ec2Service.fromEc2ServiceArn()` - `FargateService.fromFargateServiceAttributes()` - `FargateService.fromFargateServiceArn()` The logic automatically detects whether the old or new format is used. The format cannot be recognized automatically for tokenized values. Therefore the feature flag `ECS_ARN_FORMAT_INCLUDES_CLUSTER_NAME` is introduced, which controls whether the old or the new format should be used. In `Ec2Service.fromEc2ServiceAttributes()` and `FargateService.fromFargateServiceAttributes()` an ARN is created. In these methods the feature flag be considered to construct the ARN in the correct format. Closes aws#16634. Closes aws#18137. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* cr: https://code.amazon.com/reviews/CR-73367009
AWS has changed the [ARN format for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). Currently, CDK doesn't return the correct values/ARNs if the new ARN format is used in ECS. Changed methods: - `Ec2Service.fromEc2ServiceAttributes()` - `Ec2Service.fromEc2ServiceArn()` - `FargateService.fromFargateServiceAttributes()` - `FargateService.fromFargateServiceArn()` The logic automatically detects whether the old or new format is used. The format cannot be recognized automatically for tokenized values. Therefore the feature flag `ECS_ARN_FORMAT_INCLUDES_CLUSTER_NAME` is introduced, which controls whether the old or the new format should be used. In `Ec2Service.fromEc2ServiceAttributes()` and `FargateService.fromFargateServiceAttributes()` an ARN is created. In these methods the feature flag be considered to construct the ARN in the correct format. Closes aws#16634. Closes aws#18137. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
What is the problem?
Based on https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs-account-settings.html the ECS service ARN for new services has changed.
Old:
arn:aws:ecs:region:aws_account_id:service/service-name
New:
arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name
The
fromServiceAttributes
does not take that into effect.Reproduction Steps
This can be see when reviewing the
EcsDeployAction
when passing in aserviceArn
with the old format it generates the codepipeline action configuration with the correct service name, when passing in the new format the service name becomes theclusterName/serviceName
Old Arn Format
Results in the following service name and cluster in the ecs deploy action step.
New Arn format
Results in the following service name and cluster in the ecs deploy action step.
What did you expect to happen?
I would expect when passing either the old ARN format for services which existed previously or the new ARN format for the services would result in the correct serviceName in the configuration.
What actually happened?
The old format ARN generated the correct serviceName, the new ARN format generated the incorrect serviceName.
CDK CLI Version
N/A
Framework Version
No response
Node.js Version
N/A
OS
N/A
Language
Typescript
Language Version
No response
Other information
This can be tested by creating tests against EcsDeployAction so CDK version, nodejs, os, etc are N/A.
The text was updated successfully, but these errors were encountered: