1. Packages
  2. Volcengine
  3. API Docs
  4. vedb_mysql
  5. AllowlistAssociate
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.vedb_mysql.AllowlistAssociate

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

    Provides a resource to manage vedb mysql allowlist associate

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooAllowlist = new volcengine.vedb_mysql.Allowlist("fooAllowlist", {
        allowListName: "acc-test-allowlist",
        allowListDesc: "acc-test",
        allowListType: "IPv4",
        allowLists: [
            "192.168.0.0/24",
            "192.168.1.0/24",
            "192.168.2.0/24",
        ],
    });
    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?.[2]?.id),
        vpcId: fooVpc.id,
    });
    const fooInstance = new volcengine.vedb_mysql.Instance("fooInstance", {
        chargeType: "PostPaid",
        storageChargeType: "PostPaid",
        dbEngineVersion: "MySQL_8_0",
        dbMinorVersion: "3.0",
        nodeNumber: 2,
        nodeSpec: "vedb.mysql.x4.large",
        subnetId: fooSubnet.id,
        instanceName: "tf-test",
        projectName: "testA",
        tags: [
            {
                key: "tftest",
                value: "tftest",
            },
            {
                key: "tftest2",
                value: "tftest2",
            },
        ],
    });
    const fooAllowlistAssociate = new volcengine.vedb_mysql.AllowlistAssociate("fooAllowlistAssociate", {
        allowListId: fooAllowlist.id,
        instanceId: fooInstance.id,
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_allowlist = volcengine.vedb_mysql.Allowlist("fooAllowlist",
        allow_list_name="acc-test-allowlist",
        allow_list_desc="acc-test",
        allow_list_type="IPv4",
        allow_lists=[
            "192.168.0.0/24",
            "192.168.1.0/24",
            "192.168.2.0/24",
        ])
    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[2].id,
        vpc_id=foo_vpc.id)
    foo_instance = volcengine.vedb_mysql.Instance("fooInstance",
        charge_type="PostPaid",
        storage_charge_type="PostPaid",
        db_engine_version="MySQL_8_0",
        db_minor_version="3.0",
        node_number=2,
        node_spec="vedb.mysql.x4.large",
        subnet_id=foo_subnet.id,
        instance_name="tf-test",
        project_name="testA",
        tags=[
            volcengine.vedb_mysql.InstanceTagArgs(
                key="tftest",
                value="tftest",
            ),
            volcengine.vedb_mysql.InstanceTagArgs(
                key="tftest2",
                value="tftest2",
            ),
        ])
    foo_allowlist_associate = volcengine.vedb_mysql.AllowlistAssociate("fooAllowlistAssociate",
        allow_list_id=foo_allowlist.id,
        instance_id=foo_instance.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/vedb_mysql"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooAllowlist, err := vedb_mysql.NewAllowlist(ctx, "fooAllowlist", &vedb_mysql.AllowlistArgs{
    			AllowListName: pulumi.String("acc-test-allowlist"),
    			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"),
    				pulumi.String("192.168.2.0/24"),
    			},
    		})
    		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[2].Id),
    			VpcId:      fooVpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		fooInstance, err := vedb_mysql.NewInstance(ctx, "fooInstance", &vedb_mysql.InstanceArgs{
    			ChargeType:        pulumi.String("PostPaid"),
    			StorageChargeType: pulumi.String("PostPaid"),
    			DbEngineVersion:   pulumi.String("MySQL_8_0"),
    			DbMinorVersion:    pulumi.String("3.0"),
    			NodeNumber:        pulumi.Int(2),
    			NodeSpec:          pulumi.String("vedb.mysql.x4.large"),
    			SubnetId:          fooSubnet.ID(),
    			InstanceName:      pulumi.String("tf-test"),
    			ProjectName:       pulumi.String("testA"),
    			Tags: vedb_mysql.InstanceTagArray{
    				&vedb_mysql.InstanceTagArgs{
    					Key:   pulumi.String("tftest"),
    					Value: pulumi.String("tftest"),
    				},
    				&vedb_mysql.InstanceTagArgs{
    					Key:   pulumi.String("tftest2"),
    					Value: pulumi.String("tftest2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vedb_mysql.NewAllowlistAssociate(ctx, "fooAllowlistAssociate", &vedb_mysql.AllowlistAssociateArgs{
    			AllowListId: fooAllowlist.ID(),
    			InstanceId:  fooInstance.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 fooAllowlist = new Volcengine.Vedb_mysql.Allowlist("fooAllowlist", new()
        {
            AllowListName = "acc-test-allowlist",
            AllowListDesc = "acc-test",
            AllowListType = "IPv4",
            AllowLists = new[]
            {
                "192.168.0.0/24",
                "192.168.1.0/24",
                "192.168.2.0/24",
            },
        });
    
        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[2]?.Id),
            VpcId = fooVpc.Id,
        });
    
        var fooInstance = new Volcengine.Vedb_mysql.Instance("fooInstance", new()
        {
            ChargeType = "PostPaid",
            StorageChargeType = "PostPaid",
            DbEngineVersion = "MySQL_8_0",
            DbMinorVersion = "3.0",
            NodeNumber = 2,
            NodeSpec = "vedb.mysql.x4.large",
            SubnetId = fooSubnet.Id,
            InstanceName = "tf-test",
            ProjectName = "testA",
            Tags = new[]
            {
                new Volcengine.Vedb_mysql.Inputs.InstanceTagArgs
                {
                    Key = "tftest",
                    Value = "tftest",
                },
                new Volcengine.Vedb_mysql.Inputs.InstanceTagArgs
                {
                    Key = "tftest2",
                    Value = "tftest2",
                },
            },
        });
    
        var fooAllowlistAssociate = new Volcengine.Vedb_mysql.AllowlistAssociate("fooAllowlistAssociate", new()
        {
            AllowListId = fooAllowlist.Id,
            InstanceId = fooInstance.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.vedb_mysql.Allowlist;
    import com.pulumi.volcengine.vedb_mysql.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.vedb_mysql.Instance;
    import com.pulumi.volcengine.vedb_mysql.InstanceArgs;
    import com.pulumi.volcengine.vedb_mysql.inputs.InstanceTagArgs;
    import com.pulumi.volcengine.vedb_mysql.AllowlistAssociate;
    import com.pulumi.volcengine.vedb_mysql.AllowlistAssociateArgs;
    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()        
                .allowListName("acc-test-allowlist")
                .allowListDesc("acc-test")
                .allowListType("IPv4")
                .allowLists(            
                    "192.168.0.0/24",
                    "192.168.1.0/24",
                    "192.168.2.0/24")
                .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()[2].id()))
                .vpcId(fooVpc.id())
                .build());
    
            var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
                .chargeType("PostPaid")
                .storageChargeType("PostPaid")
                .dbEngineVersion("MySQL_8_0")
                .dbMinorVersion("3.0")
                .nodeNumber(2)
                .nodeSpec("vedb.mysql.x4.large")
                .subnetId(fooSubnet.id())
                .instanceName("tf-test")
                .projectName("testA")
                .tags(            
                    InstanceTagArgs.builder()
                        .key("tftest")
                        .value("tftest")
                        .build(),
                    InstanceTagArgs.builder()
                        .key("tftest2")
                        .value("tftest2")
                        .build())
                .build());
    
            var fooAllowlistAssociate = new AllowlistAssociate("fooAllowlistAssociate", AllowlistAssociateArgs.builder()        
                .allowListId(fooAllowlist.id())
                .instanceId(fooInstance.id())
                .build());
    
        }
    }
    
    resources:
      fooAllowlist:
        type: volcengine:vedb_mysql:Allowlist
        properties:
          allowListName: acc-test-allowlist
          allowListDesc: acc-test
          allowListType: IPv4
          allowLists:
            - 192.168.0.0/24
            - 192.168.1.0/24
            - 192.168.2.0/24
      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[2].id}
          vpcId: ${fooVpc.id}
      fooInstance:
        type: volcengine:vedb_mysql:Instance
        properties:
          chargeType: PostPaid
          storageChargeType: PostPaid
          dbEngineVersion: MySQL_8_0
          dbMinorVersion: '3.0'
          nodeNumber: 2
          nodeSpec: vedb.mysql.x4.large
          subnetId: ${fooSubnet.id}
          instanceName: tf-test
          projectName: testA
          tags:
            - key: tftest
              value: tftest
            - key: tftest2
              value: tftest2
      fooAllowlistAssociate:
        type: volcengine:vedb_mysql:AllowlistAssociate
        properties:
          allowListId: ${fooAllowlist.id}
          instanceId: ${fooInstance.id}
    variables:
      fooZones:
        fn::invoke:
          Function: volcengine:ecs:Zones
          Arguments: {}
    

    Create AllowlistAssociate Resource

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

    Constructor syntax

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

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

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

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AllowlistAssociate 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 AllowlistAssociate Resource

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

    Import

    VedbMysqlAllowlistAssociate can be imported using the instance id and allow list id, e.g.

    $ pulumi import volcengine:vedb_mysql/allowlistAssociate:AllowlistAssociate default vedbm-iqnh3a7z****:acl-d1fd76693bd54e658912e7337d5b****
    

    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.27 published on Tuesday, Dec 10, 2024 by Volcengine