Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bertrand PINEL
ember-aws-ehipster
Commits
da64fe8c
Commit
da64fe8c
authored
Feb 16, 2019
by
Bertrand PINEL
Browse files
Handle CORS response for all methods of the API Gateway
parent
8f1de7e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
cloud/terraform/api-gateway.tf
View file @
da64fe8c
...
...
@@ -165,8 +165,8 @@ resource "aws_api_gateway_method_response" "200TypeGet" {
http_method
=
"
${
aws_api_gateway_method
.
typePathGet
.
http_method
}
"
status_code
=
"200"
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
true
}
"method.response.header.Access-Control-Allow-Origin"
=
true
}
}
resource
"aws_api_gateway_integration_response"
"200TypeGetIntegrationResponse"
{
...
...
@@ -179,7 +179,7 @@ resource "aws_api_gateway_integration_response" "200TypeGetIntegrationResponse"
}
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
"'*'"
}
}
depends_on
=
[
"aws_api_gateway_integration.lambdaJsonTypeGet"
]
}
##############################################
...
...
@@ -205,6 +205,9 @@ resource "aws_api_gateway_method_response" "200TypePost" {
resource_id
=
"
${
aws_api_gateway_resource
.
typePath
.
id
}
"
http_method
=
"
${
aws_api_gateway_method
.
typePathPost
.
http_method
}
"
status_code
=
"200"
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
true
}
}
resource
"aws_api_gateway_integration_response"
"200TypePostIntegrationResponse"
{
...
...
@@ -215,6 +218,9 @@ resource "aws_api_gateway_integration_response" "200TypePostIntegrationResponse"
response_templates
=
{
"application/json"
=
""
}
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
"'*'"
}
depends_on
=
[
"aws_api_gateway_integration.lambdaJsonTypePost"
]
}
##############################################
...
...
@@ -240,6 +246,9 @@ resource "aws_api_gateway_method_response" "200TypeIdGet" {
resource_id
=
"
${
aws_api_gateway_method
.
typeIdPathGet
.
resource_id
}
"
http_method
=
"
${
aws_api_gateway_method
.
typeIdPathGet
.
http_method
}
"
status_code
=
"200"
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
true
}
}
resource
"aws_api_gateway_integration_response"
"200TypeIdGetIntegrationResponse"
{
...
...
@@ -249,7 +258,10 @@ resource "aws_api_gateway_integration_response" "200TypeIdGetIntegrationResponse
status_code
=
"
${
aws_api_gateway_method_response
.
200
TypeIdGet
.
status_code
}
"
response_templates
=
{
"application/json"
=
""
}
}
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
"'*'"
}
depends_on
=[
"aws_api_gateway_integration.lambdaJsonTypeIdGet"
]
}
##############################################
...
...
@@ -275,8 +287,10 @@ resource "aws_api_gateway_method_response" "200TypeIdDelete" {
resource_id
=
"
${
aws_api_gateway_method
.
typeIdPathDelete
.
resource_id
}
"
http_method
=
"
${
aws_api_gateway_method
.
typeIdPathDelete
.
http_method
}
"
status_code
=
"200"
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
true
}
}
resource
"aws_api_gateway_integration_response"
"200TypeIdDeleteIntegrationResponse"
{
rest_api_id
=
"
${
aws_api_gateway_rest_api
.
jsonapi
.
id
}
"
resource_id
=
"
${
aws_api_gateway_resource
.
typeIdPath
.
id
}
"
...
...
@@ -285,6 +299,9 @@ resource "aws_api_gateway_integration_response" "200TypeIdDeleteIntegrationRespo
response_templates
=
{
"application/json"
=
""
}
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
"'*'"
}
depends_on
=
[
"aws_api_gateway_integration.lambdaJsonTypeIdDelete"
]
}
##############################################
...
...
@@ -310,6 +327,9 @@ resource "aws_api_gateway_method_response" "200TypeIdPatch" {
resource_id
=
"
${
aws_api_gateway_method
.
typeIdPathPatch
.
resource_id
}
"
http_method
=
"
${
aws_api_gateway_method
.
typeIdPathPatch
.
http_method
}
"
status_code
=
"200"
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
true
}
}
resource
"aws_api_gateway_integration_response"
"200TypeIdPatchIntegrationResponse"
{
rest_api_id
=
"
${
aws_api_gateway_rest_api
.
jsonapi
.
id
}
"
...
...
@@ -319,6 +339,9 @@ resource "aws_api_gateway_integration_response" "200TypeIdPatchIntegrationRespon
response_templates
=
{
"application/json"
=
""
}
response_parameters
{
"method.response.header.Access-Control-Allow-Origin"
=
"'*'"
}
depends_on
=
[
"aws_api_gateway_integration.lambdaJsonTypeIdPatch"
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment