Closed ademariag closed 4 years ago
I think this is somehow caused by the "project" key in the resource.
if I run it without, it works, e.g.:
{
"resource": {
"google_project": {
"project": {
"billing_account": "008F72-XXXX-XXXXX",
"name": "Project Name",
"org_id": "XXXXXX",
"project_id": "a_project"
}
},
"google_project_service": {
"enable_cloudbilling_service": {
// "project": "${google_project.project.id}", REMOVE
"service": "cloudbilling.googleapis.com"
}
}
}
}
if I re-add, I get
# google_project_service.enable_cloudbilling_service must be replaced
-/+ resource "google_project_service" "enable_cloudbilling_service" {
disable_on_destroy = true
~ id = "a_project/cloudbilling.googleapis.com" -> (known after apply)
~ project = "a_project" -> "projects/a_project" # forces replacement
service = "cloudbilling.googleapis.com"
}
The correct attribute to call is ${google_project.project.project_id}
instead of ${google_project.project.id}
This resolves my issue, but I will leave this bug on for someone else to decide whether this behaviour is insane or working as intended.
Below is what google_project
provides. The formats of id
and project
are different. We should let google_project_service
to accept both.
resource "google_project" "my_project" {
id = "projects/myproject"
name = "myproject"
project_id = "myproject"
.....
}
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error š¤ š , please reach out to my human friends š hashibot-feedback@hashicorp.com. Thanks!
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
google_project_service
Terraform Configuration Files
Debug Output
Expected Behavior
google_project_service resource created
Actual Behavior
google_project_service resource is not being created
Steps to Reproduce
terraform apply
Important Factoids
References
0000