1. Packages
  2. AWS Classic
  3. API Docs
  4. schemas
  5. Schema

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.schemas.Schema

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides an EventBridge Schema resource.

    Note: EventBridge was formerly known as CloudWatch Events. The functionality is identical.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const test = new aws.schemas.Registry("test", {name: "my_own_registry"});
    const testSchema = new aws.schemas.Schema("test", {
        name: "my_schema",
        registryName: test.name,
        type: "OpenApi3",
        description: "The schema definition for my event",
        content: JSON.stringify({
            openapi: "3.0.0",
            info: {
                version: "1.0.0",
                title: "Event",
            },
            paths: {},
            components: {
                schemas: {
                    Event: {
                        type: "object",
                        properties: {
                            name: {
                                type: "string",
                            },
                        },
                    },
                },
            },
        }),
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    test = aws.schemas.Registry("test", name="my_own_registry")
    test_schema = aws.schemas.Schema("test",
        name="my_schema",
        registry_name=test.name,
        type="OpenApi3",
        description="The schema definition for my event",
        content=json.dumps({
            "openapi": "3.0.0",
            "info": {
                "version": "1.0.0",
                "title": "Event",
            },
            "paths": {},
            "components": {
                "schemas": {
                    "Event": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                            },
                        },
                    },
                },
            },
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/schemas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test, err := schemas.NewRegistry(ctx, "test", &schemas.RegistryArgs{
    			Name: pulumi.String("my_own_registry"),
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"openapi": "3.0.0",
    			"info": map[string]interface{}{
    				"version": "1.0.0",
    				"title":   "Event",
    			},
    			"paths": nil,
    			"components": map[string]interface{}{
    				"schemas": map[string]interface{}{
    					"Event": map[string]interface{}{
    						"type": "object",
    						"properties": map[string]interface{}{
    							"name": map[string]interface{}{
    								"type": "string",
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = schemas.NewSchema(ctx, "test", &schemas.SchemaArgs{
    			Name:         pulumi.String("my_schema"),
    			RegistryName: test.Name,
    			Type:         pulumi.String("OpenApi3"),
    			Description:  pulumi.String("The schema definition for my event"),
    			Content:      pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Aws.Schemas.Registry("test", new()
        {
            Name = "my_own_registry",
        });
    
        var testSchema = new Aws.Schemas.Schema("test", new()
        {
            Name = "my_schema",
            RegistryName = test.Name,
            Type = "OpenApi3",
            Description = "The schema definition for my event",
            Content = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["openapi"] = "3.0.0",
                ["info"] = new Dictionary<string, object?>
                {
                    ["version"] = "1.0.0",
                    ["title"] = "Event",
                },
                ["paths"] = new Dictionary<string, object?>
                {
                },
                ["components"] = new Dictionary<string, object?>
                {
                    ["schemas"] = new Dictionary<string, object?>
                    {
                        ["Event"] = new Dictionary<string, object?>
                        {
                            ["type"] = "object",
                            ["properties"] = new Dictionary<string, object?>
                            {
                                ["name"] = new Dictionary<string, object?>
                                {
                                    ["type"] = "string",
                                },
                            },
                        },
                    },
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.schemas.Registry;
    import com.pulumi.aws.schemas.RegistryArgs;
    import com.pulumi.aws.schemas.Schema;
    import com.pulumi.aws.schemas.SchemaArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var test = new Registry("test", RegistryArgs.builder()
                .name("my_own_registry")
                .build());
    
            var testSchema = new Schema("testSchema", SchemaArgs.builder()
                .name("my_schema")
                .registryName(test.name())
                .type("OpenApi3")
                .description("The schema definition for my event")
                .content(serializeJson(
                    jsonObject(
                        jsonProperty("openapi", "3.0.0"),
                        jsonProperty("info", jsonObject(
                            jsonProperty("version", "1.0.0"),
                            jsonProperty("title", "Event")
                        )),
                        jsonProperty("paths", jsonObject(
    
                        )),
                        jsonProperty("components", jsonObject(
                            jsonProperty("schemas", jsonObject(
                                jsonProperty("Event", jsonObject(
                                    jsonProperty("type", "object"),
                                    jsonProperty("properties", jsonObject(
                                        jsonProperty("name", jsonObject(
                                            jsonProperty("type", "string")
                                        ))
                                    ))
                                ))
                            ))
                        ))
                    )))
                .build());
    
        }
    }
    
    resources:
      test:
        type: aws:schemas:Registry
        properties:
          name: my_own_registry
      testSchema:
        type: aws:schemas:Schema
        name: test
        properties:
          name: my_schema
          registryName: ${test.name}
          type: OpenApi3
          description: The schema definition for my event
          content:
            fn::toJSON:
              openapi: 3.0.0
              info:
                version: 1.0.0
                title: Event
              paths: {}
              components:
                schemas:
                  Event:
                    type: object
                    properties:
                      name:
                        type: string
    

    Create Schema Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
    @overload
    def Schema(resource_name: str,
               args: SchemaArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Schema(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               content: Optional[str] = None,
               registry_name: Optional[str] = None,
               type: Optional[str] = None,
               description: Optional[str] = None,
               name: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
    func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
    public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
    public Schema(String name, SchemaArgs args)
    public Schema(String name, SchemaArgs args, CustomResourceOptions options)
    
    type: aws:schemas:Schema
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var awsSchemaResource = new Aws.Schemas.Schema("awsSchemaResource", new()
    {
        Content = "string",
        RegistryName = "string",
        Type = "string",
        Description = "string",
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := schemas.NewSchema(ctx, "awsSchemaResource", &schemas.SchemaArgs{
    	Content:      pulumi.String("string"),
    	RegistryName: pulumi.String("string"),
    	Type:         pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var awsSchemaResource = new Schema("awsSchemaResource", SchemaArgs.builder()
        .content("string")
        .registryName("string")
        .type("string")
        .description("string")
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    aws_schema_resource = aws.schemas.Schema("awsSchemaResource",
        content="string",
        registry_name="string",
        type="string",
        description="string",
        name="string",
        tags={
            "string": "string",
        })
    
    const awsSchemaResource = new aws.schemas.Schema("awsSchemaResource", {
        content: "string",
        registryName: "string",
        type: "string",
        description: "string",
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:schemas:Schema
    properties:
        content: string
        description: string
        name: string
        registryName: string
        tags:
            string: string
        type: string
    

    Schema Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Schema resource accepts the following input properties:

    Content string
    The schema specification. Must be a valid Open API 3.0 spec.
    RegistryName string
    The name of the registry in which this schema belongs.
    Type string
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    Description string
    The description of the schema. Maximum of 256 characters.
    Name string
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    Content string
    The schema specification. Must be a valid Open API 3.0 spec.
    RegistryName string
    The name of the registry in which this schema belongs.
    Type string
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    Description string
    The description of the schema. Maximum of 256 characters.
    Name string
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    content String
    The schema specification. Must be a valid Open API 3.0 spec.
    registryName String
    The name of the registry in which this schema belongs.
    type String
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    description String
    The description of the schema. Maximum of 256 characters.
    name String
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    content string
    The schema specification. Must be a valid Open API 3.0 spec.
    registryName string
    The name of the registry in which this schema belongs.
    type string
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    description string
    The description of the schema. Maximum of 256 characters.
    name string
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    content str
    The schema specification. Must be a valid Open API 3.0 spec.
    registry_name str
    The name of the registry in which this schema belongs.
    type str
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    description str
    The description of the schema. Maximum of 256 characters.
    name str
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    content String
    The schema specification. Must be a valid Open API 3.0 spec.
    registryName String
    The name of the registry in which this schema belongs.
    type String
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    description String
    The description of the schema. Maximum of 256 characters.
    name String
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Schema resource produces the following output properties:

    Arn string
    The Amazon Resource Name (ARN) of the discoverer.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModified string
    The last modified date of the schema.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Version string
    The version of the schema.
    VersionCreatedDate string
    The created date of the version of the schema.
    Arn string
    The Amazon Resource Name (ARN) of the discoverer.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModified string
    The last modified date of the schema.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Version string
    The version of the schema.
    VersionCreatedDate string
    The created date of the version of the schema.
    arn String
    The Amazon Resource Name (ARN) of the discoverer.
    id String
    The provider-assigned unique ID for this managed resource.
    lastModified String
    The last modified date of the schema.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    version String
    The version of the schema.
    versionCreatedDate String
    The created date of the version of the schema.
    arn string
    The Amazon Resource Name (ARN) of the discoverer.
    id string
    The provider-assigned unique ID for this managed resource.
    lastModified string
    The last modified date of the schema.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    version string
    The version of the schema.
    versionCreatedDate string
    The created date of the version of the schema.
    arn str
    The Amazon Resource Name (ARN) of the discoverer.
    id str
    The provider-assigned unique ID for this managed resource.
    last_modified str
    The last modified date of the schema.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    version str
    The version of the schema.
    version_created_date str
    The created date of the version of the schema.
    arn String
    The Amazon Resource Name (ARN) of the discoverer.
    id String
    The provider-assigned unique ID for this managed resource.
    lastModified String
    The last modified date of the schema.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    version String
    The version of the schema.
    versionCreatedDate String
    The created date of the version of the schema.

    Look up Existing Schema Resource

    Get an existing Schema resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SchemaState, opts?: CustomResourceOptions): Schema
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            content: Optional[str] = None,
            description: Optional[str] = None,
            last_modified: Optional[str] = None,
            name: Optional[str] = None,
            registry_name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            type: Optional[str] = None,
            version: Optional[str] = None,
            version_created_date: Optional[str] = None) -> Schema
    func GetSchema(ctx *Context, name string, id IDInput, state *SchemaState, opts ...ResourceOption) (*Schema, error)
    public static Schema Get(string name, Input<string> id, SchemaState? state, CustomResourceOptions? opts = null)
    public static Schema get(String name, Output<String> id, SchemaState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    The Amazon Resource Name (ARN) of the discoverer.
    Content string
    The schema specification. Must be a valid Open API 3.0 spec.
    Description string
    The description of the schema. Maximum of 256 characters.
    LastModified string
    The last modified date of the schema.
    Name string
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    RegistryName string
    The name of the registry in which this schema belongs.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Type string
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    Version string
    The version of the schema.
    VersionCreatedDate string
    The created date of the version of the schema.
    Arn string
    The Amazon Resource Name (ARN) of the discoverer.
    Content string
    The schema specification. Must be a valid Open API 3.0 spec.
    Description string
    The description of the schema. Maximum of 256 characters.
    LastModified string
    The last modified date of the schema.
    Name string
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    RegistryName string
    The name of the registry in which this schema belongs.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Type string
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    Version string
    The version of the schema.
    VersionCreatedDate string
    The created date of the version of the schema.
    arn String
    The Amazon Resource Name (ARN) of the discoverer.
    content String
    The schema specification. Must be a valid Open API 3.0 spec.
    description String
    The description of the schema. Maximum of 256 characters.
    lastModified String
    The last modified date of the schema.
    name String
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    registryName String
    The name of the registry in which this schema belongs.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type String
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    version String
    The version of the schema.
    versionCreatedDate String
    The created date of the version of the schema.
    arn string
    The Amazon Resource Name (ARN) of the discoverer.
    content string
    The schema specification. Must be a valid Open API 3.0 spec.
    description string
    The description of the schema. Maximum of 256 characters.
    lastModified string
    The last modified date of the schema.
    name string
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    registryName string
    The name of the registry in which this schema belongs.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type string
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    version string
    The version of the schema.
    versionCreatedDate string
    The created date of the version of the schema.
    arn str
    The Amazon Resource Name (ARN) of the discoverer.
    content str
    The schema specification. Must be a valid Open API 3.0 spec.
    description str
    The description of the schema. Maximum of 256 characters.
    last_modified str
    The last modified date of the schema.
    name str
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    registry_name str
    The name of the registry in which this schema belongs.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type str
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    version str
    The version of the schema.
    version_created_date str
    The created date of the version of the schema.
    arn String
    The Amazon Resource Name (ARN) of the discoverer.
    content String
    The schema specification. Must be a valid Open API 3.0 spec.
    description String
    The description of the schema. Maximum of 256 characters.
    lastModified String
    The last modified date of the schema.
    name String
    The name of the schema. Maximum of 385 characters consisting of lower case letters, upper case letters, ., -, _, @.
    registryName String
    The name of the registry in which this schema belongs.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type String
    The type of the schema. Valid values: OpenApi3 or JSONSchemaDraft4.
    version String
    The version of the schema.
    versionCreatedDate String
    The created date of the version of the schema.

    Import

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

    $ pulumi import aws:schemas/schema:Schema test name/registry
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi