diff --git a/README.md b/README.md index 73757ed..88d6769 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Creates AWS S3 bucket and if there is need IAM user with appropriated accesses t ```terraform module "my_bucket" { - source = "dasmeta/modules/aws//modules/s3" - version = "0.26.0" + source = "dasmeta/s3/aws" + version = "2.0.0" name = "my-files-bucket" } @@ -30,8 +30,8 @@ output "iam_user_arn" { ```terraform module "my_bucket" { - source = "dasmeta/modules/aws//modules/s3" - version = "0.26.0" + source = "dasmeta/s3/aws" + version = "2.0.0" name = "my-files-bucket" @@ -52,8 +52,8 @@ module "my_bucket" { ```terraform module "my_bucket" { - source = "dasmeta/modules/aws//modules/s3" - version = "0.36.2" + source = "dasmeta/s3/aws" + version = "2.0.0" name = "my-website" @@ -76,19 +76,19 @@ module "my_bucket" { | Name | Version | |------|---------| -| [aws](#requirement\_aws) | >= 3.43 | +| [aws](#requirement\_aws) | ~> 5.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.43 | +| [aws](#provider\_aws) | ~> 5.0 | ## Modules | Name | Source | Version | |------|--------|---------| -| [bucket](#module\_bucket) | terraform-aws-modules/s3-bucket/aws | 3.1.0 | +| [bucket](#module\_bucket) | terraform-aws-modules/s3-bucket/aws | 4.1.2 | | [bucket\_files](#module\_bucket\_files) | ./objects | n/a | | [iam\_user](#module\_iam\_user) | dasmeta/modules/aws//modules/aws-iam-user | 0.36.1 | @@ -107,6 +107,7 @@ module "my_bucket" { | [block\_public\_acls](#input\_block\_public\_acls) | Whether Amazon S3 should block public ACLs for this bucket. | `bool` | `false` | no | | [block\_public\_policy](#input\_block\_public\_policy) | Whether Amazon S3 should block public bucket policies for this bucket. | `bool` | `false` | no | | [bucket\_files](#input\_bucket\_files) | Initial content for bucket, use acl and pattern params if you need more control. |
object({|
path = string
})
{| no | +| [control\_object\_ownership](#input\_control\_object\_ownership) | Manage S3 Bucket Ownership Controls on this bucket or not. | `bool` | `false` | no | | [create\_iam\_user](#input\_create\_iam\_user) | Whether to create specific api access user to this created bucket. | `bool` | `false` | no | | [create\_index\_html](#input\_create\_index\_html) | Whether to create and initial index.html file with default data. | `bool` | `false` | no | | [grant](#input\_grant) | The ACL policy grant. NOTE: conflicts with 'acl'. | `any` | `[]` | no | @@ -114,6 +115,7 @@ module "my_bucket" { | [iam\_user\_name](#input\_iam\_user\_name) | The name of user, NOTE: this is optional and if it is not passed in use place the name will be generated based on bucket name. | `string` | `""` | no | | [ignore\_public\_acls](#input\_ignore\_public\_acls) | Whether Amazon S3 should ignore public ACLs for this bucket. | `bool` | `false` | no | | [name](#input\_name) | Bucket name. | `string` | n/a | yes | +| [object\_ownership](#input\_object\_ownership) | Object ownership. | `string` | `"BucketOwnerPreferred"` | no | | [owner](#input\_owner) | The Bucket owner's display name and ID. NOTE: Conflicts with 'acl'. | `map(string)` | `{}` | no | | [restrict\_public\_buckets](#input\_restrict\_public\_buckets) | Whether Amazon S3 should restrict public bucket policies for this bucket. | `bool` | `false` | no | | [versioning](#input\_versioning) | The versioning configuration for the created bucket. | `map(string)` | `{}` | no | diff --git a/main.tf b/main.tf index f7b8199..10b9cf8 100644 --- a/main.tf +++ b/main.tf @@ -7,7 +7,7 @@ locals { module "bucket" { source = "terraform-aws-modules/s3-bucket/aws" - version = "3.1.0" + version = "4.1.2" bucket = var.name acl = local.acl @@ -15,7 +15,8 @@ module "bucket" { restrict_public_buckets = var.restrict_public_buckets block_public_acls = var.block_public_acls block_public_policy = var.block_public_policy - control_object_ownership = var.acl != null ? true : false + control_object_ownership = var.acl != null ? true : var.control_object_ownership + object_ownership = var.object_ownership versioning = var.versioning diff --git a/variables.tf b/variables.tf index 953253b..e513b01 100644 --- a/variables.tf +++ b/variables.tf @@ -9,6 +9,18 @@ variable "acl" { description = "The acl config for bucket, NOTE: 'acl' conflicts with 'grant' and 'owner'." } +variable "control_object_ownership" { + type = bool + default = false + description = "Manage S3 Bucket Ownership Controls on this bucket or not." +} + +variable "object_ownership" { + type = string + default = "BucketOwnerPreferred" + description = "Object ownership." +} + variable "ignore_public_acls" { description = "Whether Amazon S3 should ignore public ACLs for this bucket." type = bool diff --git a/versions.tf b/versions.tf index 5d8c53b..1ac87da 100644 --- a/versions.tf +++ b/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.43" + version = "~> 5.0" } } }
"path": ""
}