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

Cognito Layer Automated Deployment Update #370

Merged
merged 5 commits into from
Jul 31, 2024

Conversation

krisstanton
Copy link
Collaborator

@krisstanton krisstanton commented Jul 31, 2024

Cognito Layer / Vendor Filtering Automated Deployment Update

Ticket Reference: https://github.com/NASA-IMPACT/csda-project/issues/655

This update introduces a 4th module to the deployments, a post-deploy-mods module which uploads a new lambda function for the purpose of filtering download requests by Vendor EULA confirmations.
This deployment uploads and inserts the new lambda into the API Gateway.
I've also added some documentation about how the Cognito Integration functions.

To test the deployment in sandbox follow these steps

  • Get the code from the new branch
git checkout main
git fetch
git pull
git checkout iss655__CognitoLayer_Deployments
git pull
  • Run the deployment
DOTENV=.env.sandbox make all-up-yes
  • Run the Smoke Test
DOTENV=.env.sandbox make bash
cumulus rules enable --name PSScene3Band___1_SmokeTest
cumulus rules run --name PSScene3Band___1_SmokeTest

Change / Commit Notes Below

- Modified Documentation to include problems I had with local system and tips on how to solve them.  
- Modified Documentation to include the new terraform module post-deploy-mods which is used for patching or over-writing any existing items that need to be overwritten.  
- Modified Documentation to include more detailed information about the cognito layer system and the vendor EULA filter.  
- Modified the Makefile to include a call to a function that zips lambdas to prepare them for deployment.  
- Added a script that will zip up the lambda function so it is ready for deployment.  
- Added the lambda python code that makes up the vendor filter.  
- Added a new module post-deploy-mods including a main.tf and base.tfvars file.  This module uploads the new lambda function, and then positions itself inside the proxy section of the API Gateway for the DistributionAPI.  The existing lambda function stays intact as it is called by the new lambda function.  
- Added a silent directive inside of base.tfvars to ensure this new module deploys AFTER the other 3 have completed.  If this module deploys in a different order, it will not function properly.  
- Also added a stacks.rb file to the config to ensure all of the modules deploy in the correct order.  
- Added the module name to the terraform doctor command and the comment of the terraform doctor script.  

…nd tips on how to solve them.

-Modified Documentation to include the new terraform module post-deploy-mods which is used for patching or over-writing any existing items that need to be overwritten.
-Modified Documentation to include more detailed information about the cognito layer system and the vendor EULA filter.
-Modified the Makefile to include a call to a function that zips lambdas to prepare them for deployment.
-Added a script that will zip up the lambda function so it is ready for deployment.
-Added the lambda python code that makes up the vendor filter.
-Added a new module post-deploy-mods including a main.tf and base.tfvars file.  This module uploads the new lambda function, and then positions itself inside the proxy section of the API Gateway for the DistributionAPI.  The existing lambda function stays intact as it is called by the new lambda function.
-Added a silent directive inside of base.tfvars to ensure this new module deploys AFTER the other 3 have completed.  If this module deploys in a different order, it will not function properly.
-Also added a stacks.rb file to the config to ensure all of the modules deploy in the correct order.
-Added the module name to the terraform doctor command and the comment of the terraform doctor script.
#655
Copy link
Collaborator

@jsrikish jsrikish left a comment

Choose a reason for hiding this comment

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

Successfully deployed in my sandbox env. Looks good

@krisstanton krisstanton merged commit 8050b4f into main Jul 31, 2024
7 checks passed
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