Skip to content
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

codepipeline: Deploy EKS via codepipeline reported a S3 access denied error #14944

Closed
uxth opened this issue Jun 1, 2021 · 17 comments
Closed
Labels
@aws-cdk/pipelines CDK Pipelines library effort/medium Medium work item – several days of effort guidance Question that needs advice or information. p2

Comments

@uxth
Copy link

uxth commented Jun 1, 2021

Hello

I have created a pipeline via cdk scripts, which deploys a VPC, an EKS, and some other stuff.
Manually deploy all the stacks via cdk deploy, works fine.
Deploy the codepipeline, works.
codepipeline tries to deploy the application stage, which contains all the stacks above.
1st step, download code from github, works.
2nd step, synth, works,
the application stage
1st step, deploy VPC, works
2nd step, deploy EKS, NOT WORKING, the error was happening when it tries to deploy the nested stack, the error is S3 access denied. no other messages.

Reproduction Steps

use codepipeline to deploy a VPC and an EKS

What did you expect to happen?

I am trying to deploy all the resources I need for my project by using codepipeline in AWS, CI/CD

What actually happened?

the EKS could not be deployed by codepipeline, but it does not have any problem in deploying via cdk deploy command locally.

Environment

  • CDK CLI Version : 1.106.1 (build c832c1b)
  • Framework Version:
  • Node.js Version: 16
  • OS : mac big sur
  • Language (Version): python3.8

Other


This is 🐛 Bug Report

@uxth uxth added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 1, 2021
@github-actions github-actions bot added @aws-cdk/aws-codepipeline Related to AWS CodePipeline @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service @aws-cdk/aws-s3 Related to Amazon S3 labels Jun 1, 2021
@skinny85
Copy link
Contributor

skinny85 commented Jun 1, 2021

Hey @uxth,

thanks for opening the issue. Can you please show your code creating the Pipeline?

Thanks,
Adam

@skinny85 skinny85 added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service @aws-cdk/aws-s3 Related to Amazon S3 labels Jun 1, 2021
@uxth
Copy link
Author

uxth commented Jun 1, 2021

Hello @skinny85 ,

it is in my github repo, named cdkpipeline.
there is a file named cdk_eks_stack.py

Thanks

@skinny85
Copy link
Contributor

skinny85 commented Jun 1, 2021

Great, can I see it? 🙂

@uxth
Copy link
Author

uxth commented Jun 1, 2021

definitely

@skinny85
Copy link
Contributor

skinny85 commented Jun 1, 2021

Can you send me the link to the code then please?

@uxth
Copy link
Author

uxth commented Jun 1, 2021

https://github.com/uxth/cdkpipeline

sorry, I thought you were able to see

@skinny85
Copy link
Contributor

skinny85 commented Jun 1, 2021

Did you perform the correct bootstrapping of the account you are deploying to, as described here? https://docs.aws.amazon.com/cdk/api/latest/docs/pipelines-readme.html#cdk-environment-bootstrapping

@uxth
Copy link
Author

uxth commented Jun 1, 2021

do you mean in the code or in my terminal?

I did bootstrap in my terminal

@uxth
Copy link
Author

uxth commented Jun 1, 2021

it looks like this, as shown in the screenshot, the eks deployment failed, but the vpc succeeded, which is before eks stack.

image

@skinny85
Copy link
Contributor

skinny85 commented Jun 1, 2021

I see it's a Nested Stack. Maybe that's the problem? Perhaps Nested Stack support has some bug in CDK Pipelines?

I'm leaving this one for @rix0rrr and @otaviomacedo to diagnose, since it's a CDK Pipelines issue (and not just CodePipeline, which I initially thought).

@skinny85 skinny85 assigned otaviomacedo and rix0rrr and unassigned skinny85 Jun 1, 2021
@skinny85 skinny85 added @aws-cdk/pipelines CDK Pipelines library and removed @aws-cdk/aws-codepipeline Related to AWS CodePipeline response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jun 1, 2021
@uxth
Copy link
Author

uxth commented Jun 2, 2021

any updates?@otaviomacedo , @rix0rrr

@uxth
Copy link
Author

uxth commented Jun 3, 2021

@skinny85 is there any other people who can answer this question?
I dont think @otaviomacedo @rix0rrr have the time here.

@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 4, 2021

Hi @uxth, @otaviomacedo is trying to get to the bottom of this as we speak. Our current suspicion is nested stacks, but the issue might be more complicated.

@rix0rrr rix0rrr added guidance Question that needs advice or information. effort/medium Medium work item – several days of effort p2 and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 4, 2021
@rix0rrr rix0rrr removed their assignment Jun 4, 2021
@otaviomacedo
Copy link
Contributor

Hi, @uxth. The problem here is that your pipeline is not self-mutating. Because of that, the "Asset" stage of the pipeline get out of sync with the main stack template, which references a nested stack template that doesn't exist.

We are considering changing this flow to be less reliant on self mutation. But for now what you can do is change it to self_mutating=True (or remove self_mutating it altogether) and this will solve your problem.

@otaviomacedo otaviomacedo removed their assignment Jun 4, 2021
@uxth
Copy link
Author

uxth commented Jun 4, 2021

hi @otaviomacedo , the reason I turned off the self-mutating option is because with it on the source code could not be downloaded from github.

@uxth
Copy link
Author

uxth commented Jun 5, 2021

it is working, thank you for pointing this out.

@uxth uxth closed this as completed Jun 5, 2021
@github-actions
Copy link

github-actions bot commented Jun 5, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

mergify bot pushed a commit that referenced this issue Jun 8, 2021
…: Access Denied" case (#14986)

Related to #14944

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
…: Access Denied" case (aws#14986)

Related to aws#14944

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library effort/medium Medium work item – several days of effort guidance Question that needs advice or information. p2
Projects
None yet
Development

No branches or pull requests

5 participants