|
|
|
|
@ -21,23 +21,31 @@ resource "aws_api_gateway_rest_api" "MyDemoAPI" {
|
|
|
|
|
description = "This is my API for demonstration purposes"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_api_gateway_resource" "test" {
|
|
|
|
|
resource "aws_api_gateway_resource" "MyDemoResource" {
|
|
|
|
|
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
|
|
|
|
|
parent_id = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}"
|
|
|
|
|
path_part = "test"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_api_gateway_method" "test" {
|
|
|
|
|
resource "aws_api_gateway_method" "MyDemoMethod" {
|
|
|
|
|
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
|
|
|
|
|
resource_id = "${aws_api_gateway_resource.test.id}"
|
|
|
|
|
resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
|
|
|
|
|
http_method = "GET"
|
|
|
|
|
authorization = "NONE"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_api_gateway_integration" "MyDemoIntegration" {
|
|
|
|
|
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
|
|
|
|
|
resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
|
|
|
|
|
http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
|
|
|
|
|
type = "MOCK"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_api_gateway_deployment" "MyDemoDeployment" {
|
|
|
|
|
depends_on = ["aws_api_gateway_integration.test"]
|
|
|
|
|
depends_on = ["aws_api_gateway_method.MyDemoMethod"]
|
|
|
|
|
|
|
|
|
|
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
|
|
|
|
|
stage_name = "test"
|
|
|
|
|
|
|
|
|
|
variables = {
|
|
|
|
|
"answer" = "42"
|
|
|
|
|
|