Skip to content

Commit

Permalink
add subject_id to transfer job project SA (#5735) (#4073)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Feb 23, 2022
1 parent cd55cb5 commit 58145fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/5735.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
transfer: added attribute `subject_id` to data source `google_storage_transfer_project_service_account`
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package google

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand All @@ -18,6 +19,10 @@ func dataSourceGoogleStorageTransferProjectServiceAccount() *schema.Resource {
Optional: true,
Computed: true,
},
"subject_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand All @@ -43,6 +48,9 @@ func dataSourceGoogleStorageTransferProjectServiceAccountRead(d *schema.Resource
if err := d.Set("email", serviceAccount.AccountEmail); err != nil {
return fmt.Errorf("Error setting email: %s", err)
}
if err := d.Set("subject_id", serviceAccount.SubjectId); err != nil {
return fmt.Errorf("Error setting subject_id: %s", err)
}
if err := d.Set("project", project); err != nil {
return fmt.Errorf("Error setting project: %s", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestAccDataSourceGoogleStorageTransferProjectServiceAccount_basic(t *testin
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttrSet(resourceName, "email"),
resource.TestCheckResourceAttrSet(resourceName, "subject_id"),
),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ The following arguments are supported:

The following attributes are exported:

* `email` - Email address of the default service account used by Storage Transfer Jobs running in this project
* `email` - Email address of the default service account used by Storage Transfer Jobs running in this project.
* `subject_id` - Unique identifier for the service account.

0 comments on commit 58145fe

Please sign in to comment.