datahub

package
v3.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetServiceArgs

type GetServiceArgs struct {
	// Setting the value to `On` to enable the service. If has been enabled, return the result. Valid values: `On` or `Off`. Default to `Off`.
	//
	// > **NOTE:** Setting `enable = "On"` to open the DataHub service that means you have read and agreed the [DataHub Terms of Service](https://help.aliyun.com/document_detail/158927.html). The service can not closed once it is opened.
	Enable *string `pulumi:"enable"`
}

A collection of arguments for invoking getService.

type GetServiceOutputArgs added in v3.9.0

type GetServiceOutputArgs struct {
	// Setting the value to `On` to enable the service. If has been enabled, return the result. Valid values: `On` or `Off`. Default to `Off`.
	//
	// > **NOTE:** Setting `enable = "On"` to open the DataHub service that means you have read and agreed the [DataHub Terms of Service](https://help.aliyun.com/document_detail/158927.html). The service can not closed once it is opened.
	Enable pulumi.StringPtrInput `pulumi:"enable"`
}

A collection of arguments for invoking getService.

func (GetServiceOutputArgs) ElementType added in v3.9.0

func (GetServiceOutputArgs) ElementType() reflect.Type

type GetServiceResult

type GetServiceResult struct {
	Enable *string `pulumi:"enable"`
	// The provider-assigned unique ID for this managed resource.
	Id string `pulumi:"id"`
	// The current service enable status.
	Status string `pulumi:"status"`
}

A collection of values returned by getService.

func GetService

func GetService(ctx *pulumi.Context, args *GetServiceArgs, opts ...pulumi.InvokeOption) (*GetServiceResult, error)

Using this data source can open DataHub service automatically. If the service has been opened, it will return opened.

