Skip to content

Commit 130b109

Browse files
iruAlex
andauthored
Fix azure trusted identity - internal (#137)
* fix azure trusted identity * add tests * update docs Co-authored-by: Alex <[email protected]>
1 parent 1edcda1 commit 130b109

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

sysdig/data_source_sysdig_secure_trusted_cloud_identity.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ func dataSourceSysdigSecureTrustedCloudIdentity() *schema.Resource {
3939
Type: schema.TypeString,
4040
Computed: true,
4141
},
42+
"azure_tenant_id": {
43+
Type: schema.TypeString,
44+
Computed: true,
45+
},
46+
"azure_client_id": {
47+
Type: schema.TypeString,
48+
Computed: true,
49+
},
4250
},
4351
}
4452
}

sysdig/data_source_sysdig_secure_trusted_cloud_identity_test.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,38 @@ func TestAccTrustedCloudIdentityDataSource(t *testing.T) {
2424
},
2525
Steps: []resource.TestStep{
2626
{
27-
Config: trustedIdentityDatasource(),
27+
Config: trustedIdentityDatasourceAWS(),
28+
},
29+
{
30+
Config: trustedIdentityDatasourceGCP(),
31+
},
32+
{
33+
Config: trustedIdentityDatasourceAzure(),
2834
},
2935
},
3036
})
3137
}
3238

33-
func trustedIdentityDatasource() string {
39+
func trustedIdentityDatasourceAWS() string {
3440
return `
3541
data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
3642
cloud_provider = "aws"
3743
}
3844
`
3945
}
46+
47+
func trustedIdentityDatasourceGCP() string {
48+
return `
49+
data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
50+
cloud_provider = "gcp"
51+
}
52+
`
53+
}
54+
55+
func trustedIdentityDatasourceAzure() string {
56+
return `
57+
data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
58+
cloud_provider = "azure"
59+
}
60+
`
61+
}

website/docs/d/secure_trusted_cloud_identity.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ In addition to all arguments above, the following attributes are exported:
3131

3232
* `identity` - Sysdig's identity (User/Role/etc) that should be used to create a trust relationship allowing Sysdig access to your cloud account.
3333

34-
* `aws_account_id` - If `identity` is an AWS ARN, this attribute contains the AWS Account ID to which the ARN belongs, otherwise it contains the empty string.
34+
* `aws_account_id` - If `identity` is an AWS ARN, this attribute contains the AWS Account ID to which the ARN belongs, otherwise it contains the empty string. `cloud_provider` must be equal to `aws` or `gcp`.
35+
36+
* `aws_role_name` - If `identity` is a AWS IAM Role ARN, this attribute contains the name of the role, otherwise it contains the empty string. `cloud_provider` must be equal to `aws` or `gcp`.
37+
38+
* `azure_tenant_id` - If `identity` contains credentials for an Azure Service Principal, this attribute contains its Tenant ID. `cloud_provider` must be equal to `azure`.
39+
40+
* `azure_client_id` - If `identity` contains credentials for an Azure Service Principal, this attribute contains its Client ID. `cloud_provider` must be equal to `azure`.
3541

36-
* `aws_role_name` - If `identity` is a AWS IAM Role ARN, this attribute contains the name of the role, otherwise it contains the empty string.

0 commit comments

Comments
 (0)