Resource: aws_schemas_schema

Provides an EventBridge Schema resource.

Example Usage

resource "aws_schemas_registry" "test" {
  name = "my_own_registry"
}

resource "aws_schemas_schema" "test" {
  name          = "my_schema"
  registry_name = aws_schemas_registry.test.name
  type          = "OpenApi3"
  description   = "The schema definition for my event"

  content = jsonencode({
    "openapi" : "3.0.0",
    "info" : {
      "version" : "1.0.0",
      "title" : "Event"
    },
    "paths" : {},
    "components" : {
      "schemas" : {
        "Event" : {
          "type" : "object",
          "properties" : {
            "name" : {
              "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 EventBridge schema using the name and registry_name. For example:

import {
  to = aws_schemas_schema.test
  id = "name/registry"
}

Using terraform import, import EventBridge schema using the name and registry_name. For example:

% terraform import aws_schemas_schema.test name/registry