awscc_apigateway_deployment (Resource)

The AWS::ApiGateway::Deployment resource deploys an API Gateway RestApi resource to a stage so that clients can call the API over the internet. The stage acts as an environment.

Example Usage

First example

Deploys a API Gateway RestApi resource to a stage

resource "awscc_apigateway_rest_api" "terraform_apigateway_rest_api" {
  name = "TestRestApi"
  endpoint_configuration = {
    types = [
      "REGIONAL"
    ]
  }
}

resource "awscc_apigateway_method" "terraform_apigateway_method" {
  http_method        = "GET"
  authorization_type = "NONE"
  integration = {
    type = "MOCK"
  }
  rest_api_id = awscc_apigateway_rest_api.terraform_apigateway_rest_api.id
  resource_id = awscc_apigateway_rest_api.terraform_apigateway_rest_api.root_resource_id

  depends_on = [awscc_apigateway_rest_api.terraform_apigateway_rest_api]
}

resource "awscc_apigateway_deployment" "terraform_apigateway_deployment" {
  description = "Test Apigateway Deployment"
  rest_api_id = awscc_apigateway_rest_api.terraform_apigateway_rest_api.id
  stage_description = {
    description = "Test stage description"
  }
  stage_name = "Test Stage"

  depends_on = [awscc_apigateway_method.terraform_apigateway_method, awscc_apigateway_rest_api.terraform_apigateway_rest_api]
}

Schema

Required

Optional

Read-Only

Nested Schema for deployment_canary_settings

Optional:

Nested Schema for stage_description

Optional:

Nested Schema for stage_description.access_log_setting

Optional:

Nested Schema for stage_description.canary_setting

Optional:

Nested Schema for stage_description.method_settings

Optional:

Nested Schema for stage_description.tags

Required:

Import

Import is supported using the following syntax:

$ terraform import awscc_apigateway_deployment.example <resource ID>