Skip to content

Commit 6c8eb65

Browse files
add subject_id to transfer job project SA (#5735) (#11156)
Signed-off-by: Modular Magician <[email protected]>
1 parent 6ef6c57 commit 6c8eb65

4 files changed

+14
-1
lines changed

.changelog/5735.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
transfer: added attribute `subject_id` to data source `google_storage_transfer_project_service_account`
3+
```

google/data_source_google_storage_transfer_project_service_account.go

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google
22

33
import (
44
"fmt"
5+
56
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
67
)
78

@@ -18,6 +19,10 @@ func dataSourceGoogleStorageTransferProjectServiceAccount() *schema.Resource {
1819
Optional: true,
1920
Computed: true,
2021
},
22+
"subject_id": {
23+
Type: schema.TypeString,
24+
Computed: true,
25+
},
2126
},
2227
}
2328
}
@@ -43,6 +48,9 @@ func dataSourceGoogleStorageTransferProjectServiceAccountRead(d *schema.Resource
4348
if err := d.Set("email", serviceAccount.AccountEmail); err != nil {
4449
return fmt.Errorf("Error setting email: %s", err)
4550
}
51+
if err := d.Set("subject_id", serviceAccount.SubjectId); err != nil {
52+
return fmt.Errorf("Error setting subject_id: %s", err)
53+
}
4654
if err := d.Set("project", project); err != nil {
4755
return fmt.Errorf("Error setting project: %s", err)
4856
}

google/data_source_google_storage_transfer_project_service_account_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestAccDataSourceGoogleStorageTransferProjectServiceAccount_basic(t *testin
2020
Check: resource.ComposeTestCheckFunc(
2121
resource.TestCheckResourceAttrSet(resourceName, "id"),
2222
resource.TestCheckResourceAttrSet(resourceName, "email"),
23+
resource.TestCheckResourceAttrSet(resourceName, "subject_id"),
2324
),
2425
},
2526
},

website/docs/d/storage_transfer_project_service_account.html.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ The following arguments are supported:
3333

3434
The following attributes are exported:
3535

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

0 commit comments

Comments
 (0)