Created
February 2, 2023 14:38
-
-
Save theCaptN21/ad23fb81d599177d1aedde76a1794b7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Jenkins Bucket Policy | |
resource "aws_iam_policy" "jenkins_s3_write_policy" { | |
name = "jenkins_s3_write_policy" | |
policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:PutObject", | |
"s3:GetObject" | |
], | |
"Effect": "Allow", | |
"Resource": "${aws_s3_bucket.yourbucketname.arn}/*" | |
} | |
] | |
} | |
EOF | |
} | |
resource "aws_iam_role_policy_attachment" "jenkins_s3_write_attachment" { | |
policy_arn = aws_iam_policy.jenkins_s3_write_policy.arn | |
role = aws_iam_role.jenkins_role.name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment