Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DMVP-5087): have index object acl set based on bucket acl and have additional outputs for module #20

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Creates AWS S3 bucket and if there is need IAM user with appropriated accesses t

module "my_bucket" {
source = "dasmeta/s3/aws"
version = "2.0.0"
version = "1.2.1"

name = "my-files-bucket"
}
Expand All @@ -31,7 +31,7 @@ output "iam_user_arn" {
```terraform
module "my_bucket" {
source = "dasmeta/s3/aws"
version = "2.0.0"
version = "1.2.1"

name = "my-files-bucket"

Expand All @@ -53,7 +53,7 @@ module "my_bucket" {
```terraform
module "my_bucket" {
source = "dasmeta/s3/aws"
version = "2.0.0"
version = "1.2.1"

name = "my-website"

Expand Down Expand Up @@ -125,10 +125,12 @@ module "my_bucket" {

| Name | Description |
|------|-------------|
| <a name="output_bucket_regional_domain_name"></a> [bucket\_regional\_domain\_name](#output\_bucket\_regional\_domain\_name) | The bucket regional domain name |
| <a name="output_iam_access_key_id"></a> [iam\_access\_key\_id](#output\_iam\_access\_key\_id) | The access key ID |
| <a name="output_iam_access_key_secret"></a> [iam\_access\_key\_secret](#output\_iam\_access\_key\_secret) | The access key secret |
| <a name="output_iam_user_arn"></a> [iam\_user\_arn](#output\_iam\_user\_arn) | The ARN assigned by AWS for this user |
| <a name="output_iam_user_name"></a> [iam\_user\_name](#output\_iam\_user\_name) | The user's name |
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The bucket arn |
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The bucket name |
| <a name="output_s3_bucket_website_endpoint"></a> [s3\_bucket\_website\_endpoint](#output\_s3\_bucket\_website\_endpoint) | The website endpoint associated to created s3 bucket |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ resource "aws_s3_object" "index" {
bucket = module.bucket.s3_bucket_id
key = "index.html"
content = "OK, ${module.bucket.s3_bucket_id}"
acl = "public-read"
acl = var.acl
content_type = "text/html"

lifecycle {
ignore_changes = [
content
content,
acl
]
}
}
Expand All @@ -51,6 +52,6 @@ module "bucket_files" {

bucket = module.bucket.s3_bucket_id
path = var.bucket_files.path
acl = try(var.bucket_files.acl, "public-read")
acl = try(var.bucket_files.acl, var.acl)
pattern = try(var.bucket_files.pattern, "**")
}
10 changes: 10 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ output "s3_bucket_id" {
value = module.bucket.s3_bucket_id
}

output "s3_bucket_arn" {
description = "The bucket arn"
value = module.bucket.s3_bucket_arn
}

output "s3_bucket_website_endpoint" {
description = "The website endpoint associated to created s3 bucket"
value = module.bucket.s3_bucket_website_endpoint
}

output "bucket_regional_domain_name" {
description = "The bucket regional domain name"
value = module.bucket.s3_bucket_bucket_regional_domain_name
}

output "iam_user_name" {
description = "The user's name"
value = module.iam_user.iam_user_name
Expand Down
Loading