Skip to content

Commit

Permalink
removing region variable and assignment for s3 bucket (made read-only…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdodsworth committed Aug 7, 2020
1 parent 50eacab commit 2507d89
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 20 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module "s3_lb_log" {
versioning_enabled = false
force_destroy = true
region = "ap-northeast-1"
lifecycle_rule_enabled = true
lifecycle_rule_prefix = ""
standard_ia_transition_days = "60"
Expand Down Expand Up @@ -92,7 +91,6 @@ module "s3_lb_log" {
| lifecycle_rule_enabled | Specifies lifecycle rule status. | `string` | `true` | no |
| lifecycle_rule_prefix | Object key prefix identifying one or more objects to which the rule applies. | `string` | `""` | no |
| noncurrent_version_expiration_days | Specifies when noncurrent object versions expire. | `string` | `"60"` | no |
| region | (Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee. | `string` | `""` | no |
| standard_ia_transition_days | Specifies a period in the object's STANDARD_IA transitions. | `string` | `"30"` | no |
| tags | A mapping of tags to assign to the bucket. | `map(string)` | `{}` | no |
| versioning_enabled | Enable versioning. Versioning is a means of keeping multiple variants of an object in the same bucket. | `string` | `true` | no |
Expand Down
1 change: 0 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module "s3_lb_log" {
versioning_enabled = false
force_destroy = true

region = "ap-northeast-1"
lifecycle_rule_enabled = true
lifecycle_rule_prefix = ""
standard_ia_transition_days = "60"
Expand Down
11 changes: 0 additions & 11 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ resource "aws_s3_bucket" "default" {
# https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules
bucket = var.name

# The AWS region this bucket should reside in. Otherwise, the region used by the callee.
region = local.bucket_region

# S3 access control lists (ACLs) enable you to manage access to buckets and objects.
# https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
acl = "private"
Expand Down Expand Up @@ -133,11 +130,3 @@ data "aws_iam_policy_document" "default" {

# https://www.terraform.io/docs/providers/aws/d/elb_service_account.html
data "aws_elb_service_account" "default" {}

# https://www.terraform.io/docs/providers/aws/d/region.html
# Get the region of the callee
data "aws_region" "current" {}

locals {
bucket_region = var.region == "" ? data.aws_region.current.name : var.region
}
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,3 @@ variable "tags" {
default = {}
description = "A mapping of tags to assign to the bucket."
}

variable "region" {
type = string
description = "(Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee."
default = ""
}

0 comments on commit 2507d89

Please sign in to comment.