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

Create azure secrets backend Update Functionality #1009

Conversation

davidadeleon
Copy link
Contributor

@davidadeleon davidadeleon commented Mar 22, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Release note for CHANGELOG:

Creating `azureSecretBackendUpdate` to handle updating of backend configuration avoiding bug where TF Apply will fail due to mount already existing in Vault.

Output from acceptance testing:

❯ make testacc TESTARGS='-run=TestAzureSecretBackend'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAzureSecretBackend -timeout 120m
?   	github.com/hashicorp/terraform-provider-vault	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/cmd/coverage	[no test files]
?   	github.com/hashicorp/terraform-provider-vault/cmd/generate	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/codegen	0.067s [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/generated	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode	0.417s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode	0.810s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet	0.679s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role	0.290s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template	0.554s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation     	0.172s [no tests to run]
?   	github.com/hashicorp/terraform-provider-vault/schema	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-vault/util	0.128s [no tests to run]
=== RUN   TestAzureSecretBackendRole
    resource_azure_secret_backend_role_test.go:18: ARM_SUBSCRIPTION_ID not set
--- SKIP: TestAzureSecretBackendRole (0.00s)
=== RUN   TestAzureSecretBackend
--- PASS: TestAzureSecretBackend (0.18s)
PASS
ok  	github.com/hashicorp/terraform-provider-vault/vault	1.136s
...

Created Update functionality to allow for backend configuration to be updated without the need to recreate resource.
@ghost ghost added the size/M label Mar 22, 2021
@davidadeleon davidadeleon changed the title Davidadeleon create azure secrets backend update Create azure secrets backend update Mar 22, 2021
@davidadeleon davidadeleon changed the title Create azure secrets backend update Create azure secrets backend Update Functionality Mar 22, 2021
@tvoran tvoran self-requested a review April 30, 2021 00:51
Copy link
Member

@tvoran tvoran left a comment

Choose a reason for hiding this comment

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

Thanks for the patch! I made some suggestions here, largely around the use of the Partial functions which are deprecated.

Let us know if you'd like to continue on this, otherwise I can pick it up.

vault/resource_azure_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_azure_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_azure_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_azure_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_azure_secret_backend_test.go Outdated Show resolved Hide resolved
vault/resource_azure_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_azure_secret_backend.go Show resolved Hide resolved
vault/resource_azure_secret_backend.go
Copy link
Member

@tvoran tvoran left a comment

Choose a reason for hiding this comment

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

Thanks, this is looking good to me, and seems to work locally as well.

@jasonodonnell Would you mind double-checking to make sure I didn't miss something?

@jasonodonnell jasonodonnell self-requested a review May 3, 2021 20:54
Copy link
Collaborator

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

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

LGTM too! Thanks!

@tvoran tvoran merged commit 7719bde into hashicorp:master May 3, 2021
davidmontoyago pushed a commit to davidmontoyago/terraform-provider-vault that referenced this pull request Aug 17, 2021
Created Update functionality to allow for backend configuration to be
updated without the need to recreate resource.

Added update test
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.

None yet

3 participants