Skip to content

Commit bd1f549

Browse files
rajkpammiPEFE
andauthored
Added iam user policy permissions to describe taskdef (#1119)
Co-authored-by: PEFE <[email protected]>
1 parent 8146471 commit bd1f549

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
terraform {
2+
required_version = "0.13.7"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = "=3.52.0"
7+
}
8+
}
9+
}
10+
11+
provider "aws" {
12+
region = "us-east-1"
13+
}
14+
15+
terraform {
16+
backend "s3" {
17+
bucket = "qppsf-conversion-tool-tf-state"
18+
key = "qppsf/qppsf-iam-ecs-gh-tf-state"
19+
region = "us-east-1"
20+
encrypt = "true"
21+
}
22+
}
23+
24+
data "aws_caller_identity" "current" {}
25+
26+
27+
resource "aws_iam_user" "github-actions-ecr" {
28+
name = "github-actions-ecr"
29+
}
30+
31+
#IAM policy to describe task definition
32+
resource "aws_iam_user_policy" "ecsgithub" {
33+
name = "ecs-github-describetask"
34+
user = aws_iam_user.github-actions-ecr.name
35+
36+
policy = jsonencode({
37+
Version = "2012-10-17"
38+
Statement = [
39+
{
40+
"Sid": "githubecs",
41+
Action = [
42+
"ecs:DescribeTaskDefinition",
43+
]
44+
Effect = "Allow"
45+
Resource = "*"
46+
},
47+
]
48+
})
49+
}
50+

0 commit comments

Comments
 (0)