title: AWS API Gateway CORS from Swagger
body: <p>I am importing a Swagger file into a Terraform created AWS API Gateway deployment, and everything seems to work fine apart from enabling CORS. Once I have finished deploying, then I always receive the 403 CORS error from any endpoint. I have to manually then go through an enable CORS within the AWS console. </p>
  
  <p>I import the swagger file via the AWS CLI like this;</p>
  
  <pre><code>aws apigateway put-rest-api \
      --body file://swagger.json \
      --mode overwrite \
      --rest-api-id ${REST_API_ID}
  </code></pre>
  
  <p>The swagger file uses the below to map the correct headers;</p>
  
  <pre><code>"x-amazon-apigateway-integration": {
     "responses": {
        "2\\d{2}": {
            "statusCode": "200",
            "responseParameters": {
                "method.response.header.Access-Control-Allow-Headers" : "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Correlation-ID'",
                "method.response.header.Access-Control-Allow-Methods" : "'*'",
                "method.response.header.Access-Control-Allow-Origin": "'*'"
             }
         }
      }
  }
  </code></pre>
  
  <p>This maps to response codes within the top level Swagger file;</p>
  
  <pre><code>"responses": {
      "200": {
           "description": "Succesfully created Report",
           "headers": {
               "Access-Control-Allow-Origin": {
                   "type": "string"
                },
                "Access-Control-Allow-Headers": {
                   "type": "string"
                },
                "Access-Control-Allow-Methods": {
                    "type": "string"
                }
            }                        
       }
  }
  </code></pre>
  
  <p>Despite doing this, I still get CORS erros straight after importing the Swagger file. </p>
  
  <p>Is there anything I am missing here?</p>