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

Reset es password #642

Merged
merged 4 commits into from
May 11, 2023
Merged

Reset es password #642

merged 4 commits into from
May 11, 2023

Conversation

tobio
Copy link
Member

@tobio tobio commented May 9, 2023

Description

Adds a reset_elasticsearch_password attribute to the deployment resource, when true this explicitly resets the password, updating the value in state with the new credentials.

Related Issues

Fixes #99

Motivation and Context

With the migration to 0.6 and higher requiring re-importing existing deployments, which in turn does not include the current elastic user, customers need a path to programatically update the credentials in TF state.

How Has This Been Tested?

Acceptance tests, manual tests.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@tobio tobio requested a review from dimuon May 9, 2023 13:46
@tobio tobio self-assigned this May 9, 2023
@tobio tobio requested review from alaudazzi and a team as code owners May 9, 2023 13:46
if isResetting != nil && *isResetting {
planVal := resp.AttributePlan.(types.String)
planVal.Unknown = true
resp.AttributePlan = planVal
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
resp.AttributePlan = planVal
resp.AttributePlan = types.String{Unknown: true}

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, the suggestion doesn't reflect the all proposed changes. planVal can be totally removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

All good. Good pickup, I was testing something out here and forgot to revert it.

Copy link
Contributor

@dimuon dimuon left a comment

Choose a reason for hiding this comment

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

👍

@tobio tobio merged commit 7aeb9c7 into elastic:master May 11, 2023
@tobio tobio deleted the reset-es-password branch May 11, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ec_deployment: Allow users to reset the Elasticsearch password
2 participants