You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very common to want to add/remove AWS elastic beanstalk settings based on variables.
This is currently not possible until we can use "count" in fields: #7034
An easier to implement solution might be to break out settings into its own resource. As recommended by @cartolari: #7034 (comment)
Something like this:
resource "aws_elastic_beanstalk_environment" "myEnv" {
...
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "FOO"
value = "BAR"
}
}
resource "aws_elastic_beanstalk_environment_setting" "environment_variables" {
environment_id = "${aws_elastic_beanstalk_environment.myEnv.id}"
count = "${length(var.myvars)}"
namespace = "aws:elasticbeanstalk:application:environment"
name = "${lookup(element(var.myvars,count.index),"name")}"
value = "${lookup(element(var.myvars,count.index),"value")}"
}
For backwards compatibility, the resource settings could be merged with any field based settings (as shown above)
If this would be an acceptable addition, I would be happy to take a crack at submitting a PR for it.
The text was updated successfully, but these errors were encountered:
I think it's worth pointing out if this feature is implemented that some care must be taken so you don't trigger a change in Elastic Beanstalk for every resource of the suggested type, aws_elastic_beanstalk_environment_setting.
If not done properly, Terraform may trigger multiple changes to Beanstalk, each of one could take several minutes depending on the environment, making this resource unsuitable to use.
So the suggestion is, and I don't know if Terraform support this, in case this gets implemented, join all the environment settings and apply them all at once, just as it is done today with the added flexibility that the individual resource syntax provides.
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.
ghost
locked and limited conversation to collaborators
Apr 10, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It is very common to want to add/remove AWS elastic beanstalk settings based on variables.
This is currently not possible until we can use "count" in fields: #7034
An easier to implement solution might be to break out settings into its own resource. As recommended by @cartolari: #7034 (comment)
Something like this:
For backwards compatibility, the resource settings could be merged with any field based settings (as shown above)
If this would be an acceptable addition, I would be happy to take a crack at submitting a PR for it.
The text was updated successfully, but these errors were encountered: