Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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://help.aliyun.com/document_detail/47440.html).
> **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/v2/go/alicloud/datahub" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := datahub.NewProject(ctx, "example", &datahub.ProjectArgs{ 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 ¶ added in v2.25.1
func (Project) ToProjectOutput ¶ added in v2.25.1
func (i Project) ToProjectOutput() ProjectOutput
func (Project) ToProjectOutputWithContext ¶ added in v2.25.1
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 ProjectInput ¶ added in v2.25.1
type ProjectInput interface { pulumi.Input ToProjectOutput() ProjectOutput ToProjectOutputWithContext(ctx context.Context) ProjectOutput }
type ProjectOutput ¶ added in v2.25.1
type ProjectOutput struct {
*pulumi.OutputState
}
func (ProjectOutput) ElementType ¶ added in v2.25.1
func (ProjectOutput) ElementType() reflect.Type
func (ProjectOutput) ToProjectOutput ¶ added in v2.25.1
func (o ProjectOutput) ToProjectOutput() ProjectOutput
func (ProjectOutput) ToProjectOutputWithContext ¶ added in v2.25.1
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 subscritpion, 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://help.aliyun.com/document_detail/47440.html).
## Example Usage
Basic Usage ¶
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/datahub" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := datahub.NewSubscription(ctx, "example", &datahub.SubscriptionArgs{ Comment: pulumi.String("created by terraform"), ProjectName: pulumi.String("tf_datahub_project"), TopicName: pulumi.String("tf_datahub_topic"), }) 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 ¶ added in v2.25.1
func (Subscription) ElementType() reflect.Type
func (Subscription) ToSubscriptionOutput ¶ added in v2.25.1
func (i Subscription) ToSubscriptionOutput() SubscriptionOutput
func (Subscription) ToSubscriptionOutputWithContext ¶ added in v2.25.1
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 SubscriptionInput ¶ added in v2.25.1
type SubscriptionInput interface { pulumi.Input ToSubscriptionOutput() SubscriptionOutput ToSubscriptionOutputWithContext(ctx context.Context) SubscriptionOutput }
type SubscriptionOutput ¶ added in v2.25.1
type SubscriptionOutput struct {
*pulumi.OutputState
}
func (SubscriptionOutput) ElementType ¶ added in v2.25.1
func (SubscriptionOutput) ElementType() reflect.Type
func (SubscriptionOutput) ToSubscriptionOutput ¶ added in v2.25.1
func (o SubscriptionOutput) ToSubscriptionOutput() SubscriptionOutput
func (SubscriptionOutput) ToSubscriptionOutputWithContext ¶ added in v2.25.1
func (o SubscriptionOutput) ToSubscriptionOutputWithContext(ctx context.Context) SubscriptionOutput
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 subscritpion, 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. 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://help.aliyun.com/document_detail/47440.html).
## Example Usage
Basic Usage ¶
- BLob Topic
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/datahub" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := datahub.NewTopic(ctx, "example", &datahub.TopicArgs{ Comment: pulumi.String("created by terraform"), LifeCycle: pulumi.Int(7), ProjectName: pulumi.String("tf_datahub_project"), RecordType: pulumi.String("BLOB"), ShardCount: pulumi.Int(3), }) if err != nil { return err } return nil }) }
``` - Tuple Topic
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/datahub" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := datahub.NewTopic(ctx, "example", &datahub.TopicArgs{ Comment: pulumi.String("created by terraform"), LifeCycle: pulumi.Int(7), ProjectName: pulumi.String("tf_datahub_project"), RecordSchema: pulumi.StringMap{ "bigint_field": pulumi.String("BIGINT"), "boolean_field": pulumi.String("BOOLEAN"), "double_field": pulumi.String("DOUBLE"), "string_field": pulumi.String("STRING"), "timestamp_field": pulumi.String("TIMESTAMP"), }, RecordType: pulumi.String("TUPLE"), ShardCount: pulumi.Int(3), }) 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 ¶ added in v2.25.1
func (Topic) ToTopicOutput ¶ added in v2.25.1
func (i Topic) ToTopicOutput() TopicOutput
func (Topic) ToTopicOutputWithContext ¶ added in v2.25.1
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. 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 ¶
type TopicInput ¶ added in v2.25.1
type TopicInput interface { pulumi.Input ToTopicOutput() TopicOutput ToTopicOutputWithContext(ctx context.Context) TopicOutput }
type TopicOutput ¶ added in v2.25.1
type TopicOutput struct {
*pulumi.OutputState
}
func (TopicOutput) ElementType ¶ added in v2.25.1
func (TopicOutput) ElementType() reflect.Type
func (TopicOutput) ToTopicOutput ¶ added in v2.25.1
func (o TopicOutput) ToTopicOutput() TopicOutput
func (TopicOutput) ToTopicOutputWithContext ¶ added in v2.25.1
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. 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