Nirav Gandhi
Nirav Gandhi

Reputation: 2005

What is the correct way of sharing your elasticbeanstalk configuration with your team?

I am looking for a way to share the EB configuration so anyone in my team with valid aws creds can deploy the code. By default, EB adds following to your .gitignore file.

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

Do I need to check-in these files to share it with the team?

Upvotes: 5

Views: 1274

Answers (2)

Jacob Thomason
Jacob Thomason

Reputation: 3411

In my opinion, AWS royally messed up with their .gitignore defaults. This was confusing at first, because it seemed like it was there for a good reason. We couldn't find a good reason. Maybe it was just a precaution so you didn't commit something you shouldn't. However, firstly, modifying a project's .gitignore is not something it should be doing by default, in my opinion. And secondly, no one should be committing code they haven't reviewed.

As Kush notes in his reply, you can add the files into a nested directory which would be tracked by your VCS. I'm assuming the reason for this is so that different developers can maintain different configurations. We have zero use for anything remotely resembling this, but it's worth noting as I'm sure someone may.

We've completely removed these entries from our project and commit the entire .elasticbeanstalk and .ebextensions directories.

Upvotes: 8

Kush Vyas
Kush Vyas

Reputation: 6079

Assuming you have CLI Access you can create template and share a command like:

eb config save dev-env --cfg prod

Now, open this file in a text editor to modify/remove sections as necessary for your production environment.

Note: AWSConfigurationTemplateVersion is a required field. Do not remove it from the configuration file.

Checking Configurations into Version Control If you want to check in your saved configurations so that anyone with access to your code can use the same settings in their own environments or if you want to track different versions of the saved configurations, move the file to the .elasticbeanstalk/folder directory. Saved configurations are located in the .elasticbeanstalk/saved_configs/ folder. By moving the configuration file up one level into the .elasticbeanstalk/ folder, the file can be checked in and will still work with the EB CLI. After you move the file, you must add and commit it.

Refer this AWS Blog Post

Upvotes: 3

Related Questions