Closed sergargar closed 1 year ago
@sergargar Did you run $ terraform apply
when getting this ERROR?
@sergargar Did you run
$ terraform apply
when getting this ERROR?
Yes
Have you run $ terraform init
? @sergargar
Have you run
$ terraform init
? @sergargar
Yes
@sergargar can you paste the ERROR log (instead of screenshot)?
Hi @sergargar This command:
$ sed -i 's/"\/static/"https:\/\/storage\.googleapis\.com\/${google_storage_bucket.data_bucket.name}\/webfiles\/build\/static/g' modules/module-1/resources/storage_bucket/webfiles/build/static/js/main.adc6b28e.js
is replacing /static/
in main.adc6b28e.js
file. Maybe you can try to run the command above first.
I could execute the previous command without errors, but when doing the terraform apply, I'm still getting the following error:
│ Error: local-exec provisioner error │ │ with null_resource.file_replacement_upload, │ on main.tf line 620, in resource "null_resource" "file_replacement_upload": │ 620: provisioner "local-exec" { │ │ Error running command 'sed -i │ 's/"\/static/"https:\/\/storage.googleapis.com\/prod-blogapp-1acffa4f9e7361c6\/webfiles\/build\/static/g' │ modules/module-1/resources/storage_bucket/webfiles/build/static/js/main.adc6b28e.js │ sed -i │ 's/n.p+"static/"https:\/\/storage.googleapis.com\/prod-blogapp-1acffa4f9e7361c6\/webfiles\/build\/static/g' │ modules/module-1/resources/storage_bucket/webfiles/build/static/js/main.adc6b28e.js │ sed -i │ 's
CLOUD_FUNCTION_URL
https://us-west1-gcp-goat-1acffa4f9e7361c6.cloudfunctions.net/backend-function`' │ modules/module-1/resources/storage_bucket/webfiles/build/static/js/main.adc6b28e.js │ ': exit status 1. Output: sed: 1: "modules/module-1/resour ...": invalid command code m │ sed: 1: "modules/module-1/resour ...": invalid command code m │ sed: 1: "modules/module-1/resour ...": invalid command code m
Which terraform version are you using?
Which terraform version are you using?
+ terraform --version Terraform v1.4.4 on darwin_arm64 + provider registry.terraform.io/hashicorp/archive v2.3.0 + provider registry.terraform.io/hashicorp/google v4.61.0 + provider registry.terraform.io/hashicorp/null v3.2.1 + provider registry.terraform.io/hashicorp/random v3.5.0 + provider registry.terraform.io/hashicorp/template v2.2.0
Hmm... this could be issue with sed on Mac @sergargar
This is my terraform version
➜ ~ terraform --version
Terraform v1.4.4
on linux_amd64
The installation steps says it requires Linux machine https://github.com/ine-labs/GCPGoat/blob/main/README.md#installation
I will try it in a Linux machine then, thank you.