Skip to content

Commit

Permalink
Rename lifecycle rules and split tag lifecycle filter (#14)
Browse files Browse the repository at this point in the history
* Rename lifecycle rules and split tag lifecycle filter

* Cleanup optional from descptions as its provided in the README

* Add pecigonzalo to contrib
  • Loading branch information
pecigonzalo authored and aknysh committed Feb 6, 2019
1 parent 072da9b commit f9cf30a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 30 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,32 @@ Available targets:
lint Lint terraform code
```

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| acl | (Optional) The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services | string | `log-delivery-write` | no |
| acl | The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services | string | `log-delivery-write` | no |
| attributes | Additional attributes (e.g. `policy` or `role`) | list | `<list>` | no |
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| enabled | Set to `false` to prevent the module from creating any resources | string | `true` | no |
| expiration_days | Number of days after which to expunge the objects | string | `90` | no |
| force_destroy | (Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. | string | `false` | no |
| glacier_transition_days | Number of days after which to move the data to the glacier storage tier | string | `60` | no |
| kms_master_key_id | The AWS KMS master key ID used for the SSE-KMS encryption. This can only be used when you set the value of sse_algorithm as aws:kms. The default aws/s3 AWS KMS master key is used if this element is absent while the sse_algorithm is aws:kms | string | `` | no |
| lifecycle_rule_enabled | (Optional) enable lifecycle events on this bucket | string | `true` | no |
| lifecycle_prefix | Prefix filter. Used to manage object lifecycle events. | string | `` | no |
| lifecycle_rule_enabled | Enable lifecycle events on this bucket | string | `true` | no |
| lifecycle_tags | Tags filter. Used to manage object lifecycle events. | map | `<map>` | no |
| name | Name (e.g. `app` or `db`) | string | - | yes |
| namespace | Namespace (e.g. `cp` or `cloudposse`) | string | - | yes |
| noncurrent_version_expiration_days | (Optional) Specifies when noncurrent object versions expire. | string | `90` | no |
| noncurrent_version_transition_days | (Optional) Specifies when noncurrent object versions transitions | string | `30` | no |
| noncurrent_version_expiration_days | Specifies when noncurrent object versions expire. | string | `90` | no |
| noncurrent_version_transition_days | Specifies when noncurrent object versions transitions | string | `30` | no |
| policy | A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. | string | `` | no |
| prefix | (Optional) Key prefix. Used to manage object lifecycle events. | string | `` | no |
| region | (Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee. | string | `` | no |
| region | If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee. | string | `` | no |
| sse_algorithm | The server-side encryption algorithm to use. Valid values are AES256 and aws:kms | string | `AES256` | no |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes |
| standard_transition_days | Number of days to persist in the standard storage tier before moving to the infrequent access tier | string | `30` | no |
| tags | Additional tags (e.g. map('BusinessUnit`,`XYZ`) | map | `<map>` | no |
| versioning_enabled | (Optional) A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket. | string | `false` | no |
| versioning_enabled | A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket. | string | `false` | no |

## Outputs

Expand Down Expand Up @@ -199,7 +199,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

## Copyright

Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2019 [Cloud Posse, LLC](https://cpco.io/copyright)



Expand Down Expand Up @@ -254,15 +254,17 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

### Contributors

| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] |
|---|---|---|
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] | [![Gonzalo Peci][pecigonzalo_avatar]][pecigonzalo_homepage]<br/>[Gonzalo Peci][pecigonzalo_homepage] |
|---|---|---|---|

[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://github.com/osterman.png?size=150
[aknysh_homepage]: https://github.com/aknysh
[aknysh_avatar]: https://github.com/aknysh.png?size=150
[SweetOps_homepage]: https://github.com/SweetOps
[SweetOps_avatar]: https://github.com/SweetOps.png?size=150
[pecigonzalo_homepage]: https://github.com/pecigonzalo
[pecigonzalo_avatar]: https://github.com/pecigonzalo.png?size=150



Expand Down
2 changes: 2 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@ contributors:
github: "aknysh"
- name: "Vladimir"
github: "SweetOps"
- name: "Gonzalo Peci"
github: "pecigonzalo"
16 changes: 8 additions & 8 deletions docs/terraform.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| acl | (Optional) The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services | string | `log-delivery-write` | no |
| acl | The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services | string | `log-delivery-write` | no |
| attributes | Additional attributes (e.g. `policy` or `role`) | list | `<list>` | no |
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| enabled | Set to `false` to prevent the module from creating any resources | string | `true` | no |
| expiration_days | Number of days after which to expunge the objects | string | `90` | no |
| force_destroy | (Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. | string | `false` | no |
| glacier_transition_days | Number of days after which to move the data to the glacier storage tier | string | `60` | no |
| kms_master_key_id | The AWS KMS master key ID used for the SSE-KMS encryption. This can only be used when you set the value of sse_algorithm as aws:kms. The default aws/s3 AWS KMS master key is used if this element is absent while the sse_algorithm is aws:kms | string | `` | no |
| lifecycle_rule_enabled | (Optional) enable lifecycle events on this bucket | string | `true` | no |
| lifecycle_prefix | Prefix filter. Used to manage object lifecycle events. | string | `` | no |
| lifecycle_rule_enabled | Enable lifecycle events on this bucket | string | `true` | no |
| lifecycle_tags | Tags filter. Used to manage object lifecycle events. | map | `<map>` | no |
| name | Name (e.g. `app` or `db`) | string | - | yes |
| namespace | Namespace (e.g. `cp` or `cloudposse`) | string | - | yes |
| noncurrent_version_expiration_days | (Optional) Specifies when noncurrent object versions expire. | string | `90` | no |
| noncurrent_version_transition_days | (Optional) Specifies when noncurrent object versions transitions | string | `30` | no |
| noncurrent_version_expiration_days | Specifies when noncurrent object versions expire. | string | `90` | no |
| noncurrent_version_transition_days | Specifies when noncurrent object versions transitions | string | `30` | no |
| policy | A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. | string | `` | no |
| prefix | (Optional) Key prefix. Used to manage object lifecycle events. | string | `` | no |
| region | (Optional) If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee. | string | `` | no |
| region | If specified, the AWS region this bucket should reside in. Otherwise, the region used by the callee. | string | `` | no |
| sse_algorithm | The server-side encryption algorithm to use. Valid values are AES256 and aws:kms | string | `AES256` | no |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes |
| standard_transition_days | Number of days to persist in the standard storage tier before moving to the infrequent access tier | string | `30` | no |
| tags | Additional tags (e.g. map('BusinessUnit`,`XYZ`) | map | `<map>` | no |
| versioning_enabled | (Optional) A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket. | string | `false` | no |
| versioning_enabled | A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket. | string | `false` | no |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ resource "aws_s3_bucket" "default" {
id = "${module.default_label.id}"
enabled = "${var.lifecycle_rule_enabled}"

prefix = "${var.prefix}"
tags = "${module.default_label.tags}"
prefix = "${var.lifecycle_prefix}"
tags = "${var.lifecycle_tags}"

noncurrent_version_expiration {
days = "${var.noncurrent_version_expiration_days}"
Expand Down
2 changes: 1 addition & 1 deletion output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ output "bucket_arn" {
}

output "prefix" {
value = "${var.prefix}"
value = "${var.lifecycle_prefix}"
description = "Prefix configured for lifecycle rules"
}

Expand Down
21 changes: 13 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ variable "tags" {
}

variable "acl" {
description = "(Optional) The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services"
description = "The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services"
default = "log-delivery-write"
}

Expand All @@ -41,13 +41,18 @@ variable "policy" {
default = ""
}

variable "prefix" {
description = "(Optional) Key prefix. Used to manage object lifecycle events."
variable "lifecycle_prefix" {
description = "Prefix filter. Used to manage object lifecycle events."
default = ""
}

variable "lifecycle_tags" {
description = "Tags filter. Used to manage object lifecycle events."
default = {}
}

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

Expand All @@ -57,22 +62,22 @@ variable "force_destroy" {
}

variable "lifecycle_rule_enabled" {
description = "(Optional) enable lifecycle events on this bucket"
description = "Enable lifecycle events on this bucket"
default = "true"
}

variable "versioning_enabled" {
description = "(Optional) A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket."
description = "A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket."
default = "false"
}

variable "noncurrent_version_expiration_days" {
description = "(Optional) Specifies when noncurrent object versions expire."
description = "Specifies when noncurrent object versions expire."
default = "90"
}

variable "noncurrent_version_transition_days" {
description = "(Optional) Specifies when noncurrent object versions transitions"
description = "Specifies when noncurrent object versions transitions"
default = "30"
}

Expand Down

0 comments on commit f9cf30a

Please sign in to comment.