-
Notifications
You must be signed in to change notification settings - Fork 109
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
Optionally Enable "redis.googleapis.com" Service #3
Optionally Enable "redis.googleapis.com" Service #3
Conversation
Enables the "redis.googleapis.com" service on the targeted project if the `enable_apis` variable is true. Defaults to `true` with what we consider to be the most basic module usecase in mind - a brand new project is targeted and service enablement is not already managed by other means.
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.
I've a handful of small comments, nothing really substantive. Let's get those small fixups in and we can merge. 👍
variables.tf
Outdated
|
||
variable "enable_apis" { | ||
description = "Enable required APIs for Cloud Memorystore." | ||
default = true |
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.
Boolean variable defaults should be quoted because terraform will coerce true
to 1
, and this behavior will change on 0.12.
main.tf
Outdated
} | ||
|
||
resource "google_project_service" "redis" { | ||
|
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.
Heads up - terraform fmt
will remove this space, so we might as well remove it in the PR.
@trotttrotttrott Please run |
Terraform docs recommend use of strings for boolean values to avoid caveats in the conversion process.
@adrienthebo I've addressed your comments. Please take another look when you have a chance! |
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.
LGTM
…odules/ludo-simple-example-and-tests Fix simple example and tests
Enables the "redis.googleapis.com" service on the targeted project if the
enable_apis
variable istrue
. Defaults totrue
with what we consider to be the most basic module use case in mind - a brand new project is targeted and service enablement is not already managed by other means.Integration tests now pass successfully when targeting a new, pristine project. As previously or with
enable_apis
set tofalse
, tests will fail run against a pristine project withError 403: Google Cloud Memorystore for Redis API has not been used in project <PROJECT_ID> before or it is disabled...
.