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

Ability to deploy stacks directly without using the CDK CLI in order to facilitate testing with moto in Python #33290

Open
2 tasks
mderner-ca opened this issue Feb 4, 2025 · 1 comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@mderner-ca
Copy link

Describe the feature

Extending aws_cdk Stacks to allow deploying of stack into cloud directly from Python with boto3.

Use Case

This would facilitate automated integration tests with the moto library. Currently the prevailing opinion online on how to perform this type of testing is to use the AWS CDK CLI to synth a CloudFormation template, ingest the template within Python and then translate that into something which can be deployed directly via boto3 within a moto decorated test. The fragility inherent in this approach is that it relies on you to synth the template prior to running tests, it requires you to create a method of consuming the CloudFormation template, and it requires you to create more methods specific to each form of infrastructure in order to accurately deploy them as described by the IAC.

If it were possible to integrate aws_cdk with boto3 to allow the deployment of infrastructure directly in Python, neither using the AWS CDK CLI nor using the intermediary CloudFormation templates then this would greatly improve the reliability and ease of using moto to perform integration tests against mock infrastructure.

Proposed Solution

Such a solution may not in fact have to integrate with boto3 since moto intercepts calls to the AWS APIs. The solution may suffice if aws_cdk leveraged the AWS SDK for JavaScript.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.177.0

Environment details (OS name and version, etc.)

Python3.13, macOS 15.3 (24D60), Apple M2

@mderner-ca mderner-ca added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 4, 2025
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Feb 4, 2025
@pahud pahud self-assigned this Feb 5, 2025
@pahud
Copy link
Contributor

pahud commented Feb 5, 2025

Thanks for this idea. We'll bring this to the team for visibility and inputs. Meanwhile, we welcome any other thoughts from the community and please help us prioritize with 👍 .

@pahud pahud added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 5, 2025
@pahud pahud removed their assignment Feb 5, 2025
@pahud pahud added the effort/medium Medium work item – several days of effort label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days 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