-
Notifications
You must be signed in to change notification settings - Fork 7
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 konnect_gateway_config_store
resource
#117
Conversation
c468aec
to
7da2301
Compare
@@ -0,0 +1,15 @@ | |||
resource "konnect_gateway_config_store" "my_configstore" { | |||
name = "Config Store" |
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.
I think the name for config store does not allow space - getting an error which goes away when space is removed.
{"code":3,"message":"validation │ error","details":[{"@type":"type.googleapis.com/kong.admin.model.v1.ErrorDetail","type":"ERROR_TYPE_FIELD","field":"name","messages":["must │ match pattern '^[\\p{N}\\p{L}.\\-_~]*$'"]}]}
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.
Good catch! I’ll update the example
resource "konnect_gateway_vault" "my_vault" { | ||
name = "konnect" | ||
prefix = "my-konnect-vault" | ||
config = jsonencode({ |
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.
In the openAPI spec, config is expected to be an object, why do we encode it as string here?
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.
Terraform expects to deal with explicit schemas. Vaults are polymorphic and the config is different for every vault type.
We had two options here:
- Create one resource per vault type
- Use a single resource with a dynamic schema and the
x-speakeasy-type-override: any
annotation
We chose option two. This makes the provider accept a string, which is then deserialized in to an any
type before being sent to the API.
This decision predates this PR and is in use for every other vault type too.
5210819
to
f94d435
Compare
26ddd14
to
dc9b247
Compare
Ready for review