1. Packages
  2. Volcengine
  3. API Docs
  4. rocketmq
  5. RocketMQAllowListAssociate
Volcengine v0.0.29 published on Tuesday, Apr 29, 2025 by Volcengine

volcengine.rocketmq.RocketMQAllowListAssociate

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.29 published on Tuesday, Apr 29, 2025 by Volcengine

    Provides a resource to manage rocketmq allow list associate

    Example Usage

    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 fooRocketMQInstance = new volcengine.rocketmq.RocketMQInstance("fooRocketMQInstance", {
        zoneIds: [fooZones.then(fooZones => fooZones.zones?.[0]?.id)],
        subnetId: fooSubnet.id,
        version: "4.8",
        computeSpec: "rocketmq.n1.x2.micro",
        storageSpace: 300,
        autoScaleQueue: true,
        fileReservedTime: 10,
        instanceName: "acc-test-rocketmq",
        instanceDescription: "acc-test",
        projectName: "default",
        chargeInfo: {
            chargeType: "PostPaid",
        },
        tags: [{
            key: "k1",
            value: "v1",
        }],
    });
    const fooRocketMQAllowList = new volcengine.rocketmq.RocketMQAllowList("fooRocketMQAllowList", {
        allowListName: "acc-test-allow-list",
        allowListDesc: "acc-test",
        allowLists: [
            "192.168.0.0/24",
            "192.168.2.0/24",
        ],
    });
    const fooRocketMQAllowListAssociate = new volcengine.rocketmq.RocketMQAllowListAssociate("fooRocketMQAllowListAssociate", {
        instanceId: fooRocketMQInstance.id,
        allowListId: fooRocketMQAllowList.id,
    });
    
    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_rocket_mq_instance = volcengine.rocketmq.RocketMQInstance("fooRocketMQInstance",
        zone_ids=[foo_zones.zones[0].id],
        subnet_id=foo_subnet.id,
        version="4.8",
        compute_spec="rocketmq.n1.x2.micro",
        storage_space=300,
        auto_scale_queue=True,
        file_reserved_time=10,
        instance_name="acc-test-rocketmq",
        instance_description="acc-test",
        project_name="default",
        charge_info=volcengine.rocketmq.RocketMQInstanceChargeInfoArgs(
            charge_type="PostPaid",
        ),
        tags=[volcengine.rocketmq.RocketMQInstanceTagArgs(
            key="k1",
            value="v1",
        )])
    foo_rocket_mq_allow_list = volcengine.rocketmq.RocketMQAllowList("fooRocketMQAllowList",
        allow_list_name="acc-test-allow-list",
        allow_list_desc="acc-test",
        allow_lists=[
            "192.168.0.0/24",
            "192.168.2.0/24",
        ])
    foo_rocket_mq_allow_list_associate = volcengine.rocketmq.RocketMQAllowListAssociate("fooRocketMQAllowListAssociate",
        instance_id=foo_rocket_mq_instance.id,
        allow_list_id=foo_rocket_mq_allow_list.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/rocketmq"
    	"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
    		}
    		fooRocketMQInstance, err := rocketmq.NewRocketMQInstance(ctx, "fooRocketMQInstance", &rocketmq.RocketMQInstanceArgs{
    			ZoneIds: pulumi.StringArray{
    				pulumi.String(fooZones.Zones[0].Id),
    			},
    			SubnetId:            fooSubnet.ID(),
    			Version:             pulumi.String("4.8"),
    			ComputeSpec:         pulumi.String("rocketmq.n1.x2.micro"),
    			StorageSpace:        pulumi.Int(300),
    			AutoScaleQueue:      pulumi.Bool(true),
    			FileReservedTime:    pulumi.Int(10),
    			InstanceName:        pulumi.String("acc-test-rocketmq"),
    			InstanceDescription: pulumi.String("acc-test"),
    			ProjectName:         pulumi.String("default"),
    			ChargeInfo: &rocketmq.RocketMQInstanceChargeInfoArgs{
    				ChargeType: pulumi.String("PostPaid"),
    			},
    			Tags: rocketmq.RocketMQInstanceTagArray{
    				&rocketmq.RocketMQInstanceTagArgs{
    					Key:   pulumi.String("k1"),
    					Value: pulumi.String("v1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooRocketMQAllowList, err := rocketmq.NewRocketMQAllowList(ctx, "fooRocketMQAllowList", &rocketmq.RocketMQAllowListArgs{
    			AllowListName: pulumi.String("acc-test-allow-list"),
    			AllowListDesc: pulumi.String("acc-test"),
    			AllowLists: pulumi.StringArray{
    				pulumi.String("192.168.0.0/24"),
    				pulumi.String("192.168.2.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = rocketmq.NewRocketMQAllowListAssociate(ctx, "fooRocketMQAllowListAssociate", &rocketmq.RocketMQAllowListAssociateArgs{
    			InstanceId:  fooRocketMQInstance.ID(),
    			AllowListId: fooRocketMQAllowList.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 fooRocketMQInstance = new Volcengine.Rocketmq.RocketMQInstance("fooRocketMQInstance", new()
        {
            ZoneIds = new[]
            {
                fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
            },
            SubnetId = fooSubnet.Id,
            Version = "4.8",
            ComputeSpec = "rocketmq.n1.x2.micro",
            StorageSpace = 300,
            AutoScaleQueue = true,
            FileReservedTime = 10,
            InstanceName = "acc-test-rocketmq",
            InstanceDescription = "acc-test",
            ProjectName = "default",
            ChargeInfo = new Volcengine.Rocketmq.Inputs.RocketMQInstanceChargeInfoArgs
            {
                ChargeType = "PostPaid",
            },
            Tags = new[]
            {
                new Volcengine.Rocketmq.Inputs.RocketMQInstanceTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
        });
    
        var fooRocketMQAllowList = new Volcengine.Rocketmq.RocketMQAllowList("fooRocketMQAllowList", new()
        {
            AllowListName = "acc-test-allow-list",
            AllowListDesc = "acc-test",
            AllowLists = new[]
            {
                "192.168.0.0/24",
                "192.168.2.0/24",
            },
        });
    
        var fooRocketMQAllowListAssociate = new Volcengine.Rocketmq.RocketMQAllowListAssociate("fooRocketMQAllowListAssociate", new()
        {
            InstanceId = fooRocketMQInstance.Id,
            AllowListId = fooRocketMQAllowList.Id,
        });
    
    });
    
    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.rocketmq.RocketMQInstance;
    import com.pulumi.volcengine.rocketmq.RocketMQInstanceArgs;
    import com.pulumi.volcengine.rocketmq.inputs.RocketMQInstanceChargeInfoArgs;
    import com.pulumi.volcengine.rocketmq.inputs.RocketMQInstanceTagArgs;
    import com.pulumi.volcengine.rocketmq.RocketMQAllowList;
    import com.pulumi.volcengine.rocketmq.RocketMQAllowListArgs;
    import com.pulumi.volcengine.rocketmq.RocketMQAllowListAssociate;
    import com.pulumi.volcengine.rocketmq.RocketMQAllowListAssociateArgs;
    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 fooRocketMQInstance = new RocketMQInstance("fooRocketMQInstance", RocketMQInstanceArgs.builder()        
                .zoneIds(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
                .subnetId(fooSubnet.id())
                .version("4.8")
                .computeSpec("rocketmq.n1.x2.micro")
                .storageSpace(300)
                .autoScaleQueue(true)
                .fileReservedTime(10)
                .instanceName("acc-test-rocketmq")
                .instanceDescription("acc-test")
                .projectName("default")
                .chargeInfo(RocketMQInstanceChargeInfoArgs.builder()
                    .chargeType("PostPaid")
                    .build())
                .tags(RocketMQInstanceTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .build());
    
            var fooRocketMQAllowList = new RocketMQAllowList("fooRocketMQAllowList", RocketMQAllowListArgs.builder()        
                .allowListName("acc-test-allow-list")
                .allowListDesc("acc-test")
                .allowLists(            
                    "192.168.0.0/24",
                    "192.168.2.0/24")
                .build());
    
            var fooRocketMQAllowListAssociate = new RocketMQAllowListAssociate("fooRocketMQAllowListAssociate", RocketMQAllowListAssociateArgs.builder()        
                .instanceId(fooRocketMQInstance.id())
                .allowListId(fooRocketMQAllowList.id())
                .build());
    
        }
    }
    
    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}
      fooRocketMQInstance:
        type: volcengine:rocketmq:RocketMQInstance
        properties:
          zoneIds:
            - ${fooZones.zones[0].id}
          subnetId: ${fooSubnet.id}
          version: '4.8'
          computeSpec: rocketmq.n1.x2.micro
          storageSpace: 300
          autoScaleQueue: true
          fileReservedTime: 10
          instanceName: acc-test-rocketmq
          instanceDescription: acc-test
          projectName: default
          chargeInfo:
            chargeType: PostPaid
          tags:
            - key: k1
              value: v1
      fooRocketMQAllowList:
        type: volcengine:rocketmq:RocketMQAllowList
        properties:
          allowListName: acc-test-allow-list
          allowListDesc: acc-test
          allowLists:
            - 192.168.0.0/24
            - 192.168.2.0/24
      fooRocketMQAllowListAssociate:
        type: volcengine:rocketmq:RocketMQAllowListAssociate
        properties:
          instanceId: ${fooRocketMQInstance.id}
          allowListId: ${fooRocketMQAllowList.id}
    variables:
      fooZones:
        fn::invoke:
          Function: volcengine:ecs:Zones
          Arguments: {}
    

    Create RocketMQAllowListAssociate Resource

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

    Constructor syntax

    new RocketMQAllowListAssociate(name: string, args: RocketMQAllowListAssociateArgs, opts?: CustomResourceOptions);
    @overload
    def RocketMQAllowListAssociate(resource_name: str,
                                   args: RocketMQAllowListAssociateArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def RocketMQAllowListAssociate(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   allow_list_id: Optional[str] = None,
                                   instance_id: Optional[str] = None)
    func NewRocketMQAllowListAssociate(ctx *Context, name string, args RocketMQAllowListAssociateArgs, opts ...ResourceOption) (*RocketMQAllowListAssociate, error)
    public RocketMQAllowListAssociate(string name, RocketMQAllowListAssociateArgs args, CustomResourceOptions? opts = null)
    public RocketMQAllowListAssociate(String name, RocketMQAllowListAssociateArgs args)
    public RocketMQAllowListAssociate(String name, RocketMQAllowListAssociateArgs args, CustomResourceOptions options)
    
    type: volcengine:rocketmq:RocketMQAllowListAssociate
    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 RocketMQAllowListAssociateArgs
    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 RocketMQAllowListAssociateArgs
    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 RocketMQAllowListAssociateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RocketMQAllowListAssociateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RocketMQAllowListAssociateArgs
    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 rocketMQAllowListAssociateResource = new Volcengine.Rocketmq.RocketMQAllowListAssociate("rocketMQAllowListAssociateResource", new()
    {
        AllowListId = "string",
        InstanceId = "string",
    });
    
    example, err := rocketmq.NewRocketMQAllowListAssociate(ctx, "rocketMQAllowListAssociateResource", &rocketmq.RocketMQAllowListAssociateArgs{
    	AllowListId: pulumi.String("string"),
    	InstanceId:  pulumi.String("string"),
    })
    
    var rocketMQAllowListAssociateResource = new RocketMQAllowListAssociate("rocketMQAllowListAssociateResource", RocketMQAllowListAssociateArgs.builder()
        .allowListId("string")
        .instanceId("string")
        .build());
    
    rocket_mq_allow_list_associate_resource = volcengine.rocketmq.RocketMQAllowListAssociate("rocketMQAllowListAssociateResource",
        allow_list_id="string",
        instance_id="string")
    
    const rocketMQAllowListAssociateResource = new volcengine.rocketmq.RocketMQAllowListAssociate("rocketMQAllowListAssociateResource", {
        allowListId: "string",
        instanceId: "string",
    });
    
    type: volcengine:rocketmq:RocketMQAllowListAssociate
    properties:
        allowListId: string
        instanceId: string
    

    RocketMQAllowListAssociate Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The RocketMQAllowListAssociate resource accepts the following input properties:

    AllowListId string
    The id of the rocketmq allow list.
    InstanceId string
    The id of the rocketmq instance.
    AllowListId string
    The id of the rocketmq allow list.
    InstanceId string
    The id of the rocketmq instance.
    allowListId String
    The id of the rocketmq allow list.
    instanceId String
    The id of the rocketmq instance.
    allowListId string
    The id of the rocketmq allow list.
    instanceId string
    The id of the rocketmq instance.
    allow_list_id str
    The id of the rocketmq allow list.
    instance_id str
    The id of the rocketmq instance.
    allowListId String
    The id of the rocketmq allow list.
    instanceId String
    The id of the rocketmq instance.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RocketMQAllowListAssociate Resource

    Get an existing RocketMQAllowListAssociate 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?: RocketMQAllowListAssociateState, opts?: CustomResourceOptions): RocketMQAllowListAssociate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allow_list_id: Optional[str] = None,
            instance_id: Optional[str] = None) -> RocketMQAllowListAssociate
    func GetRocketMQAllowListAssociate(ctx *Context, name string, id IDInput, state *RocketMQAllowListAssociateState, opts ...ResourceOption) (*RocketMQAllowListAssociate, error)
    public static RocketMQAllowListAssociate Get(string name, Input<string> id, RocketMQAllowListAssociateState? state, CustomResourceOptions? opts = null)
    public static RocketMQAllowListAssociate get(String name, Output<String> id, RocketMQAllowListAssociateState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:rocketmq:RocketMQAllowListAssociate    get:      id: ${id}
    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:
    AllowListId string
    The id of the rocketmq allow list.
    InstanceId string
    The id of the rocketmq instance.
    AllowListId string
    The id of the rocketmq allow list.
    InstanceId string
    The id of the rocketmq instance.
    allowListId String
    The id of the rocketmq allow list.
    instanceId String
    The id of the rocketmq instance.
    allowListId string
    The id of the rocketmq allow list.
    instanceId string
    The id of the rocketmq instance.
    allow_list_id str
    The id of the rocketmq allow list.
    instance_id str
    The id of the rocketmq instance.
    allowListId String
    The id of the rocketmq allow list.
    instanceId String
    The id of the rocketmq instance.

    Import

    RocketmqAllowListAssociate can be imported using the instance_id:allow_list_id, e.g.

    $ pulumi import volcengine:rocketmq/rocketMQAllowListAssociate:RocketMQAllowListAssociate default resource_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.29 published on Tuesday, Apr 29, 2025 by Volcengine