1. Packages
  2. Volcengine
  3. API Docs
  4. kafka
  5. PublicAddress
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.kafka.PublicAddress

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Provides a resource to manage kafka public address

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooZones = Volcengine.Ecs.Zones.Invoke();
    
        var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
        {
            VpcName = "acc-test-vpc",
            CidrBlock = "172.16.0.0/16",
        });
    
        var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
        {
            SubnetName = "acc-test-subnet",
            CidrBlock = "172.16.0.0/24",
            ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
            VpcId = fooVpc.Id,
        });
    
        var fooInstance = new Volcengine.Kafka.Instance("fooInstance", new()
        {
            InstanceName = "acc-test-kafka",
            InstanceDescription = "tf-test",
            Version = "2.2.2",
            ComputeSpec = "kafka.20xrate.hw",
            SubnetId = fooSubnet.Id,
            UserName = "tf-user",
            UserPassword = "tf-pass!@q1",
            ChargeType = "PostPaid",
            StorageSpace = 300,
            PartitionNumber = 350,
            ProjectName = "default",
            Tags = new[]
            {
                new Volcengine.Kafka.Inputs.InstanceTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
            Parameters = new[]
            {
                new Volcengine.Kafka.Inputs.InstanceParameterArgs
                {
                    ParameterName = "MessageMaxByte",
                    ParameterValue = "12",
                },
                new Volcengine.Kafka.Inputs.InstanceParameterArgs
                {
                    ParameterName = "LogRetentionHours",
                    ParameterValue = "70",
                },
            },
        });
    
        var fooAddress = new Volcengine.Eip.Address("fooAddress", new()
        {
            BillingType = "PostPaidByBandwidth",
            Bandwidth = 1,
            Isp = "BGP",
            Description = "tf-test",
            ProjectName = "default",
        });
    
        var fooPublicAddress = new Volcengine.Kafka.PublicAddress("fooPublicAddress", new()
        {
            InstanceId = fooInstance.Id,
            EipId = fooAddress.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/eip"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/kafka"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooZones, err := ecs.Zones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
    			VpcName:   pulumi.String("acc-test-vpc"),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
    			SubnetName: pulumi.String("acc-test-subnet"),
    			CidrBlock:  pulumi.String("172.16.0.0/24"),
    			ZoneId:     *pulumi.String(fooZones.Zones[0].Id),
    			VpcId:      fooVpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		fooInstance, err := kafka.NewInstance(ctx, "fooInstance", &kafka.InstanceArgs{
    			InstanceName:        pulumi.String("acc-test-kafka"),
    			InstanceDescription: pulumi.String("tf-test"),
    			Version:             pulumi.String("2.2.2"),
    			ComputeSpec:         pulumi.String("kafka.20xrate.hw"),
    			SubnetId:            fooSubnet.ID(),
    			UserName:            pulumi.String("tf-user"),
    			UserPassword:        pulumi.String("tf-pass!@q1"),
    			ChargeType:          pulumi.String("PostPaid"),
    			StorageSpace:        pulumi.Int(300),
    			PartitionNumber:     pulumi.Int(350),
    			ProjectName:         pulumi.String("default"),
    			Tags: kafka.InstanceTagArray{
    				&kafka.InstanceTagArgs{
    					Key:   pulumi.String("k1"),
    					Value: pulumi.String("v1"),
    				},
    			},
    			Parameters: kafka.InstanceParameterArray{
    				&kafka.InstanceParameterArgs{
    					ParameterName:  pulumi.String("MessageMaxByte"),
    					ParameterValue: pulumi.String("12"),
    				},
    				&kafka.InstanceParameterArgs{
    					ParameterName:  pulumi.String("LogRetentionHours"),
    					ParameterValue: pulumi.String("70"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooAddress, err := eip.NewAddress(ctx, "fooAddress", &eip.AddressArgs{
    			BillingType: pulumi.String("PostPaidByBandwidth"),
    			Bandwidth:   pulumi.Int(1),
    			Isp:         pulumi.String("BGP"),
    			Description: pulumi.String("tf-test"),
    			ProjectName: pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = kafka.NewPublicAddress(ctx, "fooPublicAddress", &kafka.PublicAddressArgs{
    			InstanceId: fooInstance.ID(),
    			EipId:      fooAddress.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.ecs.EcsFunctions;
    import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
    import com.pulumi.volcengine.vpc.Vpc;
    import com.pulumi.volcengine.vpc.VpcArgs;
    import com.pulumi.volcengine.vpc.Subnet;
    import com.pulumi.volcengine.vpc.SubnetArgs;
    import com.pulumi.volcengine.kafka.Instance;
    import com.pulumi.volcengine.kafka.InstanceArgs;
    import com.pulumi.volcengine.kafka.inputs.InstanceTagArgs;
    import com.pulumi.volcengine.kafka.inputs.InstanceParameterArgs;
    import com.pulumi.volcengine.eip.Address;
    import com.pulumi.volcengine.eip.AddressArgs;
    import com.pulumi.volcengine.kafka.PublicAddress;
    import com.pulumi.volcengine.kafka.PublicAddressArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var fooZones = EcsFunctions.Zones();
    
            var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
                .vpcName("acc-test-vpc")
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
                .subnetName("acc-test-subnet")
                .cidrBlock("172.16.0.0/24")
                .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
                .vpcId(fooVpc.id())
                .build());
    
            var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
                .instanceName("acc-test-kafka")
                .instanceDescription("tf-test")
                .version("2.2.2")
                .computeSpec("kafka.20xrate.hw")
                .subnetId(fooSubnet.id())
                .userName("tf-user")
                .userPassword("tf-pass!@q1")
                .chargeType("PostPaid")
                .storageSpace(300)
                .partitionNumber(350)
                .projectName("default")
                .tags(InstanceTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .parameters(            
                    InstanceParameterArgs.builder()
                        .parameterName("MessageMaxByte")
                        .parameterValue("12")
                        .build(),
                    InstanceParameterArgs.builder()
                        .parameterName("LogRetentionHours")
                        .parameterValue("70")
                        .build())
                .build());
    
            var fooAddress = new Address("fooAddress", AddressArgs.builder()        
                .billingType("PostPaidByBandwidth")
                .bandwidth(1)
                .isp("BGP")
                .description("tf-test")
                .projectName("default")
                .build());
    
            var fooPublicAddress = new PublicAddress("fooPublicAddress", PublicAddressArgs.builder()        
                .instanceId(fooInstance.id())
                .eipId(fooAddress.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_zones = volcengine.ecs.zones()
    foo_vpc = volcengine.vpc.Vpc("fooVpc",
        vpc_name="acc-test-vpc",
        cidr_block="172.16.0.0/16")
    foo_subnet = volcengine.vpc.Subnet("fooSubnet",
        subnet_name="acc-test-subnet",
        cidr_block="172.16.0.0/24",
        zone_id=foo_zones.zones[0].id,
        vpc_id=foo_vpc.id)
    foo_instance = volcengine.kafka.Instance("fooInstance",
        instance_name="acc-test-kafka",
        instance_description="tf-test",
        version="2.2.2",
        compute_spec="kafka.20xrate.hw",
        subnet_id=foo_subnet.id,
        user_name="tf-user",
        user_password="tf-pass!@q1",
        charge_type="PostPaid",
        storage_space=300,
        partition_number=350,
        project_name="default",
        tags=[volcengine.kafka.InstanceTagArgs(
            key="k1",
            value="v1",
        )],
        parameters=[
            volcengine.kafka.InstanceParameterArgs(
                parameter_name="MessageMaxByte",
                parameter_value="12",
            ),
            volcengine.kafka.InstanceParameterArgs(
                parameter_name="LogRetentionHours",
                parameter_value="70",
            ),
        ])
    foo_address = volcengine.eip.Address("fooAddress",
        billing_type="PostPaidByBandwidth",
        bandwidth=1,
        isp="BGP",
        description="tf-test",
        project_name="default")
    foo_public_address = volcengine.kafka.PublicAddress("fooPublicAddress",
        instance_id=foo_instance.id,
        eip_id=foo_address.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooZones = volcengine.ecs.Zones({});
    const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
        vpcName: "acc-test-vpc",
        cidrBlock: "172.16.0.0/16",
    });
    const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
        subnetName: "acc-test-subnet",
        cidrBlock: "172.16.0.0/24",
        zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
        vpcId: fooVpc.id,
    });
    const fooInstance = new volcengine.kafka.Instance("fooInstance", {
        instanceName: "acc-test-kafka",
        instanceDescription: "tf-test",
        version: "2.2.2",
        computeSpec: "kafka.20xrate.hw",
        subnetId: fooSubnet.id,
        userName: "tf-user",
        userPassword: "tf-pass!@q1",
        chargeType: "PostPaid",
        storageSpace: 300,
        partitionNumber: 350,
        projectName: "default",
        tags: [{
            key: "k1",
            value: "v1",
        }],
        parameters: [
            {
                parameterName: "MessageMaxByte",
                parameterValue: "12",
            },
            {
                parameterName: "LogRetentionHours",
                parameterValue: "70",
            },
        ],
    });
    const fooAddress = new volcengine.eip.Address("fooAddress", {
        billingType: "PostPaidByBandwidth",
        bandwidth: 1,
        isp: "BGP",
        description: "tf-test",
        projectName: "default",
    });
    const fooPublicAddress = new volcengine.kafka.PublicAddress("fooPublicAddress", {
        instanceId: fooInstance.id,
        eipId: fooAddress.id,
    });
    
    resources:
      fooVpc:
        type: volcengine:vpc:Vpc
        properties:
          vpcName: acc-test-vpc
          cidrBlock: 172.16.0.0/16
      fooSubnet:
        type: volcengine:vpc:Subnet
        properties:
          subnetName: acc-test-subnet
          cidrBlock: 172.16.0.0/24
          zoneId: ${fooZones.zones[0].id}
          vpcId: ${fooVpc.id}
      fooInstance:
        type: volcengine:kafka:Instance
        properties:
          instanceName: acc-test-kafka
          instanceDescription: tf-test
          version: 2.2.2
          computeSpec: kafka.20xrate.hw
          subnetId: ${fooSubnet.id}
          userName: tf-user
          userPassword: tf-pass!@q1
          chargeType: PostPaid
          storageSpace: 300
          partitionNumber: 350
          projectName: default
          tags:
            - key: k1
              value: v1
          parameters:
            - parameterName: MessageMaxByte
              parameterValue: '12'
            - parameterName: LogRetentionHours
              parameterValue: '70'
      fooAddress:
        type: volcengine:eip:Address
        properties:
          billingType: PostPaidByBandwidth
          bandwidth: 1
          isp: BGP
          description: tf-test
          projectName: default
      fooPublicAddress:
        type: volcengine:kafka:PublicAddress
        properties:
          instanceId: ${fooInstance.id}
          eipId: ${fooAddress.id}
    variables:
      fooZones:
        fn::invoke:
          Function: volcengine:ecs:Zones
          Arguments: {}
    

    Create PublicAddress Resource

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

    Constructor syntax

    new PublicAddress(name: string, args: PublicAddressArgs, opts?: CustomResourceOptions);
    @overload
    def PublicAddress(resource_name: str,
                      args: PublicAddressArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def PublicAddress(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      eip_id: Optional[str] = None,
                      instance_id: Optional[str] = None)
    func NewPublicAddress(ctx *Context, name string, args PublicAddressArgs, opts ...ResourceOption) (*PublicAddress, error)
    public PublicAddress(string name, PublicAddressArgs args, CustomResourceOptions? opts = null)
    public PublicAddress(String name, PublicAddressArgs args)
    public PublicAddress(String name, PublicAddressArgs args, CustomResourceOptions options)
    
    type: volcengine:kafka:PublicAddress
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var publicAddressResource = new Volcengine.Kafka.PublicAddress("publicAddressResource", new()
    {
        EipId = "string",
        InstanceId = "string",
    });
    
    example, err := kafka.NewPublicAddress(ctx, "publicAddressResource", &kafka.PublicAddressArgs{
    	EipId:      pulumi.String("string"),
    	InstanceId: pulumi.String("string"),
    })
    
    var publicAddressResource = new PublicAddress("publicAddressResource", PublicAddressArgs.builder()
        .eipId("string")
        .instanceId("string")
        .build());
    
    public_address_resource = volcengine.kafka.PublicAddress("publicAddressResource",
        eip_id="string",
        instance_id="string")
    
    const publicAddressResource = new volcengine.kafka.PublicAddress("publicAddressResource", {
        eipId: "string",
        instanceId: "string",
    });
    
    type: volcengine:kafka:PublicAddress
    properties:
        eipId: string
        instanceId: string
    

    PublicAddress 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 PublicAddress resource accepts the following input properties:

    EipId string
    The id of eip.
    InstanceId string
    The id of kafka instance.
    EipId string
    The id of eip.
    InstanceId string
    The id of kafka instance.
    eipId String
    The id of eip.
    instanceId String
    The id of kafka instance.
    eipId string
    The id of eip.
    instanceId string
    The id of kafka instance.
    eip_id str
    The id of eip.
    instance_id str
    The id of kafka instance.
    eipId String
    The id of eip.
    instanceId String
    The id of kafka instance.

    Outputs

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

    EndpointType string
    The endpoint type of instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkType string
    The network type of instance.
    PublicEndpoint string
    The public endpoint of instance.
    EndpointType string
    The endpoint type of instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkType string
    The network type of instance.
    PublicEndpoint string
    The public endpoint of instance.
    endpointType String
    The endpoint type of instance.
    id String
    The provider-assigned unique ID for this managed resource.
    networkType String
    The network type of instance.
    publicEndpoint String
    The public endpoint of instance.
    endpointType string
    The endpoint type of instance.
    id string
    The provider-assigned unique ID for this managed resource.
    networkType string
    The network type of instance.
    publicEndpoint string
    The public endpoint of instance.
    endpoint_type str
    The endpoint type of instance.
    id str
    The provider-assigned unique ID for this managed resource.
    network_type str
    The network type of instance.
    public_endpoint str
    The public endpoint of instance.
    endpointType String
    The endpoint type of instance.
    id String
    The provider-assigned unique ID for this managed resource.
    networkType String
    The network type of instance.
    publicEndpoint String
    The public endpoint of instance.

    Look up Existing PublicAddress Resource

    Get an existing PublicAddress 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?: PublicAddressState, opts?: CustomResourceOptions): PublicAddress
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            eip_id: Optional[str] = None,
            endpoint_type: Optional[str] = None,
            instance_id: Optional[str] = None,
            network_type: Optional[str] = None,
            public_endpoint: Optional[str] = None) -> PublicAddress
    func GetPublicAddress(ctx *Context, name string, id IDInput, state *PublicAddressState, opts ...ResourceOption) (*PublicAddress, error)
    public static PublicAddress Get(string name, Input<string> id, PublicAddressState? state, CustomResourceOptions? opts = null)
    public static PublicAddress get(String name, Output<String> id, PublicAddressState 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:
    EipId string
    The id of eip.
    EndpointType string
    The endpoint type of instance.
    InstanceId string
    The id of kafka instance.
    NetworkType string
    The network type of instance.
    PublicEndpoint string
    The public endpoint of instance.
    EipId string
    The id of eip.
    EndpointType string
    The endpoint type of instance.
    InstanceId string
    The id of kafka instance.
    NetworkType string
    The network type of instance.
    PublicEndpoint string
    The public endpoint of instance.
    eipId String
    The id of eip.
    endpointType String
    The endpoint type of instance.
    instanceId String
    The id of kafka instance.
    networkType String
    The network type of instance.
    publicEndpoint String
    The public endpoint of instance.
    eipId string
    The id of eip.
    endpointType string
    The endpoint type of instance.
    instanceId string
    The id of kafka instance.
    networkType string
    The network type of instance.
    publicEndpoint string
    The public endpoint of instance.
    eip_id str
    The id of eip.
    endpoint_type str
    The endpoint type of instance.
    instance_id str
    The id of kafka instance.
    network_type str
    The network type of instance.
    public_endpoint str
    The public endpoint of instance.
    eipId String
    The id of eip.
    endpointType String
    The endpoint type of instance.
    instanceId String
    The id of kafka instance.
    networkType String
    The network type of instance.
    publicEndpoint String
    The public endpoint of instance.

    Import

    KafkaPublicAddress can be imported using the instance_id:eip_id, e.g.

     $ pulumi import volcengine:kafka/publicAddress:PublicAddress default instance_id:eip_id
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine