-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/17/lifecycle rules #19
Fix/17/lifecycle rules #19
Conversation
README.md
Outdated
@@ -1,4 +1,4 @@ | |||
# Terraform Google Cloud Storage Module | |||
# Terraform Google Cloud Storage Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a misformatting? Shouldn't have a tab here.
examples/simple_example/main.tf
Outdated
@@ -24,5 +24,6 @@ module "cloud_storage" { | |||
prefix = var.prefix | |||
names = var.names | |||
bucket_policy_only = var.bucket_policy_only | |||
lifecycle_rules = var.lifecycle_rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please hard-code an example directly instead of making this a variable.
variables.tf
Outdated
condition = map(string) | ||
})) | ||
default = [] | ||
description = "The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#lifecycle_rule except condition.matches_storage_class - it should be comma delimited string." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to "blocks" is confusing in this context.
Instead we should say something like:
description = "The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#lifecycle_rule except condition.matches_storage_class - it should be comma delimited string." | |
description = "List of lifecycle rules to configure. Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#lifecycle_rule except condition.matches_storage_class should be a comma delimited string." |
0cf510b
to
8ac280f
Compare
@morgante please re-review |
examples/simple_example/variables.tf
Outdated
@@ -34,3 +34,14 @@ variable "bucket_policy_only" { | |||
type = map(string) | |||
} | |||
|
|||
variable "lifecycle_rules" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're hardcoding this now, can we remove the variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kopachevsky To be clear, I don't want any variables for lifecycle_rules in either examples or fixtures, it can just be hardcoded in the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did it in example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you still have a variable in the example. Please remove the variables, as I've said a number of times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, my mistake
@@ -19,3 +19,14 @@ variable "project_id" { | |||
type = string | |||
} | |||
|
|||
variable "lifecycle_rules" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove variable.
test/fixtures/simple_example/main.tf
Outdated
@@ -34,5 +34,16 @@ module "example" { | |||
"one" = true | |||
"two" = false | |||
} | |||
|
|||
lifecycle_rules = [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove, this is set in the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morgante make sense to leave it in once place, you suggest to set it in example but not here, right?
b58a0c1
to
7b7d9a6
Compare
examples/simple_example/README.md
Outdated
@@ -8,6 +8,7 @@ This example illustrates how to use the `cloud-storage` module. | |||
| Name | Description | Type | Default | Required | | |||
|------|-------------|:----:|:-----:|:-----:| | |||
| bucket\_policy\_only | Disable ad-hoc ACLs on specified buckets. Defaults to true. Map of lowercase unprefixed name => boolean | map(string) | n/a | yes | | |||
| lifecycle\_rules | List of lifecycle rules to configure. Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#lifecycle_rule except condition.matches_storage_class should be a comma delimited string. | object | `<list>` | no | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kopachevsky Please regenerate docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Added support for lifecycle rules Updated tests and lints Updated variables and readme files
7b7d9a6
to
317c5a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like tests are failing, please fix.
5cd02b7
to
ed63d28
Compare
fixed |
Added lifecycle_rules variable and corresponding dynamic block.
Fixes #17