-
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.p1
Description
What is the problem?
We use aws-gov cloud. And I try to bind s3 environment to ecs. The generated cloud formation of the config is still
arn:aws:s3:::.....
following is the sample code
const bucket = s3.Bucket.fromBucketArn(this, `${props.resourcePrefix}-Bucket`, `arn:aws-us-gov:s3:::${props.configBucket}`)
....
const container = taskDefinition.addContainer(`${props.resourcePrefix}-Web`, {
containerName: `${props.resourcePrefix}-Web`,
image: ecs.ContainerImage.fromEcrRepository(repo, props.tag),
memoryReservationMiB: props.containerMemoryReservation,
logging,
environmentFiles: [EnvironmentFile.fromBucket(bucket, `${props.configPath}`)]
});
I review the source code of aws-cdk, I think the following code is the root cause. The arn may should use bucket's arn otherwise hard code arn:aws:s3:::....
| value: `arn:aws:s3:::${s3Location.bucketName}/${s3Location.objectKey}`, |
Reproduction Steps
What did you expect to happen?
cloud formation of the container environment should start with arn:aws-gov:s3:::.....
What actually happened?
cloud formation of the container environment starts with arn:aws:s3:::.....
CDK CLI Version
2.8.0 (build 8a5eb49)
Framework Version
No response
Node.js Version
v16.13.1
OS
macOS 12.1 21C52 arm64
Language
Typescript
Language Version
No response
Other information
No response
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.p1