Skip to content

Commit

Permalink
Iam Policy added | Apply Works
Browse files Browse the repository at this point in the history
  • Loading branch information
lolli001 committed Jul 17, 2024
1 parent ca639b9 commit e02fc50
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# aws-image-pipeline
Terraform Workspace for creating and managing AWS Image Pipelines



To SSO Login:
aws sso login --profile 229685449397-csvd-dev-gov.inf-admin-t2
36 changes: 36 additions & 0 deletions iam_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
resource "aws_iam_policy" "rhel_arm_codepipeline_permissions" {
name = "rhel-arm-codepipeline-permissions"
description = "IAM policy for RHEL ARM CodePipeline to access necessary CodeCommit repositories"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"codecommit:GetBranch",
"codecommit:GetCommit",
"codecommit:UploadArchive",
"codecommit:ListRepositories",
"codecommit:ListBranches",
"codecommit:GitPush",
"codecommit:GitPull",
"codecommit:GetUploadArchiveStatus",
"codecommit:GetRepository",
"codecommit:CreateCommit",
"codecommit:BatchGetRepositories",
"codecommit:BatchGetCommits"
]
Resource = [
"arn:aws-us-gov:codecommit:us-gov-west-1:229685449397:linux-image-pipeline",
"arn:aws-us-gov:codecommit:us-gov-west-1:229685449397:image-pipeline-ansible-playbooks",
"arn:aws-us-gov:codecommit:us-gov-west-1:229685449397:image-pipeline-goss-testing"
]
}
]
})
}

resource "aws_iam_role_policy_attachment" "rhel_arm_codepipeline_role_attachment" {
role = "rhel-arm-image-pipeline-demo-codepipeline-role"
policy_arn = aws_iam_policy.rhel_arm_codepipeline_permissions.arn
}

0 comments on commit e02fc50

Please sign in to comment.