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

[gcp] Add new vault_gcp_secret_backend resource for managing GCP #212

Merged

Conversation

fatmcgav
Copy link
Contributor

@fatmcgav fatmcgav commented Oct 15, 2018

Secret backends [1]

This requires an upstream change to Vault's `api.MountConfigInput` type
which will be raised as a seperate PR.

[1] https://www.vaultproject.io/docs/secrets/gcp/index.html
@ghost ghost added the size/L label Oct 15, 2018
@fatmcgav
Copy link
Contributor Author

fatmcgav commented Oct 15, 2018

The tests pass as follows:

make testacc TEST=./vault TESTARGS="-run=TestGCPSecretBackend"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./vault -v -run=TestGCPSecretBackend -timeout 120m
=== RUN   TestGCPSecretBackend
--- PASS: TestGCPSecretBackend (0.06s)
PASS
ok      github.com/terraform-providers/terraform-provider-vault/vault   0.087s

@ghost ghost added size/XL and removed size/L labels Oct 15, 2018
@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Oct 26, 2018
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

@fatmcgav this looks fantastic! Just a couple of very minor tweaks and I'll merge it in. Thanks for writing that test - I ran it and it passed.

},
})
if err != nil {
return fmt.Errorf("Error mounting to %q: %s", path, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Go prefers lower-cased error strings.

"credentials": credentials,
}
if _, err := client.Logical().Write(configPath, data); err != nil {
return fmt.Errorf("Error writing GCP configuration for %q: %s", path, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Lower case please. :-)


path := d.Id()

// TODO: Fill this out
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this still be here?

log.Printf("[DEBUG] Checking if GCP backend exists at %q", path)
mounts, err := client.Sys().ListMounts()
if err != nil {
return true, fmt.Errorf("Error retrieving list of mounts: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Lower case.

@fatmcgav
Copy link
Contributor Author

Cheers for the review @tyrannosaurus-becks - All addressed :)

Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

@fatmcgav thank you!

@tyrannosaurus-becks tyrannosaurus-becks merged commit 5513395 into hashicorp:master Oct 30, 2018
fatmcgav added a commit to fatmcgav/terraform-provider-vault that referenced this pull request Mar 15, 2019
Resource and docs was added via hashicorp#212, but I missed the sidebar addition...
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
…_resource

[gcp] Add new `vault_gcp_secret_backend` resource for managing GCP
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
Resource and docs was added via hashicorp#212, but I missed the sidebar addition...
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.

2 participants