Skip to content

Commit

Permalink
Merge pull request #12 from CloudProjectD/feat/module-s3
Browse files Browse the repository at this point in the history
[Feat] create module s3
  • Loading branch information
dusdjhyeon authored Dec 5, 2023
2 parents 2aa58aa + 2ba2541 commit 839a6c2
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
20 changes: 20 additions & 0 deletions module-s3/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
provider "aws" {
region = var.aws_region
}

resource "aws_s3_bucket" "khu-bucket" {
bucket = var.bucket_name

tags = {
Name = var.bucket_name
}
}

resource "aws_s3_bucket_public_access_block" "bucket-public-access" {
bucket = aws_s3_bucket.khu-bucket.id

block_public_acls = var.block_public_acls
block_public_policy = var.block_public_policy
ignore_public_acls = var.ignore_public_acls
restrict_public_buckets = var.restrict_public_buckets
}
13 changes: 13 additions & 0 deletions module-s3/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
output "bucket_id" {
value = aws_s3_bucket.khu-bucket.id
description = "The name of the bucket."
}

output "bucket_arn" {
value = aws_s3_bucket.khu-bucket.arn
description = "The ARN of the bucket."
}

output "bucket_domain_name" {
value = aws_s3_bucket.khu-bucket.bucket_domain_name
}
23 changes: 23 additions & 0 deletions module-s3/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
variable "aws_region" {
type = string
}

variable "bucket_name" {
type = string
}

variable "block_public_acls" {
type = bool
}

variable "block_public_policy" {
type = bool
}

variable "ignore_public_acls" {
type = bool
}

variable "restrict_public_buckets" {
type = bool
}

0 comments on commit 839a6c2

Please sign in to comment.