Open esn89 opened 1 week ago
Hi @esn89!
I noticed you are assigning the following value for the google_project_iam_member.member
resource:
member = google_project_service_identity.storage_service_agent.member
This is not an expected value for the member
argument. According to terraform registry documentation this argument expects a value in any of the following formats:
user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.com.
serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
On the other hand you are trying to assign the value of your google_project_service_identity.storage_service_agent.member
being that again according to the terraform registry documentation there is no argument called member
for the google_project_service_identity
. There is an attribute called member
but below I will tell you the difference:
Arguments: Are your inputs to create a resource.
Attributes: Are the outputs or properties of the resource that Terraform manages
I suggest you check this link of terraform registry and read the documentation to understand how these resources work.
Hi @ggtisc
I am simply following this example: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_service_identity#example-usage---service-identity-basic
The project service identity does have an attribute called "member": https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_service_identity#member
Which should give: serviceAccount:{email}
, correct?
With this, I can then pass it to: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam#member/members
In summary, you must use one of the formats that I mentioned before with its appropriate prefix depending on what type of member you need. I again invite you to review the documentation for a better understanding of how resources and the API work
Community Note
Terraform Version & Provider Version(s)
Terraform v1.8.3 on linux amd64
Affected Resource(s)
The `google_project_iam_member", when planned always show:
Here is what the plan looks like:
Terraform Configuration
Debug Output
No response
Expected Behavior
It should be planned and applied with the member field populated.
Actual Behavior
member is not found.
Steps to reproduce
terraform apply
Important Factoids
No response
References
No response