Volcengine v0.0.26 published on Friday, Sep 13, 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
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 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
})
}
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());
}
}
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")
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",
});
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) 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:rds_mysql:Allowlists
arguments:
# arguments dictionary
The following arguments are supported:
- Region
Id string - The region of the allow lists.
- Instance
Id string - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- Output
File string - File name where to save data source results.
- Region
Id string - The region of the allow lists.
- Instance
Id string - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- Output
File string - File name where to save data source results.
- region
Id String - The region of the allow lists.
- instance
Id String - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- output
File String - File name where to save data source results.
- region
Id string - The region of the allow lists.
- instance
Id string - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- output
File 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.
- region
Id String - The region of the allow lists.
- instance
Id String - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- output
File String - File name where to save data source results.
Allowlists Result
The following output properties are available:
- Allow
Lists List<AllowlistsAllow List> - The list of allowed list.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - Total
Count int - The total count of Scaling Activity query.
- Instance
Id string - The id of the instance.
- Output
File string
- Allow
Lists []AllowlistsAllow List - The list of allowed list.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - Total
Count int - The total count of Scaling Activity query.
- Instance
Id string - The id of the instance.
- Output
File string
- allow
Lists List<AllowlistsAllow List> - The list of allowed list.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id String - total
Count Integer - The total count of Scaling Activity query.
- instance
Id String - The id of the instance.
- output
File String
- allow
Lists AllowlistsAllow List[] - The list of allowed list.
- id string
- The provider-assigned unique ID for this managed resource.
- region
Id string - total
Count number - The total count of Scaling Activity query.
- instance
Id string - The id of the instance.
- output
File 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
- allow
Lists List<Property Map> - The list of allowed list.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id String - total
Count Number - The total count of Scaling Activity query.
- instance
Id String - The id of the instance.
- output
File String
Supporting Types
AllowlistsAllowList
- Allow
List stringDesc - The description of the allow list.
- Allow
List stringId - The id of the allow list.
- Allow
List intIp Num - The total number of IP addresses (or address ranges) in the whitelist.
- Allow
List stringName - The name of the allow list.
- Allow
List stringType - The type of the allow list.
- Allow
Lists List<string> - 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 List<AllowlistsAllow List Associated Instance> - The list of instances.
- Allow
List stringDesc - The description of the allow list.
- Allow
List stringId - The id of the allow list.
- Allow
List intIp Num - The total number of IP addresses (or address ranges) in the whitelist.
- Allow
List stringName - The name of the allow list.
- Allow
List stringType - The type of the allow list.
- Allow
Lists []string - 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 []AllowlistsAllow List Associated Instance - The list of instances.
- allow
List StringDesc - The description of the allow list.
- allow
List StringId - The id of the allow list.
- allow
List IntegerIp Num - The total number of IP addresses (or address ranges) in the whitelist.
- allow
List StringName - The name of the allow list.
- allow
List StringType - The type of the allow list.
- allow
Lists List<String> - The IP address or a range of IP addresses in CIDR format.
- associated
Instance IntegerNum - The total number of instances bound under the whitelist.
- associated
Instances List<AllowlistsAllow List Associated Instance> - The list of instances.
- allow
List stringDesc - The description of the allow list.
- allow
List stringId - The id of the allow list.
- allow
List numberIp Num - The total number of IP addresses (or address ranges) in the whitelist.
- allow
List stringName - The name of the allow list.
- allow
List stringType - The type of the allow list.
- allow
Lists string[] - The IP address or a range of IP addresses in CIDR format.
- associated
Instance numberNum - The total number of instances bound under the whitelist.
- associated
Instances 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.
- allow
List StringDesc - The description of the allow list.
- allow
List StringId - The id of the allow list.
- allow
List NumberIp Num - The total number of IP addresses (or address ranges) in the whitelist.
- allow
List StringName - The name of the allow list.
- allow
List StringType - The type of the allow list.
- allow
Lists List<String> - The IP address or a range of IP addresses in CIDR format.
- associated
Instance NumberNum - The total number of instances bound under the whitelist.
- associated
Instances List<Property Map> - The list of instances.
AllowlistsAllowListAssociatedInstance
- Instance
Id string - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- Instance
Name string - The name of the instance.
- Vpc string
- The id of the vpc.
- Instance
Id string - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- Instance
Name string - The name of the instance.
- Vpc string
- The id of the vpc.
- instance
Id String - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instance
Name String - The name of the instance.
- vpc String
- The id of the vpc.
- instance
Id string - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instance
Name 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.
- instance
Id String - Instance ID. When an InstanceId is specified, the DescribeAllowLists interface will return the whitelist bound to the specified instance.
- instance
Name 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
volcengine
Terraform Provider.