Skip to content

Resource: awsApigatewayv2Model

Manages an Amazon API Gateway Version 2 model.

Example Usage

Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.apigatewayv2Model.Apigatewayv2Model(this, "example", {
  apiId: "${aws_apigatewayv2_api.example.id}",
  contentType: "application/json",
  name: "example",
  schema:
    '${jsonencode({\n    "$schema" = "http://json-schema.org/draft-04/schema#"\n    title     = "ExampleModel"\n    type      = "object"\n\n    properties = {\n      id = {\n        type = "string"\n      }\n    }\n  })}',
});

Argument Reference

The following arguments are supported:

  • apiId - (Required) API identifier.
  • contentType - (Required) The content-type for the model, for example, application/json. Must be between 1 and 256 characters in length.
  • name - (Required) Name of the model. Must be alphanumeric. Must be between 1 and 128 characters in length.
  • schema - (Required) Schema for the model. This should be a JSON schema draft 4 model. Must be less than or equal to 32768 characters in length.
  • description - (Optional) Description of the model. Must be between 1 and 128 characters in length.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Model identifier.

Import

awsApigatewayv2Model can be imported by using the API identifier and model identifier, e.g.,

$ terraform import aws_apigatewayv2_model.example aabbccddee/1122334