Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added member attribute to compute default sa datasource #6311

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/8767.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: added `member` attribute to `google_compute_default_service_account` datasource
```
13 changes: 0 additions & 13 deletions META.d/_summary.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions META.d/links.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func DataSourceGoogleComputeDefaultServiceAccount() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"member": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -82,6 +86,9 @@ func dataSourceGoogleComputeDefaultServiceAccountRead(d *schema.ResourceData, me
if err := d.Set("display_name", sa.DisplayName); err != nil {
return fmt.Errorf("Error setting display_name: %s", err)
}
if err := d.Set("member", "serviceAccount:"+sa.Email); err != nil {
return fmt.Errorf("Error setting member: %s", err)
}

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ The following attributes are exported:
* `name` - The fully-qualified name of the service account.

* `display_name` - The display name for the service account.

* `member` - The Identity of the service account in the form `serviceAccount:{email}`. This value is often used to refer to the service account in order to grant IAM permissions.