Skip to content

Commit 8e01b4d

Browse files
committed
local (temp) id_sync KMS key III
1 parent 3561c8b commit 8e01b4d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

terraform/temp_id_sync_sqs_kms.tf

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
# Eventually the aws_kms_key "id_sync_sqs_key" will go into infra/kms.tf
33

44
locals {
5+
6+
# from infra/environments/non-prod/variables.tfvars
7+
8+
imms_account_id = "345594581768"
9+
admin_role = "root" # We shouldn't be using the root account. There should be an Admin role
10+
dev_ops_role = "role/DevOps"
11+
auto_ops_role = "role/auto-ops"
12+
environment = "internal-dev"
13+
14+
# from infra/kms.tf
15+
516
policy_statement_allow_administration = {
617
Sid = "AllowKeyAdministration",
718
Effect = "Allow",
819
Principal = {
9-
AWS = "arn:aws:iam::${var.imms_account_id}:${var.admin_role}"
20+
AWS = "arn:aws:iam::${local.imms_account_id}:${local.admin_role}"
1021
},
1122
Action = [
1223
"kms:Create*",
@@ -32,7 +43,7 @@ locals {
3243
Sid = "KMSKeyUserAccess",
3344
Effect = "Allow",
3445
Principal = {
35-
AWS = "arn:aws:iam::${var.imms_account_id}:${var.auto_ops_role}"
46+
AWS = "arn:aws:iam::${local.imms_account_id}:${local.auto_ops_role}"
3647
},
3748
Action = [
3849
"kms:Encrypt",
@@ -45,7 +56,7 @@ locals {
4556
Sid = "KMSKeyUserAccessForDevOps",
4657
Effect = "Allow",
4758
Principal = {
48-
AWS = "arn:aws:iam::${var.imms_account_id}:${var.dev_ops_role}"
59+
AWS = "arn:aws:iam::${local.imms_account_id}:${local.dev_ops_role}"
4960
},
5061
Action = [
5162
"kms:Encrypt",
@@ -54,9 +65,10 @@ locals {
5465
Resource = "*"
5566
}
5667

57-
# New elements relating to id_sync are below here
68+
# -- New elements relating to id_sync are below here
69+
70+
# MNS id/role: ultimately these should go in infra/environments/<env>/variables.tfvars
5871

59-
# mns_account_id: ultimately these should go in infra/environments/<env>/variables.tfvars
6072
mns_account_id = local.environment == "prod" ? 758334270304 : 631615744739
6173
mns_admin_role = "role"
6274

0 commit comments

Comments
 (0)