-
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-cdk/aws-codecommit]: Repo can't find s3 bucket when deployed. #16958
Comments
Hey @fsmikedev, thanks for opening the issue. Can you try this, and see if that helps? const repo = new codecommit.CfnRepository(this, "test-repo", {
repositoryName: bucket.bucketName, // <--- here's the difference
code: {
branchName: "main",
s3: {
bucket: `bucket-${account}`,
key: "test",
},
},
}); |
Hi @skinny85, unfortunately that didn't change anything, still the same error. |
Hmmm... I wonder if the problem are not missing permissions? Can you try giving the |
I thought the same so I set |
Something like this: const bucket = new s3.Bucket(this, 'Bucket');
bucket.addToResourcePolicy(new iam.PolicyStatement({
actions: ['s3:*'],
resources: [
bucket.bucketArn,
bucket.arnForObjects('*'),
],
principals: [new iam.ServicePrincipal('codecommit.amazonaws.com')],
}));
|
Thanks. Still no luck, same issue...I did find this post on stackoverflow, I've already added the BucketDeployment dependency to the repo. https://stackoverflow.com/questions/63230623/aws-cdk-s3-to-codecommit-deployment |
Hmm, this answer from that question is interesting: https://stackoverflow.com/a/64746898/10787899 (look at what it says about unzipping the contents). |
Hey @fsmikedev, Have you tried adding an ordering dependency as described in the the stackoverflow response? If that doesnt resolve the issue we can keep this issue open and look into it further. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Hi @NGL321, yes that was the first thing I tried. I've checked my bucket layout and it matches what is expected by the codecommit repot bucket and key. I'm not sure what to try next. |
Hi all, anymore suggestions for this? I need to get this working somehow, thanks. |
...I've given up trying to get this to work. I'm using a lambda now. |
@fsmikedev did you do what this StackOverflow answer suggests? https://stackoverflow.com/questions/63230623/aws-cdk-s3-to-codecommit-deployment/64746898#64746898 (take special note of what is says about unzipping) |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
This repo introduces new properties to the constructor signature of the codecommit L2 Repository. It allows users to upload code when creating a codecommit repository by leveraging the aws-s3-assets lib. The user is able to upload whole directories at the moment. The behaviour has a unit tests, and an integration test, which is passing (verified manually as well). Closes #17967, provides a possible fix to #16958 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…17968) This repo introduces new properties to the constructor signature of the codecommit L2 Repository. It allows users to upload code when creating a codecommit repository by leveraging the aws-s3-assets lib. The user is able to upload whole directories at the moment. The behaviour has a unit tests, and an integration test, which is passing (verified manually as well). Closes aws#17967, provides a possible fix to aws#16958 ---- *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?
I'm trying to create a codecommit repo with the contents of an s3 bucket.
Reproduction Steps
What did you expect to happen?
The test repo would have contents deployed from the s3 bucket.
What actually happened?
An error when cdk deploy is called.
51/55 | 18:40:00 | CREATE_FAILED | AWS::CodeCommit::Repository | test-repo/test-repo (testrepoCE419A0A) Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found
CDK CLI Version
1.127.0
Framework Version
No response
Node.js Version
14.17.1
OS
Windows 10
Language
Typescript
Language Version
4.4.3
Other information
No response
The text was updated successfully, but these errors were encountered: