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 Managed Keys support to TFVP #1508

Merged
merged 61 commits into from
Aug 12, 2022
Merged

Conversation

vinay-gopalan
Copy link
Contributor

@vinay-gopalan vinay-gopalan commented Jun 23, 2022

This PR adds support for Managed keys to the PKI Secret Engine and adds a new resource vault_managed_keys to the TFVP.

Output from acceptance testing:

$ make testacc TESTARGS='-v -run TestResourceMountManagedKeys'
=== RUN   TestResourceMountMangedKeys
--- PASS: TestResourceMountMangedKeys (1.78s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     3.683s

$ make testacc TESTARGS='-v -run TestManagedKeys'
=== RUN   TestManagedKeys
--- PASS: TestManagedKeys (1.72s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     2.221s


@vinay-gopalan vinay-gopalan marked this pull request as ready for review June 23, 2022 21:44
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.

Looking good. Looks like we are missing the website docs though.

vault/resource_managed_keys.go Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
@benashz benashz added this to the 3.8.0 milestone Jul 19, 2022
vault/resource_mount.go Show resolved Hide resolved
@@ -217,6 +217,56 @@ func TestResourceMount_ExternalEntropyAccess(t *testing.T) {
})
}

func TestResourceMountMangedKeys(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we could test this field in its own step, but I suppose that's ok.

Can you add a import test step.

vault/resource_mount_test.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys.go Outdated Show resolved Hide resolved
vault/resource_managed_keys_test.go Outdated Show resolved Hide resolved
vault/resource_managed_keys_test.go Outdated Show resolved Hide resolved
vault/resource_managed_keys_test.go Outdated Show resolved Hide resolved
vault/resource_managed_keys_test.go Outdated Show resolved Hide resolved
},
Config: testManagedKeysConfig_updated(name0),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "aws.#", "1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't really prove that the a delete/create operation took place. In the end you should end up with a new UUID that is different from the original created by the provider and the one created manually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tracking this task in a separate Jira. Thanks for the callout!

vinay-gopalan and others added 4 commits August 12, 2022 14:07
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
@vinay-gopalan vinay-gopalan requested a review from benashz August 12, 2022 21:36
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.

Ship it!

@vinay-gopalan vinay-gopalan merged commit 60612e1 into main Aug 12, 2022
@vinay-gopalan vinay-gopalan deleted the VAULT-4820/managed-keys-support branch August 12, 2022 22:19
marcboudreau pushed a commit to marcboudreau/terraform-provider-vault that referenced this pull request Nov 6, 2022
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.

2 participants