{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/7613","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/7613/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/7613/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/7613/events","html_url":"https://github.com/hashicorp/terraform/issues/7613","id":165162589,"number":7613,"title":"Using ${path.module} in aws_lambda_function filename results in incorrect \"difference\" between user machines","user":{"login":"joshma","id":64739,"avatar_url":"https://avatars.githubusercontent.com/u/64739?v=3","gravatar_id":"","url":"https://api.github.com/users/joshma","html_url":"https://github.com/joshma","followers_url":"https://api.github.com/users/joshma/followers","following_url":"https://api.github.com/users/joshma/following{/other_user}","gists_url":"https://api.github.com/users/joshma/gists{/gist_id}","starred_url":"https://api.github.com/users/joshma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshma/subscriptions","organizations_url":"https://api.github.com/users/joshma/orgs","repos_url":"https://api.github.com/users/joshma/repos","events_url":"https://api.github.com/users/joshma/events{/privacy}","received_events_url":"https://api.github.com/users/joshma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-12T19:40:57Z","updated_at":"2016-07-25T15:56:22Z","closed_at":null,"body":"I'm writing this as a bug report, but it's possible I'm just not using `path.module` correctly (I followed the recommendation https://www.terraform.io/docs/modules/create.html). Let me know if there's an easy workaround!\r\n\r\n### Terraform Version\r\nTerraform v0.6.16\r\n\r\n### Affected Resource(s)\r\n- aws_lambda_function\r\n\r\n### Terraform Configuration Files\r\nThis is logging/main.tf, which is used as a module by parent:\r\n```hcl\r\nresource \"aws_lambda_function\" \"logs-lambdaCloudWatchToElasticSearch\" {\r\n  filename = \"${path.module}/lambda.zip\"\r\n\r\n  function_name = \"logs-lambdaCloudWatchToElasticSearch\"\r\n  role = \"${aws_iam_role.cwToEsRole.arn}\"\r\n  handler = \"lambda.handler\"\r\n\r\n  source_code_hash = \"${base64sha256(file(\"${path.module}/lambda.zip\"))}\"\r\n}\r\n```\r\n\r\n### Expected Behavior\r\nAfter a `terraform apply` is run by user A, new tfstate is committed to repo. User B pulls and runs `terraform plan`. It is expected that there are no changes.\r\n\r\n### Actual Behavior\r\nBecause `filename = \"${path.module}/lambda.zip\"`, the filename stored in state looks something like `\"filename\": \"/Users/josh/path/to/terraform/.terraform/modules/79cd4d17db98b26baebfcf1024aade92/lambda.zip\"`. As a result, when damon runs `terraform plan`, he gets:\r\n```\r\n~ module.logging.elasticsearch.aws_lambda_function.logs-lambdaCloudWatchToElasticSearch\r\n    filename: \"/Users/josh/path/to/terraform/.terraform/modules/79cd4d17db98b26baebfcf1024aade92/lambda.zip\" => \"/Users/damon/path/to/terraform/.terraform/modules/79cd4d17db98b26baebfcf1024aade92/lambda.zip\"\r\n```\r\n\r\n### Steps to Reproduce\r\nPlease list the steps required to reproduce the issue, for example:\r\n1. Create a lambda function with filename containing path.module\r\n2. Move/copy terraform file and state to a new folder, run terraform plan, and verify that terraform thinks the lambda function has changed.\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/234996619","html_url":"https://github.com/hashicorp/terraform/issues/7613#issuecomment-234996619","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/7613","id":234996619,"user":{"login":"leg100","id":75728,"avatar_url":"https://avatars.githubusercontent.com/u/75728?v=3","gravatar_id":"","url":"https://api.github.com/users/leg100","html_url":"https://github.com/leg100","followers_url":"https://api.github.com/users/leg100/followers","following_url":"https://api.github.com/users/leg100/following{/other_user}","gists_url":"https://api.github.com/users/leg100/gists{/gist_id}","starred_url":"https://api.github.com/users/leg100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leg100/subscriptions","organizations_url":"https://api.github.com/users/leg100/orgs","repos_url":"https://api.github.com/users/leg100/repos","events_url":"https://api.github.com/users/leg100/events{/privacy}","received_events_url":"https://api.github.com/users/leg100/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T15:56:22Z","updated_at":"2016-07-25T15:56:22Z","body":"+1 I'm seeing this too."}}
{"actor":{"display_login":"leg100"}}