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 apikey resource #124

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kwadhwa-openai
Copy link
Contributor

What was changed

Adding apikey CRUD support

Why?

API keys are currently managed using tcld. Adding support with terraform plugin will make it easy to maintain it in code

Checklist

  1. Closes [Feature Request] Add API key resource support for CRUD #123

  2. How was this tested:
    make testacc using real service-account-id

  3. Any docs updates needed?

generated the docs

@kwadhwa-openai kwadhwa-openai requested a review from a team as a code owner September 24, 2024 09:08
@CLAassistant
Copy link

CLAassistant commented Sep 24, 2024

CLA assistant check
All committers have signed the CLA.

@kwadhwa-openai kwadhwa-openai force-pushed the terraform_crud_apikey branch 2 times, most recently from 4ca4685 to 797ce6f Compare September 24, 2024 09:15
internal/provider/apikey_resource.go Outdated Show resolved Hide resolved
internal/provider/apikey_resource.go Outdated Show resolved Hide resolved
@jlacefie
Copy link
Collaborator

jlacefie commented Sep 29, 2024

TY for the contribution!
Please add the disabled field to the schema. After that, we will test manually before committing to workaround #131.

@kwadhwa-openai
Copy link
Contributor Author

TY for the contribution! Please add the disabled field to the schema

done! Also updated the docs. Will update the test with SA once that PR is merged/landed

@jlacefie
Copy link
Collaborator

jlacefie commented Oct 2, 2024

@kwadhwa-openai did anything change with the search attributes resource or test in this PR? For some reason those tests are now failing. Everything else passes though.


	github.com/temporalio/terraform-provider-temporalcloud	[no test files]
?   	github.com/temporalio/terraform-provider-temporalcloud/internal/client	[no test files]
=== RUN   TestAccBasicApiKey
=== PAUSE TestAccBasicApiKey
=== RUN   TestAccDisableApiKey
=== PAUSE TestAccDisableApiKey
=== RUN   TestAccBasicNamespace
=== PAUSE TestAccBasicNamespace
=== RUN   TestAccBasicNamespaceWithCertFilters
=== PAUSE TestAccBasicNamespaceWithCertFilters
=== RUN   TestAccNamespaceWithCodecServer
=== PAUSE TestAccNamespaceWithCodecServer
=== RUN   TestAccNamespaceRenameForcesReplacement
=== PAUSE TestAccNamespaceRenameForcesReplacement
=== RUN   TestAccNamespaceImport
=== PAUSE TestAccNamespaceImport
=== RUN   TestAccSpacesBetweenCertificateStrings
=== PAUSE TestAccSpacesBetweenCertificateStrings
=== RUN   TestAccNamespaceWithSearchAttributes
=== PAUSE TestAccNamespaceWithSearchAttributes
=== RUN   TestAccNamespaceImportSearchAttribute
=== PAUSE TestAccNamespaceImportSearchAttribute
=== RUN   TestAccNamespaceWithSearchAttributesUpdate
=== PAUSE TestAccNamespaceWithSearchAttributesUpdate
=== RUN   TestAccNamespaces
--- PASS: TestAccNamespaces (3.96s)
=== RUN   TestAccRegion
--- PASS: TestAccRegion (3.91s)
=== RUN   TestAccBasicServiceAccount
=== PAUSE TestAccBasicServiceAccount
=== RUN   TestAccBasicServiceAccountWithNamespaceAccesses
=== PAUSE TestAccBasicServiceAccountWithNamespaceAccesses
=== RUN   TestAccBasicUser
=== PAUSE TestAccBasicUser
=== RUN   TestAccBasicUserWithNamespaceAccesses
=== PAUSE TestAccBasicUserWithNamespaceAccesses
=== CONT  TestAccBasicApiKey
=== CONT  TestAccNamespaceWithSearchAttributes
=== CONT  TestAccBasicUserWithNamespaceAccesses
=== CONT  TestAccBasicNamespaceWithCertFilters
=== CONT  TestAccNamespaceImport
=== CONT  TestAccNamespaceWithCodecServer
=== CONT  TestAccNamespaceRenameForcesReplacement
=== CONT  TestAccSpacesBetweenCertificateStrings
=== CONT  TestAccBasicNamespace
=== CONT  TestAccBasicServiceAccountWithNamespaceAccesses
--- PASS: TestAccBasicApiKey (15.48s)
=== CONT  TestAccDisableApiKey
--- PASS: TestAccDisableApiKey (20.05s)
=== CONT  TestAccBasicUser
--- PASS: TestAccBasicUser (12.40s)
=== CONT  TestAccNamespaceWithSearchAttributesUpdate
=== NAME  TestAccNamespaceWithSearchAttributes
    namespace_search_attribute_resource_test.go:59: Step 1/2 error: Error running apply: exit status 1

        Error: Failed to update namespace

          with temporalcloud_namespace_search_attribute.custom_search_attribute,
          on terraform_plugin_test.tf line 27, in resource "temporalcloud_namespace_search_attribute" "custom_search_attribute":
          27: resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {

        'custom_search_attributes' and 'search_attributes' are set and different

        Error: Failed to update namespace

          with temporalcloud_namespace_search_attribute.custom_search_attribute2,
          on terraform_plugin_test.tf line 33, in resource "temporalcloud_namespace_search_attribute" "custom_search_attribute2":
          33: resource "temporalcloud_namespace_search_attribute" "custom_search_attribute2" {

        'custom_search_attributes' and 'search_attributes' are set and different
--- PASS: TestAccBasicNamespace (130.79s)
=== CONT  TestAccBasicServiceAccount
--- FAIL: TestAccNamespaceWithSearchAttributes (131.38s)
=== CONT  TestAccNamespaceImportSearchAttribute
--- PASS: TestAccNamespaceImport (131.94s)
--- PASS: TestAccBasicUserWithNamespaceAccesses (132.03s)
--- PASS: TestAccSpacesBetweenCertificateStrings (138.84s)
--- PASS: TestAccBasicNamespaceWithCertFilters (139.81s)
--- PASS: TestAccBasicServiceAccount (12.16s)
--- PASS: TestAccNamespaceWithCodecServer (147.85s)
--- PASS: TestAccBasicServiceAccountWithNamespaceAccesses (148.02s)
--- PASS: TestAccNamespaceWithSearchAttributesUpdate (119.88s)
--- PASS: TestAccNamespaceRenameForcesReplacement (243.23s)
--- PASS: TestAccNamespaceImportSearchAttribute (128.66s)
FAIL
FAIL	github.com/temporalio/terraform-provider-temporalcloud/internal/provider	268.454s
=== RUN   TestCACertNormalization
--- PASS: TestCACertNormalization (0.00s)
=== RUN   TestUnknownEncodedCAValue
--- PASS: TestUnknownEncodedCAValue (0.00s)
=== RUN   TestNullEncodedCAValue
--- PASS: TestNullEncodedCAValue (0.00s)
=== RUN   TestEncodedCAValue
--- PASS: TestEncodedCAValue (0.00s)

@kwadhwa-openai
Copy link
Contributor Author

@kwadhwa-openai did anything change with the search attributes resource or test in this PR? For some reason those tests are now failing. Everything else passes though.

It is failing on main branch as well with the same error

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.

[Feature Request] Add API key resource support for CRUD
5 participants