Skip to content
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

Promote Redis Auth to GA #4314

Merged

Conversation

upodroid
Copy link
Contributor

@upodroid upodroid commented Dec 14, 2020

Fixes: hashicorp/terraform-provider-google#8005
Fixes: hashicorp/terraform-provider-google#7601

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

redis: promoted `google_redis_instance.auth_enabled` to GA
redis: added `auth_string` output to `google_redis_instance` when `auth_enabled` is `true`

@google-cla google-cla bot added the cla: yes label Dec 14, 2020
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@ScottSuarez, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 166 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))
Ansible: Diff ( 2 files changed, 27 insertions(+))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))
Inspec: Diff ( 2 files changed, 2 insertions(+), 2 deletions(-))

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me but adding @rileykarson for a second pass

@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=164686"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 166 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))
Ansible: Diff ( 2 files changed, 27 insertions(+))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))
Inspec: Diff ( 2 files changed, 2 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceStorageBucketObjectContent_Basic|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccContainerCluster_withConfidentialNodes|TestAccContainerCluster_withPrivateClusterConfigMissingCidrBlock|TestAccContainerCluster_withIPv4Error|TestAccDataprocJob_Spark|TestAccRedisInstance_redisInstanceAuthEnabled You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=164689"

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about exposing the auth string through a datasource instead of through this resource? Users have been hesitant about including secrets of this type in state the past, and that could be a happy compromise.

Also affects hashicorp/terraform-provider-google#7601 (assuming we keep auth string in-resource, fixes it)

@@ -94,7 +91,7 @@ func TestAccRedisInstance_redisInstanceAuthEnabled(t *testing.T) {
ResourceName: "google_redis_instance.cache",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"region"},
ImportStateVerifyIgnore: []string{"region", "auth_string"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we ignore auth_string? Does the value change each GET? That's another case for using a datasource imo (since the volatile value won't impact the resource, and afaik the primary usecase of the auth string will be exporting it as an output)

If we don't expect the string to expire we could also use a resource to get the value and store it in state, keeping a stable value around.

Copy link
Contributor Author

@upodroid upodroid Dec 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see that other issue.

I excluded the field from import because the import step was failing.

That value is fixed on each call.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the import step failing? Do you have an error message? That's often an indicator of an actual issue.

Copy link
Contributor Author

@upodroid upodroid Dec 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll repro it now. Also I don't like the idea of having to use a separate ds to pull the auth string.

Also it is sent unencrypted. I know there is a new preview feature which enables TLS connections to redis.

https://cloud.google.com/memorystore/docs/redis/auth-overview#security_and_privacy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also 7601 will be fixed by this PR.

Good security for Redis is achieved by using TLS + network isolation. https://redis.io/topics/security

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it out. The decoder logic was broken. Pushed a fix now.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 166 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 75 insertions(+), 2 deletions(-))
Ansible: Diff ( 2 files changed, 27 insertions(+))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))
Inspec: Diff ( 2 files changed, 2 insertions(+), 2 deletions(-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promote auth_enabled in google_redis_instance to GA Generate memorystore redis instance auth string via TF
4 participants