Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine
volcengine.rds_mysql.Allowlists
Explore with Pulumi AI
Use this data source to query detailed information of rds mysql allowlists
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 fooAllowlist: volcengine.rds_mysql.Allowlist[] = [];
for (const range = {value: 0}; range.value < 3; range.value++) {
    fooAllowlist.push(new volcengine.rds_mysql.Allowlist(`fooAllowlist-${range.value}`, {
        allowListName: `acc-test-allowlist-${range.value}`,
        allowListDesc: "acc-test",
        allowListType: "IPv4",
        allowLists: [
            "192.168.0.0/24",
            "192.168.1.0/24",
        ],
    }));
}
const fooInstance = new volcengine.rds_mysql.Instance("fooInstance", {
    instanceName: "acc-test-rds-mysql",
    dbEngineVersion: "MySQL_5_7",
    nodeSpec: "rds.mysql.1c2g",
    primaryZoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    secondaryZoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    storageSpace: 80,
    subnetId: fooSubnet.id,
    lowerCaseTableNames: "1",
    chargeInfo: {
        chargeType: "PostPaid",
    },
    parameters: [
        {
            parameterName: "auto_increment_increment",
            parameterValue: "2",
        },
        {
            parameterName: "auto_increment_offset",
            parameterValue: "4",
        },
    ],
    allowListIds: fooAllowlist.map(__item => __item.id),
});
const fooAllowlists = volcengine.rds_mysql.AllowlistsOutput({
    instanceId: fooInstance.id,
    regionId: "cn-beijing",
});
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_allowlist = []
for range in [{"value": i} for i in range(0, 3)]:
    foo_allowlist.append(volcengine.rds_mysql.Allowlist(f"fooAllowlist-{range['value']}",
        allow_list_name=f"acc-test-allowlist-{range['value']}",
        allow_list_desc="acc-test",
        allow_list_type="IPv4",
        allow_lists=[
            "192.168.0.0/24",
            "192.168.1.0/24",
        ]))
foo_instance = volcengine.rds_mysql.Instance("fooInstance",
    instance_name="acc-test-rds-mysql",
    db_engine_version="MySQL_5_7",
    node_spec="rds.mysql.1c2g",
    primary_zone_id=foo_zones.zones[0].id,
    secondary_zone_id=foo_zones.zones[0].id,
    storage_space=80,
    subnet_id=foo_subnet.id,
    lower_case_table_names="1",
    charge_info=volcengine.rds_mysql.InstanceChargeInfoArgs(
        charge_type="PostPaid",
    ),
    parameters=[
        volcengine.rds_mysql.InstanceParameterArgs(
            parameter_name="auto_increment_increment",
            parameter_value="2",
        ),
        volcengine.rds_mysql.InstanceParameterArgs(
            parameter_name="auto_increment_offset",
            parameter_value="4",
        ),
    ],
    allow_list_ids=[__item.id for __item in foo_allowlist])
foo_allowlists = volcengine.rds_mysql.allowlists_output(instance_id=foo_instance.id,
    region_id="cn-beijing")
