forked from dandi/dandi-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
63 lines (48 loc) · 1.42 KB
/
main.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
terraform {
backend "remote" {
organization = "linc-brain-mit"
workspaces {
name = "linc-archive-terraform"
}
}
}
provider "aws" {
region = "us-east-1"
allowed_account_ids = ["151312473579"]
assume_role {
role_arn = "arn:aws:iam::151312473579:role/linc-infrastructure"
}
}
provider "aws" {
region = "us-east-2"
alias = "target"
allowed_account_ids = ["151312473579"]
assume_role {
role_arn = "arn:aws:iam::151312473579:role/linc-infrastructure"
}
}
// The "sponsored" account, the Amazon-sponsored account with the public bucket
provider "aws" {
alias = "sponsored"
region = "us-east-1"
allowed_account_ids = ["151312473579"] # TODO: Aaron make new ID
// This will authenticate using credentials from the project account, then assume the
// "linc-infrastructure" role from the sponsored account to manage resources there
assume_role {
role_arn = "arn:aws:iam::151312473579:role/linc-infrastructure"
}
# Must set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY envvars for project account
}
provider "heroku" {
}
provider "sentry" {
# Must set SENTRY_AUTH_TOKEN envvar
}
data "aws_canonical_user_id" "project_account" {}
data "aws_caller_identity" "project_account" {}
data "aws_canonical_user_id" "sponsored_account" {
provider = aws.sponsored
}
data "aws_caller_identity" "sponsored_account" {
provider = aws.sponsored
}