alikafka

package
v2.30.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerGroup

type ConsumerGroup struct {
	pulumi.CustomResourceState

	// ID of the consumer group. The length cannot exceed 64 characters.
	ConsumerId pulumi.StringOutput `pulumi:"consumerId"`
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringOutput `pulumi:"instanceId"`
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapOutput `pulumi:"tags"`
}

Provides an ALIKAFKA consumer group resource.

> **NOTE:** Available in 1.56.0+

> **NOTE:** Only the following regions support create alikafka consumer group. [`cn-hangzhou`,`cn-beijing`,`cn-shenzhen`,`cn-shanghai`,`cn-qingdao`,`cn-hongkong`,`cn-huhehaote`,`cn-zhangjiakou`,`ap-southeast-1`,`ap-south-1`,`ap-southeast-5`]

## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/alikafka"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		consumerId := "CID-alikafkaGroupDatasourceName"
		if param := cfg.Get("consumerId"); param != "" {
			consumerId = param
		}
		opt0 := "VSwitch"
		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableResourceCreation: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
			VpcId:            defaultNetwork.ID(),
			CidrBlock:        pulumi.String("172.16.0.0/24"),
			AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		defaultInstance, err := alikafka.NewInstance(ctx, "defaultInstance", &alikafka.InstanceArgs{
			TopicQuota: pulumi.Int(50),
			DiskType:   pulumi.Int(1),
			DiskSize:   pulumi.Int(500),
			DeployType: pulumi.Int(5),
			IoMax:      pulumi.Int(20),
			VswitchId:  defaultSwitch.ID(),
		})
		if err != nil {
			return err
		}
		_, err = alikafka.NewConsumerGroup(ctx, "defaultConsumerGroup", &alikafka.ConsumerGroupArgs{
			ConsumerId: pulumi.String(consumerId),
			InstanceId: defaultInstance.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

ALIKAFKA GROUP can be imported using the id, e.g.

```sh

$ pulumi import alicloud:alikafka/consumerGroup:ConsumerGroup group alikafka_post-cn-123455abc:consumerId

```

func GetConsumerGroup

func GetConsumerGroup(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ConsumerGroupState, opts ...pulumi.ResourceOption) (*ConsumerGroup, error)

GetConsumerGroup gets an existing ConsumerGroup 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 NewConsumerGroup

func NewConsumerGroup(ctx *pulumi.Context,
	name string, args *ConsumerGroupArgs, opts ...pulumi.ResourceOption) (*ConsumerGroup, error)

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

func (ConsumerGroup) ElementType added in v2.25.1

func (ConsumerGroup) ElementType() reflect.Type

func (ConsumerGroup) ToConsumerGroupOutput added in v2.25.1

func (i ConsumerGroup) ToConsumerGroupOutput() ConsumerGroupOutput

func (ConsumerGroup) ToConsumerGroupOutputWithContext added in v2.25.1

func (i ConsumerGroup) ToConsumerGroupOutputWithContext(ctx context.Context) ConsumerGroupOutput

type ConsumerGroupArgs

type ConsumerGroupArgs struct {
	// ID of the consumer group. The length cannot exceed 64 characters.
	ConsumerId pulumi.StringInput
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapInput
}

The set of arguments for constructing a ConsumerGroup resource.

func (ConsumerGroupArgs) ElementType

func (ConsumerGroupArgs) ElementType() reflect.Type

type ConsumerGroupInput added in v2.25.1

type ConsumerGroupInput interface {
	pulumi.Input

	ToConsumerGroupOutput() ConsumerGroupOutput
	ToConsumerGroupOutputWithContext(ctx context.Context) ConsumerGroupOutput
}

type ConsumerGroupOutput added in v2.25.1

type ConsumerGroupOutput struct {
	*pulumi.OutputState
}

func (ConsumerGroupOutput) ElementType added in v2.25.1

func (ConsumerGroupOutput) ElementType() reflect.Type

func (ConsumerGroupOutput) ToConsumerGroupOutput added in v2.25.1

func (o ConsumerGroupOutput) ToConsumerGroupOutput() ConsumerGroupOutput

func (ConsumerGroupOutput) ToConsumerGroupOutputWithContext added in v2.25.1

func (o ConsumerGroupOutput) ToConsumerGroupOutputWithContext(ctx context.Context) ConsumerGroupOutput

type ConsumerGroupState

type ConsumerGroupState struct {
	// ID of the consumer group. The length cannot exceed 64 characters.
	ConsumerId pulumi.StringPtrInput
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringPtrInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapInput
}

func (ConsumerGroupState) ElementType

func (ConsumerGroupState) ElementType() reflect.Type

type Instance

type Instance struct {
	pulumi.CustomResourceState

	// The deploy type of the instance. Currently only support two deploy type, 4: eip/vpc instance, 5: vpc instance.
	DeployType pulumi.IntOutput `pulumi:"deployType"`
	// The disk size of the instance. When modify this value, it only support adjust to a greater value.
	DiskSize pulumi.IntOutput `pulumi:"diskSize"`
	// The disk type of the instance. 0: efficient cloud disk , 1: SSD.
	DiskType pulumi.IntOutput `pulumi:"diskType"`
	// The max bandwidth of the instance. When modify this value, it only support adjust to a greater value.
	EipMax pulumi.IntPtrOutput `pulumi:"eipMax"`
	// The EndPoint to access the kafka instance.
	EndPoint pulumi.StringOutput `pulumi:"endPoint"`
	// The max value of io of the instance. When modify this value, it only support adjust to a greater value.
	IoMax pulumi.IntOutput `pulumi:"ioMax"`
	// Name of your Kafka instance. The length should between 3 and 64 characters. If not set, will use instance id as instance name.
	Name pulumi.StringOutput `pulumi:"name"`
	// The paid type of the instance. Support two type, "PrePaid": pre paid type instance, "PostPaid": post paid type instance. Default is PostPaid. When modify this value, it only support adjust from post pay to pre pay.
	PaidType pulumi.StringPtrOutput `pulumi:"paidType"`
	// (Optional, ForceNew, Available in v1.93.0+) The ID of security group for this instance. If the security group is empty, system will create a default one.
	SecurityGroup pulumi.StringPtrOutput `pulumi:"securityGroup"`
	// The spec type of the instance. Support two type, "normal": normal version instance, "professional": professional version instance. Default is normal. When modify this value, it only support adjust from normal to professional. Note only pre paid type instance support professional specific type.
	SpecType pulumi.StringPtrOutput `pulumi:"specType"`
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapOutput `pulumi:"tags"`
	// The max num of topic can be create of the instance. When modify this value, it only adjust to a greater value.
	TopicQuota pulumi.IntOutput `pulumi:"topicQuota"`
	// The ID of attaching VPC to instance.
	VpcId pulumi.StringOutput `pulumi:"vpcId"`
	// The ID of attaching vswitch to instance.
	VswitchId pulumi.StringOutput `pulumi:"vswitchId"`
	// The Zone to launch the kafka instance.
	ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}

Provides an ALIKAFKA instance resource.

> **NOTE:** Available in 1.59.0+

> **NOTE:** Creation or modification may took about 10-40 minutes.

> **NOTE:** Only the following regions support create alikafka pre paid instance. [`cn-hangzhou`,`cn-beijing`,`cn-shenzhen`,`cn-shanghai`,`cn-qingdao`,`cn-hongkong`,`cn-huhehaote`,`cn-zhangjiakou`,`cn-chengdu`,`cn-heyuan`,`ap-southeast-1`,`ap-southeast-3`,`ap-southeast-5`,`ap-south-1`,`ap-northeast-1`,`eu-central-1`,`eu-west-1`,`us-west-1`,`us-east-1`]

> **NOTE:** Only the following regions support create alikafka post paid instance(International account is not support to buy post paid instance currently). [`cn-hangzhou`,`cn-beijing`,`cn-shenzhen`,`cn-shanghai`,`cn-qingdao`,`cn-hongkong`,`cn-huhehaote`,`cn-zhangjiakou`,`cn-chengdu`,`cn-heyuan`,`ap-southeast-1`,`ap-southeast-3`,`ap-northeast-1`,`eu-central-1`,`eu-west-1`,`us-west-1`,`us-east-1`] ## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/alikafka"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		instanceName := "alikafkaInstanceName"
		if param := cfg.Get("instanceName"); param != "" {
			instanceName = param
		}
		opt0 := "VSwitch"
		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableResourceCreation: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
			VpcId:            defaultNetwork.ID(),
			CidrBlock:        pulumi.String("172.16.0.0/24"),
			AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		_, err = alikafka.NewInstance(ctx, "defaultInstance", &alikafka.InstanceArgs{
			TopicQuota: pulumi.Int(50),
			DiskType:   pulumi.Int(1),
			DiskSize:   pulumi.Int(500),
			DeployType: pulumi.Int(4),
			IoMax:      pulumi.Int(20),
			VswitchId:  defaultSwitch.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

ALIKAFKA TOPIC can be imported using the id, e.g.

```sh

$ pulumi import alicloud:alikafka/instance:Instance instance alikafka_post-cn-123455abc

```

func GetInstance

func GetInstance(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *InstanceState, opts ...pulumi.ResourceOption) (*Instance, error)

GetInstance gets an existing Instance 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 NewInstance

func NewInstance(ctx *pulumi.Context,
	name string, args *InstanceArgs, opts ...pulumi.ResourceOption) (*Instance, error)

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

func (Instance) ElementType added in v2.25.1

func (Instance) ElementType() reflect.Type

func (Instance) ToInstanceOutput added in v2.25.1

func (i Instance) ToInstanceOutput() InstanceOutput

func (Instance) ToInstanceOutputWithContext added in v2.25.1

func (i Instance) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput

type InstanceArgs

type InstanceArgs struct {
	// The deploy type of the instance. Currently only support two deploy type, 4: eip/vpc instance, 5: vpc instance.
	DeployType pulumi.IntInput
	// The disk size of the instance. When modify this value, it only support adjust to a greater value.
	DiskSize pulumi.IntInput
	// The disk type of the instance. 0: efficient cloud disk , 1: SSD.
	DiskType pulumi.IntInput
	// The max bandwidth of the instance. When modify this value, it only support adjust to a greater value.
	EipMax pulumi.IntPtrInput
	// The max value of io of the instance. When modify this value, it only support adjust to a greater value.
	IoMax pulumi.IntInput
	// Name of your Kafka instance. The length should between 3 and 64 characters. If not set, will use instance id as instance name.
	Name pulumi.StringPtrInput
	// The paid type of the instance. Support two type, "PrePaid": pre paid type instance, "PostPaid": post paid type instance. Default is PostPaid. When modify this value, it only support adjust from post pay to pre pay.
	PaidType pulumi.StringPtrInput
	// (Optional, ForceNew, Available in v1.93.0+) The ID of security group for this instance. If the security group is empty, system will create a default one.
	SecurityGroup pulumi.StringPtrInput
	// The spec type of the instance. Support two type, "normal": normal version instance, "professional": professional version instance. Default is normal. When modify this value, it only support adjust from normal to professional. Note only pre paid type instance support professional specific type.
	SpecType pulumi.StringPtrInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapInput
	// The max num of topic can be create of the instance. When modify this value, it only adjust to a greater value.
	TopicQuota pulumi.IntInput
	// The ID of attaching vswitch to instance.
	VswitchId pulumi.StringInput
}

The set of arguments for constructing a Instance resource.

func (InstanceArgs) ElementType

func (InstanceArgs) ElementType() reflect.Type

type InstanceInput added in v2.25.1

type InstanceInput interface {
	pulumi.Input

	ToInstanceOutput() InstanceOutput
	ToInstanceOutputWithContext(ctx context.Context) InstanceOutput
}

type InstanceOutput added in v2.25.1

type InstanceOutput struct {
	*pulumi.OutputState
}

func (InstanceOutput) ElementType added in v2.25.1

func (InstanceOutput) ElementType() reflect.Type

func (InstanceOutput) ToInstanceOutput added in v2.25.1

func (o InstanceOutput) ToInstanceOutput() InstanceOutput

func (InstanceOutput) ToInstanceOutputWithContext added in v2.25.1

func (o InstanceOutput) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput

type InstanceState

type InstanceState struct {
	// The deploy type of the instance. Currently only support two deploy type, 4: eip/vpc instance, 5: vpc instance.
	DeployType pulumi.IntPtrInput
	// The disk size of the instance. When modify this value, it only support adjust to a greater value.
	DiskSize pulumi.IntPtrInput
	// The disk type of the instance. 0: efficient cloud disk , 1: SSD.
	DiskType pulumi.IntPtrInput
	// The max bandwidth of the instance. When modify this value, it only support adjust to a greater value.
	EipMax pulumi.IntPtrInput
	// The EndPoint to access the kafka instance.
	EndPoint pulumi.StringPtrInput
	// The max value of io of the instance. When modify this value, it only support adjust to a greater value.
	IoMax pulumi.IntPtrInput
	// Name of your Kafka instance. The length should between 3 and 64 characters. If not set, will use instance id as instance name.
	Name pulumi.StringPtrInput
	// The paid type of the instance. Support two type, "PrePaid": pre paid type instance, "PostPaid": post paid type instance. Default is PostPaid. When modify this value, it only support adjust from post pay to pre pay.
	PaidType pulumi.StringPtrInput
	// (Optional, ForceNew, Available in v1.93.0+) The ID of security group for this instance. If the security group is empty, system will create a default one.
	SecurityGroup pulumi.StringPtrInput
	// The spec type of the instance. Support two type, "normal": normal version instance, "professional": professional version instance. Default is normal. When modify this value, it only support adjust from normal to professional. Note only pre paid type instance support professional specific type.
	SpecType pulumi.StringPtrInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapInput
	// The max num of topic can be create of the instance. When modify this value, it only adjust to a greater value.
	TopicQuota pulumi.IntPtrInput
	// The ID of attaching VPC to instance.
	VpcId pulumi.StringPtrInput
	// The ID of attaching vswitch to instance.
	VswitchId pulumi.StringPtrInput
	// The Zone to launch the kafka instance.
	ZoneId pulumi.StringPtrInput
}

func (InstanceState) ElementType

func (InstanceState) ElementType() reflect.Type

type SaslAcl

type SaslAcl struct {
	pulumi.CustomResourceState

	// Operation type for this acl. The operation type can only be "Write" and "Read".
	AclOperationType pulumi.StringOutput `pulumi:"aclOperationType"`
	// Resource name for this acl. The resource name should be a topic or consumer group name.
	AclResourceName pulumi.StringOutput `pulumi:"aclResourceName"`
	// Resource pattern type for this acl. The resource pattern support two types "LITERAL" and "PREFIXED". "LITERAL": A literal name defines the full name of a resource. The special wildcard character "*" can be used to represent a resource with any name. "PREFIXED": A prefixed name defines a prefix for a resource.
	AclResourcePatternType pulumi.StringOutput `pulumi:"aclResourcePatternType"`
	// Resource type for this acl. The resource type can only be "Topic" and "Group".
	AclResourceType pulumi.StringOutput `pulumi:"aclResourceType"`
	// The host of the acl.
	Host pulumi.StringOutput `pulumi:"host"`
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringOutput `pulumi:"instanceId"`
	// Username for the sasl user. The length should between 1 to 64 characters. The user should be an existed sasl user.
	Username pulumi.StringOutput `pulumi:"username"`
}

Provides an ALIKAFKA sasl acl resource.

> **NOTE:** Available in 1.66.0+

> **NOTE:** Only the following regions support create alikafka sasl user. [`cn-hangzhou`,`cn-beijing`,`cn-shenzhen`,`cn-shanghai`,`cn-qingdao`,`cn-hongkong`,`cn-huhehaote`,`cn-zhangjiakou`,`ap-southeast-1`,`ap-south-1`,`ap-southeast-5`]

## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/alikafka"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		username := "testusername"
		if param := cfg.Get("username"); param != "" {
			username = param
		}
		password := "testpassword"
		if param := cfg.Get("password"); param != "" {
			password = param
		}
		opt0 := "VSwitch"
		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableResourceCreation: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
			VpcId:            defaultNetwork.ID(),
			CidrBlock:        pulumi.String("172.16.0.0/24"),
			AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		defaultInstance, err := alikafka.NewInstance(ctx, "defaultInstance", &alikafka.InstanceArgs{
			TopicQuota: pulumi.Int(50),
			DiskType:   pulumi.Int(1),
			DiskSize:   pulumi.Int(500),
			DeployType: pulumi.Int(5),
			IoMax:      pulumi.Int(20),
			VswitchId:  defaultSwitch.ID(),
		})
		if err != nil {
			return err
		}
		defaultTopic, err := alikafka.NewTopic(ctx, "defaultTopic", &alikafka.TopicArgs{
			InstanceId: defaultInstance.ID(),
			Topic:      pulumi.String("test-topic"),
			Remark:     pulumi.String("topic-remark"),
		})
		if err != nil {
			return err
		}
		defaultSaslUser, err := alikafka.NewSaslUser(ctx, "defaultSaslUser", &alikafka.SaslUserArgs{
			InstanceId: defaultInstance.ID(),
			Username:   pulumi.String(username),
			Password:   pulumi.String(password),
		})
		if err != nil {
			return err
		}
		_, err = alikafka.NewSaslAcl(ctx, "defaultSaslAcl", &alikafka.SaslAclArgs{
			InstanceId:             defaultInstance.ID(),
			Username:               defaultSaslUser.Username,
			AclResourceType:        pulumi.String("Topic"),
			AclResourceName:        defaultTopic.Topic,
			AclResourcePatternType: pulumi.String("LITERAL"),
			AclOperationType:       pulumi.String("Write"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

ALIKAFKA GROUP can be imported using the id, e.g.

```sh

$ pulumi import alicloud:alikafka/saslAcl:SaslAcl acl alikafka_post-cn-123455abc:username:Topic:test-topic:LITERAL:Write

```

func GetSaslAcl

func GetSaslAcl(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *SaslAclState, opts ...pulumi.ResourceOption) (*SaslAcl, error)

GetSaslAcl gets an existing SaslAcl 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 NewSaslAcl

func NewSaslAcl(ctx *pulumi.Context,
	name string, args *SaslAclArgs, opts ...pulumi.ResourceOption) (*SaslAcl, error)

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

func (SaslAcl) ElementType added in v2.25.1

func (SaslAcl) ElementType() reflect.Type

func (SaslAcl) ToSaslAclOutput added in v2.25.1

func (i SaslAcl) ToSaslAclOutput() SaslAclOutput

func (SaslAcl) ToSaslAclOutputWithContext added in v2.25.1

func (i SaslAcl) ToSaslAclOutputWithContext(ctx context.Context) SaslAclOutput

type SaslAclArgs

type SaslAclArgs struct {
	// Operation type for this acl. The operation type can only be "Write" and "Read".
	AclOperationType pulumi.StringInput
	// Resource name for this acl. The resource name should be a topic or consumer group name.
	AclResourceName pulumi.StringInput
	// Resource pattern type for this acl. The resource pattern support two types "LITERAL" and "PREFIXED". "LITERAL": A literal name defines the full name of a resource. The special wildcard character "*" can be used to represent a resource with any name. "PREFIXED": A prefixed name defines a prefix for a resource.
	AclResourcePatternType pulumi.StringInput
	// Resource type for this acl. The resource type can only be "Topic" and "Group".
	AclResourceType pulumi.StringInput
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringInput
	// Username for the sasl user. The length should between 1 to 64 characters. The user should be an existed sasl user.
	Username pulumi.StringInput
}

The set of arguments for constructing a SaslAcl resource.

func (SaslAclArgs) ElementType

func (SaslAclArgs) ElementType() reflect.Type

type SaslAclInput added in v2.25.1

type SaslAclInput interface {
	pulumi.Input

	ToSaslAclOutput() SaslAclOutput
	ToSaslAclOutputWithContext(ctx context.Context) SaslAclOutput
}

type SaslAclOutput added in v2.25.1

type SaslAclOutput struct {
	*pulumi.OutputState
}

func (SaslAclOutput) ElementType added in v2.25.1

func (SaslAclOutput) ElementType() reflect.Type

func (SaslAclOutput) ToSaslAclOutput added in v2.25.1

func (o SaslAclOutput) ToSaslAclOutput() SaslAclOutput

func (SaslAclOutput) ToSaslAclOutputWithContext added in v2.25.1

func (o SaslAclOutput) ToSaslAclOutputWithContext(ctx context.Context) SaslAclOutput

type SaslAclState

type SaslAclState struct {
	// Operation type for this acl. The operation type can only be "Write" and "Read".
	AclOperationType pulumi.StringPtrInput
	// Resource name for this acl. The resource name should be a topic or consumer group name.
	AclResourceName pulumi.StringPtrInput
	// Resource pattern type for this acl. The resource pattern support two types "LITERAL" and "PREFIXED". "LITERAL": A literal name defines the full name of a resource. The special wildcard character "*" can be used to represent a resource with any name. "PREFIXED": A prefixed name defines a prefix for a resource.
	AclResourcePatternType pulumi.StringPtrInput
	// Resource type for this acl. The resource type can only be "Topic" and "Group".
	AclResourceType pulumi.StringPtrInput
	// The host of the acl.
	Host pulumi.StringPtrInput
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringPtrInput
	// Username for the sasl user. The length should between 1 to 64 characters. The user should be an existed sasl user.
	Username pulumi.StringPtrInput
}

func (SaslAclState) ElementType

func (SaslAclState) ElementType() reflect.Type

type SaslUser

type SaslUser struct {
	pulumi.CustomResourceState

	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringOutput `pulumi:"instanceId"`
	// An KMS encrypts password used to a db account. You have to specify one of `password` and `kmsEncryptedPassword` fields.
	KmsEncryptedPassword pulumi.StringPtrOutput `pulumi:"kmsEncryptedPassword"`
	// An KMS encryption context used to decrypt `kmsEncryptedPassword` before creating or updating a user with `kmsEncryptedPassword`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kmsEncryptedPassword` is set.
	KmsEncryptionContext pulumi.MapOutput `pulumi:"kmsEncryptionContext"`
	// Operation password. It may consist of letters, digits, or underlines, with a length of 1 to 64 characters. You have to specify one of `password` and `kmsEncryptedPassword` fields.
	Password pulumi.StringPtrOutput `pulumi:"password"`
	// Username for the sasl user. The length should between 1 to 64 characters. The characters can only contain 'a'-'z', 'A'-'Z', '0'-'9', '_' and '-'.
	Username pulumi.StringOutput `pulumi:"username"`
}

Provides an ALIKAFKA sasl user resource.

> **NOTE:** Available in 1.66.0+

> **NOTE:** Only the following regions support create alikafka sasl user. [`cn-hangzhou`,`cn-beijing`,`cn-shenzhen`,`cn-shanghai`,`cn-qingdao`,`cn-hongkong`,`cn-huhehaote`,`cn-zhangjiakou`,`ap-southeast-1`,`ap-south-1`,`ap-southeast-5`]

## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/alikafka"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		username := "testusername"
		if param := cfg.Get("username"); param != "" {
			username = param
		}
		password := "testpassword"
		if param := cfg.Get("password"); param != "" {
			password = param
		}
		opt0 := "VSwitch"
		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableResourceCreation: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
			VpcId:            defaultNetwork.ID(),
			CidrBlock:        pulumi.String("172.16.0.0/24"),
			AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		defaultInstance, err := alikafka.NewInstance(ctx, "defaultInstance", &alikafka.InstanceArgs{
			TopicQuota: pulumi.Int(50),
			DiskType:   pulumi.Int(1),
			DiskSize:   pulumi.Int(500),
			DeployType: pulumi.Int(5),
			IoMax:      pulumi.Int(20),
			VswitchId:  defaultSwitch.ID(),
		})
		if err != nil {
			return err
		}
		_, err = alikafka.NewSaslUser(ctx, "defaultSaslUser", &alikafka.SaslUserArgs{
			InstanceId: defaultInstance.ID(),
			Username:   pulumi.String(username),
			Password:   pulumi.String(password),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

ALIKAFKA GROUP can be imported using the id, e.g.

```sh

$ pulumi import alicloud:alikafka/saslUser:SaslUser user alikafka_post-cn-123455abc:username

```

func GetSaslUser

func GetSaslUser(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *SaslUserState, opts ...pulumi.ResourceOption) (*SaslUser, error)

GetSaslUser gets an existing SaslUser 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 NewSaslUser

func NewSaslUser(ctx *pulumi.Context,
	name string, args *SaslUserArgs, opts ...pulumi.ResourceOption) (*SaslUser, error)

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

func (SaslUser) ElementType added in v2.25.1

func (SaslUser) ElementType() reflect.Type

func (SaslUser) ToSaslUserOutput added in v2.25.1

func (i SaslUser) ToSaslUserOutput() SaslUserOutput

func (SaslUser) ToSaslUserOutputWithContext added in v2.25.1

func (i SaslUser) ToSaslUserOutputWithContext(ctx context.Context) SaslUserOutput

type SaslUserArgs

type SaslUserArgs struct {
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringInput
	// An KMS encrypts password used to a db account. You have to specify one of `password` and `kmsEncryptedPassword` fields.
	KmsEncryptedPassword pulumi.StringPtrInput
	// An KMS encryption context used to decrypt `kmsEncryptedPassword` before creating or updating a user with `kmsEncryptedPassword`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kmsEncryptedPassword` is set.
	KmsEncryptionContext pulumi.MapInput
	// Operation password. It may consist of letters, digits, or underlines, with a length of 1 to 64 characters. You have to specify one of `password` and `kmsEncryptedPassword` fields.
	Password pulumi.StringPtrInput
	// Username for the sasl user. The length should between 1 to 64 characters. The characters can only contain 'a'-'z', 'A'-'Z', '0'-'9', '_' and '-'.
	Username pulumi.StringInput
}

The set of arguments for constructing a SaslUser resource.

func (SaslUserArgs) ElementType

func (SaslUserArgs) ElementType() reflect.Type

type SaslUserInput added in v2.25.1

type SaslUserInput interface {
	pulumi.Input

	ToSaslUserOutput() SaslUserOutput
	ToSaslUserOutputWithContext(ctx context.Context) SaslUserOutput
}

type SaslUserOutput added in v2.25.1

type SaslUserOutput struct {
	*pulumi.OutputState
}

func (SaslUserOutput) ElementType added in v2.25.1

func (SaslUserOutput) ElementType() reflect.Type

func (SaslUserOutput) ToSaslUserOutput added in v2.25.1

func (o SaslUserOutput) ToSaslUserOutput() SaslUserOutput

func (SaslUserOutput) ToSaslUserOutputWithContext added in v2.25.1

func (o SaslUserOutput) ToSaslUserOutputWithContext(ctx context.Context) SaslUserOutput

type SaslUserState

type SaslUserState struct {
	// ID of the ALIKAFKA Instance that owns the groups.
	InstanceId pulumi.StringPtrInput
	// An KMS encrypts password used to a db account. You have to specify one of `password` and `kmsEncryptedPassword` fields.
	KmsEncryptedPassword pulumi.StringPtrInput
	// An KMS encryption context used to decrypt `kmsEncryptedPassword` before creating or updating a user with `kmsEncryptedPassword`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kmsEncryptedPassword` is set.
	KmsEncryptionContext pulumi.MapInput
	// Operation password. It may consist of letters, digits, or underlines, with a length of 1 to 64 characters. You have to specify one of `password` and `kmsEncryptedPassword` fields.
	Password pulumi.StringPtrInput
	// Username for the sasl user. The length should between 1 to 64 characters. The characters can only contain 'a'-'z', 'A'-'Z', '0'-'9', '_' and '-'.
	Username pulumi.StringPtrInput
}

func (SaslUserState) ElementType

func (SaslUserState) ElementType() reflect.Type

type Topic

type Topic struct {
	pulumi.CustomResourceState

	// Whether the topic is compactTopic or not. Compact topic must be a localTopic.
	CompactTopic pulumi.BoolPtrOutput `pulumi:"compactTopic"`
	// InstanceId of your Kafka resource, the topic will create in this instance.
	InstanceId pulumi.StringOutput `pulumi:"instanceId"`
	// Whether the topic is localTopic or not.
	LocalTopic pulumi.BoolPtrOutput `pulumi:"localTopic"`
	// The number of partitions of the topic. The number should between 1 and 48.
	PartitionNum pulumi.IntPtrOutput `pulumi:"partitionNum"`
	// This attribute is a concise description of topic. The length cannot exceed 64.
	Remark pulumi.StringOutput `pulumi:"remark"`
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapOutput `pulumi:"tags"`
	// Name of the topic. Two topics on a single instance cannot have the same name. The length cannot exceed 64 characters.
	Topic pulumi.StringOutput `pulumi:"topic"`
}

Provides an ALIKAFKA topic resource.

> **NOTE:** Available in 1.56.0+

> **NOTE:** Only the following regions support create alikafka topic. [`cn-hangzhou`,`cn-beijing`,`cn-shenzhen`,`cn-shanghai`,`cn-qingdao`,`cn-hongkong`,`cn-huhehaote`,`cn-zhangjiakou`,`ap-southeast-1`,`ap-south-1`,`ap-southeast-5`]

## Example Usage

Basic Usage

```go package main

import (

"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/alikafka"
"github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "VSwitch"
		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableResourceCreation: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
			VpcId:            defaultNetwork.ID(),
			CidrBlock:        pulumi.String("172.16.0.0/24"),
			AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		defaultInstance, err := alikafka.NewInstance(ctx, "defaultInstance", &alikafka.InstanceArgs{
			TopicQuota: pulumi.Int(50),
			DiskType:   pulumi.Int(1),
			DiskSize:   pulumi.Int(500),
			DeployType: pulumi.Int(5),
			IoMax:      pulumi.Int(20),
			VswitchId:  defaultSwitch.ID(),
		})
		if err != nil {
			return err
		}
		cfg := config.New(ctx, "")
		topic := "alikafkaTopicName"
		if param := cfg.Get("topic"); param != "" {
			topic = param
		}
		_, err = alikafka.NewTopic(ctx, "defaultTopic", &alikafka.TopicArgs{
			InstanceId:   defaultInstance.ID(),
			Topic:        pulumi.String(topic),
			LocalTopic:   pulumi.Bool(false),
			CompactTopic: pulumi.Bool(false),
			PartitionNum: pulumi.Int(12),
			Remark:       pulumi.String("dafault_kafka_topic_remark"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

ALIKAFKA TOPIC can be imported using the id, e.g.

```sh

$ pulumi import alicloud:alikafka/topic:Topic topic alikafka_post-cn-123455abc:topicName

```

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) ElementType() reflect.Type

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 {
	// Whether the topic is compactTopic or not. Compact topic must be a localTopic.
	CompactTopic pulumi.BoolPtrInput
	// InstanceId of your Kafka resource, the topic will create in this instance.
	InstanceId pulumi.StringInput
	// Whether the topic is localTopic or not.
	LocalTopic pulumi.BoolPtrInput
	// The number of partitions of the topic. The number should between 1 and 48.
	PartitionNum pulumi.IntPtrInput
	// This attribute is a concise description of topic. The length cannot exceed 64.
	Remark pulumi.StringInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapInput
	// Name of the topic. Two topics on a single instance cannot have the same name. The length cannot exceed 64 characters.
	Topic pulumi.StringInput
}

The set of arguments for constructing a Topic resource.

func (TopicArgs) ElementType

func (TopicArgs) ElementType() reflect.Type

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 {
	// Whether the topic is compactTopic or not. Compact topic must be a localTopic.
	CompactTopic pulumi.BoolPtrInput
	// InstanceId of your Kafka resource, the topic will create in this instance.
	InstanceId pulumi.StringPtrInput
	// Whether the topic is localTopic or not.
	LocalTopic pulumi.BoolPtrInput
	// The number of partitions of the topic. The number should between 1 and 48.
	PartitionNum pulumi.IntPtrInput
	// This attribute is a concise description of topic. The length cannot exceed 64.
	Remark pulumi.StringPtrInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.MapInput
	// Name of the topic. Two topics on a single instance cannot have the same name. The length cannot exceed 64 characters.
	Topic pulumi.StringPtrInput
}

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