1. Packages
  2. Volcengine
  3. API Docs
  4. redis
  5. AllowLists
Volcengine v0.0.25 published on Tuesday, Jul 2, 2024 by Volcengine

volcengine.redis.AllowLists

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.25 published on Tuesday, Jul 2, 2024 by Volcengine

    Use this data source to query detailed information of redis allow lists

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooAllowList = new Volcengine.Redis.AllowList("fooAllowList", new()
        {
            AllowLists = new[]
            {
                "192.168.0.0/24",
            },
            AllowListName = "acc-test-allowlist",
        });
    
        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.Redis.Instance("fooInstance", new()
        {
            ZoneIds = new[]
            {
                fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
            },
            InstanceName = "acc-test-tf-redis",
            ShardedCluster = 1,
            Password = "1qaz!QAZ12",
            NodeNumber = 2,
            ShardCapacity = 1024,
            ShardNumber = 2,
            EngineVersion = "5.0",
            SubnetId = fooSubnet.Id,
            DeletionProtection = "disabled",
            VpcAuthMode = "close",
            ChargeType = "PostPaid",
            Port = 6381,
            ProjectName = "default",
        });
    
        var fooAllowListAssociate = new Volcengine.Redis.AllowListAssociate("fooAllowListAssociate", new()
        {
            AllowListId = fooAllowList.Id,
            InstanceId = fooInstance.Id,
        });
    
        var fooAllowLists = Volcengine.Redis.AllowLists.Invoke(new()
        {
            InstanceId = fooAllowListAssociate.InstanceId,
            RegionId = "cn-beijing",
            NameRegex = fooAllowList.AllowListName,
        });
    
    });
    
    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/redis"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooAllowList, err := redis.NewAllowList(ctx, "fooAllowList", &redis.AllowListArgs{
    			AllowLists: pulumi.StringArray{
    				pulumi.String("192.168.0.0/24"),
    			},
    			AllowListName: pulumi.String("acc-test-allowlist"),
    		})
    		if err != nil {
    			return err
    		}
    		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 := redis.NewInstance(ctx, "fooInstance", &redis.InstanceArgs{
    			ZoneIds: pulumi.StringArray{
    				*pulumi.String(fooZones.Zones[0].Id),
    			},
    			InstanceName:       pulumi.String("acc-test-tf-redis"),
    			ShardedCluster:     pulumi.Int(1),
    			Password:           pulumi.String("1qaz!QAZ12"),
    			NodeNumber:         pulumi.Int(2),
    			ShardCapacity:      pulumi.Int(1024),
    			ShardNumber:        pulumi.Int(2),
    			EngineVersion:      pulumi.String("5.0"),
    			SubnetId:           fooSubnet.ID(),
    			DeletionProtection: pulumi.String("disabled"),
    			VpcAuthMode:        pulumi.String("close"),
    			ChargeType:         pulumi.String("PostPaid"),
    			Port:               pulumi.Int(6381),
    			ProjectName:        pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		fooAllowListAssociate, err := redis.NewAllowListAssociate(ctx, "fooAllowListAssociate", &redis.AllowListAssociateArgs{
    			AllowListId: fooAllowList.ID(),
    			InstanceId:  fooInstance.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_ = redis.AllowListsOutput(ctx, redis.AllowListsOutputArgs{
    			InstanceId: fooAllowListAssociate.InstanceId,
    			RegionId:   pulumi.String("cn-beijing"),
    			NameRegex:  fooAllowList.AllowListName,
    		}, nil)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.redis.AllowList;
    import com.pulumi.volcengine.redis.AllowListArgs;
    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.redis.Instance;
    import com.pulumi.volcengine.redis.InstanceArgs;
    import com.pulumi.volcengine.redis.AllowListAssociate;
    import com.pulumi.volcengine.redis.AllowListAssociateArgs;
    import com.pulumi.volcengine.redis.RedisFunctions;
    import com.pulumi.volcengine.redis.inputs.AllowListsArgs;
    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) {
            var fooAllowList = new AllowList("fooAllowList", AllowListArgs.builder()        
                .allowLists("192.168.0.0/24")
                .allowListName("acc-test-allowlist")
                .build());
    
            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()        
                .zoneIds(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
                .instanceName("acc-test-tf-redis")
                .shardedCluster(1)
                .password("1qaz!QAZ12")
                .nodeNumber(2)
                .shardCapacity(1024)
                .shardNumber(2)
                .engineVersion("5.0")
                .subnetId(fooSubnet.id())
                .deletionProtection("disabled")
                .vpcAuthMode("close")
                .chargeType("PostPaid")
                .port(6381)
                .projectName("default")
                .build());
    
            var fooAllowListAssociate = new AllowListAssociate("fooAllowListAssociate", AllowListAssociateArgs.builder()        
                .allowListId(fooAllowList.id())
                .instanceId(fooInstance.id())
                .build());
    
            final var fooAllowLists = RedisFunctions.AllowLists(AllowListsArgs.builder()
                .instanceId(fooAllowListAssociate.instanceId())
                .regionId("cn-beijing")
                .nameRegex(fooAllowList.allowListName())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_allow_list = volcengine.redis.AllowList("fooAllowList",
        allow_lists=["192.168.0.0/24"],
        allow_list_name="acc-test-allowlist")
    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.redis.Instance("fooInstance",
        zone_ids=[foo_zones.zones[0].id],
        instance_name="acc-test-tf-redis",
        sharded_cluster=1,
        password="1qaz!QAZ12",
        node_number=2,
        shard_capacity=1024,
        shard_number=2,
        engine_version="5.0",
        subnet_id=foo_subnet.id,
        deletion_protection="disabled",
        vpc_auth_mode="close",
        charge_type="PostPaid",
        port=6381,
        project_name="default")
    foo_allow_list_associate = volcengine.redis.AllowListAssociate("fooAllowListAssociate",
        allow_list_id=foo_allow_list.id,
        instance_id=foo_instance.id)
    foo_allow_lists = volcengine.redis.allow_lists_output(instance_id=foo_allow_list_associate.instance_id,
        region_id="cn-beijing",
        name_regex=foo_allow_list.allow_list_name)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooAllowList = new volcengine.redis.AllowList("fooAllowList", {
        allowLists: ["192.168.0.0/24"],
        allowListName: "acc-test-allowlist",
    });
    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.redis.Instance("fooInstance", {
        zoneIds: [fooZones.then(fooZones => fooZones.zones?.[0]?.id)],
        instanceName: "acc-test-tf-redis",
        shardedCluster: 1,
        password: "1qaz!QAZ12",
        nodeNumber: 2,
        shardCapacity: 1024,
        shardNumber: 2,
        engineVersion: "5.0",
        subnetId: fooSubnet.id,
        deletionProtection: "disabled",
        vpcAuthMode: "close",
        chargeType: "PostPaid",
        port: 6381,
        projectName: "default",
    });
    const fooAllowListAssociate = new volcengine.redis.AllowListAssociate("fooAllowListAssociate", {
        allowListId: fooAllowList.id,
        instanceId: fooInstance.id,
    });
    const fooAllowLists = volcengine.redis.AllowListsOutput({
        instanceId: fooAllowListAssociate.instanceId,
        regionId: "cn-beijing",
        nameRegex: fooAllowList.allowListName,
    });
    
    resources:
      fooAllowList:
        type: volcengine:redis:AllowList
        properties:
          allowLists:
            - 192.168.0.0/24
          allowListName: acc-test-allowlist
      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:redis:Instance
        properties:
          zoneIds:
            - ${fooZones.zones[0].id}
          instanceName: acc-test-tf-redis
          shardedCluster: 1
          password: 1qaz!QAZ12
          nodeNumber: 2
          shardCapacity: 1024
          shardNumber: 2
          engineVersion: '5.0'
          subnetId: ${fooSubnet.id}
          deletionProtection: disabled
          vpcAuthMode: close
          chargeType: PostPaid
          port: 6381
          projectName: default
      fooAllowListAssociate:
        type: volcengine:redis:AllowListAssociate
        properties:
          allowListId: ${fooAllowList.id}
          instanceId: ${fooInstance.id}
    variables:
      fooZones:
        fn::invoke:
          Function: volcengine:ecs:Zones
          Arguments: {}
      fooAllowLists:
        fn::invoke:
          Function: volcengine:redis:AllowLists
          Arguments:
            instanceId: ${fooAllowListAssociate.instanceId}
            regionId: cn-beijing
            nameRegex: ${fooAllowList.allowListName}
    

    Using AllowLists

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function allowLists(args: AllowListsArgs, opts?: InvokeOptions): Promise<AllowListsResult>
    function allowListsOutput(args: AllowListsOutputArgs, opts?: InvokeOptions): Output<AllowListsResult>
    def allow_lists(instance_id: Optional[str] = None,
                    name_regex: Optional[str] = None,
                    output_file: Optional[str] = None,
                    region_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> AllowListsResult
    def allow_lists_output(instance_id: Optional[pulumi.Input[str]] = None,
                    name_regex: Optional[pulumi.Input[str]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    region_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[AllowListsResult]
    func AllowLists(ctx *Context, args *AllowListsArgs, opts ...InvokeOption) (*AllowListsResult, error)
    func AllowListsOutput(ctx *Context, args *AllowListsOutputArgs, opts ...InvokeOption) AllowListsResultOutput
    public static class AllowLists 
    {
        public static Task<AllowListsResult> InvokeAsync(AllowListsArgs args, InvokeOptions? opts = null)
        public static Output<AllowListsResult> Invoke(AllowListsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<AllowListsResult> allowLists(AllowListsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: volcengine:redis:AllowLists
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RegionId string
    The Id of region.
    InstanceId string
    The Id of instance.
    NameRegex string
    A Name Regex of Allow List.
    OutputFile string
    File name where to save data source results.
    RegionId string
    The Id of region.
    InstanceId string
    The Id of instance.
    NameRegex string
    A Name Regex of Allow List.
    OutputFile string
    File name where to save data source results.
    regionId String
    The Id of region.
    instanceId String
    The Id of instance.
    nameRegex String
    A Name Regex of Allow List.
    outputFile String
    File name where to save data source results.
    regionId string
    The Id of region.
    instanceId string
    The Id of instance.
    nameRegex string
    A Name Regex of Allow List.
    outputFile string
    File name where to save data source results.
    region_id str
    The Id of region.
    instance_id str
    The Id of instance.
    name_regex str
    A Name Regex of Allow List.
    output_file str
    File name where to save data source results.
    regionId String
    The Id of region.
    instanceId String
    The Id of instance.
    nameRegex String
    A Name Regex of Allow List.
    outputFile String
    File name where to save data source results.

    AllowLists Result

    The following output properties are available:

    AllowLists List<AllowListsAllowList>
    Information of list of allow list.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    TotalCount int
    The total count of allow list query.
    InstanceId string
    Id of instance.
    NameRegex string
    OutputFile string
    AllowLists []AllowListsAllowList
    Information of list of allow list.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    TotalCount int
    The total count of allow list query.
    InstanceId string
    Id of instance.
    NameRegex string
    OutputFile string
    allowLists List<AllowListsAllowList>
    Information of list of allow list.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    totalCount Integer
    The total count of allow list query.
    instanceId String
    Id of instance.
    nameRegex String
    outputFile String
    allowLists AllowListsAllowList[]
    Information of list of allow list.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    totalCount number
    The total count of allow list query.
    instanceId string
    Id of instance.
    nameRegex string
    outputFile string
    allow_lists Sequence[AllowListsAllowList]
    Information of list of allow list.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    total_count int
    The total count of allow list query.
    instance_id str
    Id of instance.
    name_regex str
    output_file str
    allowLists List<Property Map>
    Information of list of allow list.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    totalCount Number
    The total count of allow list query.
    instanceId String
    Id of instance.
    nameRegex String
    outputFile String

    Supporting Types

    AllowListsAllowList

    AllowListDesc string
    Description of allow list.
    AllowListId string
    Id of allow list.
    AllowListIpNum int
    The IP number of allow list.
    AllowListName string
    Name of allow list.
    AllowListType string
    Type of allow list.
    AllowLists List<string>
    Ip list of allow list.
    AssociatedInstanceNum int
    The number of instance that associated to allow list.
    AssociatedInstances List<AllowListsAllowListAssociatedInstance>
    Instances associated by this allow list.
    AllowListDesc string
    Description of allow list.
    AllowListId string
    Id of allow list.
    AllowListIpNum int
    The IP number of allow list.
    AllowListName string
    Name of allow list.
    AllowListType string
    Type of allow list.
    AllowLists []string
    Ip list of allow list.
    AssociatedInstanceNum int
    The number of instance that associated to allow list.
    AssociatedInstances []AllowListsAllowListAssociatedInstance
    Instances associated by this allow list.
    allowListDesc String
    Description of allow list.
    allowListId String
    Id of allow list.
    allowListIpNum Integer
    The IP number of allow list.
    allowListName String
    Name of allow list.
    allowListType String
    Type of allow list.
    allowLists List<String>
    Ip list of allow list.
    associatedInstanceNum Integer
    The number of instance that associated to allow list.
    associatedInstances List<AllowListsAllowListAssociatedInstance>
    Instances associated by this allow list.
    allowListDesc string
    Description of allow list.
    allowListId string
    Id of allow list.
    allowListIpNum number
    The IP number of allow list.
    allowListName string
    Name of allow list.
    allowListType string
    Type of allow list.
    allowLists string[]
    Ip list of allow list.
    associatedInstanceNum number
    The number of instance that associated to allow list.
    associatedInstances AllowListsAllowListAssociatedInstance[]
    Instances associated by this allow list.
    allow_list_desc str
    Description of allow list.
    allow_list_id str
    Id of allow list.
    allow_list_ip_num int
    The IP number of allow list.
    allow_list_name str
    Name of allow list.
    allow_list_type str
    Type of allow list.
    allow_lists Sequence[str]
    Ip list of allow list.
    associated_instance_num int
    The number of instance that associated to allow list.
    associated_instances Sequence[AllowListsAllowListAssociatedInstance]
    Instances associated by this allow list.
    allowListDesc String
    Description of allow list.
    allowListId String
    Id of allow list.
    allowListIpNum Number
    The IP number of allow list.
    allowListName String
    Name of allow list.
    allowListType String
    Type of allow list.
    allowLists List<String>
    Ip list of allow list.
    associatedInstanceNum Number
    The number of instance that associated to allow list.
    associatedInstances List<Property Map>
    Instances associated by this allow list.

    AllowListsAllowListAssociatedInstance

    InstanceId string
    The Id of instance.
    InstanceName string
    Name of instance.
    Vpc string
    Id of virtual private cloud.
    InstanceId string
    The Id of instance.
    InstanceName string
    Name of instance.
    Vpc string
    Id of virtual private cloud.
    instanceId String
    The Id of instance.
    instanceName String
    Name of instance.
    vpc String
    Id of virtual private cloud.
    instanceId string
    The Id of instance.
    instanceName string
    Name of instance.
    vpc string
    Id of virtual private cloud.
    instance_id str
    The Id of instance.
    instance_name str
    Name of instance.
    vpc str
    Id of virtual private cloud.
    instanceId String
    The Id of instance.
    instanceName String
    Name of instance.
    vpc String
    Id of virtual private cloud.

    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.25 published on Tuesday, Jul 2, 2024 by Volcengine