Upstash

v0.0.21 published on Thursday, Aug 4, 2022 by Upstash

KafkaCredential

Example Usage

using Pulumi;
using Upstash = Pulumi.Upstash;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleKafkaCluster = new Upstash.KafkaCluster("exampleKafkaCluster", new Upstash.KafkaClusterArgs
        {
            ClusterName = @var.Cluster_name,
            Region = @var.Region,
            Multizone = @var.Multizone,
        });
        var exampleKafkaTopic = new Upstash.KafkaTopic("exampleKafkaTopic", new Upstash.KafkaTopicArgs
        {
            TopicName = @var.Topic_name,
            Partitions = @var.Partitions,
            RetentionTime = @var.Retention_time,
            RetentionSize = @var.Retention_size,
            MaxMessageSize = @var.Max_message_size,
            CleanupPolicy = @var.Cleanup_policy,
            ClusterId = resource.Upstash_kafka_cluster.ExampleKafkaCluster.Cluster_id,
        });
        var exampleKafkaCredential = new Upstash.KafkaCredential("exampleKafkaCredential", new Upstash.KafkaCredentialArgs
        {
            ClusterId = exampleKafkaCluster.ClusterId,
            CredentialName = "credentialFromTerraform",
            Topic = exampleKafkaTopic.TopicName,
            Permissions = "ALL",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/upstash/upstash-pulumi-provider/sdk/go/upstash"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleKafkaCluster, err := upstash.NewKafkaCluster(ctx, "exampleKafkaCluster", &upstash.KafkaClusterArgs{
			ClusterName: pulumi.Any(_var.Cluster_name),
			Region:      pulumi.Any(_var.Region),
			Multizone:   pulumi.Any(_var.Multizone),
		})
		if err != nil {
			return err
		}
		exampleKafkaTopic, err := upstash.NewKafkaTopic(ctx, "exampleKafkaTopic", &upstash.KafkaTopicArgs{
			TopicName:      pulumi.Any(_var.Topic_name),
			Partitions:     pulumi.Any(_var.Partitions),
			RetentionTime:  pulumi.Any(_var.Retention_time),
			RetentionSize:  pulumi.Any(_var.Retention_size),
			MaxMessageSize: pulumi.Any(_var.Max_message_size),
			CleanupPolicy:  pulumi.Any(_var.Cleanup_policy),
			ClusterId:      pulumi.Any(resource.Upstash_kafka_cluster.ExampleKafkaCluster.Cluster_id),
		})
		if err != nil {
			return err
		}
		_, err = upstash.NewKafkaCredential(ctx, "exampleKafkaCredential", &upstash.KafkaCredentialArgs{
			ClusterId:      exampleKafkaCluster.ClusterId,
			CredentialName: pulumi.String("credentialFromTerraform"),
			Topic:          exampleKafkaTopic.TopicName,
			Permissions:    pulumi.String("ALL"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleKafkaCluster = new KafkaCluster("exampleKafkaCluster", KafkaClusterArgs.builder()        
            .clusterName(var_.cluster_name())
            .region(var_.region())
            .multizone(var_.multizone())
            .build());

        var exampleKafkaTopic = new KafkaTopic("exampleKafkaTopic", KafkaTopicArgs.builder()        
            .topicName(var_.topic_name())
            .partitions(var_.partitions())
            .retentionTime(var_.retention_time())
            .retentionSize(var_.retention_size())
            .maxMessageSize(var_.max_message_size())
            .cleanupPolicy(var_.cleanup_policy())
            .clusterId(resource.upstash_kafka_cluster().exampleKafkaCluster().cluster_id())
            .build());

        var exampleKafkaCredential = new KafkaCredential("exampleKafkaCredential", KafkaCredentialArgs.builder()        
            .clusterId(exampleKafkaCluster.clusterId())
            .credentialName("credentialFromTerraform")
            .topic(exampleKafkaTopic.topicName())
            .permissions("ALL")
            .build());

    }
}
import pulumi
import upstash_pulumi as upstash

example_kafka_cluster = upstash.KafkaCluster("exampleKafkaCluster",
    cluster_name=var["cluster_name"],
    region=var["region"],
    multizone=var["multizone"])
example_kafka_topic = upstash.KafkaTopic("exampleKafkaTopic",
    topic_name=var["topic_name"],
    partitions=var["partitions"],
    retention_time=var["retention_time"],
    retention_size=var["retention_size"],
    max_message_size=var["max_message_size"],
    cleanup_policy=var["cleanup_policy"],
    cluster_id=resource["upstash_kafka_cluster"]["exampleKafkaCluster"]["cluster_id"])
example_kafka_credential = upstash.KafkaCredential("exampleKafkaCredential",
    cluster_id=example_kafka_cluster.cluster_id,
    credential_name="credentialFromTerraform",
    topic=example_kafka_topic.topic_name,
    permissions="ALL")
import * as pulumi from "@pulumi/pulumi";
import * as pulumi from "@upstash/pulumi";

const exampleKafkaCluster = new upstash.KafkaCluster("exampleKafkaCluster", {
    clusterName: _var.cluster_name,
    region: _var.region,
    multizone: _var.multizone,
});
const exampleKafkaTopic = new upstash.KafkaTopic("exampleKafkaTopic", {
    topicName: _var.topic_name,
    partitions: _var.partitions,
    retentionTime: _var.retention_time,
    retentionSize: _var.retention_size,
    maxMessageSize: _var.max_message_size,
    cleanupPolicy: _var.cleanup_policy,
    clusterId: resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id,
});
const exampleKafkaCredential = new upstash.KafkaCredential("exampleKafkaCredential", {
    clusterId: exampleKafkaCluster.clusterId,
    credentialName: "credentialFromTerraform",
    topic: exampleKafkaTopic.topicName,
    permissions: "ALL",
});
resources:
  exampleKafkaCluster:
    type: upstash:KafkaCluster
    properties:
      clusterName: ${var.cluster_name}
      region: ${var.region}
      multizone: ${var.multizone}
  exampleKafkaTopic:
    type: upstash:KafkaTopic
    properties:
      topicName: ${var.topic_name}
      partitions: ${var.partitions}
      retentionTime: ${var.retention_time}
      retentionSize: ${var.retention_size}
      maxMessageSize: ${var.max_message_size}
      cleanupPolicy: ${var.cleanup_policy}
      clusterId: ${resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id}
  exampleKafkaCredential:
    type: upstash:KafkaCredential
    properties:
      clusterId: ${exampleKafkaCluster.clusterId}
      credentialName: credentialFromTerraform
      topic: ${exampleKafkaTopic.topicName}
      permissions: ALL

Create KafkaCredential Resource

new KafkaCredential(name: string, args: KafkaCredentialArgs, opts?: CustomResourceOptions);
@overload
def KafkaCredential(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    cluster_id: Optional[str] = None,
                    credential_name: Optional[str] = None,
                    permissions: Optional[str] = None,
                    topic: Optional[str] = None)
@overload
def KafkaCredential(resource_name: str,
                    args: KafkaCredentialArgs,
                    opts: Optional[ResourceOptions] = None)
func NewKafkaCredential(ctx *Context, name string, args KafkaCredentialArgs, opts ...ResourceOption) (*KafkaCredential, error)
public KafkaCredential(string name, KafkaCredentialArgs args, CustomResourceOptions? opts = null)
public KafkaCredential(String name, KafkaCredentialArgs args)
public KafkaCredential(String name, KafkaCredentialArgs args, CustomResourceOptions options)
type: upstash:KafkaCredential
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args KafkaCredentialArgs
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 KafkaCredentialArgs
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 KafkaCredentialArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args KafkaCredentialArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args KafkaCredentialArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

KafkaCredential Resource Properties

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

Inputs

The KafkaCredential resource accepts the following input properties:

ClusterId string

ID of the kafka cluster

CredentialName string

Name of the kafka credential

Permissions string

Permission scope given to the kafka credential

Topic string

Name of the kafka topic

ClusterId string

ID of the kafka cluster

CredentialName string

Name of the kafka credential

Permissions string

Permission scope given to the kafka credential

Topic string

Name of the kafka topic

clusterId String

ID of the kafka cluster

credentialName String

Name of the kafka credential

permissions String

Permission scope given to the kafka credential

topic String

Name of the kafka topic

clusterId string

ID of the kafka cluster

credentialName string

Name of the kafka credential

permissions string

Permission scope given to the kafka credential

topic string

Name of the kafka topic

cluster_id str

ID of the kafka cluster

credential_name str

Name of the kafka credential

permissions str

Permission scope given to the kafka credential

topic str

Name of the kafka topic

clusterId String

ID of the kafka cluster

credentialName String

Name of the kafka credential

permissions String

Permission scope given to the kafka credential

topic String

Name of the kafka topic

Outputs

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

CreationTime int

Creation time of the credential

CredentialId string

Unique ID of the kafka credential

Id string

The provider-assigned unique ID for this managed resource.

Password string

Password to be used in authenticating to the cluster

State string

State of the credential(active or deleted)

Username string

Username to be used for the kafka credential

CreationTime int

Creation time of the credential

CredentialId string

Unique ID of the kafka credential

Id string

The provider-assigned unique ID for this managed resource.

Password string

Password to be used in authenticating to the cluster

State string

State of the credential(active or deleted)

Username string

Username to be used for the kafka credential

creationTime Integer

Creation time of the credential

credentialId String

Unique ID of the kafka credential

id String

The provider-assigned unique ID for this managed resource.

password String

Password to be used in authenticating to the cluster

state String

State of the credential(active or deleted)

username String

Username to be used for the kafka credential

creationTime number

Creation time of the credential

credentialId string

Unique ID of the kafka credential

id string

The provider-assigned unique ID for this managed resource.

password string

Password to be used in authenticating to the cluster

state string

State of the credential(active or deleted)

username string

Username to be used for the kafka credential

creation_time int

Creation time of the credential

credential_id str

Unique ID of the kafka credential

id str

The provider-assigned unique ID for this managed resource.

password str

Password to be used in authenticating to the cluster

state str

State of the credential(active or deleted)

username str

Username to be used for the kafka credential

creationTime Number

Creation time of the credential

credentialId String

Unique ID of the kafka credential

id String

The provider-assigned unique ID for this managed resource.

password String

Password to be used in authenticating to the cluster

state String

State of the credential(active or deleted)

username String

Username to be used for the kafka credential

Look up Existing KafkaCredential Resource

Get an existing KafkaCredential 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?: KafkaCredentialState, opts?: CustomResourceOptions): KafkaCredential
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        creation_time: Optional[int] = None,
        credential_id: Optional[str] = None,
        credential_name: Optional[str] = None,
        password: Optional[str] = None,
        permissions: Optional[str] = None,
        state: Optional[str] = None,
        topic: Optional[str] = None,
        username: Optional[str] = None) -> KafkaCredential
func GetKafkaCredential(ctx *Context, name string, id IDInput, state *KafkaCredentialState, opts ...ResourceOption) (*KafkaCredential, error)
public static KafkaCredential Get(string name, Input<string> id, KafkaCredentialState? state, CustomResourceOptions? opts = null)
public static KafkaCredential get(String name, Output<String> id, KafkaCredentialState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ClusterId string

ID of the kafka cluster

CreationTime int

Creation time of the credential

CredentialId string

Unique ID of the kafka credential

CredentialName string

Name of the kafka credential

Password string

Password to be used in authenticating to the cluster

Permissions string

Permission scope given to the kafka credential

State string

State of the credential(active or deleted)

Topic string

Name of the kafka topic

Username string

Username to be used for the kafka credential

ClusterId string

ID of the kafka cluster

CreationTime int

Creation time of the credential

CredentialId string

Unique ID of the kafka credential

CredentialName string

Name of the kafka credential

Password string

Password to be used in authenticating to the cluster

Permissions string

Permission scope given to the kafka credential

State string

State of the credential(active or deleted)

Topic string

Name of the kafka topic

Username string

Username to be used for the kafka credential

clusterId String

ID of the kafka cluster

creationTime Integer

Creation time of the credential

credentialId String

Unique ID of the kafka credential

credentialName String

Name of the kafka credential

password String

Password to be used in authenticating to the cluster

permissions String

Permission scope given to the kafka credential

state String

State of the credential(active or deleted)

topic String

Name of the kafka topic

username String

Username to be used for the kafka credential

clusterId string

ID of the kafka cluster

creationTime number

Creation time of the credential

credentialId string

Unique ID of the kafka credential

credentialName string

Name of the kafka credential

password string

Password to be used in authenticating to the cluster

permissions string

Permission scope given to the kafka credential

state string

State of the credential(active or deleted)

topic string

Name of the kafka topic

username string

Username to be used for the kafka credential

cluster_id str

ID of the kafka cluster

creation_time int

Creation time of the credential

credential_id str

Unique ID of the kafka credential

credential_name str

Name of the kafka credential

password str

Password to be used in authenticating to the cluster

permissions str

Permission scope given to the kafka credential

state str

State of the credential(active or deleted)

topic str

Name of the kafka topic

username str

Username to be used for the kafka credential

clusterId String

ID of the kafka cluster

creationTime Number

Creation time of the credential

credentialId String

Unique ID of the kafka credential

credentialName String

Name of the kafka credential

password String

Password to be used in authenticating to the cluster

permissions String

Permission scope given to the kafka credential

state String

State of the credential(active or deleted)

topic String

Name of the kafka topic

username String

Username to be used for the kafka credential

Package Details

Repository
https://github.com/upstash/upstash-pulumi-provider
License
Apache-2.0
Notes

This Pulumi package is based on the upstash Terraform Provider.