-
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
[aws-codecommit] cloneUrls returned from Repository.fromRepositoryArn(...) do not respect region in ARN #10630
Comments
Made a few edits to clarify the region mismatch where I said us-east-2 but meant us-east-1. Also corrected the "Other" url to point to the correct location, I was linking to an old version I was looking at for regressions. |
Thanks for reporting @raykrueger . This seems like a simple fix - I think you've already identified where the problem is. Any chance you could submit us a PR with a fix for this? Our docs talk about getting started with contributing to the CDK: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md Thanks, |
Yep, happy to work on a fix. I'm building a workaround in my app that I need first :) |
PR incoming shortly |
As a CDK User I expect Repository.fromRepositoryArn to use the region given when building the repository clone urls. Prior to this commit, a stack deploy in us-east-1, would return clone urls for us-east-1 even if given an ARN for us-west-2.
As a CDK User I expect Repository.fromRepositoryArn to use the region given when building the repository clone urls. Prior to this commit, a stack deploy in us-east-1, would return clone urls for us-east-1 even if given an ARN for us-west-2. Fixes aws#10630
…clone urls (#10639) As a CDK User I expect Repository.fromRepositoryArn to use the region given when building the repository clone urls. Prior to this commit, a stack deploy in us-east-1, would return clone urls for us-east-1 even if given an ARN for us-west-2. Fixes #10630 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
An IRepository instance created using Repository.fromRepositoryArn does not respect the region in the Arn. This results in a cloneUrl for the current stack region, not the region intended in the arn.
Reproduction Steps
const repo = Repository.fromRepositoryArn(stack, 'Repo', 'arn:aws:codecommit:us-east-1:1234567890:TestRepo');
console.log(repo.repositoryCloneUrlHttp);
What did you expect to happen?
While running my stack against us-west-2, I expect the clone url to come back with the region specified in the arn; us-east-1.
What actually happened?
Calls to repositoryCloneUrlHttp return a clone url targeting us-west-2, my stack region, not us-east-1 as specified in the arn.
Environment
Other
As seen here, makeCloneUrl uses ${stack.region}
aws-cdk/packages/@aws-cdk/aws-codecommit/lib/repository.ts
Line 313 in 1c2cba4
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: