Skip to content

Instantly share code, notes, and snippets.

@grimm26
Last active January 6, 2020 18:43
Show Gist options
  • Save grimm26/a0ced6cdfb0f8d6ec5377abe2ca5ba3f to your computer and use it in GitHub Desktop.
Save grimm26/a0ced6cdfb0f8d6ec5377abe2ca5ba3f to your computer and use it in GitHub Desktop.
terraform-docs issue supporting docs

Required Inputs

The following input variables are required:

default_retention_days

Description: The number of days that you want to specify for the default retention period.

Type: number

default_retention_years

Description: The number of years that you want to specify for the default retention period.

Type: number

environment

Description: Is this part of production, staging, development?

Type: string

name

Description: What is the name of the bucket?

Type: string

product

Description: Product this bucket is associated with

Type: string

service

Description: Service that this bucket is associated with

Type: string

team_email

Description: Provide an email address for the team resposnible for this bucket

Type: string

Optional Inputs

The following input variables are optional (have default values):

allow_public_get

Description: Allow public GET

Type: bool

Default: false

allow_source_ips

Description: Allow these CIDR ranges to read the bucket and its contents

Type: list(string)

Default: []

allow_source_ips_actions

Description: What s3 actions whitelisted CIDRs can do

Type: list(string)

Default:

[
  "s3:ListBucket",
  "s3:ListBucketVersions",
  "s3:GetBucketLocation",
  "s3:GetObject",
  "s3:GetObjectTagging",
  "s3:GetObjectVersion",
  "s3:GetObjectAcl"
]

allow_vpce_actions

Description: What s3 actions whitelisted VPCEs can do

Type: list(string)

Default:

[
  "s3:ListBucket",
  "s3:ListBucketVersions",
  "s3:GetBucketLocation",
  "s3:GetObject",
  "s3:GetObjectTagging",
  "s3:GetObjectVersion",
  "s3:GetObjectAcl"
]

allow_vpces

Description: Allow these VPC Endpoints to read the bucket and its contents

Type: list(string)

Default: []

cors_allowed_headers

Description: n/a

Type: list(string)

Default:

[
  "Authorization"
]

cors_allowed_methods

Description: n/a

Type: list(string)

Default:

[
  "GET"
]

cors_allowed_origins

Description: n/a

Type: list(string)

Default:

[
  "*"
]

cors_expose_headers

Description: n/a

Type: list(string)

Default: []

cors_max_age_seconds

Description: n/a

Type: string

Default: "3000"

enable_logging

Description: Should we enable bucket logging?

Type: bool

Default: true

enable_object_locking

Description: Indicates whether this bucket has an Object Lock configuration enabled. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html

Type: bool

Default: false

enable_replication

Description: Should we replicate this bucket to another region?

Type: bool

Default: true

enable_s3_inventory

Description: Enable S3 inventory?

Type: bool

Default: false

enable_versioning

Description: Enabling versioning?

Type: bool

Default: true

external_account_actions

Description: What policy actions will we allow the 3rd party account?

Type: list(string)

Default:

[
  "s3:ListBucket",
  "s3:ListBucketVersions",
  "s3:GetBucketLocation",
  "s3:GetObject",
  "s3:GetObjectTagging",
  "s3:GetObjectVersion",
  "s3:GetObjectAcl"
]

external_account_id

Description: The ID for an external account to give access to

Type: list(string)

Default: []

inventory_format

Description: Specifies the output format of the inventory results. Can be CSV, ORC or Parquet.

Type: string

Default: "CSV"

inventory_frequency

Description: Specifies how frequently inventory results are produced. Can be Daily or Weekly.

Type: string

Default: "Weekly"

inventory_included_object_versions

Description: Object filtering that accepts a prefix (documented below). Can be All or Current.

Type: string

Default: "Current"

inventory_optional_fields

Description: Contains the optional fields that are included in the inventory results. Accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus.

Type: list(string)

Default:

[
  "ETag",
  "LastModifiedDate",
  "IsMultipartUploaded",
  "Size"
]

lifecycle_current_enabled

Description: Enable lifecycle rule for current object versions?

Type: bool

Default: false

lifecycle_current_prefix

Description: Prefix that current version lifecycle rule works on

Type: string

Default: ""

lifecycle_current_transitions

Description: The number of days until transitions.

Type: map(string)

Default:

{
  "expiration": 2555,
  "glacier": 120,
  "standard_ia": 30
}

lifecycle_noncurrent_enabled

Description: Enable lifecycle rule for noncurrent object versions?

Type: bool

Default: true

lifecycle_noncurrent_prefix

Description: Prefix that noncurrent version lifecycle rule works on

Type: string

Default: ""

lifecycle_noncurrent_transitions

Description: The number of days until transitions.

Type: map(string)

Default:

{
  "expiration": 2555,
  "glacier": 120,
  "standard_ia": 30
}

metric_filters

Description: Metric filters to apply to your s3 bucket

Type:

list(
    object(
      {
        name   = string
        prefix = string
      }
    )
  )

Default: []

object_locking_mode

Description: The default Object Lock retention mode you want to apply to new objects placed in this bucket. Valid values are GOVERNANCE and COMPLIANCE. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes

Type: string

Default: "GOVERNANCE"

origin_access_iam_arn

Description: ARN of the origin access ID, used only when the bucket is the source for a cloudfront distribution and you want no other access.

Type: string

Default: "none"

redshift_logging

Description: Set to 1 to enable logging for redshift

Type: bool

Default: false

redshift_region

Description: What region is the redshift instance in?

Type: string

Default: ""

replica_storage_class

Description: S3 Storage class to use for replica bucket.

Type: string

Default: "STANDARD_IA"

versioning_enabled

Description: DEPRECATED, use enable_versioning

Type: bool

Default: true

Outputs

The following outputs are exported:

bucket_arn

Description: Bucket's ARN

bucket_domain_name

Description: n/a

bucket_name

Description: Bucket's name

bucket_region

Description: Bucket's region

s3_bucket_arn

Description: Bucket's ARN (deprecated)

s3_bucket_name

Description: Bucket's name (deprecated)

s3_bucket_region

Description: Bucket's region (deprecated)

Inputs

Name Description Type Default Required
default_retention_days The number of days that you want to specify for the default retention period. number n/a yes
default_retention_years The number of years that you want to specify for the default retention period. number n/a yes
environment Is this part of production, staging, development? string n/a yes
name What is the name of the bucket? string n/a yes
product Product this bucket is associated with string n/a yes
service Service that this bucket is associated with string n/a yes
team_email Provide an email address for the team resposnible for this bucket string n/a yes
allow_public_get Allow public GET bool false no
allow_source_ips Allow these CIDR ranges to read the bucket and its contents list(string) [] no
allow_source_ips_actions What s3 actions whitelisted CIDRs can do list(string)
[
"s3:ListBucket",
"s3:ListBucketVersions",
"s3:GetBucketLocation",
"s3:GetObject",
"s3:GetObjectTagging",
"s3:GetObjectVersion",
"s3:GetObjectAcl"
]
no
allow_vpce_actions What s3 actions whitelisted VPCEs can do list(string)
[
"s3:ListBucket",
"s3:ListBucketVersions",
"s3:GetBucketLocation",
"s3:GetObject",
"s3:GetObjectTagging",
"s3:GetObjectVersion",
"s3:GetObjectAcl"
]
no
allow_vpces Allow these VPC Endpoints to read the bucket and its contents list(string) [] no
cors_allowed_headers n/a list(string)
[
"Authorization"
]
no
cors_allowed_methods n/a list(string)
[
"GET"
]
no
cors_allowed_origins n/a list(string)
[
"*"
]
no
cors_expose_headers n/a list(string) [] no
cors_max_age_seconds n/a string "3000" no
enable_logging Should we enable bucket logging? bool true no
enable_object_locking Indicates whether this bucket has an Object Lock configuration enabled. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html bool false no
enable_replication Should we replicate this bucket to another region? bool true no
enable_s3_inventory Enable S3 inventory? bool false no
enable_versioning Enabling versioning? bool true no
external_account_actions What policy actions will we allow the 3rd party account? list(string)
[
"s3:ListBucket",
"s3:ListBucketVersions",
"s3:GetBucketLocation",
"s3:GetObject",
"s3:GetObjectTagging",
"s3:GetObjectVersion",
"s3:GetObjectAcl"
]
no
external_account_id The ID for an external account to give access to list(string) [] no
inventory_format Specifies the output format of the inventory results. Can be CSV, ORC or Parquet. string "CSV" no
inventory_frequency Specifies how frequently inventory results are produced. Can be Daily or Weekly. string "Weekly" no
inventory_included_object_versions Object filtering that accepts a prefix (documented below). Can be All or Current. string "Current" no
inventory_optional_fields Contains the optional fields that are included in the inventory results. Accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus. list(string)
[
"ETag",
"LastModifiedDate",
"IsMultipartUploaded",
"Size"
]
no
lifecycle_current_enabled Enable lifecycle rule for current object versions? bool false no
lifecycle_current_prefix Prefix that current version lifecycle rule works on string "" no
lifecycle_current_transitions The number of days until transitions. map(string)
{
"expiration": 2555,
"glacier": 120,
"standard_ia": 30
}
no
lifecycle_noncurrent_enabled Enable lifecycle rule for noncurrent object versions? bool true no
lifecycle_noncurrent_prefix Prefix that noncurrent version lifecycle rule works on string "" no
lifecycle_noncurrent_transitions The number of days until transitions. map(string)
{
"expiration": 2555,
"glacier": 120,
"standard_ia": 30
}
no
metric_filters Metric filters to apply to your s3 bucket
list(
object(
{
name = string
prefix = string
}
)
)
[] no
object_locking_mode The default Object Lock retention mode you want to apply to new objects placed in this bucket. Valid values are GOVERNANCE and COMPLIANCE. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes string "GOVERNANCE" no
origin_access_iam_arn ARN of the origin access ID, used only when the bucket is the source for a cloudfront distribution and you want no other access. string "none" no
redshift_logging Set to 1 to enable logging for redshift bool false no
redshift_region What region is the redshift instance in? string "" no
replica_storage_class S3 Storage class to use for replica bucket. string "STANDARD\_IA" no
versioning_enabled DEPRECATED, use enable_versioning bool true no

Outputs

Name Description
bucket_arn Bucket's ARN
bucket_domain_name n/a
bucket_name Bucket's name
bucket_region Bucket's region
s3_bucket_arn Bucket's ARN (deprecated)
s3_bucket_name Bucket's name (deprecated)
s3_bucket_region Bucket's region (deprecated)

Inputs

Name Description Type Default Required
default_retention_days The number of days that you want to specify for the default retention period. number n/a yes
default_retention_years The number of years that you want to specify for the default retention period. number n/a yes
environment Is this part of production, staging, development? string n/a yes
name What is the name of the bucket? string n/a yes
product Product this bucket is associated with string n/a yes
service Service that this bucket is associated with string n/a yes
team_email Provide an email address for the team resposnible for this bucket string n/a yes
allow_public_get Allow public GET bool false no
allow_source_ips Allow these CIDR ranges to read the bucket and its contents list(string) [] no
allow_source_ips_actions What s3 actions whitelisted CIDRs can do list(string) ["s3:ListBucket", "s3:ListBucketVersions", "s3:GetBucketLocation", "s3:GetObject", "s3:GetObjectTagging", "s3:GetObjectVersion", "s3:GetObjectAcl"] no
allow_vpce_actions What s3 actions whitelisted VPCEs can do list(string) ["s3:ListBucket", "s3:ListBucketVersions", "s3:GetBucketLocation", "s3:GetObject", "s3:GetObjectTagging", "s3:GetObjectVersion", "s3:GetObjectAcl"] no
allow_vpces Allow these VPC Endpoints to read the bucket and its contents list(string) [] no
cors_allowed_headers n/a list(string) ["Authorization"] no
cors_allowed_methods n/a list(string) ["GET"] no
cors_allowed_origins n/a list(string) ["*"] no
cors_expose_headers n/a list(string) [] no
cors_max_age_seconds n/a string "3000" no
enable_logging Should we enable bucket logging? bool true no
enable_object_locking Indicates whether this bucket has an Object Lock configuration enabled. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html bool false no
enable_replication Should we replicate this bucket to another region? bool true no
enable_s3_inventory Enable S3 inventory? bool false no
enable_versioning Enabling versioning? bool true no
external_account_actions What policy actions will we allow the 3rd party account? list(string) ["s3:ListBucket", "s3:ListBucketVersions", "s3:GetBucketLocation", "s3:GetObject", "s3:GetObjectTagging", "s3:GetObjectVersion", "s3:GetObjectAcl"] no
external_account_id The ID for an external account to give access to list(string) [] no
inventory_format Specifies the output format of the inventory results. Can be CSV, ORC or Parquet. string "CSV" no
inventory_frequency Specifies how frequently inventory results are produced. Can be Daily or Weekly. string "Weekly" no
inventory_included_object_versions Object filtering that accepts a prefix (documented below). Can be All or Current. string "Current" no
inventory_optional_fields Contains the optional fields that are included in the inventory results. Accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus. list(string) ["ETag", "LastModifiedDate", "IsMultipartUploaded", "Size"] no
lifecycle_current_enabled Enable lifecycle rule for current object versions? bool false no
lifecycle_current_prefix Prefix that current version lifecycle rule works on string "" no
lifecycle_current_transitions The number of days until transitions. map(string) { "expiration": 2555, "glacier": 120, "standard_ia": 30} no
lifecycle_noncurrent_enabled Enable lifecycle rule for noncurrent object versions? bool true no
lifecycle_noncurrent_prefix Prefix that noncurrent version lifecycle rule works on string "" no
lifecycle_noncurrent_transitions The number of days until transitions. map(string) { "expiration": 2555, "glacier": 120, "standard_ia": 30} no
metric_filters Metric filters to apply to your s3 bucket list( object( { name = string prefix = string } ) ) [] no
object_locking_mode The default Object Lock retention mode you want to apply to new objects placed in this bucket. Valid values are GOVERNANCE and COMPLIANCE. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes string "GOVERNANCE" no
origin_access_iam_arn ARN of the origin access ID, used only when the bucket is the source for a cloudfront distribution and you want no other access. string "none" no
redshift_logging Set to 1 to enable logging for redshift bool false no
redshift_region What region is the redshift instance in? string "" no
replica_storage_class S3 Storage class to use for replica bucket. string "STANDARD_IA" no
versioning_enabled DEPRECATED, use enable_versioning bool true no

Outputs

Name Description
bucket_arn Bucket's ARN
bucket_domain_name n/a
bucket_name Bucket's name
bucket_region Bucket's region
s3_bucket_arn Bucket's ARN (deprecated)
s3_bucket_name Bucket's name (deprecated)
s3_bucket_region Bucket's region (deprecated)
variable "name" {
description = "What is the name of the bucket?"
type = string
}
variable "lifecycle_current_prefix" {
description = "Prefix that current version lifecycle rule works on"
type = string
default = ""
}
variable "lifecycle_current_enabled" {
description = "Enable lifecycle rule for current object versions?"
type = bool
default = false
}
variable "lifecycle_current_transitions" {
description = "The number of days until transitions."
type = map(string)
default = {
standard_ia = 30
glacier = 120
expiration = 2555
}
}
variable "lifecycle_noncurrent_prefix" {
description = "Prefix that noncurrent version lifecycle rule works on"
type = string
default = ""
}
variable "lifecycle_noncurrent_enabled" {
description = "Enable lifecycle rule for noncurrent object versions?"
type = bool
default = true
}
variable "lifecycle_noncurrent_transitions" {
description = "The number of days until transitions."
type = map(string)
default = {
standard_ia = 30
glacier = 120
expiration = 2555
}
}
variable "environment" {
description = "Is this part of production, staging, development?"
type = string
}
variable "product" {
description = "Product this bucket is associated with"
type = string
}
variable "service" {
description = "Service that this bucket is associated with"
type = string
}
variable "cors_allowed_headers" {
type = list(string)
default = ["Authorization"]
}
variable "cors_allowed_methods" {
type = list(string)
default = ["GET"]
}
variable "cors_allowed_origins" {
type = list(string)
default = ["*"]
}
variable "cors_expose_headers" {
type = list(string)
default = []
}
variable "cors_max_age_seconds" {
default = "3000"
}
variable "versioning_enabled" {
description = "DEPRECATED, use enable_versioning"
type = bool
default = true
}
variable "enable_versioning" {
description = "Enabling versioning?"
type = bool
default = true
}
variable "enable_s3_inventory" {
description = "Enable S3 inventory?"
type = bool
default = false
}
variable "team_email" {
description = "Provide an email address for the team resposnible for this bucket"
type = string
}
variable "inventory_included_object_versions" {
description = "Object filtering that accepts a prefix (documented below). Can be All or Current."
type = string
default = "Current"
}
variable "inventory_format" {
description = "Specifies the output format of the inventory results. Can be CSV, ORC or Parquet."
type = string
default = "CSV"
}
variable "inventory_frequency" {
description = "Specifies how frequently inventory results are produced. Can be Daily or Weekly."
type = string
default = "Weekly"
}
variable "inventory_optional_fields" {
description = "Contains the optional fields that are included in the inventory results. Accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus."
type = list(string)
default = ["ETag", "LastModifiedDate", "IsMultipartUploaded", "Size"]
}
variable "replica_storage_class" {
description = "S3 Storage class to use for replica bucket."
type = string
default = "STANDARD_IA"
}
variable "enable_replication" {
description = "Should we replicate this bucket to another region?"
type = bool
default = true
}
variable "enable_logging" {
description = "Should we enable bucket logging?"
type = bool
default = true
}
variable "enable_object_locking" {
description = "Indicates whether this bucket has an Object Lock configuration enabled. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html"
type = bool
default = false
}
variable "object_locking_mode" {
description = "The default Object Lock retention mode you want to apply to new objects placed in this bucket. Valid values are GOVERNANCE and COMPLIANCE. https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes"
type = string
default = "GOVERNANCE"
}
variable "default_retention_days" {
description = "The number of days that you want to specify for the default retention period."
type = number
default = null
}
variable "default_retention_years" {
description = "The number of years that you want to specify for the default retention period."
type = number
default = null
}
variable "metric_filters" {
description = "Metric filters to apply to your s3 bucket"
type = list(
object(
{
name = string
prefix = string
}
)
)
default = []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment