File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,20 @@ module "api_gateway" {
81
81
authorizer_key = " cognito"
82
82
}
83
83
84
+ " GET /some-route-with-authorizer-and-scope" = {
85
+ lambda_arn = module.lambda_function.lambda_function_arn
86
+ payload_format_version = " 2.0"
87
+ authorizer_key = " cognito"
88
+ authorization_scopes = " tf/something.relevant.read,tf/something.relevant.write" # Should comply with the resource server configuration part of the cognito user pool
89
+ }
90
+
91
+ " GET /some-route-with-authorizer-and-different-scope" = {
92
+ lambda_arn = module.lambda_function.lambda_function_arn
93
+ payload_format_version = " 2.0"
94
+ authorizer_key = " cognito"
95
+ authorization_scopes = " tf/something.relevant.write" # Should comply with the resource server configuration part of the cognito user pool
96
+ }
97
+
84
98
" POST /start-step-function" = {
85
99
integration_type = " AWS_PROXY"
86
100
integration_subtype = " StepFunctions-StartExecution"
Original file line number Diff line number Diff line change @@ -125,16 +125,16 @@ resource "aws_apigatewayv2_route" "this" {
125
125
route_key = each. key
126
126
127
127
api_key_required = try (each. value . api_key_required , null )
128
+ authorization_scopes = try (split (" ," , each. value . authorization_scopes ), null )
128
129
authorization_type = try (each. value . authorization_type , " NONE" )
129
130
authorizer_id = try (aws_apigatewayv2_authorizer. this [each . value . authorizer_key ]. id , each. value . authorizer_id , null )
130
131
model_selection_expression = try (each. value . model_selection_expression , null )
131
132
operation_name = try (each. value . operation_name , null )
132
133
route_response_selection_expression = try (each. value . route_response_selection_expression , null )
133
134
target = " integrations/${ aws_apigatewayv2_integration . this [each . key ]. id } "
134
135
135
- # Not sure what structure is allowed for these arguments...
136
- # authorization_scopes = try(each.value.authorization_scopes, null)
137
- # request_models = try(each.value.request_models, null)
136
+ # Have been added to the docs. But is WEBSOCKET only(not yet supported)
137
+ # request_models = try(each.value.request_models, null)
138
138
}
139
139
140
140
resource "aws_apigatewayv2_integration" "this" {
You can’t perform that action at this time.
0 commit comments