-
Notifications
You must be signed in to change notification settings - Fork 50
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
Hvt 4182 http proxy for hcpv in hcp tfp #577
Conversation
…ields in setVaultClusterResourceData
…pdateVaultClusterPublicIps
… appropriate payload
// Remove invalid option from allowed list in error message | ||
expectedEnumList = strings.ReplaceAll( | ||
expectedEnumList, | ||
strings.ToLower(string(vaultmodels.HashicorpCloudVault20201125HTTPProxyOptionHTTPPROXYOPTIONINVALID)), | ||
"", | ||
) | ||
|
||
// Format as comma-separated list | ||
expectedEnumList = strings.Join(strings.Fields(expectedEnumList), ", ") |
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.
These steps are extra compared to our other enum validations (for example on the MVU enums). I added this so users don't receive a confusing error message that the invalid/zero enum is actually allowed.
Talked about this a little more in-depth on Michael's PR: #575 (comment)
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.
thanks for finding this
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 good to me
🛠️ Description
Updating the
hcp_vault_cluster
resource to haveproxy_endpoint
(writeable) andvault_proxy_endpoint_url
(read-only) fields. Theproxy_endpoint
field allows users to toggle the proxy on/off for their cluster. This feature was released on Mon Aug 7 for HCP Vault Dedicated through the UI.As part of this change, we are also refactoring
public_endpoint
updates to be grouped intoUpdateVaultClusterConfig
call and moving off ofUpdateVaultClusterPublicIps
. Please refer to the ADR for more details.🏗️ Acceptance tests
Output from acceptance testing:
AWS
Checking the three updates that are run on acceptance tests:
First update is tier only:
Second update now updates public and proxy in addition to observability on update call (mvu update is through different endpoint)
Third update now updates public and proxy in addition to observability and tier on update call
Azure (slightly affected by update refactoring, but Azure currently only tests tier update)
Validation with local binary
First, created clusters on latest 0.68.0 (when HCP TFP has no knowledge of proxy fields, so clusters are created with zero enum i.e.
HTTP_PROXY_OPTION_INVALID
) usingtest.tf
:Followed guide here to test using local binary and point my
test.tf
file toAfter I created the clusters, I had to run
terraform refresh
for the new field to be picked up (otherwise it would try to populate the field toDISABLED
default). After refreshing then runningterraform plan
, no changes show up as expected. Even though the cluster was created withINVALID
enum, onterraform refresh
, the cloud-vault-service API masks invalid values asDISABLED
here, which is why we are able to get "no change."Also validated the following with the local binary:
DISABLED
DISABLED
ENABLED
ENABLED
DISABLED
ENABLED
returns service errorENABLED
returns service error