Open mukesh-panigrahi opened 5 years ago
@mukesh-panigrahi if I understand correctly, your terraform configuration example lists a vault_gcp_auth_backend_role
. This is related to GCP Auth Method and not the GCP secret engine.
From the rest of your description, I understand that your use case would be to dynamically generate credentials for GCP, so you would need to use the secret engine resources, which unfortunately are not yet implemented in this provider.
For further reference: GCP Secret Engine: https://www.vaultproject.io/api/secret/gcp/index.html
GCP Auth Method: https://www.vaultproject.io/api/auth/gcp/index.html
@tyrannosaurus-becks Recommendation: Close
@cvbarros I guess the vault_gcp_secret_backend resource is available now, but still it seems that it lacks many of the actual vault write features like role binding to generated service-accounts. Plus the sample on the website for the resource is very poor. I am finding a hardtime to understand the functionality.
Can you please explain, how can i make the tf resource work similar to the link given below- https://codelabs.developers.google.com/codelabs/hashicorp-vault-secrets-generate-service-account-credentials/index.html?index=..%2F..hashiconf-us-18#5
I am assuming that I have to use both resource i.e vault_gcp_secret_backend + vault_gcp_auth_backend_role
My vault_gcp_secret_backend resource looks like below along with vault_gcp_auth_backend_role mentioned above.
resource "vault_gcp_secret_backend" "gcp" {
path = "gcp/config"
default_lease_ttl_seconds = "3600"
}
@mukesh-panigrahi Did you ever get this to work? We are going down the same path and anything you've got to work would be really helpful.
@howsTricks No not yet. I am working on it now, as I can see few more terraform resources has been added to the list related to gcp secret.
Will update as I get it done.
Terraform Version
Terraform Configuration Files
Expected Behavior
It should work similar to below vault commands:-
where it creates Google IAM service accounts with keys and manages it. May be the working of the tf resource is different. Would like to know what are the prerequisites on gcp iam side before tf apply of this resource. Do we need to create the service accounts in advance n mention the same in bound_service accounts?
Actual Behavior
No error!! tf apply goes well. Cant read from 'vault read' commands after vault changes are done.
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
terraform init
terraform apply
Additional Context
Even couldn't find a way to attach role-set bindings from external files to the resource just as we can with below vault write command
Plz update the https://www.terraform.io/docs/providers/vault/r/gcp_auth_backend_role.html#role accordingly with better samples. and links for integrating the vault services along with sample applications.
References
Would like the tf resource to work similar to below vault configuration page. https://www.vaultproject.io/docs/secrets/gcp/index.html
Raised a issue before as well but was closed after moved to wrong provider (gcp). https://github.com/hashicorp/terraform/issues/20474