Skip to content

Commit

Permalink
add config to split into submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Nov 4, 2020
1 parent af8c9c3 commit e1ca878
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 20 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@

* v1.2 -- 20201104
- fix s3 bucket permission to not output statement with deny if no IP and VPCE provided

* v2.0 -- 20201104
- change to aws-s3
- create submodules `standard` and `title26`
- standard
- no versioning
- no explicit boc:authority tag
- auto create encryption key if not provided already
- title26
- versioning
- explicit boc:authority tag
- auto create encryption key
File renamed without changes.
File renamed without changes.
23 changes: 4 additions & 19 deletions main.tf → common/resources.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* # About aws-t26-s3
*
* # Usage
*
* ```hcl
* module "mybucket" {
* source = "git@github.e.it.census.gov:terraform-modules/aws-t26-s3.git"
*
* bucket_name = "myt26bucket"
* }
* ```
*
*/

locals {
name = var.bucket_name
bucket_name = format("%s%s", local._prefixes["s3"], var.bucket_name)
Expand All @@ -34,9 +19,9 @@ locals {
s3_bucket_conditions_list = list(local.condition_allowed_cidr, local.condition_allowed_endpoints)
s3_bucket_conditions = [for x in local.s3_bucket_conditions_list : x if length(x.values) > 0]

enforced_tags = {
"boc:safeguard" = "title26"
}
# enforced_tags = {
# "boc:safeguard" = "title26"
# }
base_tags = {
"boc:tf_module_version" = var._module_version
"boc:created_by" = "terraform"
Expand All @@ -61,7 +46,7 @@ resource "aws_s3_bucket" "this" {
}

versioning {
enabled = true
enabled = local.versioning
}

logging {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion version.tf → common/version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "_module_version" {
description = "Module version number"
type = string
default = "1.2"
default = "2.0"
}
18 changes: 18 additions & 0 deletions standard/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* # About aws-s3
*
* # Usage
*
* ```hcl
* module "mybucket" {
* source = "git@github.e.it.census.gov:terraform-modules/aws-s3//standard"
*
* bucket_name = "mynormalbucket"
* }
* ```
*
*/
locals {
enforced_tags = {}
versioning = false
}
1 change: 1 addition & 0 deletions standard/outputs.tf
1 change: 1 addition & 0 deletions standard/prefixes.tf
1 change: 1 addition & 0 deletions standard/resources.tf
1 change: 1 addition & 0 deletions standard/variables.tf
1 change: 1 addition & 0 deletions standard/version.tf
20 changes: 20 additions & 0 deletions title26/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* # About aws-s3
*
* # Usage
*
* ```hcl
* module "mybucket" {
* source = "git@github.e.it.census.gov:terraform-modules/aws-s3//title26"
*
* bucket_name = "myt26bucket"
* }
* ```
*
*/
locals {
enforced_tags = {
"boc:safeguard" = "title26"
}
versioning = true
}
1 change: 1 addition & 0 deletions title26/outputs.tf
1 change: 1 addition & 0 deletions title26/prefixes.tf
1 change: 1 addition & 0 deletions title26/resources.tf
1 change: 1 addition & 0 deletions title26/variables.tf
1 change: 1 addition & 0 deletions title26/version.tf

0 comments on commit e1ca878

Please sign in to comment.