package main
import (
	"fmt"
	"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/rds_mysql"
	"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
		}
		var fooAllowlist []*rds_mysql.Allowlist
		for index := 0; index < 3; index++ {
			key0 := index
			val0 := index
			__res, err := rds_mysql.NewAllowlist(ctx, fmt.Sprintf("fooAllowlist-%v", key0), &rds_mysql.AllowlistArgs{
				AllowListName: pulumi.String(fmt.Sprintf("acc-test-allowlist-%v", val0)),
				AllowListDesc: pulumi.String("acc-test"),
				AllowListType: pulumi.String("IPv4"),
				AllowLists: pulumi.StringArray{
					pulumi.String("192.168.0.0/24"),
					pulumi.String("192.168.1.0/24"),
				},
			})
			if err != nil {
				return err
			}
			fooAllowlist = append(fooAllowlist, __res)
		}
		var splat0 pulumi.StringArray
		for _, val0 := range fooAllowlist {
			splat0 = append(splat0, val0.ID())
		}
		fooInstance, err := rds_mysql.NewInstance(ctx, "fooInstance", &rds_mysql.InstanceArgs{
			InstanceName:        pulumi.String("acc-test-rds-mysql"),
			DbEngineVersion:     pulumi.String("MySQL_5_7"),
			NodeSpec:            pulumi.String("rds.mysql.1c2g"),
			PrimaryZoneId:       pulumi.String(fooZones.Zones[0].Id),
			SecondaryZoneId:     pulumi.String(fooZones.Zones[0].Id),
			StorageSpace:        pulumi.Int(80),
			SubnetId:            fooSubnet.ID(),
			LowerCaseTableNames: pulumi.String("1"),
			ChargeInfo: &rds_mysql.InstanceChargeInfoArgs{
				ChargeType: pulumi.String("PostPaid"),
			},
			Parameters: rds_mysql.InstanceParameterArray{
				&rds_mysql.InstanceParameterArgs{
					ParameterName:  pulumi.String("auto_increment_increment"),
					ParameterValue: pulumi.String("2"),
				},
				&rds_mysql.InstanceParameterArgs{
					ParameterName:  pulumi.String("auto_increment_offset"),
					ParameterValue: pulumi.String("4"),
				},
			},
			AllowListIds: splat0,
		})
		if err != nil {
			return err
		}
		_ = rds_mysql.AllowlistsOutput(ctx, rds_mysql.AllowlistsOutputArgs{
			InstanceId: fooInstance.ID(),
			RegionId:   pulumi.String("cn-beijing"),
		}, nil)
		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 fooAllowlist = new List<Volcengine.Rds_mysql.Allowlist>();
    for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
    {
        var range = new { Value = rangeIndex };
        fooAllowlist.Add(new Volcengine.Rds_mysql.Allowlist($"fooAllowlist-{range.Value}", new()
        {
            AllowListName = $"acc-test-allowlist-{range.Value}",
            AllowListDesc = "acc-test",
            AllowListType = "IPv4",
            AllowLists = new[]
            {
                "192.168.0.0/24",
                "192.168.1.0/24",
            },
        }));
    }
    var fooInstance = new Volcengine.Rds_mysql.Instance("fooInstance", new()
    {
        InstanceName = "acc-test-rds-mysql",
        DbEngineVersion = "MySQL_5_7",
        NodeSpec = "rds.mysql.1c2g",
        PrimaryZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        SecondaryZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        StorageSpace = 80,
        SubnetId = fooSubnet.Id,
        LowerCaseTableNames = "1",
        ChargeInfo = new Volcengine.Rds_mysql.Inputs.InstanceChargeInfoArgs
        {
            ChargeType = "PostPaid",
        },
        Parameters = new[]
        {
            new Volcengine.Rds_mysql.Inputs.InstanceParameterArgs
            {
                ParameterName = "auto_increment_increment",
                ParameterValue = "2",
            },
            new Volcengine.Rds_mysql.Inputs.InstanceParameterArgs
            {
                ParameterName = "auto_increment_offset",
                ParameterValue = "4",
            },
        },
        AllowListIds = fooAllowlist.Select(__item => __item.Id).ToList(),
    });
    var fooAllowlists = Volcengine.Rds_mysql.Allowlists.Invoke(new()
    {
        InstanceId = fooInstance.Id,
        RegionId = "cn-beijing",
    });
});
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.rds_mysql.Allowlist;
import com.pulumi.volcengine.rds_mysql.AllowlistArgs;
import com.pulumi.volcengine.rds_mysql.Instance;
import com.pulumi.volcengine.rds_mysql.InstanceArgs;
import com.pulumi.volcengine.rds_mysql.inputs.InstanceChargeInfoArgs;
import com.pulumi.volcengine.rds_mysql.inputs.InstanceParameterArgs;
import com.pulumi.volcengine.rds_mysql.Rds_mysqlFunctions;
import com.pulumi.volcengine.rds_mysql.inputs.AllowlistsArgs;
import com.pulumi.codegen.internal.KeyedValue;
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());
        for (var i = 0; i < 3; i++) {
            new Allowlist("fooAllowlist-" + i, AllowlistArgs.builder()            
                .allowListName(String.format("acc-test-allowlist-%s", range.value()))
                .allowListDesc("acc-test")
                .allowListType("IPv4")
                .allowLists(                
                    "192.168.0.0/24",
                    "192.168.1.0/24")
                .build());
        
}
        var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
            .instanceName("acc-test-rds-mysql")
            .dbEngineVersion("MySQL_5_7")
            .nodeSpec("rds.mysql.1c2g")
            .primaryZoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .secondaryZoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .storageSpace(80)
            .subnetId(fooSubnet.id())
            .lowerCaseTableNames("1")
            .chargeInfo(InstanceChargeInfoArgs.builder()
                .chargeType("PostPaid")
                .build())
            .parameters(            
                InstanceParameterArgs.builder()
                    .parameterName("auto_increment_increment")
                    .parameterValue("2")
                    .build(),
                InstanceParameterArgs.builder()
                    .parameterName("auto_increment_offset")
                    .parameterValue("4")
                    .build())
            .allowListIds(fooAllowlist.stream().map(element -> element.id()).collect(toList()))
            .build());
        final var fooAllowlists = Rds_mysqlFunctions.Allowlists(AllowlistsArgs.builder()
            .instanceId(fooInstance.id())
            .regionId("cn-beijing")
            .build());
    }
}
Coming soon!
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 allowlists(instance_id: Optional[str] = None,
               output_file: Optional[str] = None,
               region_id: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> AllowlistsResult
def allowlists_output(instance_id: 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) AllowlistsResultOutputpublic 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)
public static Output<AllowlistsResult> allowlists(AllowlistsArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:rds_mysql:Allowlists
  arguments:
    # arguments dictionaryThe following arguments are supported:
- RegionId string
- The region of the allow lists.
- InstanceId string
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- OutputFile string
- File name where to save data source results.
- RegionId string
- The region of the allow lists.
- InstanceId string
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- OutputFile string
- File name where to save data source results.
- regionId String
- The region of the allow lists.
- instanceId String
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- outputFile String
- File name where to save data source results.
- regionId string
- The region of the allow lists.
- instanceId string
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- outputFile string
- File name where to save data source results.
- region_id str
- The region of the allow lists.
- instance_id str
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- output_file str
- File name where to save data source results.
- regionId String
- The region of the allow lists.
- instanceId String
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- outputFile String
- File name where to save data source results.
Allowlists Result
The following output properties are available:
- AllowLists List<AllowlistsAllow List> 
- The list of allowed list.
- Id string
- The provider-assigned unique ID for this managed resource.
- RegionId string
- TotalCount int
- The total count of Scaling Activity query.
- InstanceId string
- The id of the instance.
- OutputFile string
- AllowLists []AllowlistsAllow List 
- The list of allowed list.
- Id string
- The provider-assigned unique ID for this managed resource.
- RegionId string
- TotalCount int
- The total count of Scaling Activity query.
- InstanceId string
- The id of the instance.
- OutputFile string
- allowLists List<AllowlistsAllow List> 
- The list of allowed list.
- id String
- The provider-assigned unique ID for this managed resource.
- regionId String
- totalCount Integer
- The total count of Scaling Activity query.
- instanceId String
- The id of the instance.
- outputFile String
- allowLists AllowlistsAllow List[] 
- The list of allowed list.
- id string
- The provider-assigned unique ID for this managed resource.
- regionId string
- totalCount number
- The total count of Scaling Activity query.
- instanceId string
- The id of the instance.
- outputFile string
- allow_lists Sequence[AllowlistsAllow List] 
- The list of allowed list.
- id str
- The provider-assigned unique ID for this managed resource.
- region_id str
- total_count int
- The total count of Scaling Activity query.
- instance_id str
- The id of the instance.
- output_file str
- allowLists List<Property Map>
- The list of allowed list.
- id String
- The provider-assigned unique ID for this managed resource.
- regionId String
- totalCount Number
- The total count of Scaling Activity query.
- instanceId String
- The id of the instance.
- outputFile String
Supporting Types
AllowlistsAllowList  
- AllowList stringDesc 
- The description of the allow list.
- AllowList stringId 
- The id of the allow list.
- AllowList intIp Num 
- The total number of IP addresses (or address ranges) in the whitelist.
- AllowList stringName 
- The name of the allow list.
- AllowList stringType 
- The type of the allow list.
- AllowLists List<string>
- The IP address or a range of IP addresses in CIDR format.
- AssociatedInstance intNum 
- The total number of instances bound under the whitelist.
- AssociatedInstances List<AllowlistsAllow List Associated Instance> 
- The list of instances.
- AllowList stringDesc 
- The description of the allow list.
- AllowList stringId 
- The id of the allow list.
- AllowList intIp Num 
- The total number of IP addresses (or address ranges) in the whitelist.
- AllowList stringName 
- The name of the allow list.
- AllowList stringType 
- The type of the allow list.
- AllowLists []string
- The IP address or a range of IP addresses in CIDR format.
- AssociatedInstance intNum 
- The total number of instances bound under the whitelist.
- AssociatedInstances []AllowlistsAllow List Associated Instance 
- The list of instances.
- allowList StringDesc 
- The description of the allow list.
- allowList StringId 
- The id of the allow list.
- allowList IntegerIp Num 
- The total number of IP addresses (or address ranges) in the whitelist.
- allowList StringName 
- The name of the allow list.
- allowList StringType 
- The type of the allow list.
- allowLists List<String>
- The IP address or a range of IP addresses in CIDR format.
- associatedInstance IntegerNum 
- The total number of instances bound under the whitelist.
- associatedInstances List<AllowlistsAllow List Associated Instance> 
- The list of instances.
- allowList stringDesc 
- The description of the allow list.
- allowList stringId 
- The id of the allow list.
- allowList numberIp Num 
- The total number of IP addresses (or address ranges) in the whitelist.
- allowList stringName 
- The name of the allow list.
- allowList stringType 
- The type of the allow list.
- allowLists string[]
- The IP address or a range of IP addresses in CIDR format.
- associatedInstance numberNum 
- The total number of instances bound under the whitelist.
- associatedInstances AllowlistsAllow List Associated Instance[] 
- The list of instances.
- allow_list_ strdesc 
- The description of the allow list.
- allow_list_ strid 
- The id of the allow list.
- allow_list_ intip_ num 
- The total number of IP addresses (or address ranges) in the whitelist.
- allow_list_ strname 
- The name of the allow list.
- allow_list_ strtype 
- The type of the allow list.
- allow_lists Sequence[str]
- The IP address or a range of IP addresses in CIDR format.
- associated_instance_ intnum 
- The total number of instances bound under the whitelist.
- associated_instances Sequence[AllowlistsAllow List Associated Instance] 
- The list of instances.
- allowList StringDesc 
- The description of the allow list.
- allowList StringId 
- The id of the allow list.
- allowList NumberIp Num 
- The total number of IP addresses (or address ranges) in the whitelist.
- allowList StringName 
- The name of the allow list.
- allowList StringType 
- The type of the allow list.
- allowLists List<String>
- The IP address or a range of IP addresses in CIDR format.
- associatedInstance NumberNum 
- The total number of instances bound under the whitelist.
- associatedInstances List<Property Map>
- The list of instances.
AllowlistsAllowListAssociatedInstance    
- InstanceId string
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- InstanceName string
- The name of the instance.
- Vpc string
- The id of the vpc.
- InstanceId string
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- InstanceName string
- The name of the instance.
- Vpc string
- The id of the vpc.
- instanceId String
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instanceName String
- The name of the instance.
- vpc String
- The id of the vpc.
- instanceId string
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instanceName string
- The name of the instance.
- vpc string
- The id of the vpc.
- instance_id str
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instance_name str
- The name of the instance.
- vpc str
- The id of the vpc.
- instanceId String
- Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instanceName String
- The name of the instance.
- vpc String
- The id of the vpc.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the volcengineTerraform Provider.