Skip to content

Commit 20a34f1

Browse files
authored
[Doc] Replaced managed_policy_arns with aws_iam_role_policy_attachment in guides (#4737)
## Changes `managed_policy_arns` are deprecated - hashicorp/terraform-provider-aws#39771 ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] relevant change in `docs/` folder
1 parent c78a375 commit 20a34f1

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
### Documentation
1616

17+
* Replaced `managed_policy_arns` with `aws_iam_role_policy_attachment` in AWS guides ([#4737](https://github.com/databricks/terraform-provider-databricks/pull/4737)).
18+
1719
### Exporter
1820

1921
### Internal Changes

docs/data-sources/aws_unity_catalog_assume_role_policy.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ resource "aws_iam_policy" "unity_metastore" {
3333
resource "aws_iam_role" "metastore_data_access" {
3434
name = "${var.prefix}-uc-access"
3535
assume_role_policy = data.databricks_aws_unity_catalog_assume_role_policy.this.json
36-
managed_policy_arns = [aws_iam_policy.unity_metastore.arn]
36+
}
37+
38+
resource "aws_iam_role_policy_attachment" "metastore_data_access" {
39+
role = aws_iam_role.metastore_data_access.name
40+
policy_arn = aws_iam_policy.unity_metastore.arn
3741
}
3842
```
3943

docs/data-sources/aws_unity_catalog_policy.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ resource "aws_iam_policy" "unity_metastore" {
3333
resource "aws_iam_role" "metastore_data_access" {
3434
name = "${var.prefix}-uc-access"
3535
assume_role_policy = data.databricks_aws_unity_catalog_assume_role_policy.this.json
36-
managed_policy_arns = [aws_iam_policy.unity_metastore.arn]
36+
}
37+
38+
resource "aws_iam_role_policy_attachment" "metastore_data_access" {
39+
role = aws_iam_role.metastore_data_access.name
40+
policy_arn = aws_iam_policy.unity_metastore.arn
3741
}
3842
```
3943

docs/guides/unity-catalog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,15 @@ resource "aws_iam_policy" "external_data_access" {
264264
resource "aws_iam_role" "external_data_access" {
265265
name = local.uc_iam_role
266266
assume_role_policy = data.databricks_aws_unity_catalog_assume_role_policy.this.json
267-
managed_policy_arns = [aws_iam_policy.external_data_access.arn]
268267
tags = merge(var.tags, {
269268
Name = "${local.prefix}-unity-catalog external access IAM role"
270269
})
271270
}
271+
272+
resource "aws_iam_role_policy_attachment" "external_data_access" {
273+
role = aws_iam_role.external_data_access.name
274+
policy_arn = aws_iam_policy.external_data_access.arn
275+
}
272276
```
273277

274278
Then we can create the [databricks_external_location](../resources/external_location.md) in Unity Catalog.

0 commit comments

Comments
 (0)