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

Source field causing modifications on different machines #8754

Closed
OllyGinger opened this issue Sep 9, 2016 · 3 comments
Closed

Source field causing modifications on different machines #8754

OllyGinger opened this issue Sep 9, 2016 · 3 comments

Comments

@OllyGinger
Copy link

We make use of "aws_s3_bucket_object" to upload a config file to S3, and we specify the "source" like: "${path.module}/config.json". After an apply we make use of remote states so that changes can be made by different people.

When someone else runs a plan the source field causes the whole resource to be marked as changed, for example:

~ module.service_cluster_dev.aws_s3_bucket_object.SOTConfig source: "/Users/jeffrey/work/config.json" => "/Users/oliver/work/config.json"

The contents of the file are the same, and we supply the etag as it mentions in the docs.

It seems like the resource modification should either ignore the source field (as it makes no difference where the source is from, it should be based on the etag if it's supplied).

Or there should be an interpolater that will return a path relative to cwd - effectively removing the personal path part that contains usernames, and different paths depending on where the project is checked out.

Terraform v0.7.3

@mitchellh
Copy link
Contributor

For AWS provider folks: is it possible for the state storage of "source" to be a checksum instead of the actual path?

@apparentlymart
Copy link
Contributor

There is a separate attribute for the actual content that works like that... Could potentially make source read the file in its StateFunc and do a similar thing here I think, but feels weird to do I/O in StateFunc.

We have run into this a few times now and I keep thinking it'd be handy to expose the current module's dir path to resources somehow so they can normalize paths to be module-relative when possible. If course that requires some provider protocol changes so not super simple...

@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