Resource: aws_apigatewayv2_model

Manages an Amazon API Gateway Version 2 model.

Example Usage

Basic

resource "aws_apigatewayv2_model" "example" {
  api_id       = aws_apigatewayv2_api.example.id
  content_type = "application/json"
  name         = "example"

  schema = jsonencode({
    "$schema" = "http://json-schema.org/draft-04/schema#"
    title     = "ExampleModel"
    type      = "object"

    properties = {
      id = {
        type = "string"
      }
    }
  })
}

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_apigatewayv2_model using the API identifier and model identifier. For example:

import {
  to = aws_apigatewayv2_model.example
  id = "aabbccddee/1122334"
}

Using terraform import, import aws_apigatewayv2_model using the API identifier and model identifier. For example:

% terraform import aws_apigatewayv2_model.example aabbccddee/1122334