Skip to content

Commit

Permalink
fixing some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Aug 13, 2024
1 parent de20828 commit 25f45f3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,39 @@ resource "aws_s3_bucket" "assets_bucket" {
bucket = "image-pipeline-assets"
}

# module.amazon_linux.iam_arn
resource "aws_s3_bucket_policy" "assets_bucket_policy" {
bucket = aws_s3_bucket.assets_bucket.id
policy = data.aws_iam_policy_document.assets_bucket_policy_document.json
}

data "aws_iam_policy_document" "assets_bucket_policy_document" {
statement {
principals {
type = "AWS"
identifiers = [
module.amazon_linux.iam_arn
]
}

actions = [
"s3:Get*",
"s3:List*",
"s3:ReplicateObject",
"s3:PutObject",
"s3:RestoreObject",
"s3:PutObjectVersionTagging",
"s3:PutObjectTagging",
"s3:PutObjectAcl"
]

resources = [
aws_s3_bucket.assets_bucket.arn,
"${aws_s3_bucket.assets_bucket.arn}/*",
]
}
}


resource "aws_s3_bucket_server_side_encryption_configuration" "state_bucket_encryption" {
for_each = tomap({
Expand Down
2 changes: 1 addition & 1 deletion rhel.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ module "rhel" {
# goss_profile = "base-test"
state = local.state_config
vpc_config = local.vpc_config
source_ami = "ami-03fadeeea589a106b" # x86_64 compatible AMI
source_ami = "ami-03f5c6b8195c66b04" # x86_64 compatible AMI
instance_type = "t3.micro" # x86_64 compatible instance type
}

0 comments on commit 25f45f3

Please sign in to comment.