-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from terraform-modules/split-into-submodule
Split into submodule
- Loading branch information
Showing
30 changed files
with
380 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,30 @@ | ||
| # About aws-t26-s3 | ||
| # About aws-s3 | ||
|
|
||
| This module allows you to create an S3 bucket, either a standard bucket or a bucket used for FTI (Title26) | ||
| data. | ||
|
|
||
| # Usage | ||
|
|
||
| * [Standard](standard) | ||
|
|
||
| ```hcl | ||
| module "mybucket" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-t26-s3.git" | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-s3.git//standard" | ||
| bucket_name = "myt26bucket" | ||
| bucket_name = "mynormalbucket" | ||
| access_log_bucket = "accesslogs" | ||
| } | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | aws | n/a | | ||
| | null | n/a | | ||
| * [Title 26](title26) | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | \_module\_version | Module version number | `string` | `"1.2"` | no | | ||
| | access\_log\_bucket | Server Access Logging Bucket ID | `string` | n/a | yes | | ||
| | access\_log\_bucket\_prefix | Access log bucket prefix, to which the bucket name will be appended to make the target\_prefix | `string` | `"s3"` | no | | ||
| | allowed\_cidr | List of allowed source IPs (NOT from within the VPC) | `list(string)` | `[]` | no | | ||
| | allowed\_endpoints | List of allowed VPC endpoint IDs | `list(string)` | `[]` | no | | ||
| | bucket\_folders | List of folders (keys) to create after creation of bucket | `list(string)` | `[]` | no | | ||
| | bucket\_name | AWS Bucket Name | `string` | n/a | yes | | ||
| | force\_destroy | Sets force\_destroy to allow the bucket and contents to be deleted. The deletion may take a very long time | `bool` | `false` | no | | ||
| | kms\_key\_id | AWS KMS Key ID (one per bucket) | `string` | `""` | no | | ||
| | tags | AWS Tags | `map(string)` | `{}` | no | | ||
| ```hcl | ||
| module "mybucket" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-s3.git//title26" | ||
| ## Outputs | ||
| bucket_name = "mytitle26bucket" | ||
| access_log_bucket = "accesslogs" | ||
| } | ||
| ``` | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | kms\_key\_arn | Created KMS Key ARN | | ||
| | kms\_key\_id | Created KMS Key ID | | ||
| | s3\_bucket\_arn | Created S3 Bucket ARN | | ||
| | s3\_bucket\_id | Created S3 Bucket ID | | ||
| See each section for additional information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | aws | n/a | | ||
| | null | n/a | | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | access\_log\_bucket | Server Access Logging Bucket ID | `string` | n/a | yes | | ||
| | access\_log\_bucket\_prefix | Access log bucket prefix, to which the bucket name will be appended to make the target\_prefix | `string` | `"s3"` | no | | ||
| | allowed\_cidr | List of allowed source IPs (NOT from within the VPC). If empty, there will be no restrictions on source IP. If provided, you must also use allowed\_endpoints for access within a VPC. | `list(string)` | `[]` | no | | ||
| | allowed\_endpoints | List of allowed VPC endpoint IDs. If used, it will enable access to the bucket from the specific VPC endpoints. | `list(string)` | `[]` | no | | ||
| | bucket\_folders | List of folders (keys) to create after creation of bucket. They will have object metadata provided based on metadata\_tags and data\_safeguard labels. | `list(string)` | `[]` | no | | ||
| | bucket\_name | AWS Bucket Name. Standard prefix will be applied here, do not include here. | `string` | n/a | yes | | ||
| | force\_destroy | Sets force\_destroy to allow the bucket and contents to be deleted. The deletion may take a very long time based on the number of objects. You normally want to update this to true, apply, and then destroy the resource. | `bool` | `false` | no | | ||
| | kms\_key\_id | AWS KMS Key ID (one per bucket). This is currently ignored. | `string` | `""` | no | | ||
| | metadata\_tags | AWS S3 Custom metadata (prefix x-amzn-meta- automatically included, not needed here). If data\_safeguard labels are applied, they will be incorporated on any bucket objects created. | `map(string)` | `{}` | no | | ||
| | tags | AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data\_safeguard field for such things. | `map(string)` | `{}` | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | kms\_key\_arn | Created KMS Key ARN | | ||
| | kms\_key\_id | Created KMS Key ID | | ||
| | s3\_bucket\_arn | Created S3 Bucket ARN | | ||
| | s3\_bucket\_id | Created S3 Bucket ID | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # local._defaults["data_safeguards"] | ||
|
|
||
| locals { | ||
| _defaults = { | ||
| data_safeguards = ["title13", "title26", "title42", "pii", "title5"] | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| variable "bucket_name" { | ||
| description = "AWS Bucket Name. Standard prefix will be applied here, do not include here." | ||
| type = string | ||
| } | ||
|
|
||
| variable "bucket_folders" { | ||
| description = "List of folders (keys) to create after creation of bucket. They will have object metadata provided based on metadata_tags and data_safeguard labels." | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "kms_key_id" { | ||
| description = "AWS KMS Key ID (one per bucket). This is currently ignored." | ||
| type = string | ||
| default = "" | ||
| } | ||
|
|
||
| variable "tags" { | ||
| description = "AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data_safeguard field for such things." | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "metadata_tags" { | ||
| description = "AWS S3 Custom metadata (prefix x-amzn-meta- automatically included, not needed here). If data_safeguard labels are applied, they will be incorporated on any bucket objects created." | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "access_log_bucket_prefix" { | ||
| description = "Access log bucket prefix, to which the bucket name will be appended to make the target_prefix" | ||
| type = string | ||
| default = "s3" | ||
| } | ||
|
|
||
| variable "access_log_bucket" { | ||
| description = "Server Access Logging Bucket ID" | ||
| type = string | ||
| # default = null | ||
| } | ||
|
|
||
| variable "allowed_cidr" { | ||
| description = "List of allowed source IPs (NOT from within the VPC). If empty, there will be no restrictions on source IP. If provided, you must also use allowed_endpoints for access within a VPC." | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "allowed_endpoints" { | ||
| description = "List of allowed VPC endpoint IDs. If used, it will enable access to the bucket from the specific VPC endpoints." | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "force_destroy" { | ||
| description = "Sets force_destroy to allow the bucket and contents to be deleted. The deletion may take a very long time based on the number of objects. You normally want to update this to true, apply, and then destroy the resource." | ||
| type = bool | ||
| default = false | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| locals { | ||
| _module_version = "2.0" | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # About aws-s3 :: standard | ||
|
|
||
| This submodule allows you to create an S3 bucket using the standard prefixes and settings required for | ||
| non-FTI Data. This includes | ||
| - Server Access Logging | ||
|
|
||
| Other configurations such as versioning or data safegurad tagging (only on the bucket/keys) are oiptional | ||
|
|
||
| # Usage | ||
|
|
||
| ```hcl | ||
| module "mybucket" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-s3.git//standard" | ||
| bucket_name = "mynormalbucket" | ||
| access_log_bucket = "mylogbucket" | ||
| } | ||
| ``` | ||
|
|
||
| This automaticaly creates an AWS KMS key used just for this bucket. | ||
|
|
||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | aws | n/a | | ||
| | null | n/a | | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | access\_log\_bucket | Server Access Logging Bucket ID | `string` | n/a | yes | | ||
| | access\_log\_bucket\_prefix | Access log bucket prefix, to which the bucket name will be appended to make the target\_prefix | `string` | `"s3"` | no | | ||
| | allowed\_cidr | List of allowed source IPs (NOT from within the VPC). If empty, there will be no restrictions on source IP. If provided, you must also use allowed\_endpoints for access within a VPC. | `list(string)` | `[]` | no | | ||
| | allowed\_endpoints | List of allowed VPC endpoint IDs. If used, it will enable access to the bucket from the specific VPC endpoints. | `list(string)` | `[]` | no | | ||
| | bucket\_folders | List of folders (keys) to create after creation of bucket. They will have object metadata provided based on metadata\_tags and data\_safeguard labels. | `list(string)` | `[]` | no | | ||
| | bucket\_name | AWS Bucket Name. Standard prefix will be applied here, do not include here. | `string` | n/a | yes | | ||
| | data\_safeguards | Selected available safeguards which apply to the data in the bucket | `list(string)` | `[]` | no | | ||
| | enable\_title26 | Flag to enable bucket with Title 26 (FTI) settings | `bool` | `false` | no | | ||
| | force\_destroy | Sets force\_destroy to allow the bucket and contents to be deleted. The deletion may take a very long time based on the number of objects. You normally want to update this to true, apply, and then destroy the resource. | `bool` | `false` | no | | ||
| | kms\_key\_id | AWS KMS Key ID (one per bucket). This is currently ignored. | `string` | `""` | no | | ||
| | metadata\_tags | AWS S3 Custom metadata (prefix x-amzn-meta- automatically included, not needed here). If data\_safeguard labels are applied, they will be incorporated on any bucket objects created. | `map(string)` | `{}` | no | | ||
| | tags | AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data\_safeguard field for such things. | `map(string)` | `{}` | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | kms\_key\_arn | Created KMS Key ARN | | ||
| | kms\_key\_id | Created KMS Key ID | | ||
| | s3\_bucket\_arn | Created S3 Bucket ARN | | ||
| | s3\_bucket\_id | Created S3 Bucket ID | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/defaults.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * # About aws-s3 :: standard | ||
| * | ||
| * This submodule allows you to create an S3 bucket using the standard prefixes and settings required for | ||
| * non-FTI Data. This includes | ||
| * - Server Access Logging | ||
| * | ||
| * Other configurations such as versioning or data safegurad tagging (only on the bucket/keys) are oiptional | ||
| * | ||
| * # Usage | ||
| * | ||
| * ```hcl | ||
| * module "mybucket" { | ||
| * source = "git@github.e.it.census.gov:terraform-modules/aws-s3.git//standard" | ||
| * | ||
| * bucket_name = "mynormalbucket" | ||
| * access_log_bucket = "mylogbucket" | ||
| * } | ||
| * ``` | ||
| * | ||
| * This automaticaly creates an AWS KMS key used just for this bucket. | ||
| */ | ||
|
|
||
| locals { | ||
| enable_title26 = var.enable_title26 ? true : false | ||
| versioning = false | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/outputs.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/prefixes.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/resources.tf |
Oops, something went wrong.