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

Resource gets modified when absolute path to module changes #6

Closed
brainsik opened this issue Apr 24, 2018 · 4 comments
Closed

Resource gets modified when absolute path to module changes #6

brainsik opened this issue Apr 24, 2018 · 4 comments

Comments

@brainsik
Copy link
Contributor

Hello. It appears the absolute path of the module is encoded in the state such that using the exact same Terraform in two different paths produces state changes instead of producing no changes at all.

For example:

  ~ module.notify_slack_engineering.aws_lambda_function.notify_slack
      filename:           "/Users/foo/src/project/.terraform/modules/d040de6279d8f75cc8478e75c8a39e23/terraform-aws-modules-terraform-aws-notify-slack-5cdd039/functions/notify_slack.zip" => "/Users/bar/src/project/.terraform/modules/d040de6279d8f75cc8478e75c8a39e23/terraform-aws-modules-terraform-aws-notify-slack-5cdd039/functions/notify_slack.zip"
      last_modified:      "2018-04-17T23:20:20.668+0000" => <computed>

This is problematic for having different users running terraform plan locally while doing development work as they end up getting this false change in their output.

Is there a way to use a relative path?

@lorengordon
Copy link

Probably safe to modify the resource in main.tf to ignore changes to the filename. It ought to generate changes if the sha changes, anyway...

@antonbabenko
Copy link
Member

Fixed in v1.3.0

@brainsik
Copy link
Contributor Author

brainsik commented Jun 4, 2018

This is still a problem due to the "last_modified" attribute which is based on when the local file was modified. This means its different for different users depending on when they ran terraform init. I'll make PR shortly.

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants