Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ember-aws-ehipster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bertrand PINEL
ember-aws-ehipster
Commits
da64fe8c
Commit
da64fe8c
authored
6 years ago
by
Bertrand PINEL
Browse files
Options
Downloads
Patches
Plain Diff
Handle CORS response for all methods of the API Gateway
parent
8f1de7e1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cloud/terraform/api-gateway.tf
+28
-5
28 additions, 5 deletions
cloud/terraform/api-gateway.tf
with
28 additions
and
5 deletions
cloud/terraform/api-gateway.tf
+
28
−
5
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"
]
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment