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

Revert change to Transfer Acceleration from #178 #180

Merged
merged 1 commit into from
May 9, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ Available targets:
| <a name="input_store_access_key_in_ssm"></a> [store\_access\_key\_in\_ssm](#input\_store\_access\_key\_in\_ssm) | Set to `true` to store the created IAM user's access key in SSM Parameter Store,<br>`false` to store them in Terraform state as outputs.<br>Since Terraform state would contain the secrets in plaintext,<br>use of SSM Parameter Store is recommended. | `bool` | `false` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
| <a name="input_transfer_acceleration_enabled"></a> [transfer\_acceleration\_enabled](#input\_transfer\_acceleration\_enabled) | Set this to true to enable S3 Transfer Acceleration for the bucket. | `bool` | `false` | no |
| <a name="input_transfer_acceleration_enabled"></a> [transfer\_acceleration\_enabled](#input\_transfer\_acceleration\_enabled) | Set this to `true` to enable S3 Transfer Acceleration for the bucket.<br>Note: When this is set to `false` Terraform does not perform drift detection<br>and will not disable Transfer Acceleration if it was enabled outside of Terraform.<br>To disable it via Terraform, you must set this to `true` and then to `false`.<br>Note: not all regions support Transfer Acceleration. | `bool` | `false` | no |
| <a name="input_user_enabled"></a> [user\_enabled](#input\_user\_enabled) | Set to `true` to create an IAM user with permission to access the bucket | `bool` | `false` | no |
| <a name="input_user_permissions_boundary_arn"></a> [user\_permissions\_boundary\_arn](#input\_user\_permissions\_boundary\_arn) | Permission boundary ARN for the IAM user created to access the bucket. | `string` | `null` | no |
| <a name="input_versioning_enabled"></a> [versioning\_enabled](#input\_versioning\_enabled) | A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket | `bool` | `true` | no |
Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
| <a name="input_store_access_key_in_ssm"></a> [store\_access\_key\_in\_ssm](#input\_store\_access\_key\_in\_ssm) | Set to `true` to store the created IAM user's access key in SSM Parameter Store,<br>`false` to store them in Terraform state as outputs.<br>Since Terraform state would contain the secrets in plaintext,<br>use of SSM Parameter Store is recommended. | `bool` | `false` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
| <a name="input_transfer_acceleration_enabled"></a> [transfer\_acceleration\_enabled](#input\_transfer\_acceleration\_enabled) | Set this to true to enable S3 Transfer Acceleration for the bucket. | `bool` | `false` | no |
| <a name="input_transfer_acceleration_enabled"></a> [transfer\_acceleration\_enabled](#input\_transfer\_acceleration\_enabled) | Set this to `true` to enable S3 Transfer Acceleration for the bucket.<br>Note: When this is set to `false` Terraform does not perform drift detection<br>and will not disable Transfer Acceleration if it was enabled outside of Terraform.<br>To disable it via Terraform, you must set this to `true` and then to `false`.<br>Note: not all regions support Transfer Acceleration. | `bool` | `false` | no |
| <a name="input_user_enabled"></a> [user\_enabled](#input\_user\_enabled) | Set to `true` to create an IAM user with permission to access the bucket | `bool` | `false` | no |
| <a name="input_user_permissions_boundary_arn"></a> [user\_permissions\_boundary\_arn](#input\_user\_permissions\_boundary\_arn) | Permission boundary ARN for the IAM user created to access the bucket. | `string` | `null` | no |
| <a name="input_versioning_enabled"></a> [versioning\_enabled](#input\_versioning\_enabled) | A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket | `bool` | `true` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "s3_bucket" {
s3_replication_rules = local.s3_replication_rules
privileged_principal_actions = var.privileged_principal_actions
privileged_principal_arns = local.privileged_principal_arns
transfer_acceleration_enabled = true
transfer_acceleration_enabled = var.transfer_acceleration_enabled
bucket_key_enabled = var.bucket_key_enabled

access_key_enabled = var.access_key_enabled
Expand Down
2 changes: 2 additions & 0 deletions examples/complete/privileged-principals.us-east-2.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ privileged_principal_enabled = true
versioning_enabled = false

user_enabled = false

transfer_acceleration_enabled = false
5 changes: 5 additions & 0 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,8 @@ variable "store_access_key_in_ssm" {
EOT
}

variable "transfer_acceleration_enabled" {
type = bool
default = true
description = "Set true to enable Transfer Acceleration (many regions not supported)"
}
5 changes: 2 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ resource "aws_s3_bucket" "default" {
tags = module.this.tags
}

# Ensure the resource exists to track drift, even if the feature is disabled
resource "aws_s3_bucket_accelerate_configuration" "default" {
count = local.enabled ? 1 : 0
count = local.transfer_acceleration_enabled ? 1 : 0
bucket = join("", aws_s3_bucket.default.*.id)
status = local.transfer_acceleration_enabled ? "Enabled" : "Suspended"
status = "Enabled"
}

# Ensure the resource exists to track drift, even if the feature is disabled
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,13 @@ variable "privileged_principal_actions" {
variable "transfer_acceleration_enabled" {
type = bool
default = false
description = "Set this to true to enable S3 Transfer Acceleration for the bucket."
description = <<-EOT
Set this to `true` to enable S3 Transfer Acceleration for the bucket.
Note: When this is set to `false` Terraform does not perform drift detection
and will not disable Transfer Acceleration if it was enabled outside of Terraform.
To disable it via Terraform, you must set this to `true` and then to `false`.
Note: not all regions support Transfer Acceleration.
EOT
}

variable "s3_object_ownership" {
Expand Down