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

EREGCSC-2883 Deploy CDK via Github Actions (ready for review, ignore the red X) #1465

Merged
merged 9 commits into from
Nov 5, 2024

Conversation

cgodwin1
Copy link
Contributor

@cgodwin1 cgodwin1 commented Nov 1, 2024

Resolves #2883

Description-

This PR implements a simple "hello world" lambda function (accessible from API Gateway) deployed via CDK alongside the standard Serverless stacks. This does not change or replace any existing stacks, only adds one additional stack per deploy.

To satisfy story number 2883, we need to deploy this code through to production and verify that the "hello world" lambda can successfully deploy via CDK in each environment: dev, val, and prod.

Once verified, manual deletion will be required (stack name is {stage}-HelloWorldStack, e.g. val-HelloWorldStack). Then a PR can be created that removes the experimental code from "deploy.yml", "deploy-experimental.yml", and "remove-experimental.yml".

This pull request changes...

  • Experimental CDK code created by @addis-samtek.
  • Code modified by me to add stages comparable to our existing Serverless stacks.
  • "Hello World" lambda added (cdk-eregs/lambda/hello_world.py).
  • Experimental redirect etc stacks commented out of CDK and replaced with hello world temporarily.
  • Added CDK Deploy to "deploy.yml" and "deploy-experimental.yml"
  • Added CDK Destroy to "remove-experimental.yml" only. (We do not ever run "remove.yml" so removal from prod must be done manually, and it's safer that way anyway.)

Steps to manually verify this change...

Initial verification:

  1. Go to CloudTamer on the VPN and go to the dev AWS console.
  2. Go to CloudFormation and search for "HelloWorldStack".
  3. Verify that the stack exists and is prefixed by the stage and PR number (dev1464).
  4. Go to the Outputs tab of the stack and click the API Gateway link.
  5. You will see "Internal Server Error" or "Missing Authentication Token". This is normal for this test code.
  6. Append /hello to the end of the URL and see that the page loads properly.

Additional verification if desired (not required, I already tested this and it's not needed to satisfy the AC):

  1. Close this PR and verify the remove experimental action runs successfully.
  2. Re-open the PR once the action is done and see that the hello world lambda deploys again.

Final verification:

  1. Approve and deploy this PR to dev+val.
  2. Go to the respective AWS accounts -> then CloudFormation.
  3. Verify dev-HelloWorldStack and val-HelloWorldStack both exist and their API Gateways are properly configured.
  4. Approve deployment to prod and repeat steps 1-3 with prod-HelloWorldStack.
  5. Once done, manually remove the stack and all resources from the AWS console for dev, val, and prod.
  6. Create a new PR and remove the test deploy and remove code. (I.e., everything in this PR under .github.)
    • Optionally, this PR may also remove the cdk-eregs directory from the main branch, although having it in main will not cause issues.

Copy link

github-actions bot commented Nov 1, 2024

✨ See the Django Site in action

@cgodwin1 cgodwin1 marked this pull request as ready for review November 1, 2024 20:06
@cgodwin1 cgodwin1 requested a review from PhilR8 as a code owner November 1, 2024 20:06
@cgodwin1 cgodwin1 added the Needs Review This PR needs a code review label Nov 1, 2024
@cgodwin1 cgodwin1 changed the title EREGCSC-2883 (attempt 4) Deploy CDK via Github Actions EREGCSC-2883 Deploy CDK via Github Actions (ignore the red X) Nov 1, 2024
@cgodwin1 cgodwin1 changed the title EREGCSC-2883 Deploy CDK via Github Actions (ignore the red X) EREGCSC-2883 Deploy CDK via Github Actions (ready for review, ignore the red X) Nov 1, 2024
Copy link
Contributor

@PhilR8 PhilR8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@PhilR8 PhilR8 added Approved and removed Needs Review This PR needs a code review labels Nov 4, 2024
@cgodwin1 cgodwin1 merged commit e2b2622 into main Nov 5, 2024
54 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants