generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 291
/
Copy pathproviders.tf
42 lines (36 loc) · 1.44 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
# AWS provider for the workspace you're working in (every resource will default to using this, unless otherwise specified)
provider "aws" {
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids[terraform.workspace]}:role/ModernisationPlatformAccess"
}
}
# AWS provider for the Modernisation Platform, to get things from there if required
provider "aws" {
alias = "modernisation-platform"
region = "eu-west-2"
}
# AWS provider for core-vpc-<environment>, to share VPCs into this account
provider "aws" {
alias = "core-vpc"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids[local.provider_name]}:role/ModernisationPlatformAccess"
}
}
# AWS provider for core-network-services-production, to share VPCs into this account
provider "aws" {
alias = "core-network-services"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}