ABT
ABT

Reputation: 1

AWS CodeDeploy --Deploy different web.config

Can someone tell any way to deploy different web.config on different EC2 instances with in same deployment group.

Scenario: We have few entries in the config that will be different on different instances. So need some way to update based on instance.

Upvotes: 0

Views: 921

Answers (2)

Nick Cipollina
Nick Cipollina

Reputation: 551

I actually took the approach of storing my web.config files for each environment in an S3 bucket. As part of the CodeDeploy Deployment group process, it would download the config file from the S3 bucket in the After Install hook. This way you can build the application once and push the same application files for each environment. This also separates the configuration of the application from the actual code so that the development team doesn't need to know things like connection string values, etc...

Upvotes: 1

Alex Terry
Alex Terry

Reputation: 2092

Create a script to make the necessary changes to your web.config and then use the hooks section of your app.spec file to run the script before install on your deployment. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html

Upvotes: 1

Related Questions