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

Feat: support Non-Admin API key creation #422

Merged
merged 3 commits into from
Jun 18, 2022

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

closes #405

Solution

  1. Added additional API calls for user-project-assignment.
  2. Implemented the user-project-assignment resource.
  3. Added acceptance tests for the resource.
  4. Added integration tests for api-key-project-assignment (same as user-project-assignment).
  5. Added examples.

@TomerHeber
Copy link
Collaborator Author

Note: the PR is 500 lines. However, most of it is tests and examples.

Type: schema.TypeString,
Description: "the assigned role (Admin, Planner, Viewer, Deployer)",
Required: true,
ValidateDiagFunc: ValidateRole,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved out to a function in validators.go

Required: true,
ForceNew: true,
},
"role": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the only field that can be updated.
Updating the other fields will create a new assignment.

Type: schema.TypeString,
Description: "the assigned role (Admin, Planner, Viewer, Deployer)",
Required: true,
ValidateDiagFunc: ValidateRole,
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't the provider framework have a way of specifying some enum in a more native way than a validation func?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yaronya , maybe? I honestly don't know (couldn't find anything). In general, enum is not a valid schema type in the SDK. The AWS provider is doing something similar to us: hashicorp/terraform-provider-aws#14601
If you know of another way please let me know and I will fix it in a future PR.

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Jun 18, 2022
@TomerHeber TomerHeber merged commit b2e4fd7 into main Jun 18, 2022
@TomerHeber TomerHeber deleted the feat-support-non-admin-api-key-#405 branch June 18, 2022 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Support Non-Admin API key creation
2 participants