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

HCPE-955: Vault resources #97

Merged
merged 26 commits into from
Apr 7, 2021
Merged

HCPE-955: Vault resources #97

merged 26 commits into from
Apr 7, 2021

Conversation

bcmdarroch
Copy link
Contributor

@bcmdarroch bcmdarroch commented Apr 6, 2021

πŸ› οΈ Description

Feature branch for the Vault resources: hcp_vault_cluster and hcp_vault_cluster_admin_token πŸ”’ πŸ”‘ ✨

πŸ—οΈ Acceptance tests

  • Are there any feature flags that are required to use this functionality? NOPE
  • 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=TestAccVaultCluster'

--- PASS: TestAccVaultCluster (854.62s)
PASS

--- PASS: TestAccVaultClusterAdminToken (748.13s)
PASS

@bcmdarroch bcmdarroch requested a review from a team April 6, 2021 21:52
stub out vault cluster CRUD and add timeouts

add vault cluster resource schema

add vault cluster admin token resource stub

add vault cluster resource schema and CRUD stubs

add created_at to vault cluster
output admin_token -> token so not redundant

drop answered questions

drop update

add Read function for admin_token

drop max_lease_ttl and move namespace
to computed outputs

tier can only be dev currently,
so change to computed output

fix tests

initial_vault_version -> min_vault_version
add GetVaultClusterByID helper

add CreateVaultCluster helper

add DeleteVaultCluster helper

add CreateVaultClusterAdminToken helper
into new input package to be shared across resources
add resourceVaultClusterCreate
and setVaultClusterResourceData

add resourceVaultClusterRead

add resourceVaultClusterDelete
also dropped namespace, since the default is set by the API
and update test
add resourceVaultClusterAdminTokenCreate

add resourceVaultClusterAdminTokenRead & Delete
update comments + change delete behavior
fix description

add resource template + example .tf

gen doc

add adminTokenExpiry

drop min_version from test tf

regen docs
instead of calling Create, which entangled those two functions
@bcmdarroch bcmdarroch force-pushed the hcpe-955-vault-resources-2 branch from 58fd325 to 7d0bf5b Compare April 7, 2021 00:32
@bcmdarroch bcmdarroch self-assigned this Apr 7, 2021
@bcmdarroch bcmdarroch merged commit 72843ff into main Apr 7, 2021
@bcmdarroch bcmdarroch deleted the hcpe-955-vault-resources-2 branch April 7, 2021 00:40
This resource saves a single admin token per Vault cluster and auto-refreshes the token when it is about to expire.
Destroying this resource *does not* invalidate the admin token.

~> **Known Issue** An admin token may be generated during a `terraform plan` if the current token is expiring.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice tips πŸ‘Œ


# Resource `hcp_vault_cluster_admin_token`

~> **Important Security Notice** The admin token generated by this resource will
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a similar problem with Consul tokens @bcmdarroch ? πŸ€”
I thought it was encrypted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aidan-mundy pushed a commit that referenced this pull request Sep 8, 2023
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.

3 participants