Skip to content
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
5 changes: 4 additions & 1 deletion .github/workflows/commitmsg-conform.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Commit Message Conformance

on:
pull_request: {}

permissions:
statuses: write
checks: write
contents: read
pull-requests: read

jobs:
commitmsg-conform:
uses: tfstack/actions/.github/workflows/commitmsg-conform.yml@main
uses: actionsforge/actions/.github/workflows/commitmsg-conform.yml@main
5 changes: 4 additions & 1 deletion .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Markdown Lint

on:
pull_request: {}

permissions:
statuses: write
checks: write
contents: read
pull-requests: read

jobs:
markdown-lint:
uses: tfstack/actions/.github/workflows/markdown-lint.yml@main
uses: actionsforge/actions/.github/workflows/markdown-lint.yml@main
13 changes: 13 additions & 0 deletions .github/workflows/terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Generate terraform docs

on:
push:
branches:
- main

permissions:
contents: write

jobs:
terraform-docs:
uses: actionsforge/actions/.github/workflows/terraform-docs.yml@main
4 changes: 3 additions & 1 deletion .github/workflows/terraform-lint-validate.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Terraform Lint & Validate

on:
pull_request: {}
permissions:
statuses: write
checks: write
contents: read
pull-requests: read

jobs:
terraform-lint-validate:
uses: tfstack/actions/.github/workflows/terraform-lint-validate.yml@main
uses: actionsforge/actions/.github/workflows/terraform-lint-validate.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/terraform-tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Terraform Tag and Release
on:
workflow_run:
workflows: ["Generate terraform docs"]
types:
- completed

permissions:
contents: write
jobs:
terraform-tag-and-release:
uses: actionsforge/actions/.github/workflows/terraform-tag-and-release.yml@main
67 changes: 2 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,5 @@

Terraform module to create an S3 bucket

## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.94.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_s3_bucket.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_acl.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl) | resource |
| [aws_s3_bucket_lifecycle_configuration.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_lifecycle_configuration) | resource |
| [aws_s3_bucket_logging.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging) | resource |
| [aws_s3_bucket_ownership_controls.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls) | resource |
| [aws_s3_bucket_ownership_controls.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls) | resource |
| [aws_s3_bucket_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [aws_s3_bucket_server_side_encryption_configuration.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource |
| [aws_s3_bucket_server_side_encryption_configuration.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource |
| [aws_s3_bucket_versioning.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioning) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_allowed_principals"></a> [allowed\_principals](#input\_allowed\_principals) | List of IAM principals allowed to access the S3 bucket. Use '*' for public access. | `list(string)` | <pre>[<br/> "*"<br/>]</pre> | no |
| <a name="input_block_public_acls"></a> [block\_public\_acls](#input\_block\_public\_acls) | Whether to block public ACLs on the S3 bucket. | `bool` | `true` | no |
| <a name="input_block_public_policy"></a> [block\_public\_policy](#input\_block\_public\_policy) | Whether to block public bucket policies. | `bool` | `true` | no |
| <a name="input_bucket_acl"></a> [bucket\_acl](#input\_bucket\_acl) | The ACL for the S3 bucket | `string` | `"private"` | no |
| <a name="input_bucket_name"></a> [bucket\_name](#input\_bucket\_name) | The name of the S3 bucket (must be unique, 3-63 characters, lowercase, and DNS-compliant) | `string` | n/a | yes |
| <a name="input_bucket_suffix"></a> [bucket\_suffix](#input\_bucket\_suffix) | Optional suffix for the S3 bucket name. | `string` | `""` | no |
| <a name="input_enable_versioning"></a> [enable\_versioning](#input\_enable\_versioning) | Enable versioning for the bucket | `bool` | `true` | no |
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | Whether to allow deletion of non-empty bucket | `bool` | `false` | no |
| <a name="input_ignore_public_acls"></a> [ignore\_public\_acls](#input\_ignore\_public\_acls) | Whether to ignore public ACLs for this bucket. | `bool` | `true` | no |
| <a name="input_logging_enabled"></a> [logging\_enabled](#input\_logging\_enabled) | Enable logging for the S3 bucket | `bool` | `false` | no |
| <a name="input_logging_encryption_algorithm"></a> [logging\_encryption\_algorithm](#input\_logging\_encryption\_algorithm) | The encryption algorithm used for S3 logging. Valid values: 'AES256', 'aws:kms'. | `string` | `"AES256"` | no |
| <a name="input_logging_encryption_enabled"></a> [logging\_encryption\_enabled](#input\_logging\_encryption\_enabled) | Enable encryption for S3 logging. | `bool` | `true` | no |
| <a name="input_logging_lifecycle_filter_prefix"></a> [logging\_lifecycle\_filter\_prefix](#input\_logging\_lifecycle\_filter\_prefix) | Prefix to apply S3 lifecycle rule to. Set to "" to apply to all objects. | `string` | `""` | no |
| <a name="input_logging_log_retention_days"></a> [logging\_log\_retention\_days](#input\_logging\_log\_retention\_days) | Number of days to retain S3 logging data before expiration. | `number` | `30` | no |
| <a name="input_logging_s3_prefix"></a> [logging\_s3\_prefix](#input\_logging\_s3\_prefix) | Prefix for S3 logging objects. | `string` | `"s3/"` | no |
| <a name="input_object_ownership"></a> [object\_ownership](#input\_object\_ownership) | Defines who owns newly uploaded objects in the bucket. | `string` | `"BucketOwnerPreferred"` | no |
| <a name="input_restrict_public_buckets"></a> [restrict\_public\_buckets](#input\_restrict\_public\_buckets) | Whether to restrict public access to the bucket. | `bool` | `true` | no |
| <a name="input_sse_algorithm"></a> [sse\_algorithm](#input\_sse\_algorithm) | The encryption algorithm for S3 bucket | `string` | `"AES256"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags for the S3 bucket | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_bucket_arn"></a> [bucket\_arn](#output\_bucket\_arn) | The ARN of the S3 bucket |
| <a name="output_bucket_domain_name"></a> [bucket\_domain\_name](#output\_bucket\_domain\_name) | The bucket domain name |
| <a name="output_bucket_hosted_zone_id"></a> [bucket\_hosted\_zone\_id](#output\_bucket\_hosted\_zone\_id) | The Route 53 hosted zone ID for this bucket |
| <a name="output_bucket_id"></a> [bucket\_id](#output\_bucket\_id) | The ID (name) of the S3 bucket |
| <a name="output_bucket_logging_target"></a> [bucket\_logging\_target](#output\_bucket\_logging\_target) | The target bucket for logging (if logging is enabled) |
| <a name="output_bucket_region"></a> [bucket\_region](#output\_bucket\_region) | The AWS region where the S3 bucket is located |
<!-- BEGIN_TF_DOCS -->
<!-- END_TF_DOCS -->
44 changes: 44 additions & 0 deletions examples/minimal/.terraform.lock.hcl

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

29 changes: 0 additions & 29 deletions output.tf

This file was deleted.

64 changes: 64 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
output "bucket_arn" {
description = "The ARN of the S3 bucket"
value = aws_s3_bucket.this.arn
}

output "bucket_bucket_domain_name" {
description = "The bucket domain name (suitable for direct website hosting)"
value = aws_s3_bucket.this.bucket_domain_name
}

output "bucket_bucket_regional_domain_name" {
description = "The bucket region-specific domain name"
value = aws_s3_bucket.this.bucket_regional_domain_name
}

output "bucket_domain_name" {
description = "The bucket domain name"
value = aws_s3_bucket.this.bucket_domain_name
}

output "bucket_encryption_configuration" {
description = "The bucket's server-side encryption configuration"
value = length(aws_s3_bucket.this.server_side_encryption_configuration) > 0 ? aws_s3_bucket.this.server_side_encryption_configuration : null
}

output "bucket_hosted_zone_id" {
description = "The Route 53 hosted zone ID for this bucket"
value = aws_s3_bucket.this.hosted_zone_id
}

output "bucket_id" {
description = "The ID of the S3 bucket"
value = aws_s3_bucket.this.id
}

output "bucket_lifecycle_configuration" {
description = "The bucket's lifecycle configuration"
value = length(aws_s3_bucket.this.lifecycle_rule) > 0 ? aws_s3_bucket.this.lifecycle_rule : null
}

output "bucket_logging_target" {
description = "The target bucket for logging (if logging is enabled)"
value = var.logging_enabled ? aws_s3_bucket.logging[0].id : null
}

output "bucket_name" {
description = "The name of the S3 bucket"
value = aws_s3_bucket.this.bucket
}

output "bucket_region" {
description = "The AWS region where the S3 bucket is located"
value = aws_s3_bucket.this.region
}

output "bucket_replication_configuration" {
description = "The bucket's replication configuration"
value = length(aws_s3_bucket.this.replication_configuration) > 0 ? aws_s3_bucket.this.replication_configuration : null
}

output "bucket_versioning" {
description = "The bucket's versioning configuration"
value = length(aws_s3_bucket.this.versioning) > 0 ? aws_s3_bucket.this.versioning : null
}