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

hvs pg rotating secret #1130

Closed
wants to merge 29 commits into from
Closed

hvs pg rotating secret #1130

wants to merge 29 commits into from

Conversation

dhuckins
Copy link
Contributor

@dhuckins dhuckins commented Nov 7, 2024

add new postgres integration resource and add postgres rotating secret
HV-1704
HV-1707

๐Ÿ› ๏ธ Description

๐Ÿ—๏ธ Acceptance tests

  • Are there any feature flags that are required to use this functionality?
  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

@dhuckins dhuckins marked this pull request as ready for review November 12, 2024 16:31
@dhuckins dhuckins requested review from a team as code owners November 12, 2024 16:31
@dhuckins dhuckins changed the title Dh/hvs pg rotating hvs pg rotating secret Nov 12, 2024
docs/resources/vault_secrets_integration_postgres.md Outdated Show resolved Hide resolved
docs/resources/vault_secrets_rotating_secret.md Outdated Show resolved Hide resolved

// Inner API-compatible models derived from the Terraform fields
capabilities []*secretmodels.Secrets20231128Capability `tfsdk:"-"`
staticCredentialDetails *secretmodels.Secrets20231128PostgresStaticCredentialsRequest `tfsdk:"-"`
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to add a gateway pool ID here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we introduce that separately (in a diff PR) or here?
are (should) gateways be added to the tf provider?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd opt for here since a postgres integration is not particularly useful without a gateway

@dhuckins dhuckins requested a review from averche November 13, 2024 15:28
@dhuckins dhuckins requested a review from averche November 14, 2024 20:13
averche
averche previously approved these changes Nov 22, 2024
@dhuckins dhuckins requested a review from averche November 25, 2024 19:54
Copy link
Contributor

@pierluc-codes pierluc-codes left a comment

Choose a reason for hiding this comment

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

  • postgresql vs postgres

  • no test?

Import is supported using the following syntax:

```shell
terraform import hcp_vault_secrets_integration_postgres.example my-postgres-1
Copy link
Contributor

Choose a reason for hiding this comment

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

Please clarify my-postgres-1

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -0,0 +1,57 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "hcp_vault_secrets_integration_postgres Resource - terraform-provider-hcp"
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be named postgresql?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, postgres is correct


### Optional

- `project_id` (String) HCP project ID that owns the HCP Vault Secrets integration. Inferred from the provider configuration if omitted.
Copy link
Contributor

Choose a reason for hiding this comment

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

where this can be found?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure what you mean (this is consistent with other docs for other providers)
see #1143


Required:

- `connection_string` (String, Sensitive) Connection string (DSN) for the Postgres database.
Copy link
Contributor

Choose a reason for hiding this comment

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

where this can be found?


### Required

- `capabilities` (Set of String) Capabilities enabled for the integration. See the Vault Secrets documentation for the list of supported capabilities per provider.
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't find the matching documentation

@dhuckins dhuckins requested review from pierluc-codes and a team December 9, 2024 19:40

func (r *resourceVaultSecretsIntegrationPostgres) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_vault_secrets_integration_postgres"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@dhuckins there is an initiative on the Ecosystem side to make the integration management API more generic and reduce the amount of provider-specific code necessary to build and maintain for new integrations. We,ll move closer to how the rotating & dynamic secret resources are architected.

We will shortly implement a hcp_vault_secrets_integration resource (ticket) to support all providers and deprecate the provider-specific resources. We should not introduce new provider-specific integration resources e.i. hcp_vault_secrets_integration_{provider}.

We should wait a bit and support postgres only via the hcp_vault_secrets_integration resource. Sorry if this is last minute and requires work on this PR. If there are any questions please reach out to the team on #team-hvs-ecosystem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will close this then.
have a gateway PR that I can put up

@dhuckins dhuckins closed this Dec 11, 2024
@dhuckins dhuckins deleted the dh/hvs-pg-rotating branch December 11, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants