Skip to content

Instantly share code, notes, and snippets.

@alexwlchan
Created July 6, 2021 13:55
Show Gist options
  • Save alexwlchan/575770e8f391d474b3f4d5d242387cec to your computer and use it in GitHub Desktop.
Save alexwlchan/575770e8f391d474b3f4d5d242387cec to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o xtrace
terraform -version
echo "Hello Lexie!" > greeting.txt
cat > main.tf<< EOF
resource "local_file" "greeting" {
content = file("\${path.module}/greeting.txt")
filename = "out.txt"
}
EOF
terraform init
terraform plan -out=terraform.plan
echo "Bonjour Lexie!" > greeting.txt
terraform apply terraform.plan
bash run.sh > terraform.out 2>&1
TF_LOG=debug bash run.sh > terraform.debug.out 2>&1
+ terraform -version
2021-07-06T14:54:34.507+0100 [DEBUG] Adding temp file log sink: /var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/terraform-log304708144
2021-07-06T14:54:34.507+0100 [INFO] Terraform version: 1.0.1
2021-07-06T14:54:34.507+0100 [INFO] Go runtime version: go1.16.4
2021-07-06T14:54:34.507+0100 [INFO] CLI args: []string{"/usr/local/bin/terraform", "-version"}
2021-07-06T14:54:34.507+0100 [DEBUG] Attempting to open CLI config file: /Users/alexwlchan/.terraformrc
2021-07-06T14:54:34.507+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-07-06T14:54:34.507+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-07-06T14:54:34.507+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/.terraform.d/plugins
2021-07-06T14:54:34.507+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/Library/Application Support/io.terraform/plugins
2021-07-06T14:54:34.507+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2021-07-06T14:54:34.508+0100 [INFO] CLI command args: []string{"version", "-version"}
Terraform v1.0.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ echo 'Hello Lexie!'
+ cat
+ terraform init
2021-07-06T14:54:34.559+0100 [DEBUG] Adding temp file log sink: /var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/terraform-log447638535
2021-07-06T14:54:34.559+0100 [INFO] Terraform version: 1.0.1
2021-07-06T14:54:34.559+0100 [INFO] Go runtime version: go1.16.4
2021-07-06T14:54:34.559+0100 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"}
2021-07-06T14:54:34.559+0100 [DEBUG] Attempting to open CLI config file: /Users/alexwlchan/.terraformrc
2021-07-06T14:54:34.559+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-07-06T14:54:34.559+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-07-06T14:54:34.559+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/.terraform.d/plugins
2021-07-06T14:54:34.559+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/Library/Application Support/io.terraform/plugins
2021-07-06T14:54:34.559+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2021-07-06T14:54:34.559+0100 [INFO] CLI command args: []string{"init"}
Initializing the backend...
2021-07-06T14:54:34.560+0100 [DEBUG] New state was assigned lineage "d5eddac9-a5bd-d4e1-0b89-856f77ab5790"
2021-07-06T14:54:34.560+0100 [WARN] Failed to determine selected providers: 1 error occurred:
* there is no package for registry.terraform.io/hashicorp/local 2.1.0 cached in .terraform/providers
2021-07-06T14:54:34.560+0100 [DEBUG] checking for provisioner in "."
2021-07-06T14:54:34.566+0100 [DEBUG] checking for provisioner in "/usr/local/bin"
2021-07-06T14:54:34.566+0100 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
Initializing provider plugins...
- Reusing previous version of hashicorp/local from the dependency lock file
2021-07-06T14:54:34.566+0100 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2021-07-06T14:54:34.701+0100 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/local/versions
- Using hashicorp/local v2.1.0 from the shared cache directory
Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
+ terraform plan -out=terraform.plan
2021-07-06T14:54:34.866+0100 [DEBUG] Adding temp file log sink: /var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/terraform-log884697081
2021-07-06T14:54:34.866+0100 [INFO] Terraform version: 1.0.1
2021-07-06T14:54:34.866+0100 [INFO] Go runtime version: go1.16.4
2021-07-06T14:54:34.867+0100 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan", "-out=terraform.plan"}
2021-07-06T14:54:34.867+0100 [DEBUG] Attempting to open CLI config file: /Users/alexwlchan/.terraformrc
2021-07-06T14:54:34.867+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-07-06T14:54:34.867+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-07-06T14:54:34.867+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/.terraform.d/plugins
2021-07-06T14:54:34.867+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/Library/Application Support/io.terraform/plugins
2021-07-06T14:54:34.867+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2021-07-06T14:54:34.867+0100 [INFO] CLI command args: []string{"plan", "-out=terraform.plan"}
2021-07-06T14:54:34.868+0100 [DEBUG] New state was assigned lineage "da05ebca-12e7-1538-6759-868e389151fa"
2021-07-06T14:54:34.898+0100 [DEBUG] checking for provisioner in "."
2021-07-06T14:54:34.904+0100 [DEBUG] checking for provisioner in "/usr/local/bin"
2021-07-06T14:54:34.904+0100 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2021-07-06T14:54:34.904+0100 [INFO] backend/local: starting Plan operation
2021-07-06T14:54:34.905+0100 [DEBUG] created provider logger: level=debug
2021-07-06T14:54:34.905+0100 [INFO] provider: configuring client automatic mTLS
2021-07-06T14:54:34.932+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5]
2021-07-06T14:54:34.935+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80084
2021-07-06T14:54:34.935+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5
2021-07-06T14:54:34.942+0100 [INFO] provider.terraform-provider-local_v2.1.0_x5: configuring server automatic mTLS: timestamp=2021-07-06T14:54:34.942+0100
2021-07-06T14:54:34.969+0100 [DEBUG] provider.terraform-provider-local_v2.1.0_x5: plugin address: address=/var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/plugin972008771 network=unix timestamp=2021-07-06T14:54:34.969+0100
2021-07-06T14:54:34.969+0100 [DEBUG] provider: using plugin: version=5
2021-07-06T14:54:35.005+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-07-06T14:54:35.007+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80084
2021-07-06T14:54:35.007+0100 [DEBUG] provider: plugin exited
2021-07-06T14:54:35.007+0100 [INFO] terraform: building graph: GraphTypeValidate
2021-07-06T14:54:35.007+0100 [DEBUG] adding implicit provider configuration provider["registry.terraform.io/hashicorp/local"], implied first by local_file.greeting
2021-07-06T14:54:35.007+0100 [DEBUG] ProviderTransformer: "local_file.greeting" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/local"]
2021-07-06T14:54:35.007+0100 [INFO] ReferenceTransformer: reference not found: "path.module"
2021-07-06T14:54:35.007+0100 [DEBUG] ReferenceTransformer: "local_file.greeting" references: []
2021-07-06T14:54:35.007+0100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/local\"]" references: []
2021-07-06T14:54:35.008+0100 [DEBUG] Starting graph walk: walkValidate
2021-07-06T14:54:35.008+0100 [DEBUG] created provider logger: level=debug
2021-07-06T14:54:35.008+0100 [INFO] provider: configuring client automatic mTLS
2021-07-06T14:54:35.035+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5]
2021-07-06T14:54:35.037+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80085
2021-07-06T14:54:35.037+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5
2021-07-06T14:54:35.045+0100 [INFO] provider.terraform-provider-local_v2.1.0_x5: configuring server automatic mTLS: timestamp=2021-07-06T14:54:35.045+0100
2021-07-06T14:54:35.072+0100 [DEBUG] provider.terraform-provider-local_v2.1.0_x5: plugin address: address=/var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/plugin526137744 network=unix timestamp=2021-07-06T14:54:35.072+0100
2021-07-06T14:54:35.072+0100 [DEBUG] provider: using plugin: version=5
2021-07-06T14:54:35.109+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-07-06T14:54:35.110+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80085
2021-07-06T14:54:35.110+0100 [DEBUG] provider: plugin exited
2021-07-06T14:54:35.110+0100 [INFO] backend/local: plan calling Plan
2021-07-06T14:54:35.110+0100 [INFO] terraform: building graph: GraphTypePlan
2021-07-06T14:54:35.110+0100 [DEBUG] adding implicit provider configuration provider["registry.terraform.io/hashicorp/local"], implied first by local_file.greeting (expand)
2021-07-06T14:54:35.110+0100 [DEBUG] ProviderTransformer: "local_file.greeting (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/local"]
2021-07-06T14:54:35.110+0100 [INFO] ReferenceTransformer: reference not found: "path.module"
2021-07-06T14:54:35.110+0100 [DEBUG] ReferenceTransformer: "local_file.greeting (expand)" references: []
2021-07-06T14:54:35.110+0100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/local\"]" references: []
2021-07-06T14:54:35.111+0100 [DEBUG] Starting graph walk: walkPlan
2021-07-06T14:54:35.111+0100 [DEBUG] created provider logger: level=debug
2021-07-06T14:54:35.111+0100 [INFO] provider: configuring client automatic mTLS
2021-07-06T14:54:35.137+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5]
2021-07-06T14:54:35.139+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80086
2021-07-06T14:54:35.139+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5
2021-07-06T14:54:35.146+0100 [INFO] provider.terraform-provider-local_v2.1.0_x5: configuring server automatic mTLS: timestamp=2021-07-06T14:54:35.146+0100
2021-07-06T14:54:35.175+0100 [DEBUG] provider.terraform-provider-local_v2.1.0_x5: plugin address: address=/var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/plugin155178237 network=unix timestamp=2021-07-06T14:54:35.174+0100
2021-07-06T14:54:35.175+0100 [DEBUG] provider: using plugin: version=5
2021-07-06T14:54:35.211+0100 [DEBUG] Resource instance state not found for node "local_file.greeting", instance local_file.greeting
2021-07-06T14:54:35.211+0100 [INFO] ReferenceTransformer: reference not found: "path.module"
2021-07-06T14:54:35.211+0100 [DEBUG] ReferenceTransformer: "local_file.greeting" references: []
2021-07-06T14:54:35.211+0100 [DEBUG] refresh: local_file.greeting: no state, so not refreshing
2021-07-06T14:54:35.212+0100 [WARN] Provider "registry.terraform.io/hashicorp/local" produced an invalid plan for local_file.greeting, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .directory_permission: planned value cty.StringVal("0777") for a non-computed attribute
- .file_permission: planned value cty.StringVal("0777") for a non-computed attribute
2021-07-06T14:54:35.213+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-07-06T14:54:35.214+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80086
2021-07-06T14:54:35.214+0100 [DEBUG] provider: plugin exited
2021-07-06T14:54:35.214+0100 [INFO] backend/local: plan operation completed
2021-07-06T14:54:35.214+0100 [INFO] backend/local: writing plan output to: terraform.plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:
 # local_file.greeting will be created
 + resource "local_file" "greeting" {
+ content = <<-EOT
Hello Lexie!
EOT
+ directory_permission = "0777"
+ file_permission = "0777"
+ filename = "tfgreeting.txt"
+ id = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────
Saved the plan to: terraform.plan
To perform exactly these actions, run the following command to apply:
terraform apply "terraform.plan"
+ echo 'Bonjour Lexie!'
+ terraform apply terraform.plan
2021-07-06T14:54:35.267+0100 [DEBUG] Adding temp file log sink: /var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/terraform-log250349146
2021-07-06T14:54:35.267+0100 [INFO] Terraform version: 1.0.1
2021-07-06T14:54:35.267+0100 [INFO] Go runtime version: go1.16.4
2021-07-06T14:54:35.267+0100 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "terraform.plan"}
2021-07-06T14:54:35.267+0100 [DEBUG] Attempting to open CLI config file: /Users/alexwlchan/.terraformrc
2021-07-06T14:54:35.267+0100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-07-06T14:54:35.267+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-07-06T14:54:35.267+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/.terraform.d/plugins
2021-07-06T14:54:35.267+0100 [DEBUG] ignoring non-existing provider search directory /Users/alexwlchan/Library/Application Support/io.terraform/plugins
2021-07-06T14:54:35.267+0100 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2021-07-06T14:54:35.267+0100 [INFO] CLI command args: []string{"apply", "terraform.plan"}
2021-07-06T14:54:35.299+0100 [DEBUG] checking for provisioner in "."
2021-07-06T14:54:35.304+0100 [DEBUG] checking for provisioner in "/usr/local/bin"
2021-07-06T14:54:35.304+0100 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2021-07-06T14:54:35.305+0100 [INFO] backend/local: starting Apply operation
2021-07-06T14:54:35.306+0100 [DEBUG] created provider logger: level=debug
2021-07-06T14:54:35.306+0100 [INFO] provider: configuring client automatic mTLS
2021-07-06T14:54:35.334+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5]
2021-07-06T14:54:35.336+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80089
2021-07-06T14:54:35.336+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5
2021-07-06T14:54:35.344+0100 [INFO] provider.terraform-provider-local_v2.1.0_x5: configuring server automatic mTLS: timestamp=2021-07-06T14:54:35.344+0100
2021-07-06T14:54:35.371+0100 [DEBUG] provider.terraform-provider-local_v2.1.0_x5: plugin address: address=/var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/plugin554779548 network=unix timestamp=2021-07-06T14:54:35.371+0100
2021-07-06T14:54:35.371+0100 [DEBUG] provider: using plugin: version=5
2021-07-06T14:54:35.407+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-07-06T14:54:35.408+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80089
2021-07-06T14:54:35.408+0100 [DEBUG] provider: plugin exited
2021-07-06T14:54:35.408+0100 [INFO] backend/local: apply calling Apply
2021-07-06T14:54:35.408+0100 [INFO] terraform: building graph: GraphTypeApply
2021-07-06T14:54:35.408+0100 [DEBUG] Resource state not found for node "local_file.greeting", instance local_file.greeting
2021-07-06T14:54:35.409+0100 [DEBUG] adding implicit provider configuration provider["registry.terraform.io/hashicorp/local"], implied first by local_file.greeting (expand)
2021-07-06T14:54:35.409+0100 [DEBUG] ProviderTransformer: "local_file.greeting" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/hashicorp/local"]
2021-07-06T14:54:35.409+0100 [DEBUG] ProviderTransformer: "local_file.greeting (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/hashicorp/local"]
2021-07-06T14:54:35.409+0100 [DEBUG] ReferenceTransformer: "local_file.greeting (expand)" references: []
2021-07-06T14:54:35.409+0100 [INFO] ReferenceTransformer: reference not found: "path.module"
2021-07-06T14:54:35.409+0100 [DEBUG] ReferenceTransformer: "local_file.greeting" references: []
2021-07-06T14:54:35.409+0100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/local\"]" references: []
2021-07-06T14:54:35.409+0100 [DEBUG] Starting graph walk: walkApply
2021-07-06T14:54:35.410+0100 [DEBUG] created provider logger: level=debug
2021-07-06T14:54:35.410+0100 [INFO] provider: configuring client automatic mTLS
2021-07-06T14:54:35.436+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5]
2021-07-06T14:54:35.439+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80090
2021-07-06T14:54:35.439+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5
2021-07-06T14:54:35.446+0100 [INFO] provider.terraform-provider-local_v2.1.0_x5: configuring server automatic mTLS: timestamp=2021-07-06T14:54:35.446+0100
2021-07-06T14:54:35.473+0100 [DEBUG] provider.terraform-provider-local_v2.1.0_x5: plugin address: address=/var/folders/_c/h0g4c9_n6rg8d2v509hztzdc0000gn/T/plugin138229353 network=unix timestamp=2021-07-06T14:54:35.473+0100
2021-07-06T14:54:35.473+0100 [DEBUG] provider: using plugin: version=5
2021-07-06T14:54:35.511+0100 [WARN] Provider "registry.terraform.io/hashicorp/local" produced an invalid plan for local_file.greeting, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .directory_permission: planned value cty.StringVal("0777") for a non-computed attribute
- .file_permission: planned value cty.StringVal("0777") for a non-computed attribute
╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for local_file.greeting to include new values
│ learned so far during apply, provider
│ "registry.terraform.io/hashicorp/local" produced an invalid new value for
│ .content: was cty.StringVal("Hello Lexie!\n"), but now
│ cty.StringVal("Bonjour Lexie!\n").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
2021-07-06T14:54:35.522+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-07-06T14:54:35.523+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/local/2.1.0/darwin_amd64/terraform-provider-local_v2.1.0_x5 pid=80090
2021-07-06T14:54:35.523+0100 [DEBUG] provider: plugin exited
+ terraform -version
Terraform v1.0.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ echo 'Hello Lexie!'
+ cat
+ terraform init
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of hashicorp/local from the dependency lock file
- Using hashicorp/local v2.1.0 from the shared cache directory
Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
+ terraform plan -out=terraform.plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:
 # local_file.greeting will be created
 + resource "local_file" "greeting" {
+ content = <<-EOT
Hello Lexie!
EOT
+ directory_permission = "0777"
+ file_permission = "0777"
+ filename = "tfgreeting.txt"
+ id = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────
Saved the plan to: terraform.plan
To perform exactly these actions, run the following command to apply:
terraform apply "terraform.plan"
+ echo 'Bonjour Lexie!'
+ terraform apply terraform.plan
╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for local_file.greeting to include new values
│ learned so far during apply, provider
│ "registry.terraform.io/hashicorp/local" produced an invalid new value for
│ .content: was cty.StringVal("Hello Lexie!\n"), but now
│ cty.StringVal("Bonjour Lexie!\n").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment