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

Force the re-creation of the template resource if its content is modifed #7265

Closed
wants to merge 2 commits into from

Conversation

ColinHebert
Copy link
Contributor

@ColinHebert ColinHebert commented Jun 22, 2016

Fixes #6899

At the moment the provider makes the assumption that the template can be "modified" (while still being the same resource), this is not going to work as expected because the resource doesn't notify the system to mention that the resource has changed.

In the case of templates, there is no "update" it gets thrown away and recreated.

@jen20
Copy link
Contributor

jen20 commented Jun 22, 2016

Hi @ColinHebert! Thanks for opening a pull request. This doesn't look quite correct however - the internal validation of the provider is failing with this changeset:

--- FAIL: TestProvider (0.00s)
    provider_test.go:11: err: resource template_cloudinit_config: All fields are ForceNew or Computed w/out Optional, Update is superfluous
FAIL
FAIL    github.com/hashicorp/terraform/builtin/providers/template   0.006s

I'll try to fix this up at some point, unless you get a chance to take another look at it!

@ColinHebert
Copy link
Contributor Author

Heh, if I read it correctly, it's complaining about the fact that there is an update path when the fields are by design forcing new resources (therefore the update path is irrelevant).

That's awesome because that's exactly what I want \o/

@modax
Copy link
Contributor

modax commented Jun 23, 2016

Won't this problem go away when template_file is converted to data source so it no longer has state?

@apparentlymart
Copy link
Contributor

apparentlymart commented Jun 23, 2016

@modax yes I think you are right here... the template_file data source should get refreshed automatically before planning begins and so dependent resources will automatically see the newly-rendered result, without needing to apply first.

That change is in #6717, by the way. Slated to be included in 0.7.

@ColinHebert
Copy link
Contributor Author

Oh neato!

@jen20
Copy link
Contributor

jen20 commented Jun 23, 2016

Thanks for the ping on #6717, @apparentlymart! I'll get that reviewed soon.

@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.

template_cloudinit_config needs two applys to propagate a change
4 participants