github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/aws/r/api_gateway_deployment.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_api_gateway_deployment"
     4  sidebar_current: "docs-aws-resource-api-gateway-deployment"
     5  description: |-
     6    Provides an API Gateway Deployment.
     7  ---
     8  
     9  # aws\_api\_gateway\_deployment
    10  
    11  Provides an API Gateway Deployment.
    12  
    13  -> **Note:** Depends on having `aws_api_gateway_method` inside your rest api. To ensure this
    14  you might need to add an explicit `depends_on` for clean runs.
    15  
    16  ## Example Usage
    17  
    18  ```
    19  resource "aws_api_gateway_rest_api" "MyDemoAPI" {
    20    name        = "MyDemoAPI"
    21    description = "This is my API for demonstration purposes"
    22  }
    23  
    24  resource "aws_api_gateway_resource" "MyDemoResource" {
    25    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    26    parent_id   = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}"
    27    path_part   = "test"
    28  }
    29  
    30  resource "aws_api_gateway_method" "MyDemoMethod" {
    31    rest_api_id   = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    32    resource_id   = "${aws_api_gateway_resource.MyDemoResource.id}"
    33    http_method   = "GET"
    34    authorization = "NONE"
    35  }
    36  
    37  resource "aws_api_gateway_integration" "MyDemoIntegration" {
    38    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    39    resource_id = "${aws_api_gateway_resource.MyDemoResource.id}"
    40    http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}"
    41    type        = "MOCK"
    42  }
    43  
    44  resource "aws_api_gateway_deployment" "MyDemoDeployment" {
    45    depends_on = ["aws_api_gateway_method.MyDemoMethod"]
    46  
    47    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    48    stage_name  = "test"
    49  
    50    variables = {
    51      "answer" = "42"
    52    }
    53  }
    54  ```
    55  
    56  ## Argument Reference
    57  
    58  The following arguments are supported:
    59  
    60  * `rest_api_id` - (Required) The ID of the associated REST API
    61  * `stage_name` - (Required) The name of the stage
    62  * `description` - (Optional) The description of the deployment
    63  * `stage_description` - (Optional) The description of the stage
    64  * `variables` - (Optional) A map that defines variables for the stage
    65  
    66  ## Attribute Reference
    67  
    68  The following attributes are exported:
    69  
    70  * `id` - The ID of the deployment
    71  * `created_date` - The creation date of the deployment