Skip to content

Commit

Permalink
Merge branch 'main' into win-userdata
Browse files Browse the repository at this point in the history
  • Loading branch information
sethAmazon authored Nov 10, 2023
2 parents ad75b58 + cc44437 commit d07fb0d
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 75 deletions.
26 changes: 12 additions & 14 deletions terraform/eks/daemon/emf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,19 @@ resource "aws_eks_node_group" "this" {
# EKS Node IAM Role
resource "aws_iam_role" "node_role" {
name = "cwagent-eks-Worker-Role-${module.common.testing_id}"
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Effect = "Allow",
Principal = {
Service = "ec2.amazonaws.com"
},
Action = "sts:AssumeRole"
}
]
})

assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
POLICY
}

resource "aws_iam_role_policy_attachment" "node_AmazonEKSWorkerNodePolicy" {
Expand Down
27 changes: 12 additions & 15 deletions terraform/eks/daemon/fluent/common/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,18 @@ resource "aws_eks_node_group" "node_group" {
# EKS Node IAM Role
resource "aws_iam_role" "node_role" {
name = "cwagent-eks-Worker-Role-${module.common.testing_id}"

assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
POLICY
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Effect = "Allow",
Principal = {
Service = "ec2.amazonaws.com"
},
Action = "sts:AssumeRole"
}
]
})
}

resource "aws_iam_role_policy_attachment" "node_AmazonEKSWorkerNodePolicy" {
Expand Down
28 changes: 13 additions & 15 deletions terraform/eks/daemon/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,21 @@ resource "aws_eks_node_group" "this" {
# EKS Node IAM Role
resource "aws_iam_role" "node_role" {
name = "cwagent-eks-Worker-Role-${module.common.testing_id}"

assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
POLICY
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Effect = "Allow",
Principal = {
Service = "ec2.amazonaws.com"
},
Action = "sts:AssumeRole"
}
]
})
}


resource "aws_iam_role_policy_attachment" "node_AmazonEKSWorkerNodePolicy" {
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
role = aws_iam_role.node_role.name
Expand Down
28 changes: 13 additions & 15 deletions terraform/eks/daemon/statsd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,21 @@ resource "aws_eks_node_group" "this" {
# EKS Node IAM Role
resource "aws_iam_role" "node_role" {
name = "cwagent-eks-Worker-Role-${module.common.testing_id}"

assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
POLICY
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Effect = "Allow",
Principal = {
Service = "ec2.amazonaws.com"
},
Action = "sts:AssumeRole"
}
]
})
}


resource "aws_iam_role_policy_attachment" "node_AmazonEKSWorkerNodePolicy" {
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
role = aws_iam_role.node_role.name
Expand Down
27 changes: 12 additions & 15 deletions terraform/eks/deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,18 @@ resource "aws_eks_node_group" "this" {
# EKS Node IAM Role
resource "aws_iam_role" "node_role" {
name = "cwagent-eks-Worker-Role-${module.common.testing_id}"

assume_role_policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
POLICY
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Effect = "Allow",
Principal = {
Service = "ec2.amazonaws.com"
},
Action = "sts:AssumeRole"
}
]
})
}

resource "aws_iam_role_policy_attachment" "node_AmazonEKSWorkerNodePolicy" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/performance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ resource "null_resource" "validator_linux" {
"git clone --branch ${var.github_test_repo_branch} ${var.github_test_repo}",
var.run_mock_server ? "cd mockserver && sudo docker build -t mockserver . && cd .." : "echo skipping mock server build",
var.run_mock_server ? "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver" : "echo skipping mock server run",
"cd ..", # return to root , two copy xray configs next to validator
"cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/",
"export AWS_REGION=${var.region}",
"cd ./validator/validators",
"sudo chmod +x ./${local.install_validator}",
"./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=true",
local.start_command,
Expand Down

0 comments on commit d07fb0d

Please sign in to comment.