forked from cisagov/cool-assessment-provisioner-iam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders.tf
37 lines (35 loc) · 1013 Bytes
/
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
# This is the "default" provider that is used to obtain the caller's
# credentials, which are used to set the session name when assuming roles in
# the other providers.
provider "aws" {
default_tags {
tags = var.tags
}
region = var.aws_region
}
# The provider used to determine which accounts in the organization are
# assessment accounts and which are not (OrganizationsReadOnly role in
# Master account).
provider "aws" {
alias = "organizationsreadonly"
assume_role {
role_arn = data.terraform_remote_state.master.outputs.organizationsreadonly_role.arn
session_name = local.caller_user_name
}
default_tags {
tags = var.tags
}
region = var.aws_region
}
# The provider used to create resources inside the Users account.
provider "aws" {
alias = "users"
assume_role {
role_arn = data.terraform_remote_state.users.outputs.provisionaccount_role.arn
session_name = local.caller_user_name
}
default_tags {
tags = var.tags
}
region = var.aws_region
}