Skip to content
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

Break out beanstalk settings as its own resource #11314

Closed
oillio opened this issue Jan 20, 2017 · 2 comments
Closed

Break out beanstalk settings as its own resource #11314

oillio opened this issue Jan 20, 2017 · 2 comments

Comments

@oillio
Copy link

oillio commented Jan 20, 2017

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.

@cartolari
Copy link

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.

@ghost
Copy link

ghost commented Apr 10, 2020

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 ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants