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

generated content (using cdk synth) in cdk.out cannot be reused for deploying infrastructure in another region #27063

Open
ttais2017 opened this issue Sep 8, 2023 · 7 comments
Labels
effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@ttais2017
Copy link

ttais2017 commented Sep 8, 2023

Describe the bug

generated content in cdk.out cannot be reused for deploying infrastructure in another region.

image

Expected Behavior

With the generated content within cdk.out should be also possible to deploy the App (Intrastrukture) in another Region.

Current Behavior

I have a simple Infrastrukture with nested stacks. Its deployment from console is possible, using cdk deploy.

I uploaded the content of cdk.out into a s3-bucket. This contains all files, template and assets.

From the AWS-Console in Cloud Formation (located in another region), I try to deploy/create a stack with the S3 URL of that template . But I get the error "S3 error: Access Denied For more information check http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html".

The S3 bucket allows public access and the full content of cdk.out was uploaded in that bucket

Reproduction Steps

Using the creation of a new stack from CloudFormation:
image

Try with the S3 URL of the bucket where is located the content of cdk.out.zip

cdk.out.zip

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

aws-cli/2.13.12 Python/3.11.4 Windows/10 exe/AMD64 prompt/off

Framework Version

No response

Node.js Version

9.5.1

OS

Windows

Language

Java

Language Version

Java 17

Other information

No response

@ttais2017 ttais2017 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 8, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Sep 8, 2023
@peterwoodworth
Copy link
Contributor

I'm not sure why you would expect this to work. Do we have any documentation on this topic?

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 8, 2023
@ttais2017
Copy link
Author

I would expect it, because looking into the s3 bucket (created by bootstrap), each time I deployed, the whole directory cdk.out will be uploaded to the s3 bucket and from there, CloudFormation references the resources, creating my whole scenario.

Or perhaps I 'm assuming to much ?. :\

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 8, 2023
@peterwoodworth
Copy link
Contributor

It's probably close to working, I've just never heard of the use case and am not sure if this is supposed to work. When you get the S3 error: Access Denied error, is that showing up after deployment has started? Or can you not start deployment at all? (A screenshot would be helpful)

@peterwoodworth
Copy link
Contributor

@peterwoodworth
Copy link
Contributor

OK, I think what you're encountering is that you're uploading the assets directly as they are to S3. The names of the assets in the CloudFormation template differ from as they appear in cdk.out, so you're probably encountering S3 error: Access Denied because it cannot find the filenames specified in the template.

@peterwoodworth peterwoodworth added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 11, 2023
@ttais2017
Copy link
Author

ttais2017 commented Sep 12, 2023

CloudFormation starts the deployment and in sometime later comes the error:

image

@ttais2017
Copy link
Author

I followed some steps for testing the deployment based on cdk.out.

  • I deployed my project as always with cdk deploy. The resources were uploaded on the s3 (bootstrap) and cloud formation started the deployment as always, successfully.

  • I destroyed the stack and everything was removed. Also Ok.

  • After that, I used the URL of the template (located on the s3-bootstrap) and I called from AWS-Console - Cloud Formation the function "Create Stack" from a URL.
    The deployment was also successful

  • Next Step: I tested from another region the deployment from AWS-Console/Cloud-Formation : CreateStack. This time with error :( 400

I think this kind of deployment could be considered as near new feature. Projects with IaC should also be available via Marketplace. For this, the user gets normally an URL of the related cloud template and the infrastructure will be by the used deployed.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 12, 2023
@peterwoodworth peterwoodworth added p2 feature-request A feature should be added or improved. effort/large Large work item – several weeks of effort and removed bug This issue is a bug. labels Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

2 participants