For information about DataHub and how to use it, see [What is DataHub](https://help.aliyun.com/product/53345.html).

> **NOTE:** Available in v1.111.0+

> **NOTE:** The DataHub service is not support in the international site.

## Example Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/datahub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datahub.GetService(ctx, &datahub.GetServiceArgs{
			Enable: pulumi.StringRef("On"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

```

type GetServiceResultOutput added in v3.9.0

type GetServiceResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getService.

func GetServiceOutput added in v3.9.0

func GetServiceOutput(ctx *pulumi.Context, args GetServiceOutputArgs, opts ...pulumi.InvokeOption) GetServiceResultOutput

func (GetServiceResultOutput) ElementType added in v3.9.0

func (GetServiceResultOutput) ElementType() reflect.Type

func (GetServiceResultOutput) Enable added in v3.9.0

func (GetServiceResultOutput) Id added in v3.9.0

The provider-assigned unique ID for this managed resource.

func (GetServiceResultOutput) Status added in v3.9.0

The current service enable status.

func (GetServiceResultOutput) ToGetServiceResultOutput added in v3.9.0

func (o GetServiceResultOutput) ToGetServiceResultOutput() GetServiceResultOutput

func (GetServiceResultOutput) ToGetServiceResultOutputWithContext added in v3.9.0

func (o GetServiceResultOutput) ToGetServiceResultOutputWithContext(ctx context.Context) GetServiceResultOutput

type Project

type Project struct {
	pulumi.CustomResourceState

	// Comment of the datahub project. It cannot be longer than 255 characters.
	Comment pulumi.StringPtrOutput `pulumi:"comment"`
	// Create time of the datahub project. It is a human-readable string rather than 64-bits UTC.
	CreateTime pulumi.StringOutput `pulumi:"createTime"`
	// Last modify time of the datahub project. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.
	LastModifyTime pulumi.StringOutput `pulumi:"lastModifyTime"`
	// The name of the datahub project. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	Name pulumi.StringOutput `pulumi:"name"`
}

The project is the basic unit of resource management in Datahub Service and is used to isolate and control resources. It contains a set of Topics. You can manage the datahub sources of an application by using projects. [Refer to details](https://www.alibabacloud.com/help/en/datahub/latest/nerbcz).

> **NOTE:** Available since v1.19.0.

> **NOTE:** Currently Datahub service only can be supported in the regions: cn-beijing, cn-hangzhou, cn-shanghai, cn-shenzhen, ap-southeast-1.

## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/datahub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "tf_example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_, err := datahub.NewProject(ctx, "example", &datahub.ProjectArgs{
			Name:    pulumi.String(name),
			Comment: pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Datahub project can be imported using the *name* or ID, e.g.

```sh $ pulumi import alicloud:datahub/project:Project example tf_datahub_project ```

func GetProject

func GetProject(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error)

GetProject gets an existing Project resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewProject

func NewProject(ctx *pulumi.Context,
	name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error)

NewProject registers a new resource with the given unique name, arguments, and options.

func (*Project) ElementType

func (*Project) ElementType() reflect.Type

func (*Project) ToProjectOutput

func (i *Project) ToProjectOutput() ProjectOutput

func (*Project) ToProjectOutputWithContext

func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput

type ProjectArgs

type ProjectArgs struct {
	// Comment of the datahub project. It cannot be longer than 255 characters.
	Comment pulumi.StringPtrInput
	// The name of the datahub project. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	Name pulumi.StringPtrInput
}

The set of arguments for constructing a Project resource.

func (ProjectArgs) ElementType

func (ProjectArgs) ElementType() reflect.Type

type ProjectArray

type ProjectArray []ProjectInput

func (ProjectArray) ElementType

func (ProjectArray) ElementType() reflect.Type

func (ProjectArray) ToProjectArrayOutput

func (i ProjectArray) ToProjectArrayOutput() ProjectArrayOutput

func (ProjectArray) ToProjectArrayOutputWithContext

func (i ProjectArray) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput

type ProjectArrayInput

type ProjectArrayInput interface {
	pulumi.Input

	ToProjectArrayOutput() ProjectArrayOutput
	ToProjectArrayOutputWithContext(context.Context) ProjectArrayOutput
}

ProjectArrayInput is an input type that accepts ProjectArray and ProjectArrayOutput values. You can construct a concrete instance of `ProjectArrayInput` via:

ProjectArray{ ProjectArgs{...} }

type ProjectArrayOutput

type ProjectArrayOutput struct{ *pulumi.OutputState }

func (ProjectArrayOutput) ElementType

func (ProjectArrayOutput) ElementType() reflect.Type

func (ProjectArrayOutput) Index

func (ProjectArrayOutput) ToProjectArrayOutput

func (o ProjectArrayOutput) ToProjectArrayOutput() ProjectArrayOutput

func (ProjectArrayOutput) ToProjectArrayOutputWithContext

func (o ProjectArrayOutput) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput

type ProjectInput

type ProjectInput interface {
	pulumi.Input

	ToProjectOutput() ProjectOutput
	ToProjectOutputWithContext(ctx context.Context) ProjectOutput
}

type ProjectMap

type ProjectMap map[string]ProjectInput

func (ProjectMap) ElementType

func (ProjectMap) ElementType() reflect.Type

func (ProjectMap) ToProjectMapOutput

func (i ProjectMap) ToProjectMapOutput() ProjectMapOutput

func (ProjectMap) ToProjectMapOutputWithContext

func (i ProjectMap) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput

type ProjectMapInput

type ProjectMapInput interface {
	pulumi.Input

	ToProjectMapOutput() ProjectMapOutput
	ToProjectMapOutputWithContext(context.Context) ProjectMapOutput
}

ProjectMapInput is an input type that accepts ProjectMap and ProjectMapOutput values. You can construct a concrete instance of `ProjectMapInput` via:

ProjectMap{ "key": ProjectArgs{...} }

type ProjectMapOutput

type ProjectMapOutput struct{ *pulumi.OutputState }

func (ProjectMapOutput) ElementType

func (ProjectMapOutput) ElementType() reflect.Type

func (ProjectMapOutput) MapIndex

func (ProjectMapOutput) ToProjectMapOutput

func (o ProjectMapOutput) ToProjectMapOutput() ProjectMapOutput

func (ProjectMapOutput) ToProjectMapOutputWithContext

func (o ProjectMapOutput) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput

type ProjectOutput

type ProjectOutput struct{ *pulumi.OutputState }

func (ProjectOutput) Comment added in v3.27.0

func (o ProjectOutput) Comment() pulumi.StringPtrOutput

Comment of the datahub project. It cannot be longer than 255 characters.

func (ProjectOutput) CreateTime added in v3.27.0

func (o ProjectOutput) CreateTime() pulumi.StringOutput

Create time of the datahub project. It is a human-readable string rather than 64-bits UTC.

func (ProjectOutput) ElementType

func (ProjectOutput) ElementType() reflect.Type

func (ProjectOutput) LastModifyTime added in v3.27.0

func (o ProjectOutput) LastModifyTime() pulumi.StringOutput

Last modify time of the datahub project. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.

func (ProjectOutput) Name added in v3.27.0

The name of the datahub project. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.

func (ProjectOutput) ToProjectOutput

func (o ProjectOutput) ToProjectOutput() ProjectOutput

func (ProjectOutput) ToProjectOutputWithContext

func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput

type ProjectState

type ProjectState struct {
	// Comment of the datahub project. It cannot be longer than 255 characters.
	Comment pulumi.StringPtrInput
	// Create time of the datahub project. It is a human-readable string rather than 64-bits UTC.
	CreateTime pulumi.StringPtrInput
	// Last modify time of the datahub project. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.
	LastModifyTime pulumi.StringPtrInput
	// The name of the datahub project. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	Name pulumi.StringPtrInput
}

func (ProjectState) ElementType

func (ProjectState) ElementType() reflect.Type

type Subscription

type Subscription struct {
	pulumi.CustomResourceState

	// Comment of the datahub subscription. It cannot be longer than 255 characters.
	Comment pulumi.StringPtrOutput `pulumi:"comment"`
	// Create time of the datahub subscription. It is a human-readable string rather than 64-bits UTC.
	CreateTime pulumi.StringOutput `pulumi:"createTime"`
	// Last modify time of the datahub subscription. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.
	LastModifyTime pulumi.StringOutput `pulumi:"lastModifyTime"`
	// The name of the datahub project that the subscription belongs to. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	ProjectName pulumi.StringOutput `pulumi:"projectName"`
	// The identidy of the subscription, generate from server side.
	SubId pulumi.StringOutput `pulumi:"subId"`
	// The name of the datahub topic that the subscription belongs to. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	TopicName pulumi.StringOutput `pulumi:"topicName"`
}

The subscription is the basic unit of resource usage in Datahub Service under Publish/Subscribe model. You can manage the relationships between user and topics by using subscriptions. [Refer to details](https://www.alibabacloud.com/help/en/datahub/latest/nerbcz).

> **NOTE:** Available since v1.19.0.

## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/datahub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "terraform_example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		example, err := datahub.NewProject(ctx, "example", &datahub.ProjectArgs{
			Name:    pulumi.String(name),
			Comment: pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		exampleTopic, err := datahub.NewTopic(ctx, "example", &datahub.TopicArgs{
			Name:        pulumi.String(name),
			ProjectName: example.Name,
			RecordType:  pulumi.String("BLOB"),
			ShardCount:  pulumi.Int(3),
			LifeCycle:   pulumi.Int(7),
			Comment:     pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		_, err = datahub.NewSubscription(ctx, "example", &datahub.SubscriptionArgs{
			ProjectName: example.Name,
			TopicName:   exampleTopic.Name,
			Comment:     pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Datahub subscription can be imported using the ID, e.g.

```sh $ pulumi import alicloud:datahub/subscription:Subscription example tf_datahub_project:tf_datahub_topic:1539073399567UgCzY ```

func GetSubscription

func GetSubscription(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *SubscriptionState, opts ...pulumi.ResourceOption) (*Subscription, error)

GetSubscription gets an existing Subscription resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewSubscription

func NewSubscription(ctx *pulumi.Context,
	name string, args *SubscriptionArgs, opts ...pulumi.ResourceOption) (*Subscription, error)

NewSubscription registers a new resource with the given unique name, arguments, and options.

func (*Subscription) ElementType

func (*Subscription) ElementType() reflect.Type

func (*Subscription) ToSubscriptionOutput

func (i *Subscription) ToSubscriptionOutput() SubscriptionOutput

func (*Subscription) ToSubscriptionOutputWithContext

func (i *Subscription) ToSubscriptionOutputWithContext(ctx context.Context) SubscriptionOutput

type SubscriptionArgs

type SubscriptionArgs struct {
	// Comment of the datahub subscription. It cannot be longer than 255 characters.
	Comment pulumi.StringPtrInput
	// The name of the datahub project that the subscription belongs to. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	ProjectName pulumi.StringInput
	// The name of the datahub topic that the subscription belongs to. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	TopicName pulumi.StringInput
}

The set of arguments for constructing a Subscription resource.

func (SubscriptionArgs) ElementType

func (SubscriptionArgs) ElementType() reflect.Type

type SubscriptionArray

type SubscriptionArray []SubscriptionInput

func (SubscriptionArray) ElementType

func (SubscriptionArray) ElementType() reflect.Type

func (SubscriptionArray) ToSubscriptionArrayOutput

func (i SubscriptionArray) ToSubscriptionArrayOutput() SubscriptionArrayOutput

func (SubscriptionArray) ToSubscriptionArrayOutputWithContext

func (i SubscriptionArray) ToSubscriptionArrayOutputWithContext(ctx context.Context) SubscriptionArrayOutput

type SubscriptionArrayInput

type SubscriptionArrayInput interface {
	pulumi.Input

	ToSubscriptionArrayOutput() SubscriptionArrayOutput
	ToSubscriptionArrayOutputWithContext(context.Context) SubscriptionArrayOutput
}

SubscriptionArrayInput is an input type that accepts SubscriptionArray and SubscriptionArrayOutput values. You can construct a concrete instance of `SubscriptionArrayInput` via:

SubscriptionArray{ SubscriptionArgs{...} }

type SubscriptionArrayOutput

type SubscriptionArrayOutput struct{ *pulumi.OutputState }

func (SubscriptionArrayOutput) ElementType

func (SubscriptionArrayOutput) ElementType() reflect.Type

func (SubscriptionArrayOutput) Index

func (SubscriptionArrayOutput) ToSubscriptionArrayOutput

func (o SubscriptionArrayOutput) ToSubscriptionArrayOutput() SubscriptionArrayOutput

func (SubscriptionArrayOutput) ToSubscriptionArrayOutputWithContext

func (o SubscriptionArrayOutput) ToSubscriptionArrayOutputWithContext(ctx context.Context) SubscriptionArrayOutput

type SubscriptionInput

type SubscriptionInput interface {
	pulumi.Input

	ToSubscriptionOutput() SubscriptionOutput
	ToSubscriptionOutputWithContext(ctx context.Context) SubscriptionOutput
}

type SubscriptionMap

type SubscriptionMap map[string]SubscriptionInput

func (SubscriptionMap) ElementType

func (SubscriptionMap) ElementType() reflect.Type

func (SubscriptionMap) ToSubscriptionMapOutput

func (i SubscriptionMap) ToSubscriptionMapOutput() SubscriptionMapOutput

func (SubscriptionMap) ToSubscriptionMapOutputWithContext

func (i SubscriptionMap) ToSubscriptionMapOutputWithContext(ctx context.Context) SubscriptionMapOutput

type SubscriptionMapInput

type SubscriptionMapInput interface {
	pulumi.Input

	ToSubscriptionMapOutput() SubscriptionMapOutput
	ToSubscriptionMapOutputWithContext(context.Context) SubscriptionMapOutput
}

SubscriptionMapInput is an input type that accepts SubscriptionMap and SubscriptionMapOutput values. You can construct a concrete instance of `SubscriptionMapInput` via:

SubscriptionMap{ "key": SubscriptionArgs{...} }

type SubscriptionMapOutput

type SubscriptionMapOutput struct{ *pulumi.OutputState }

func (SubscriptionMapOutput) ElementType

func (SubscriptionMapOutput) ElementType() reflect.Type

func (SubscriptionMapOutput) MapIndex

func (SubscriptionMapOutput) ToSubscriptionMapOutput

func (o SubscriptionMapOutput) ToSubscriptionMapOutput() SubscriptionMapOutput

func (SubscriptionMapOutput) ToSubscriptionMapOutputWithContext

func (o SubscriptionMapOutput) ToSubscriptionMapOutputWithContext(ctx context.Context) SubscriptionMapOutput

type SubscriptionOutput

type SubscriptionOutput struct{ *pulumi.OutputState }

func (SubscriptionOutput) Comment added in v3.27.0

Comment of the datahub subscription. It cannot be longer than 255 characters.

func (SubscriptionOutput) CreateTime added in v3.27.0

func (o SubscriptionOutput) CreateTime() pulumi.StringOutput

Create time of the datahub subscription. It is a human-readable string rather than 64-bits UTC.

func (SubscriptionOutput) ElementType

func (SubscriptionOutput) ElementType() reflect.Type

func (SubscriptionOutput) LastModifyTime added in v3.27.0

func (o SubscriptionOutput) LastModifyTime() pulumi.StringOutput

Last modify time of the datahub subscription. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.

func (SubscriptionOutput) ProjectName added in v3.27.0

func (o SubscriptionOutput) ProjectName() pulumi.StringOutput

The name of the datahub project that the subscription belongs to. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.

func (SubscriptionOutput) SubId added in v3.27.0

The identidy of the subscription, generate from server side.

func (SubscriptionOutput) ToSubscriptionOutput

func (o SubscriptionOutput) ToSubscriptionOutput() SubscriptionOutput

func (SubscriptionOutput) ToSubscriptionOutputWithContext

func (o SubscriptionOutput) ToSubscriptionOutputWithContext(ctx context.Context) SubscriptionOutput

func (SubscriptionOutput) TopicName added in v3.27.0

func (o SubscriptionOutput) TopicName() pulumi.StringOutput

The name of the datahub topic that the subscription belongs to. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.

type SubscriptionState

type SubscriptionState struct {
	// Comment of the datahub subscription. It cannot be longer than 255 characters.
	Comment pulumi.StringPtrInput
	// Create time of the datahub subscription. It is a human-readable string rather than 64-bits UTC.
	CreateTime pulumi.StringPtrInput
	// Last modify time of the datahub subscription. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.
	LastModifyTime pulumi.StringPtrInput
	// The name of the datahub project that the subscription belongs to. Its length is limited to 3-32 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	ProjectName pulumi.StringPtrInput
	// The identidy of the subscription, generate from server side.
	SubId pulumi.StringPtrInput
	// The name of the datahub topic that the subscription belongs to. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	TopicName pulumi.StringPtrInput
}

func (SubscriptionState) ElementType

func (SubscriptionState) ElementType() reflect.Type

type Topic

type Topic struct {
	pulumi.CustomResourceState

	// Comment of the datahub topic. It cannot be longer than 255 characters.
	//
	// **Notes:** Currently `lifeCycle` can not be modified and it will be supported in the next future.
	Comment pulumi.StringPtrOutput `pulumi:"comment"`
	// Create time of the datahub topic. It is a human-readable string rather than 64-bits UTC.
	CreateTime pulumi.StringOutput `pulumi:"createTime"`
	// Last modify time of the datahub topic. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.
	LastModifyTime pulumi.StringOutput `pulumi:"lastModifyTime"`
	// How many days this topic lives. The permitted range of values is [1, 7]. The default value is 3.
	LifeCycle pulumi.IntPtrOutput `pulumi:"lifeCycle"`
	// The name of the datahub topic. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	Name pulumi.StringOutput `pulumi:"name"`
	// The name of the datahub project that this topic belongs to. It is case-insensitive.
	ProjectName pulumi.StringOutput `pulumi:"projectName"`
	// Schema of this topic, required only for TUPLE topic. Supported data types (case-insensitive) are:
	// - BIGINT
	// - STRING
	// - BOOLEAN
	// - DOUBLE
	// - TIMESTAMP
	RecordSchema pulumi.MapOutput `pulumi:"recordSchema"`
	// The type of this topic. Its value must be one of {BLOB, TUPLE}. For BLOB topic, data will be organized as binary and encoded by BASE64. For TUPLE topic, data has fixed schema. The default value is "TUPLE" with a schema {STRING}.
	RecordType pulumi.StringPtrOutput `pulumi:"recordType"`
	// The number of shards this topic contains. The permitted range of values is [1, 10]. The default value is 1.
	ShardCount pulumi.IntPtrOutput `pulumi:"shardCount"`
}

The topic is the basic unit of Datahub data source and is used to define one kind of data or stream. It contains a set of subscriptions. You can manage the datahub source of an application by using topics. [Refer to details](https://www.alibabacloud.com/help/en/datahub/latest/nerbcz).

> **NOTE:** Available since v1.19.0.

## Example Usage

Basic Usage

```go package main

import (

"fmt"

"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/datahub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "tf_example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		example, err := datahub.NewProject(ctx, "example", &datahub.ProjectArgs{
			Name:    pulumi.String(name),
			Comment: pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		_, err = datahub.NewTopic(ctx, "example_blob", &datahub.TopicArgs{
			Name:        pulumi.String(fmt.Sprintf("%v_blob", name)),
			ProjectName: example.Name,
			RecordType:  pulumi.String("BLOB"),
			ShardCount:  pulumi.Int(3),
			LifeCycle:   pulumi.Int(7),
			Comment:     pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		_, err = datahub.NewTopic(ctx, "example_tuple", &datahub.TopicArgs{
			Name:        pulumi.String(fmt.Sprintf("%v_tuple", name)),
			ProjectName: example.Name,
			RecordType:  pulumi.String("TUPLE"),
			RecordSchema: pulumi.Map{
				"bigint_field":    pulumi.Any("BIGINT"),
				"timestamp_field": pulumi.Any("TIMESTAMP"),
				"string_field":    pulumi.Any("STRING"),
				"double_field":    pulumi.Any("DOUBLE"),
				"boolean_field":   pulumi.Any("BOOLEAN"),
			},
			ShardCount: pulumi.Int(3),
			LifeCycle:  pulumi.Int(7),
			Comment:    pulumi.String("created by terraform"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Datahub topic can be imported using the ID, e.g.

```sh $ pulumi import alicloud:datahub/topic:Topic example tf_datahub_project:tf_datahub_topic ```

func GetTopic

func GetTopic(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *TopicState, opts ...pulumi.ResourceOption) (*Topic, error)

GetTopic gets an existing Topic resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewTopic

func NewTopic(ctx *pulumi.Context,
	name string, args *TopicArgs, opts ...pulumi.ResourceOption) (*Topic, error)

NewTopic registers a new resource with the given unique name, arguments, and options.

func (*Topic) ElementType

func (*Topic) ElementType() reflect.Type

func (*Topic) ToTopicOutput

func (i *Topic) ToTopicOutput() TopicOutput

func (*Topic) ToTopicOutputWithContext

func (i *Topic) ToTopicOutputWithContext(ctx context.Context) TopicOutput

type TopicArgs

type TopicArgs struct {
	// Comment of the datahub topic. It cannot be longer than 255 characters.
	//
	// **Notes:** Currently `lifeCycle` can not be modified and it will be supported in the next future.
	Comment pulumi.StringPtrInput
	// How many days this topic lives. The permitted range of values is [1, 7]. The default value is 3.
	LifeCycle pulumi.IntPtrInput
	// The name of the datahub topic. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	Name pulumi.StringPtrInput
	// The name of the datahub project that this topic belongs to. It is case-insensitive.
	ProjectName pulumi.StringInput
	// Schema of this topic, required only for TUPLE topic. Supported data types (case-insensitive) are:
	// - BIGINT
	// - STRING
	// - BOOLEAN
	// - DOUBLE
	// - TIMESTAMP
	RecordSchema pulumi.MapInput
	// The type of this topic. Its value must be one of {BLOB, TUPLE}. For BLOB topic, data will be organized as binary and encoded by BASE64. For TUPLE topic, data has fixed schema. The default value is "TUPLE" with a schema {STRING}.
	RecordType pulumi.StringPtrInput
	// The number of shards this topic contains. The permitted range of values is [1, 10]. The default value is 1.
	ShardCount pulumi.IntPtrInput
}

The set of arguments for constructing a Topic resource.

func (TopicArgs) ElementType

func (TopicArgs) ElementType() reflect.Type

type TopicArray

type TopicArray []TopicInput

func (TopicArray) ElementType

func (TopicArray) ElementType() reflect.Type

func (TopicArray) ToTopicArrayOutput

func (i TopicArray) ToTopicArrayOutput() TopicArrayOutput

func (TopicArray) ToTopicArrayOutputWithContext

func (i TopicArray) ToTopicArrayOutputWithContext(ctx context.Context) TopicArrayOutput

type TopicArrayInput

type TopicArrayInput interface {
	pulumi.Input

	ToTopicArrayOutput() TopicArrayOutput
	ToTopicArrayOutputWithContext(context.Context) TopicArrayOutput
}

TopicArrayInput is an input type that accepts TopicArray and TopicArrayOutput values. You can construct a concrete instance of `TopicArrayInput` via:

TopicArray{ TopicArgs{...} }

type TopicArrayOutput

type TopicArrayOutput struct{ *pulumi.OutputState }

func (TopicArrayOutput) ElementType

func (TopicArrayOutput) ElementType() reflect.Type

func (TopicArrayOutput) Index

func (TopicArrayOutput) ToTopicArrayOutput

func (o TopicArrayOutput) ToTopicArrayOutput() TopicArrayOutput

func (TopicArrayOutput) ToTopicArrayOutputWithContext

func (o TopicArrayOutput) ToTopicArrayOutputWithContext(ctx context.Context) TopicArrayOutput

type TopicInput

type TopicInput interface {
	pulumi.Input

	ToTopicOutput() TopicOutput
	ToTopicOutputWithContext(ctx context.Context) TopicOutput
}

type TopicMap

type TopicMap map[string]TopicInput

func (TopicMap) ElementType

func (TopicMap) ElementType() reflect.Type

func (TopicMap) ToTopicMapOutput

func (i TopicMap) ToTopicMapOutput() TopicMapOutput

func (TopicMap) ToTopicMapOutputWithContext

func (i TopicMap) ToTopicMapOutputWithContext(ctx context.Context) TopicMapOutput

type TopicMapInput

type TopicMapInput interface {
	pulumi.Input

	ToTopicMapOutput() TopicMapOutput
	ToTopicMapOutputWithContext(context.Context) TopicMapOutput
}

TopicMapInput is an input type that accepts TopicMap and TopicMapOutput values. You can construct a concrete instance of `TopicMapInput` via:

TopicMap{ "key": TopicArgs{...} }

type TopicMapOutput

type TopicMapOutput struct{ *pulumi.OutputState }

func (TopicMapOutput) ElementType

func (TopicMapOutput) ElementType() reflect.Type

func (TopicMapOutput) MapIndex

func (TopicMapOutput) ToTopicMapOutput

func (o TopicMapOutput) ToTopicMapOutput() TopicMapOutput

func (TopicMapOutput) ToTopicMapOutputWithContext

func (o TopicMapOutput) ToTopicMapOutputWithContext(ctx context.Context) TopicMapOutput

type TopicOutput

type TopicOutput struct{ *pulumi.OutputState }

func (TopicOutput) Comment added in v3.27.0

func (o TopicOutput) Comment() pulumi.StringPtrOutput

Comment of the datahub topic. It cannot be longer than 255 characters.

**Notes:** Currently `lifeCycle` can not be modified and it will be supported in the next future.

func (TopicOutput) CreateTime added in v3.27.0

func (o TopicOutput) CreateTime() pulumi.StringOutput

Create time of the datahub topic. It is a human-readable string rather than 64-bits UTC.

func (TopicOutput) ElementType

func (TopicOutput) ElementType() reflect.Type

func (TopicOutput) LastModifyTime added in v3.27.0

func (o TopicOutput) LastModifyTime() pulumi.StringOutput

Last modify time of the datahub topic. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.

func (TopicOutput) LifeCycle added in v3.27.0

func (o TopicOutput) LifeCycle() pulumi.IntPtrOutput

How many days this topic lives. The permitted range of values is [1, 7]. The default value is 3.

func (TopicOutput) Name added in v3.27.0

func (o TopicOutput) Name() pulumi.StringOutput

The name of the datahub topic. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.

func (TopicOutput) ProjectName added in v3.27.0

func (o TopicOutput) ProjectName() pulumi.StringOutput

The name of the datahub project that this topic belongs to. It is case-insensitive.

func (TopicOutput) RecordSchema added in v3.27.0

func (o TopicOutput) RecordSchema() pulumi.MapOutput

Schema of this topic, required only for TUPLE topic. Supported data types (case-insensitive) are: - BIGINT - STRING - BOOLEAN - DOUBLE - TIMESTAMP

func (TopicOutput) RecordType added in v3.27.0

func (o TopicOutput) RecordType() pulumi.StringPtrOutput

The type of this topic. Its value must be one of {BLOB, TUPLE}. For BLOB topic, data will be organized as binary and encoded by BASE64. For TUPLE topic, data has fixed schema. The default value is "TUPLE" with a schema {STRING}.

func (TopicOutput) ShardCount added in v3.27.0

func (o TopicOutput) ShardCount() pulumi.IntPtrOutput

The number of shards this topic contains. The permitted range of values is [1, 10]. The default value is 1.

func (TopicOutput) ToTopicOutput

func (o TopicOutput) ToTopicOutput() TopicOutput

func (TopicOutput) ToTopicOutputWithContext

func (o TopicOutput) ToTopicOutputWithContext(ctx context.Context) TopicOutput

type TopicState

type TopicState struct {
	// Comment of the datahub topic. It cannot be longer than 255 characters.
	//
	// **Notes:** Currently `lifeCycle` can not be modified and it will be supported in the next future.
	Comment pulumi.StringPtrInput
	// Create time of the datahub topic. It is a human-readable string rather than 64-bits UTC.
	CreateTime pulumi.StringPtrInput
	// Last modify time of the datahub topic. It is the same as *create_time* at the beginning. It is also a human-readable string rather than 64-bits UTC.
	LastModifyTime pulumi.StringPtrInput
	// How many days this topic lives. The permitted range of values is [1, 7]. The default value is 3.
	LifeCycle pulumi.IntPtrInput
	// The name of the datahub topic. Its length is limited to 1-128 and only characters such as letters, digits and '_' are allowed. It is case-insensitive.
	Name pulumi.StringPtrInput
	// The name of the datahub project that this topic belongs to. It is case-insensitive.
	ProjectName pulumi.StringPtrInput
	// Schema of this topic, required only for TUPLE topic. Supported data types (case-insensitive) are:
	// - BIGINT
	// - STRING
	// - BOOLEAN
	// - DOUBLE
	// - TIMESTAMP
	RecordSchema pulumi.MapInput
	// The type of this topic. Its value must be one of {BLOB, TUPLE}. For BLOB topic, data will be organized as binary and encoded by BASE64. For TUPLE topic, data has fixed schema. The default value is "TUPLE" with a schema {STRING}.
	RecordType pulumi.StringPtrInput
	// The number of shards this topic contains. The permitted range of values is [1, 10]. The default value is 1.
	ShardCount pulumi.IntPtrInput
}

func (TopicState) ElementType

func (TopicState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL