FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_api_gateway_base_path_mapping

Connects a custom domain name registered via aws_api_gateway_domain_name with a deployed API so that its methods can be called via the custom domain name.

Example Usage

resource "aws_api_gateway_deployment" "example" {
  # See aws_api_gateway_rest_api_docs for how to create this
  rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
  stage_name  = "live"
}

resource "aws_api_gateway_domain_name" "example" {
  domain_name = "example.com"

  certificate_name        = "example-api"
  certificate_body        = "${file("${path.module}/example.com/example.crt")}"
  certificate_chain       = "${file("${path.module}/example.com/ca.crt")}"
  certificate_private_key = "${file("${path.module}/example.com/example.key")}"
}

resource "aws_api_gateway_base_path_mapping" "test" {
  api_id      = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
  stage_name       = "${aws_api_gateway_deployment.example.stage_name}"
  domain_name = "${aws_api_gateway_domain_name.example.domain_name}"
}

Argument Reference

The following arguments are supported:


See the source of this document at Terraform.io