Hi All,
Version : Terraform v1.2.8
resource “google_cloud_identity_group_membership” “cf-db-conn” {
count = var.connection_to_host_project == “true” ? 1 : 0
group = “nogcds_crun_service_agent_host-project-euwest1-1@xxxxx.com”
preferred_member_key {
id = “serviceAccount:${local.sa_cr_vpc_connector}”
}
roles {
name = “MEMBER”
}
}
I need terraform resource which to make a service account member of a group without specifying group id, for example
group = groups/012345xxxxx
where I can simply specify the group name and get this service account added as a member of the group.
Appreciate your help
Thanks
data “google_cloud_identity_group_lookup” “group-cr” {
group_key {
id = “nogcds_crun_service_agent_host-project-euwest1-1@xxxxxx.com”
}
}
resource “google_cloud_identity_group_membership” “cf-db-conn-cr” {
count = var.connection_to_host_project == “true” ? 1 : 0
group = “nogcds_crun_service_agent_${var.host_project_id}”
preferred_member_key {
id = “serviceAccount:${data.google_cloud_identity_group_lookup.group-cr.id}”
}
roles {
name = “MEMBER”
}
}
Error: Invalid data source
[137]│
[138]│ on vpc_connector.tf line 123, in data “google_cloud_identity_group_lookup” “group-cf”:
[139]│ 123: data “google_cloud_identity_group_lookup” “group-cf” {
[140]│
[141]│ The provider hashicorp/google does not support data source
[142]│ “google_cloud_identity_group_lookup”.
above was the error when tried with data source