Skip to content

Commit e29e299

Browse files
authored
Docs: Move tags to default_tags in AWS provider examples (#1969)
Default tags on AWS resources can be specified on the provider as of v3.38.0, see https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider Tag specifications on individual resources can then either be removed or simplified (e.g. no need to merge tags).
1 parent 01c5671 commit e29e299

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/awsmt-integration/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ locals {
2323

2424
provider "aws" {
2525
region = local.region
26+
default_tags {
27+
tags = locals.tags
28+
}
2629
}
2730

2831
// initialize provider in "MWS" mode to provision new workspace
@@ -39,7 +42,6 @@ data "databricks_aws_assume_role_policy" "this" {
3942
resource "aws_iam_role" "cross_account_role" {
4043
name = "${local.prefix}-crossaccount"
4144
assume_role_policy = data.databricks_aws_assume_role_policy.this.json
42-
tags = local.tags
4345
}
4446

4547
data "databricks_aws_crossaccount_policy" "this" {
@@ -71,9 +73,9 @@ resource "aws_s3_bucket" "root_storage_bucket" {
7173
enabled = false
7274
}
7375
force_destroy = true
74-
tags = merge(local.tags, {
76+
tags = {
7577
Name = "${local.prefix}-root-bucket"
76-
})
78+
}
7779
}
7880

7981
resource "aws_s3_bucket_public_access_block" "root_storage_bucket" {
@@ -109,7 +111,6 @@ module "vpc" {
109111
name = local.prefix
110112
cidr = local.cidr_block
111113
azs = data.aws_availability_zones.available.names
112-
tags = local.tags
113114

114115
enable_dns_hostnames = true
115116
enable_nat_gateway = true

0 commit comments

Comments
 (0)