Skip to content

Commit f90beaf

Browse files
committed
testnet
1 parent 249997e commit f90beaf

3 files changed

Lines changed: 62 additions & 10 deletions

File tree

flake.nix

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,9 @@
8080

8181
solc
8282
foundry
83-
];
8483

85-
shellHook = ''
86-
alias ga="$(which git) add"
87-
alias gst="$(which git) status"
88-
alias gc="$(which git) commit"
89-
alias gco="$(which git) checkout -b"
90-
alias glog="$(which git) log"
91-
alias lsa="ls -lah"
92-
alias prettyup="cargo fmt --all && cargo clippy --all-features --fix --allow-dirty"
93-
'';
84+
terraform
85+
];
9486
};
9587
}
9688
);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
data "aws_caller_identity" "current" {}
2+
3+
resource "aws_kms_key" "this" {
4+
description = "Key used for encryption/decryption of WCN SOPS secrets"
5+
multi_region = true
6+
}
7+
8+
resource "aws_kms_key_policy" "this" {
9+
key_id = aws_kms_key.this.id
10+
11+
policy = jsonencode({
12+
Version = "2012-10-17"
13+
Id = "key-default-1"
14+
Statement = [
15+
{
16+
Effect = "Allow"
17+
Principal = {
18+
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
19+
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/TerraformCloud"
20+
},
21+
Action = "kms:*"
22+
Resource = "*"
23+
},
24+
{
25+
Effect = "Allow"
26+
Principal = {
27+
AWS = "*"
28+
},
29+
Action = [
30+
"kms:DescribeKey",
31+
"kms:Encrypt",
32+
"kms:Decrypt",
33+
"kms:ReEncrypt*",
34+
"kms:GenerateDataKey",
35+
"kms:GenerateDataKeyWithoutPlaintext"
36+
],
37+
Resource = "*",
38+
"Condition" : {
39+
"ArnLike" : {
40+
"aws:PrincipalArn" : "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/AWSReservedSSO_Read-Only*"
41+
}
42+
}
43+
}
44+
]
45+
})
46+
47+
}

infra/testnet/main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_version = ">= 1.12"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 6.0"
7+
}
8+
}
9+
}
10+
11+
module "sops-encryption-key" {
12+
source = "../modules/sops-encryption-key"
13+
}

0 commit comments

Comments
 (0)