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

aws_autoscaling_lifecycle_hook: omitting optional param always results in diff #4572

Closed
elblivion opened this issue Jan 8, 2016 · 3 comments · Fixed by #4695
Closed

aws_autoscaling_lifecycle_hook: omitting optional param always results in diff #4572

elblivion opened this issue Jan 8, 2016 · 3 comments · Fixed by #4695

Comments

@elblivion
Copy link
Contributor

Hi folks,

Leaving out the optional default_result attribute of the aws_autoscaling_lifecycle_hook will make plan always see a difference after the first apply, since the AWS API will fill this in on creation with the value ABANDON:

~ aws_autoscaling_lifecycle_hook.foobar
    default_result: "ABANDON" => ""

I tried adding an else here to set the default value the AWS API uses in case there is no input, but no luck, I guess this is only read on apply and not when diffing:

Expected behaviour is that Terraform is aware of the default value and does not produce a diff.

I've worked around this by making the default_result explicit, if there is a standard way to deal with this pattern (Cloud service API adding default values when omitted) I'd be happy to work on this myself.

Thanks!

@stack72
Copy link
Contributor

stack72 commented Jan 15, 2016

Hi @elblivion this needed to be changed to a computed value. There is a PR just about to hit for this with a test to prove that it's now working as expected

I also updated the docs to note that the default is ABANDON

@elblivion
Copy link
Contributor Author

Awesome, thanks @stack72!

@ghost
Copy link

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

Successfully merging a pull request may close this issue.

3 participants