You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add databricks_aws_unity_catalog_policy data source (#2483)
* WIP Add `data_aws_unity_catalog_policy` data source
* Create `aws_unity_catalog_policy` data with option to provide KMS key
* Add tests for `databricks_aws_unity_catalog_policy`
* Add documentation for `databricks_aws_unity_catalog_policy`
* Refactor `databricks_aws_unity_catalog_policy`, remove redundant test, made ID derive from parameters
* Use evaluated conditional to pass role
* Revert "Use evaluated conditional to pass role"
This reverts commit 272d548.
* Use `common.Resource`
* Update docs
* Correct indentiation for tests
* Remove redundant statements in policy
* Improve tests
-> **Note** This resource has an evolving API, which may change in future versions of the provider. Please always consult [latest documentation](https://docs.databricks.com/administration-guide/account-api/iam-role.html#language-Your%C2%A0VPC,%C2%A0default) in case of any questions.
7
+
8
+
This data source constructs necessary AWS Unity Catalog policy for you, which is based on [official documentation](https://docs.databricks.com/data-governance/unity-catalog/get-started.html#configure-a-storage-bucket-and-iam-role-in-aws).
9
+
10
+
## Example Usage
11
+
12
+
```hcl
13
+
data "databricks_aws_unity_catalog_policy" "this" {
14
+
aws_account_id = var.aws_account_id
15
+
bucket_name = "databricks-bucket"
16
+
role_name = "databricks-role"
17
+
kms_name = "databricks-kms"
18
+
}
19
+
20
+
data "aws_iam_policy_document" "passrole_for_uc" {
21
+
statement {
22
+
effect = "Allow"
23
+
actions = ["sts:AssumeRole"]
24
+
principals {
25
+
identifiers = [
26
+
"arn:aws:iam::414351767826:role/unity-catalog-prod-UCMasterRole-14S5ZJVKOTYTL" # Databricks Account ID
*`aws_account_id` (Required) The Account ID of the current AWS account (not your Databricks account).
67
+
*`bucket_name` (Required) The name of the S3 bucket used as root storage location for [managed tables](https://docs.databricks.com/data-governance/unity-catalog/index.html#managed-table) in Unity Catalog.
68
+
*`role_name` (Required) The name of the AWS IAM role that you created in the previous step in the [official documentation](https://docs.databricks.com/data-governance/unity-catalog/get-started.html#configure-a-storage-bucket-and-iam-role-in-aws).
69
+
*`kms_name` (Optional) If encryption is enabled, provide the name of the KMS key that encrypts the S3 bucket contents. If encryption is disabled, do not provide this argument.
70
+
71
+
## Attribute Reference
72
+
73
+
In addition to all arguments above, the following attributes are exported:
0 commit comments