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 (attempt 3) Connect GitHub to CDK via OIDC #1464

Closed
wants to merge 9 commits into from

Conversation

cgodwin1
Copy link
Contributor

@cgodwin1 cgodwin1 commented Oct 31, 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

✨ See the Django Site in action

Copy link

github-actions bot commented Nov 1, 2024

✨ See the Django Site in action

Copy link

github-actions bot commented Nov 1, 2024

✨ See the Django Site in action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants