Skip to content

Commit

Permalink
Added member attribute to compute default sa datasource (#8767) (#6311)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Sep 19, 2023
1 parent af46731 commit 8773d87
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
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
}
2 changes: 2 additions & 0 deletions website/docs/d/compute_default_service_account.html.markdown
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.

0 comments on commit 8773d87

Please sign in to comment.