Skip to content

Commit

Permalink
chore: fix tf format files
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmonteiro committed Jun 14, 2024
1 parent 14c76df commit 10ac684
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
126 changes: 63 additions & 63 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ resource "aws_iam_role" "tf_role" {
name = "tf_role"

assume_role_policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRoleWithWebIdentity",
"Principal": {
"Federated": "arn:aws:iam::${var.aws_account_id}:oidc-provider/token.actions.githubusercontent.com"
},
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": [
"sts.amazonaws.com"
],
"token.actions.githubusercontent.com:sub": [
var.github_iac_repo
]
}
}
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : "sts:AssumeRoleWithWebIdentity",
"Principal" : {
"Federated" : "arn:aws:iam::${var.aws_account_id}:oidc-provider/token.actions.githubusercontent.com"
},
"Condition" : {
"StringEquals" : {
"token.actions.githubusercontent.com:aud" : [
"sts.amazonaws.com"
],
"token.actions.githubusercontent.com:sub" : [
var.github_iac_repo
]
}
}
}
]
})

Expand All @@ -46,60 +46,60 @@ resource "aws_iam_role" "ecr_role" {
name = "ecr_role"

assume_role_policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRoleWithWebIdentity",
"Principal": {
"Federated": "arn:aws:iam::${var.aws_account_id}:oidc-provider/token.actions.githubusercontent.com"
},
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": [
"sts.amazonaws.com"
],
"token.actions.githubusercontent.com:sub": [
var.github_app_repo
]
}
}
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : "sts:AssumeRoleWithWebIdentity",
"Principal" : {
"Federated" : "arn:aws:iam::${var.aws_account_id}:oidc-provider/token.actions.githubusercontent.com"
},
"Condition" : {
"StringEquals" : {
"token.actions.githubusercontent.com:aud" : [
"sts.amazonaws.com"
],
"token.actions.githubusercontent.com:sub" : [
var.github_app_repo
]
}
}
}
]
})

inline_policy {
name = "ecr-app-permission"

policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
"Version" : "2012-10-17",
"Statement" : [
{
"Action": "apprunner:*"
"Effect": "Allow",
"Resource": "*"
"Action" : "apprunner:*"
"Effect" : "Allow",
"Resource" : "*"
},
{
"Action": [
"Action" : [
"iam:PassRole",
"iam:CreateServiceLinkedRole"
],
"Effect": "Allow",
"Resource": "*"
],
"Effect" : "Allow",
"Resource" : "*"
},
{
"Effect": "Allow",
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability",
"ecr:PutImage",
"ecr:InitiateLayerUpload",
"ecr:UploadLayerPart",
"ecr:CompleteLayerUpload",
"ecr:GetAuthorizationToken"
"Effect" : "Allow",
"Action" : [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability",
"ecr:PutImage",
"ecr:InitiateLayerUpload",
"ecr:UploadLayerPart",
"ecr:CompleteLayerUpload",
"ecr:GetAuthorizationToken"
],
"Resource": "*"
"Resource" : "*"
}
]
})
Expand All @@ -114,14 +114,14 @@ resource "aws_iam_role" "app_runner_role" {
name = "app_runner_role"

assume_role_policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
"Version" : "2012-10-17",
"Statement" : [
{
"Effect": "Allow",
"Principal": {
"Service": "build.apprunner.amazonaws.com"
"Effect" : "Allow",
"Principal" : {
"Service" : "build.apprunner.amazonaws.com"
},
"Action": "sts:AssumeRole"
"Action" : "sts:AssumeRole"
}
]
})
Expand All @@ -135,4 +135,4 @@ resource "aws_iam_role" "app_runner_role" {
}
}


4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
source = "hashicorp/aws"
version = "5.53.0"
}
}
}

provider "aws" {
profile = "rcmonteiro-iac"
region = "us-east-2"
region = "us-east-2"
}

0 comments on commit 10ac684

Please sign in to comment.