-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
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, |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Issue & Steps to Reproduce / Feature Request
closes #405
Solution