-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Elastic Beanstalk Configuration Template #6601
Comments
@dharrisio figured I would ping you as you seem to have a good amount of knowledge here. |
I think there are two separate issues here. The first sounds like a bug in how the settings are added and removed. I'm not too familiar with that piece of the code, but I should be able to look into it a bit more some time this week. The second issue has quite a lengthy response, here's the short version and my current recommendation From your example, I'm making the assumption that the My current recommendation would be to create Configuration Templates and Application Versions(GH-5770) per environment. Ideally using cd infrastructure to create new resources with new names like "mytemplate-${env}-${version}" or "myapplication-${env}-${version}", where ${version} would be changed everytime any changes are released. That way the names are unique, and you won't run into the current dependency issues. Extended explanationOne possible way to deal with the environment not seeing changes would be to use randomly generated In Terraform I think that it is best to keep environments separate from each other. For example, staging and production environments would have their own state files and in general wouldn't share resources between them. Elastic Beanstalk doesn't have that separation. There are several resources that can be shared between environments: The Elastic Beanstalk Application, Configuration Templates, and Application Versions. All of these resources could be used by multiple environments at the same time, which causes the dependencies to become more complicated. Elastic Beanstalk Applications are fairly easy to deal with, I simply seeded the state files of new environments with the existing, shared resource. As an alternative to manually creating state files, it would probably be possible to use the Scenario 1All of your environments are in the same Terraform document. With random template names, a new template would cause all of your environments to be updated at the same time, which probably wouldn't be the desired action. As I mentioned above, I generally wouldn't advise mixing environments because of reasons like this. Scenario 2Environments are in their own separate Terraform documents and state files. When Terraform creates a new resource, it deletes the old resource, either before or after the new resource is created( The issue with Application Versions is the same as scenario 2. This has been the piece blocking me on GH-5770. Ultimately this issue comes from dependencies that span multiple state files. Currently, Terraform doesn't have a way to handle this. So far, I haven't been too happy with the solutions that I have come up with to deal with this. I'll probably open up a separate issue exploring one of the more promising(maybe?) ideas instead of dragging this post on much further 😄 . |
Thanks for your wonderful answer. We actually have our stage and production in separate AWS account, and separate state files completely, so this separation is okay for us. I understand about making the config template have a new name when you change it, this makes much more sense now. Not sure how we can handle this, I'll have to see if we can figure out a way, not sure why you mean by Having a version variable we need to set when we change the config template isn't ideal, but its not terrible. |
Sorry, shouldn't have used an abbreviation there. Meant continuous delivery: Jenkins, Bamboo, etc. Depending on how you version manage Terraform documents(if they are included with app source control), you could just use something like the commit sha that you are deploying. The more I think about it, adding a |
@dharrisio yea if the template had |
I've opened a new issue to address that apply bug I had #6636 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Perhaps I'm misunderstanding how the beanstalk environment templates are supposed to function.
I'm on Terraform 0.6.16
However, I have configuration like the following:
The first time this planned, it said it was removing the stuff I moved into the config template. But didn't say that the environment variable would be removed. But after applying, all of the
aws:elasticbeanstalk:application:environment
were gone. So I did another plan, it said it was going to add back theaws:elasticbeanstalk:application:environment
sections, which appears to have happened.If I make a change to the config template (tweak an autoscaling value for instance), it applies that change, but the environment doesn't ACTUALLY change. Am I misunderstanding how these are supposed to be used?
The text was updated successfully, but these errors were encountered: