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

Deploy via AWS CDK #2479

Closed
wants to merge 27 commits into from
Closed

Deploy via AWS CDK #2479

wants to merge 27 commits into from

Conversation

jtherrmann
Copy link
Contributor

@jtherrmann jtherrmann commented Nov 1, 2024

This PR demonstrates that it's possible to deploy via AWS CDK without converting any of our existing CF templates. We still don't know whether it's feasible to then incrementally convert stacks/resources to CDK or add new CDK resources using this approach.

Also see https://asfdaac.atlassian.net/browse/TOOL-3274

TODO:

  • Confirm that creating a new deployment works
  • Confirm that deploying to an existing environment works
    • I was able to re-deploy via CDK to an existing cloudformation stack from my local terminal and everything seemed to work, but I haven't tested it via GitHub Actions
  • Confirm that converting an existing sub-stack to CDK works
  • Confirm that creating a new sub-stack via CDK works
  • Review contents of cdk.json (it was auto-generated via cdk init app --language python per the hello world tutorial so could probably be refined)
  • Update deployment docs (docs/deployments, README, enterprise deployment wiki article, etc.)
  • Changelog entry?

Notes:

For the GitHub Actions deployments, I created an IAM user with a policy allowing the following actions:

  • sts:AssumeRole for each role created as part of the bootstrapped CDKToolkit stack
  • s3:PutObject for the cf-templates bucket
  • ssm:GetParameters for all resources, which I think may be necessary for resolving the AmiId parameter of type AWS::SSM::Parameter::Value<AWS::EC2::Image::Id> in main-cf.yml.j2

I didn't specifically search the AWS CDK docs to see if they document the recommended IAM policy to use for automated deployments.

Wrapping up:

  • Delete GitHub environment
  • Delete CloudFormation stack
  • Delete IAM user and policy

@jtherrmann jtherrmann added the bumpless Changes to documentation, CI/CD pipelines, etc that don't affect the project's version label Nov 1, 2024
@jtherrmann jtherrmann closed this Nov 1, 2024
@jtherrmann jtherrmann reopened this Nov 1, 2024
@jtherrmann jtherrmann closed this Nov 1, 2024
@jtherrmann jtherrmann deleted the cdk-sandbox branch November 1, 2024 02:26
@jtherrmann jtherrmann restored the cdk-sandbox branch November 1, 2024 02:26
@jtherrmann jtherrmann reopened this Nov 1, 2024
@jtherrmann jtherrmann closed this Nov 1, 2024
@jtherrmann jtherrmann reopened this Nov 1, 2024
@jtherrmann jtherrmann closed this Nov 1, 2024
@jtherrmann jtherrmann deleted the cdk-sandbox branch November 1, 2024 03:22
@jtherrmann jtherrmann restored the cdk-sandbox branch November 1, 2024 03:22
@jtherrmann jtherrmann closed this Nov 2, 2024
@jtherrmann jtherrmann deleted the cdk-sandbox branch November 2, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bumpless Changes to documentation, CI/CD pipelines, etc that don't affect the project's version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant