Skip to content

Commit c78a375

Browse files
authored
[Fix] Add missing external Id in trust relationship for databricks_aws_unity_catalog_assume_role_policy (#4738)
## Changes - `databricks_aws_unity_catalog_assume_role_policy` data source requires external id in the self-assumption trust relationship ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [x] relevant change in `docs/` folder - [x] covered with integration tests in `internal/acceptance` - [x] using Go SDK
1 parent b447d40 commit c78a375

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
* Don't fail delete when `databricks_system_schema` can be disabled only by Databricks [#4727](https://github.com/databricks/terraform-provider-databricks/pull/4727)
1212
* Fix debug logging for attributes used to configure the provider ([#4728](https://github.com/databricks/terraform-provider-databricks/pull/4728)).
13+
* Add missing external Id in trust relationship for `databricks_aws_unity_catalog_assume_role_policy` ([#4738](https://github.com/databricks/terraform-provider-databricks/pull/4738)).
1314

1415
### Documentation
1516

aws/data_aws_unity_catalog_assume_role_policy.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func DataAwsUnityCatalogAssumeRolePolicy() common.Resource {
5353
"ArnLike": {
5454
"aws:PrincipalArn": fmt.Sprintf("arn:%s:iam::%s:role/%s", awsNamespace, data.AwsAccountId, data.RoleName),
5555
},
56+
"StringEquals": {
57+
"sts:ExternalId": data.ExternalId,
58+
},
5659
},
5760
Principal: map[string]string{
5861
"AWS": fmt.Sprintf("arn:%s:iam::%s:root", awsNamespace, data.AwsAccountId),

aws/data_aws_unity_catalog_assume_role_policy_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func TestDataAwsUnityCatalogAssumeRolePolicy(t *testing.T) {
4848
"Condition": {
4949
"ArnLike": {
5050
"aws:PrincipalArn": "arn:aws:iam::123456789098:role/databricks-role"
51+
},
52+
"StringEquals": {
53+
"sts:ExternalId": "12345"
5154
}
5255
}
5356
}
@@ -96,6 +99,9 @@ func TestDataAwsUnityCatalogAssumeRolePolicyWithoutUcArn(t *testing.T) {
9699
"Condition": {
97100
"ArnLike": {
98101
"aws:PrincipalArn": "arn:aws:iam::123456789098:role/databricks-role"
102+
},
103+
"StringEquals": {
104+
"sts:ExternalId": "12345"
99105
}
100106
}
101107
}
@@ -145,6 +151,9 @@ func TestDataAwsUnityCatalogAssumeRolePolicyGovWithoutUcArn(t *testing.T) {
145151
"Condition": {
146152
"ArnLike": {
147153
"aws:PrincipalArn": "arn:aws-us-gov:iam::123456789098:role/databricks-role"
154+
},
155+
"StringEquals": {
156+
"sts:ExternalId": "12345"
148157
}
149158
}
150159
}
@@ -194,7 +203,10 @@ func TestDataAwsUnityCatalogAssumeRolePolicyGovDoDWithoutUcArn(t *testing.T) {
194203
"Condition": {
195204
"ArnLike": {
196205
"aws:PrincipalArn": "arn:aws-us-gov:iam::123456789098:role/databricks-role"
197-
}
206+
},
207+
"StringEquals": {
208+
"sts:ExternalId": "12345"
209+
}
198210
}
199211
}
200212
]

0 commit comments

Comments
 (0)