forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tf][aws] add aws terraform for validator
Closes: aptos-labs#10019
- Loading branch information
1 parent
96261c5
commit 3a764a0
Showing
22 changed files
with
2,574 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
data "aws_iam_policy_document" "eks-assume-role" { | ||
statement { | ||
actions = ["sts:AssumeRole"] | ||
|
||
principals { | ||
type = "Service" | ||
identifiers = ["eks.amazonaws.com"] | ||
} | ||
} | ||
} | ||
|
||
resource "aws_iam_role" "cluster" { | ||
name = "diem-${local.workspace_name}-cluster" | ||
path = var.iam_path | ||
assume_role_policy = data.aws_iam_policy_document.eks-assume-role.json | ||
permissions_boundary = var.permissions_boundary_policy | ||
tags = local.default_tags | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "cluster-cluster" { | ||
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy" | ||
role = aws_iam_role.cluster.name | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "cluster-service" { | ||
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy" | ||
role = aws_iam_role.cluster.name | ||
} | ||
|
||
data "aws_iam_policy_document" "ec2-assume-role" { | ||
statement { | ||
actions = ["sts:AssumeRole"] | ||
|
||
principals { | ||
type = "Service" | ||
identifiers = ["ec2.amazonaws.com"] | ||
} | ||
} | ||
} | ||
|
||
resource "aws_iam_role" "nodes" { | ||
name = "diem-${local.workspace_name}-nodes" | ||
path = var.iam_path | ||
assume_role_policy = data.aws_iam_policy_document.ec2-assume-role.json | ||
permissions_boundary = var.permissions_boundary_policy | ||
tags = local.default_tags | ||
} | ||
|
||
resource "aws_iam_instance_profile" "nodes" { | ||
name = "diem-${local.workspace_name}-nodes" | ||
role = aws_iam_role.nodes.name | ||
path = var.iam_path | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "nodes-node" { | ||
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy" | ||
role = aws_iam_role.nodes.name | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "nodes-cni" { | ||
policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy" | ||
role = aws_iam_role.nodes.name | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "nodes-ecr" { | ||
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly" | ||
role = aws_iam_role.nodes.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*~ | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
name: aws-calico | ||
version: 1.6.0 | ||
description: Calico network plugin for AWS | ||
home: https://github.com/aws/amazon-vpc-cni-k8s |
Oops, something went wrong.