Skip to content

Commit 94e8919

Browse files
committed
Add user details. Implements #113
Signed-off-by: Andy Lo-A-Foe <andy.loafoe@gmail.com>
1 parent 7487964 commit 94e8919

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/data-sources/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ The following attributes are exported:
3434
* `host` - (string) The host of the service
3535
* `domain` - (string) The domain associated with the service
3636
* `services` - (list(string)) The list of available services in the region/environment
37+
* `service_id` - (string) The IAM service ID used for authenticating against IAM
38+
* `org_admin_username` - (string) The IAM OrgAdmin used for authenticating against IAM

hsdp/data_source_config.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,23 @@ func dataSourceConfig() *schema.Resource {
4747
Computed: true,
4848
Elem: &schema.Schema{Type: schema.TypeString},
4949
},
50+
"service_id": {
51+
Type: schema.TypeString,
52+
Computed: true,
53+
Description: "The service ID used to authenticate against IAM",
54+
},
55+
"org_admin_username": {
56+
Type: schema.TypeString,
57+
Computed: true,
58+
Description: "The OrgAdmin username used to authenticate against IAM",
59+
},
5060
},
5161
}
5262

5363
}
5464

55-
func dataSourceConfigRead(_ context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
56-
providerConfig := meta.(*Config)
65+
func dataSourceConfigRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
66+
providerConfig := m.(*Config)
5767

5868
var diags diag.Diagnostics
5969

@@ -82,6 +92,8 @@ func dataSourceConfigRead(_ context.Context, d *schema.ResourceData, meta interf
8292
_ = d.Set("domain", domain)
8393
}
8494
_ = d.Set("services", c.Services())
95+
_ = d.Set("service_id", providerConfig.ServiceID)
96+
_ = d.Set("org_admin_username", providerConfig.OrgAdminUsername)
8597

8698
return diags
8799
}

0 commit comments

Comments
 (0)