-
Notifications
You must be signed in to change notification settings - Fork 545
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
[gcp] Add new vault_gcp_secret_backend
resource for managing GCP
#212
Conversation
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
The tests pass as follows:
|
…tion to the Vault API
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.
@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.
vault/resource_gcp_secret_backend.go
Outdated
}, | ||
}) | ||
if err != nil { | ||
return fmt.Errorf("Error mounting to %q: %s", path, err) |
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.
Go prefers lower-cased error strings.
vault/resource_gcp_secret_backend.go
Outdated
"credentials": credentials, | ||
} | ||
if _, err := client.Logical().Write(configPath, data); err != nil { | ||
return fmt.Errorf("Error writing GCP configuration for %q: %s", path, err) |
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.
Lower case please. :-)
vault/resource_gcp_secret_backend.go
Outdated
|
||
path := d.Id() | ||
|
||
// TODO: Fill this out |
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.
Should this still be here?
vault/resource_gcp_secret_backend.go
Outdated
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) |
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.
Lower case.
Cheers for the review @tyrannosaurus-becks - All addressed :) |
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.
@fatmcgav thank you!
Resource and docs was added via hashicorp#212, but I missed the sidebar addition...
…_resource [gcp] Add new `vault_gcp_secret_backend` resource for managing GCP
Resource and docs was added via hashicorp#212, but I missed the sidebar addition...
Secret backends [1]
Add docs.
[1] https://www.vaultproject.io/docs/secrets/gcp/index.html