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

Add resource for GCP Static Account #1094

Merged
merged 15 commits into from Jul 31, 2021

Conversation

lawliet89
Copy link
Contributor

@lawliet89 lawliet89 commented Jul 14, 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

Implemented in hashicorp/vault-plugin-secrets-gcp#107, merged to Vault in hashicorp/vault#12023 and documented in hashicorp/vault#12027

Release note for CHANGELOG:

Add `vault_gcp_secret_static_account` resource

Output from acceptance testing:

Test was done by installing a custom build of the plugin into a Vault Dev server.

$ VAULT_ADDR=http://127.0.0.1:8200 VAULT_TOKEN=12345 GOOGLE_PROJECT=<snip> GOOGLE_CREDENTIALS=<snip> TESTARGS="--run TestGCPSecretStaticAccount" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v --run TestGCPSecretStaticAccount -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   (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/generated [no test files]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/decode    (cached) [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/datasources/transform/encode    (cached) [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/alphabet    (cached) [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/role        (cached) [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/template    (cached) [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-vault/generated/resources/transform/transformation      (cached) [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      (cached) [no tests to run]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.

=== RUN   TestGCPSecretStaticAccount
--- PASS: TestGCPSecretStaticAccount (23.78s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     23.791s

...

@lawliet89 lawliet89 marked this pull request as ready for review July 14, 2021 04:35
@lawliet89
Copy link
Contributor Author

lawliet89 commented Jul 14, 2021

Hey, @austingebauer, not sure if you're the right person for this PR. This is the final bit in the "GCP static account saga".

@austingebauer
Copy link
Member

Thanks for doing this, @lawliet89! I will have a look at this along with others who are more familiar with the provider.

@austingebauer austingebauer self-requested a review July 14, 2021 17:03
Copy link
Member

@austingebauer austingebauer left a comment

Choose a reason for hiding this comment

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

Just a few comments and questions to get started. Thanks again, @lawliet89!

vault/provider.go Outdated Show resolved Hide resolved
vault/resource_gcp_secret_roleset_test.go Show resolved Hide resolved
vault/resource_gcp_secret_static_account.go Outdated Show resolved Hide resolved
vault/resource_gcp_secret_static_account.go Outdated Show resolved Hide resolved
vault/resource_gcp_secret_static_account.go Outdated Show resolved Hide resolved
vault/resource_gcp_secret_static_account.go Show resolved Hide resolved
website/docs/r/gcp_secret_static_account.html.md Outdated Show resolved Hide resolved
website/docs/r/gcp_secret_static_account.html.md Outdated Show resolved Hide resolved
website/docs/r/gcp_secret_static_account.html.md Outdated Show resolved Hide resolved
lawliet89 and others added 3 commits July 29, 2021 10:07
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
@austingebauer
Copy link
Member

austingebauer commented Jul 29, 2021

@lawliet89 - This is looking good. I'm going to have someone more familiar with the provider take a quick look before I merge it. Thanks again!

vault/gcp.go Show resolved Hide resolved
lawliet89 and others added 2 commits July 30, 2021 09:47
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@austingebauer austingebauer left a comment

Choose a reason for hiding this comment

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

LGTM!

@austingebauer austingebauer merged commit eb66cc1 into hashicorp:master Jul 31, 2021
@lawliet89 lawliet89 deleted the gcp-static branch August 2, 2021 01:45
davidmontoyago pushed a commit to davidmontoyago/terraform-provider-vault that referenced this pull request Aug 17, 2021
* Refactor some GCP functions out to a separate file

* Add GCP Static account resource

* Rename Binding type

* Add tests

* Update

* Update prefix

Ref hashicorp/vault-plugin-secrets-gcp@8fba665

* Add docs

* Apply suggestions from code review

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* Rename function

* Update vault/resource_gcp_secret_static_account.go

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>

* Add some comments

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants