-
Notifications
You must be signed in to change notification settings - Fork 1
/
providers.tf
64 lines (61 loc) · 1.73 KB
/
providers.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
data "aws_default_tags" "current" {}
locals {
all_tags = merge(data.aws_default_tags.current.tags, {
managed_by = "AFT"
})
}
# Copyright Amazon.com, Inc. or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
provider "aws" {
alias = "ct_management"
region = var.ct_home_region
# The default profile or environment variables should authenticate to the Control Tower Management Account as Administrator
default_tags {
tags = local.all_tags
}
}
provider "aws" {
alias = "aft_management"
region = var.ct_home_region
assume_role {
role_arn = "arn:${data.aws_partition.current.partition}:iam::${var.aft_management_account_id}:role/AWSControlTowerExecution"
session_name = local.aft_session_name
}
default_tags {
tags = local.all_tags
}
}
provider "aws" {
alias = "tf_backend_secondary_region"
region = var.tf_backend_secondary_region
assume_role {
role_arn = "arn:${data.aws_partition.current.partition}:iam::${var.aft_management_account_id}:role/AWSControlTowerExecution"
session_name = local.aft_session_name
}
default_tags {
tags = local.all_tags
}
}
provider "aws" {
alias = "audit"
region = var.ct_home_region
assume_role {
role_arn = "arn:${data.aws_partition.current.partition}:iam::${var.audit_account_id}:role/AWSControlTowerExecution"
session_name = local.aft_session_name
}
default_tags {
tags = local.all_tags
}
}
provider "aws" {
alias = "log_archive"
region = var.ct_home_region
assume_role {
role_arn = "arn:${data.aws_partition.current.partition}:iam::${var.log_archive_account_id}:role/AWSControlTowerExecution"
session_name = local.aft_session_name
}
default_tags {
tags = local.all_tags
}
}