Resource: aws_api_gateway_model

Provides a Model for a REST API Gateway.

Example Usage

resource "aws_api_gateway_rest_api" "MyDemoAPI" {
  name        = "MyDemoAPI"
  description = "This is my API for demonstration purposes"
}

resource "aws_api_gateway_model" "MyDemoModel" {
  rest_api_id  = aws_api_gateway_rest_api.MyDemoAPI.id
  name         = "user"
  description  = "a JSON schema"
  content_type = "application/json"

  schema = jsonencode({
    type = "object"
  })
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_api_gateway_model using REST-API-ID/NAME. For example:

import {
  to = aws_api_gateway_model.example
  id = "12345abcde/example"
}

Using terraform import, import aws_api_gateway_model using REST-API-ID/NAME. For example:

% terraform import aws_api_gateway_model.example 12345abcde/example