Skip to content

Commit

Permalink
tf: update AWS provider, and needed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone committed Sep 25, 2024
1 parent 7a7514b commit 1eece57
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions setup.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data "aws_caller_identity" "current" {}
data "aws_canonical_user_id" "current" {}

module "log_storage" {
bucket = "logs.ideas.offby1.net"
Expand Down Expand Up @@ -60,6 +61,12 @@ resource "aws_s3_bucket" "blog" {

resource "aws_s3_bucket_acl" "blog" {
bucket = aws_s3_bucket.blog.id
access_control_policy {
owner {
id = data.aws_canonical_user_id.current.id
display_name = "offline"
}
}
}

resource "aws_s3_bucket_website_configuration" "blog" {
Expand Down Expand Up @@ -188,6 +195,28 @@ resource "aws_s3_bucket" "wwwblog" {

resource "aws_s3_bucket_acl" "wwwblog" {
bucket = aws_s3_bucket.wwwblog.id
access_control_policy {
grant {
permission = "READ"
grantee {
type = "Group"
uri = "http://acs.amazonaws.com/groups/global/AllUsers"
}
}

grant {
permission = "FULL_CONTROL"
grantee {
id = data.aws_canonical_user_id.current.id
type = "CanonicalUser"
}
}

owner {
id = data.aws_canonical_user_id.current.id
display_name = "offline"
}
}
}

resource "aws_s3_bucket_server_side_encryption_configuration" "wwwblog" {
Expand Down

0 comments on commit 1eece57

Please sign in to comment.