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

provider/aws: Read Elastic Beanstalk stack name #7445

Merged

Conversation

dharrisio
Copy link
Contributor

Fixes #7300 where an Elastic Beanstalk error or change outside of Terraform modifies the solution_stack_name attribute, which results in a stale value in the state file.

@stack72
Copy link
Contributor

stack72 commented Jul 1, 2016

Hi @dharrisio

Just ran through the tests and they look good to me :)

Thanks for this

Paul

@stack72 stack72 merged commit a347b17 into hashicorp:master Jul 1, 2016
@stack72
Copy link
Contributor

stack72 commented Jul 1, 2016

Actually, @dharrisio

On second look at the tests, we are getting a plan cycle

=== RUN   TestAccAWSBeanstalkEnv_config
--- FAIL: TestAccAWSBeanstalkEnv_config (401.23s)
    testing.go:255: Step 0 error: After applying this step, the plan was not empty:

        DIFF:

        UPDATE: aws_elastic_beanstalk_environment.tftest
          solution_stack_name: "64bit Amazon Linux running Python" => ""

@dharrisio
Copy link
Contributor Author

@stack72 The tests fails because the solution_stack_name and template_name are mutually exclusive. When the template_name is used, the solution_stack_name is still read from the environment. When this happens, Terraform will try and correct this by setting solution_stack_name to nothing.

I was able to get around this by setting solution_stack_name to computed, but this means it can no longer use ConflictsWith on the template_name. With this change, if the Terraform document has both attributes, the Elastic Beanstalk API will return an error. I think that will be ok, but wanted to check if there was a better way to handle this.

@stack72
Copy link
Contributor

stack72 commented Jul 2, 2016

Hi @dharrisio

If this is Computed, then let's make it so :) Do they both need to be Computed?

P.

@dharrisio
Copy link
Contributor Author

I think that only the solution_stack_name is computed. This will have a value if solution_stack_name or template_name is used. template_name is optional, and should only have a value if it is explicitly used in the Terraform document.

Running a few more tests to verify, but should have a new pr for this up today.

@ghost
Copy link

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

Successfully merging this pull request may close these issues.

Elastic Beanstalk Solution Stack Name stale in State
2 participants