mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 17:02:05 +03:00
codepipeline-demo
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
resource "aws_iam_role" "ecs-task-execution-role" {
|
||||
name = "ecs-task-execution-role"
|
||||
|
||||
assume_role_policy = <<EOF
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "",
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": "ecs-tasks.amazonaws.com"
|
||||
},
|
||||
"Action": "sts:AssumeRole"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
resource "aws_iam_role_policy" "ecs-task-execution-role" {
|
||||
name = "ecs-task-execution-role"
|
||||
role = aws_iam_role.ecs-task-execution-role.id
|
||||
|
||||
policy = <<EOF
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"ecr:GetAuthorizationToken",
|
||||
"ecr:BatchCheckLayerAvailability",
|
||||
"ecr:GetDownloadUrlForLayer",
|
||||
"ecr:BatchGetImage",
|
||||
"logs:CreateLogStream",
|
||||
"logs:PutLogEvents",
|
||||
"ssm:GetParameters",
|
||||
"ssm:GetParameter"
|
||||
],
|
||||
"Resource": "*"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
resource "aws_iam_role" "ecs-demo-task-role" {
|
||||
name = "ecs-demo-task-role"
|
||||
|
||||
assume_role_policy = <<EOF
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "",
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": "ecs-tasks.amazonaws.com"
|
||||
},
|
||||
"Action": "sts:AssumeRole"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user