1. Packages
  2. Ibm Provider
  3. API Docs
  4. EventStreamsSchema
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.EventStreamsSchema

Explore with Pulumi AI

ibm logo
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

    Create, update or delete the Event Streams schemas. The schema operations can only be performed on an Event Streams Enterprise plan service instances. For more information, about Event Streams schema, see Event Streams Schema Registry.

    Example Usage

    Sample 2: Create a schema on an existing Event Streams instance

    Create a schema on an existing Event Streams Enterprise plan service instance.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const esInstance2 = ibm.getResourceInstance({
        name: "terraform-integration-2",
        resourceGroupId: data.ibm_resource_group.group.id,
    });
    const esSchema2 = new ibm.EventStreamsSchema("esSchema2", {
        resourceInstanceId: ibm_resource_instance.es_instance_2.id,
        schemaId: "my-es-schema",
        schema: `   {
               "type": "record",
               "name": "record_name",
               "fields" : [
                 {"name": "value_1", "type": "long"},
                 {"name": "value_2", "type": "string"}
               ]
             }
    `,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    es_instance2 = ibm.get_resource_instance(name="terraform-integration-2",
        resource_group_id=data["ibm_resource_group"]["group"]["id"])
    es_schema2 = ibm.EventStreamsSchema("esSchema2",
        resource_instance_id=ibm_resource_instance["es_instance_2"]["id"],
        schema_id="my-es-schema",
        schema="""   {
               "type": "record",
               "name": "record_name",
               "fields" : [
                 {"name": "value_1", "type": "long"},
                 {"name": "value_2", "type": "string"}
               ]
             }
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupResourceInstance(ctx, &ibm.LookupResourceInstanceArgs{
    			Name:            pulumi.StringRef("terraform-integration-2"),
    			ResourceGroupId: pulumi.StringRef(data.Ibm_resource_group.Group.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewEventStreamsSchema(ctx, "esSchema2", &ibm.EventStreamsSchemaArgs{
    			ResourceInstanceId: pulumi.Any(ibm_resource_instance.Es_instance_2.Id),
    			SchemaId:           pulumi.String("my-es-schema"),
    			Schema: pulumi.String(`   {
               "type": "record",
               "name": "record_name",
               "fields" : [
                 {"name": "value_1", "type": "long"},
                 {"name": "value_2", "type": "string"}
               ]
             }
    `),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var esInstance2 = Ibm.GetResourceInstance.Invoke(new()
        {
            Name = "terraform-integration-2",
            ResourceGroupId = data.Ibm_resource_group.Group.Id,
        });
    
        var esSchema2 = new Ibm.EventStreamsSchema("esSchema2", new()
        {
            ResourceInstanceId = ibm_resource_instance.Es_instance_2.Id,
            SchemaId = "my-es-schema",
            Schema = @"   {
               ""type"": ""record"",
               ""name"": ""record_name"",
               ""fields"" : [
                 {""name"": ""value_1"", ""type"": ""long""},
                 {""name"": ""value_2"", ""type"": ""string""}
               ]
             }
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceInstanceArgs;
    import com.pulumi.ibm.EventStreamsSchema;
    import com.pulumi.ibm.EventStreamsSchemaArgs;
    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) {
            final var esInstance2 = IbmFunctions.getResourceInstance(GetResourceInstanceArgs.builder()
                .name("terraform-integration-2")
                .resourceGroupId(data.ibm_resource_group().group().id())
                .build());
    
            var esSchema2 = new EventStreamsSchema("esSchema2", EventStreamsSchemaArgs.builder()
                .resourceInstanceId(ibm_resource_instance.es_instance_2().id())
                .schemaId("my-es-schema")
                .schema("""
       {
               "type": "record",
               "name": "record_name",
               "fields" : [
                 {"name": "value_1", "type": "long"},
                 {"name": "value_2", "type": "string"}
               ]
             }
                """)
                .build());
    
        }
    }
    
    resources:
      esSchema2:
        type: ibm:EventStreamsSchema
        properties:
          resourceInstanceId: ${ibm_resource_instance.es_instance_2.id}
          schemaId: my-es-schema
          schema: |2
               {
                       "type": "record",
                       "name": "record_name",
                       "fields" : [
                         {"name": "value_1", "type": "long"},
                         {"name": "value_2", "type": "string"}
                       ]
                     }
    variables:
      esInstance2:
        fn::invoke:
          function: ibm:getResourceInstance
          arguments:
            name: terraform-integration-2
            resourceGroupId: ${data.ibm_resource_group.group.id}
    

    Create EventStreamsSchema Resource

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

    Constructor syntax

    new EventStreamsSchema(name: string, args: EventStreamsSchemaArgs, opts?: CustomResourceOptions);
    @overload
    def EventStreamsSchema(resource_name: str,
                           args: EventStreamsSchemaArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def EventStreamsSchema(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           resource_instance_id: Optional[str] = None,
                           schema: Optional[str] = None,
                           event_streams_schema_id: Optional[str] = None,
                           schema_id: Optional[str] = None)
    func NewEventStreamsSchema(ctx *Context, name string, args EventStreamsSchemaArgs, opts ...ResourceOption) (*EventStreamsSchema, error)
    public EventStreamsSchema(string name, EventStreamsSchemaArgs args, CustomResourceOptions? opts = null)
    public EventStreamsSchema(String name, EventStreamsSchemaArgs args)
    public EventStreamsSchema(String name, EventStreamsSchemaArgs args, CustomResourceOptions options)
    
    type: ibm:EventStreamsSchema
    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 EventStreamsSchemaArgs
    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 EventStreamsSchemaArgs
    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 EventStreamsSchemaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EventStreamsSchemaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EventStreamsSchemaArgs
    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 eventStreamsSchemaResource = new Ibm.EventStreamsSchema("eventStreamsSchemaResource", new()
    {
        ResourceInstanceId = "string",
        Schema = "string",
        EventStreamsSchemaId = "string",
        SchemaId = "string",
    });
    
    example, err := ibm.NewEventStreamsSchema(ctx, "eventStreamsSchemaResource", &ibm.EventStreamsSchemaArgs{
    	ResourceInstanceId:   pulumi.String("string"),
    	Schema:               pulumi.String("string"),
    	EventStreamsSchemaId: pulumi.String("string"),
    	SchemaId:             pulumi.String("string"),
    })
    
    var eventStreamsSchemaResource = new EventStreamsSchema("eventStreamsSchemaResource", EventStreamsSchemaArgs.builder()
        .resourceInstanceId("string")
        .schema("string")
        .eventStreamsSchemaId("string")
        .schemaId("string")
        .build());
    
    event_streams_schema_resource = ibm.EventStreamsSchema("eventStreamsSchemaResource",
        resource_instance_id="string",
        schema="string",
        event_streams_schema_id="string",
        schema_id="string")
    
    const eventStreamsSchemaResource = new ibm.EventStreamsSchema("eventStreamsSchemaResource", {
        resourceInstanceId: "string",
        schema: "string",
        eventStreamsSchemaId: "string",
        schemaId: "string",
    });
    
    type: ibm:EventStreamsSchema
    properties:
        eventStreamsSchemaId: string
        resourceInstanceId: string
        schema: string
        schemaId: string
    

    EventStreamsSchema Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The EventStreamsSchema resource accepts the following input properties:

    ResourceInstanceId string
    The ID or the CRN of the Event Streams service instance.
    Schema string
    The schema in JSON format.
    EventStreamsSchemaId string
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    SchemaId string
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    ResourceInstanceId string
    The ID or the CRN of the Event Streams service instance.
    Schema string
    The schema in JSON format.
    EventStreamsSchemaId string
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    SchemaId string
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    resourceInstanceId String
    The ID or the CRN of the Event Streams service instance.
    schema String
    The schema in JSON format.
    eventStreamsSchemaId String
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    schemaId String
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    resourceInstanceId string
    The ID or the CRN of the Event Streams service instance.
    schema string
    The schema in JSON format.
    eventStreamsSchemaId string
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    schemaId string
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    resource_instance_id str
    The ID or the CRN of the Event Streams service instance.
    schema str
    The schema in JSON format.
    event_streams_schema_id str
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    schema_id str
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    resourceInstanceId String
    The ID or the CRN of the Event Streams service instance.
    schema String
    The schema in JSON format.
    eventStreamsSchemaId String
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    schemaId String
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    KafkaHttpUrl string
    (String) The API endpoint for interacting with an Event Streams REST API.
    Id string
    The provider-assigned unique ID for this managed resource.
    KafkaHttpUrl string
    (String) The API endpoint for interacting with an Event Streams REST API.
    id String
    The provider-assigned unique ID for this managed resource.
    kafkaHttpUrl String
    (String) The API endpoint for interacting with an Event Streams REST API.
    id string
    The provider-assigned unique ID for this managed resource.
    kafkaHttpUrl string
    (String) The API endpoint for interacting with an Event Streams REST API.
    id str
    The provider-assigned unique ID for this managed resource.
    kafka_http_url str
    (String) The API endpoint for interacting with an Event Streams REST API.
    id String
    The provider-assigned unique ID for this managed resource.
    kafkaHttpUrl String
    (String) The API endpoint for interacting with an Event Streams REST API.

    Look up Existing EventStreamsSchema Resource

    Get an existing EventStreamsSchema 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?: EventStreamsSchemaState, opts?: CustomResourceOptions): EventStreamsSchema
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            event_streams_schema_id: Optional[str] = None,
            kafka_http_url: Optional[str] = None,
            resource_instance_id: Optional[str] = None,
            schema: Optional[str] = None,
            schema_id: Optional[str] = None) -> EventStreamsSchema
    func GetEventStreamsSchema(ctx *Context, name string, id IDInput, state *EventStreamsSchemaState, opts ...ResourceOption) (*EventStreamsSchema, error)
    public static EventStreamsSchema Get(string name, Input<string> id, EventStreamsSchemaState? state, CustomResourceOptions? opts = null)
    public static EventStreamsSchema get(String name, Output<String> id, EventStreamsSchemaState state, CustomResourceOptions options)
    resources:  _:    type: ibm:EventStreamsSchema    get:      id: ${id}
    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:
    EventStreamsSchemaId string
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    KafkaHttpUrl string
    (String) The API endpoint for interacting with an Event Streams REST API.
    ResourceInstanceId string
    The ID or the CRN of the Event Streams service instance.
    Schema string
    The schema in JSON format.
    SchemaId string
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    EventStreamsSchemaId string
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    KafkaHttpUrl string
    (String) The API endpoint for interacting with an Event Streams REST API.
    ResourceInstanceId string
    The ID or the CRN of the Event Streams service instance.
    Schema string
    The schema in JSON format.
    SchemaId string
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    eventStreamsSchemaId String
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    kafkaHttpUrl String
    (String) The API endpoint for interacting with an Event Streams REST API.
    resourceInstanceId String
    The ID or the CRN of the Event Streams service instance.
    schema String
    The schema in JSON format.
    schemaId String
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    eventStreamsSchemaId string
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    kafkaHttpUrl string
    (String) The API endpoint for interacting with an Event Streams REST API.
    resourceInstanceId string
    The ID or the CRN of the Event Streams service instance.
    schema string
    The schema in JSON format.
    schemaId string
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    event_streams_schema_id str
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    kafka_http_url str
    (String) The API endpoint for interacting with an Event Streams REST API.
    resource_instance_id str
    The ID or the CRN of the Event Streams service instance.
    schema str
    The schema in JSON format.
    schema_id str
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
    eventStreamsSchemaId String
    (String) The ID of the schema in CRN format. For example, crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema.
    kafkaHttpUrl String
    (String) The API endpoint for interacting with an Event Streams REST API.
    resourceInstanceId String
    The ID or the CRN of the Event Streams service instance.
    schema String
    The schema in JSON format.
    schemaId String
    The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.

    Import

    The ibm_event_streams_schema resource can be imported by using CRN. The three colon-separated parameters of the CRN are:

    • instance CRN = CRN of the Event Streams instance
    • resource type = schema
    • schema ID = ID of the schema

    Syntax

    $ pulumi import ibm:index/eventStreamsSchema:EventStreamsSchema es_schema <crn>
    

    Example

    $ pulumi import ibm:index/eventStreamsSchema:EventStreamsSchema es_schema crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:cb5a0252-8b8d-4390-b017-80b743d32839:schema:my-es-schema
    

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

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud