How do I allow EC2 Agent to retrieve Secrets from Secret Manager when using CodeDeploy?
0
We have an EC2 instance that is running a CodeDeploy agent on Windows Server. I have a powershell script that runs as part of the CodeDeploy deployment in an "after-install" script. This script uses aws CLI to retrieve secrets and then updates a file in our app. When it tries to run during a deployment, it fails - the script execution times out. If I run the same script from a powershell window on the EC2 server, it works fine and only takes a few seconds. How to configure CodeDeploy agent on EC2 to have permissions to secret manager?
asked 20 days ago16 views
1 Answers
0
There is a blog that shows how this can be accomplished using the Parameter Store - https://aws.amazon.com/blogs/mt/use-parameter-store-to-securely-access-secrets-and-config-data-in-aws-codedeploy/
answered 19 days ago
Relevant questions
Specify Powershell 7 when running SSM scripts
asked 5 months agoEnvironment variables for a Node app running on an EC2 Instance
asked 6 months agoHow do I retrieve my secrets from secret manager in a pipeline build?
asked 2 months agoHow do I allow EC2 Agent to retrieve Secrets from Secret Manager when using CodeDeploy?
asked 20 days agoIs It Possible to CodeDeploy to an EC2 Instance In A Different Region
asked 4 months agoCodeDeploy just recognizes IAM instance profiles after restarting agent
Accepted Answerasked 3 years agoCodeDeploy, deployment failed after EC2 changed instance type
asked 3 years agoCodeDeploy Environment Variables On Windows
asked 4 months agohow do I uninstall the cloudwatch unified agent from an EC2 instance?
asked 3 years agoDataSync Agent on EC2 VM
Accepted Answerasked a month ago