mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-18 16:00:48 -04:00
When stage_name is not passed to the resource aws_api_gateway_deployment a terraform apply will fail. This is because the stage_name is required and not optional.
1.6 KiB
1.6 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| aws | AWS: aws_api_gateway_deployment | docs-aws-resource-api-gateway-deployment | Provides an API Gateway Deployment. |
aws_api_gateway_deployment
Provides an API Gateway Deployment.
-> Note: Depends on having aws_api_gateway_method inside your rest api. To ensure this
you might need to add an explicit depends_on for clean runs.
Example Usage
resource "aws_api_gateway_rest_api" "MyDemoAPI" {
name = "MyDemoAPI"
description = "This is my API for demonstration purposes"
}
resource "aws_api_gateway_resource" "test" {
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" {
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
resource_id = "${aws_api_gateway_resource.test.id}"
http_method = "GET"
authorization = "NONE"
}
resource "aws_api_gateway_deployment" "MyDemoDeployment" {
depends_on = ["aws_api_gateway_integration.test"]
rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
variables = {
"answer" = "42"
}
}
Argument Reference
The following arguments are supported:
rest_api_id- (Required) The ID of the associated REST APIstage_name- (Required) The name of the stagedescription- (Optional) The description of the deploymentstage_description- (Optional) The description of the stagevariables- (Optional) A map that defines variables for the stage
Attribute Reference
The following attributes are exported:
id- The ID of the deployment