Closed okdana closed 2 years ago
jsonencode()
is a hack that can be used when dealing with errors like all elements should be of the same type
but I don't think it is necessary here.
Also, there is #54 which implements the support for authorization_scopes
and request_models
on routes as well as other features - https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2/pull/54/files#diff-dc46acf24afd63ef8c556b77c126ccc6e578bc87e3aa09a931f33d9bf2532fbbR130
I think we can safely close this one and wait for @bryantbiggs to finish #54.
I'm going to lock this pull request because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
Set
authorization_scopes
andrequest_models
on the created route resource when specified inintegrations
.Motivation and Context
I'm experimenting with converting a toy SAM template to Terraform using this module, and found that i couldn't proceed because the module doesn't handle
authorization_scopes
.Both this attribute and
request_models
are commented out in the source because the previous dev didn't know what their structure was. Per the provider source,authorization_scopes
is aset(string)
andrequest_models
is amap(string)
.I'm not sure it really matters, though, since
integrations
is amap(any)
β if i understand correctly, that requires you to usejsonencode()
or similar on non-scalar values. That's how some of the integration resource's attributes are currently handled, anyway.I think the
try()
method being used here would allowintegrations
to be changed to a fully typedmap(object(...))
whilst retaining backwards compatibility, but i haven't tried making that change myself. (I'm not familiar enough with Terraform or this project to know if it's even desirable.)Breaking Changes
This shouldn't affect backwards compatibility.
How Has This Been Tested?
examples/*
projectsI tested this by sourcing my branch of the repo as a local module, adding an integration like the following, and deploying to AWS.
This resulted in the route being associated with the authoriser and having the correct authorisation scopes specified.
If there's further testing i should do, please let me know how; i'm still pretty new to both Terraform and AWS.