1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cr
  5. VpcEndpointLinkedVpc
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.cr.VpcEndpointLinkedVpc

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    Provides a CR Vpc Endpoint Linked Vpc resource.

    For information about CR Vpc Endpoint Linked Vpc and how to use it, see What is Vpc Endpoint Linked Vpc.

    NOTE: Available since v1.199.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const default = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vswitchName: name,
        cidrBlock: "10.4.0.0/24",
        vpcId: defaultNetwork.id,
        zoneId: _default.then(_default => _default.zones?.[0]?.id),
    });
    const defaultRegistryEnterpriseInstance = new alicloud.cr.RegistryEnterpriseInstance("default", {
        paymentType: "Subscription",
        period: 1,
        renewPeriod: 0,
        renewalStatus: "ManualRenewal",
        instanceType: "Advanced",
        instanceName: name,
    });
    const defaultVpcEndpointLinkedVpc = new alicloud.cr.VpcEndpointLinkedVpc("default", {
        instanceId: defaultRegistryEnterpriseInstance.id,
        vpcId: defaultNetwork.id,
        vswitchId: defaultSwitch.id,
        moduleName: "Registry",
        enableCreateDnsRecordInPvzt: true,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.get_zones(available_resource_creation="VSwitch")
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vswitch_name=name,
        cidr_block="10.4.0.0/24",
        vpc_id=default_network.id,
        zone_id=default.zones[0].id)
    default_registry_enterprise_instance = alicloud.cr.RegistryEnterpriseInstance("default",
        payment_type="Subscription",
        period=1,
        renew_period=0,
        renewal_status="ManualRenewal",
        instance_type="Advanced",
        instance_name=name)
    default_vpc_endpoint_linked_vpc = alicloud.cr.VpcEndpointLinkedVpc("default",
        instance_id=default_registry_enterprise_instance.id,
        vpc_id=default_network.id,
        vswitch_id=default_switch.id,
        module_name="Registry",
        enable_create_dns_record_in_pvzt=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			CidrBlock:   pulumi.String("10.4.0.0/24"),
    			VpcId:       defaultNetwork.ID(),
    			ZoneId:      pulumi.String(_default.Zones[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		defaultRegistryEnterpriseInstance, err := cr.NewRegistryEnterpriseInstance(ctx, "default", &cr.RegistryEnterpriseInstanceArgs{
    			PaymentType:   pulumi.String("Subscription"),
    			Period:        pulumi.Int(1),
    			RenewPeriod:   pulumi.Int(0),
    			RenewalStatus: pulumi.String("ManualRenewal"),
    			InstanceType:  pulumi.String("Advanced"),
    			InstanceName:  pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cr.NewVpcEndpointLinkedVpc(ctx, "default", &cr.VpcEndpointLinkedVpcArgs{
    			InstanceId:                  defaultRegistryEnterpriseInstance.ID(),
    			VpcId:                       defaultNetwork.ID(),
    			VswitchId:                   defaultSwitch.ID(),
    			ModuleName:                  pulumi.String("Registry"),
    			EnableCreateDnsRecordInPvzt: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VswitchName = name,
            CidrBlock = "10.4.0.0/24",
            VpcId = defaultNetwork.Id,
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
        });
    
        var defaultRegistryEnterpriseInstance = new AliCloud.CR.RegistryEnterpriseInstance("default", new()
        {
            PaymentType = "Subscription",
            Period = 1,
            RenewPeriod = 0,
            RenewalStatus = "ManualRenewal",
            InstanceType = "Advanced",
            InstanceName = name,
        });
    
        var defaultVpcEndpointLinkedVpc = new AliCloud.CR.VpcEndpointLinkedVpc("default", new()
        {
            InstanceId = defaultRegistryEnterpriseInstance.Id,
            VpcId = defaultNetwork.Id,
            VswitchId = defaultSwitch.Id,
            ModuleName = "Registry",
            EnableCreateDnsRecordInPvzt = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.cr.RegistryEnterpriseInstance;
    import com.pulumi.alicloud.cr.RegistryEnterpriseInstanceArgs;
    import com.pulumi.alicloud.cr.VpcEndpointLinkedVpc;
    import com.pulumi.alicloud.cr.VpcEndpointLinkedVpcArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName(name)
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
                .vswitchName(name)
                .cidrBlock("10.4.0.0/24")
                .vpcId(defaultNetwork.id())
                .zoneId(default_.zones()[0].id())
                .build());
    
            var defaultRegistryEnterpriseInstance = new RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", RegistryEnterpriseInstanceArgs.builder()        
                .paymentType("Subscription")
                .period(1)
                .renewPeriod(0)
                .renewalStatus("ManualRenewal")
                .instanceType("Advanced")
                .instanceName(name)
                .build());
    
            var defaultVpcEndpointLinkedVpc = new VpcEndpointLinkedVpc("defaultVpcEndpointLinkedVpc", VpcEndpointLinkedVpcArgs.builder()        
                .instanceId(defaultRegistryEnterpriseInstance.id())
                .vpcId(defaultNetwork.id())
                .vswitchId(defaultSwitch.id())
                .moduleName("Registry")
                .enableCreateDnsRecordInPvzt(true)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 10.4.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vswitchName: ${name}
          cidrBlock: 10.4.0.0/24
          vpcId: ${defaultNetwork.id}
          zoneId: ${default.zones[0].id}
      defaultRegistryEnterpriseInstance:
        type: alicloud:cr:RegistryEnterpriseInstance
        name: default
        properties:
          paymentType: Subscription
          period: 1
          renewPeriod: 0
          renewalStatus: ManualRenewal
          instanceType: Advanced
          instanceName: ${name}
      defaultVpcEndpointLinkedVpc:
        type: alicloud:cr:VpcEndpointLinkedVpc
        name: default
        properties:
          instanceId: ${defaultRegistryEnterpriseInstance.id}
          vpcId: ${defaultNetwork.id}
          vswitchId: ${defaultSwitch.id}
          moduleName: Registry
          enableCreateDnsRecordInPvzt: true
    variables:
      default:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    Create VpcEndpointLinkedVpc Resource

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

    Constructor syntax

    new VpcEndpointLinkedVpc(name: string, args: VpcEndpointLinkedVpcArgs, opts?: CustomResourceOptions);
    @overload
    def VpcEndpointLinkedVpc(resource_name: str,
                             args: VpcEndpointLinkedVpcArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcEndpointLinkedVpc(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             instance_id: Optional[str] = None,
                             module_name: Optional[str] = None,
                             vpc_id: Optional[str] = None,
                             vswitch_id: Optional[str] = None,
                             enable_create_dns_record_in_pvzt: Optional[bool] = None)
    func NewVpcEndpointLinkedVpc(ctx *Context, name string, args VpcEndpointLinkedVpcArgs, opts ...ResourceOption) (*VpcEndpointLinkedVpc, error)
    public VpcEndpointLinkedVpc(string name, VpcEndpointLinkedVpcArgs args, CustomResourceOptions? opts = null)
    public VpcEndpointLinkedVpc(String name, VpcEndpointLinkedVpcArgs args)
    public VpcEndpointLinkedVpc(String name, VpcEndpointLinkedVpcArgs args, CustomResourceOptions options)
    
    type: alicloud:cr:VpcEndpointLinkedVpc
    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 VpcEndpointLinkedVpcArgs
    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 VpcEndpointLinkedVpcArgs
    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 VpcEndpointLinkedVpcArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcEndpointLinkedVpcArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcEndpointLinkedVpcArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var vpcEndpointLinkedVpcResource = new AliCloud.CR.VpcEndpointLinkedVpc("vpcEndpointLinkedVpcResource", new()
    {
        InstanceId = "string",
        ModuleName = "string",
        VpcId = "string",
        VswitchId = "string",
        EnableCreateDnsRecordInPvzt = false,
    });
    
    example, err := cr.NewVpcEndpointLinkedVpc(ctx, "vpcEndpointLinkedVpcResource", &cr.VpcEndpointLinkedVpcArgs{
    	InstanceId:                  pulumi.String("string"),
    	ModuleName:                  pulumi.String("string"),
    	VpcId:                       pulumi.String("string"),
    	VswitchId:                   pulumi.String("string"),
    	EnableCreateDnsRecordInPvzt: pulumi.Bool(false),
    })
    
    var vpcEndpointLinkedVpcResource = new VpcEndpointLinkedVpc("vpcEndpointLinkedVpcResource", VpcEndpointLinkedVpcArgs.builder()        
        .instanceId("string")
        .moduleName("string")
        .vpcId("string")
        .vswitchId("string")
        .enableCreateDnsRecordInPvzt(false)
        .build());
    
    vpc_endpoint_linked_vpc_resource = alicloud.cr.VpcEndpointLinkedVpc("vpcEndpointLinkedVpcResource",
        instance_id="string",
        module_name="string",
        vpc_id="string",
        vswitch_id="string",
        enable_create_dns_record_in_pvzt=False)
    
    const vpcEndpointLinkedVpcResource = new alicloud.cr.VpcEndpointLinkedVpc("vpcEndpointLinkedVpcResource", {
        instanceId: "string",
        moduleName: "string",
        vpcId: "string",
        vswitchId: "string",
        enableCreateDnsRecordInPvzt: false,
    });
    
    type: alicloud:cr:VpcEndpointLinkedVpc
    properties:
        enableCreateDnsRecordInPvzt: false
        instanceId: string
        moduleName: string
        vpcId: string
        vswitchId: string
    

    VpcEndpointLinkedVpc Resource Properties

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

    Inputs

    The VpcEndpointLinkedVpc resource accepts the following input properties:

    InstanceId string
    The ID of the instance.
    ModuleName string
    The name of the module that you want to access. Valid Values:
    VpcId string
    The ID of the VPC.
    VswitchId string
    The ID of the vSwitch.
    EnableCreateDnsRecordInPvzt bool
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    InstanceId string
    The ID of the instance.
    ModuleName string
    The name of the module that you want to access. Valid Values:
    VpcId string
    The ID of the VPC.
    VswitchId string
    The ID of the vSwitch.
    EnableCreateDnsRecordInPvzt bool
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instanceId String
    The ID of the instance.
    moduleName String
    The name of the module that you want to access. Valid Values:
    vpcId String
    The ID of the VPC.
    vswitchId String
    The ID of the vSwitch.
    enableCreateDnsRecordInPvzt Boolean
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instanceId string
    The ID of the instance.
    moduleName string
    The name of the module that you want to access. Valid Values:
    vpcId string
    The ID of the VPC.
    vswitchId string
    The ID of the vSwitch.
    enableCreateDnsRecordInPvzt boolean
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instance_id str
    The ID of the instance.
    module_name str
    The name of the module that you want to access. Valid Values:
    vpc_id str
    The ID of the VPC.
    vswitch_id str
    The ID of the vSwitch.
    enable_create_dns_record_in_pvzt bool
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instanceId String
    The ID of the instance.
    moduleName String
    The name of the module that you want to access. Valid Values:
    vpcId String
    The ID of the VPC.
    vswitchId String
    The ID of the vSwitch.
    enableCreateDnsRecordInPvzt Boolean
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Vpc Endpoint Linked Vpc.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Vpc Endpoint Linked Vpc.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Vpc Endpoint Linked Vpc.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the Vpc Endpoint Linked Vpc.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the Vpc Endpoint Linked Vpc.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Vpc Endpoint Linked Vpc.

    Look up Existing VpcEndpointLinkedVpc Resource

    Get an existing VpcEndpointLinkedVpc 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?: VpcEndpointLinkedVpcState, opts?: CustomResourceOptions): VpcEndpointLinkedVpc
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enable_create_dns_record_in_pvzt: Optional[bool] = None,
            instance_id: Optional[str] = None,
            module_name: Optional[str] = None,
            status: Optional[str] = None,
            vpc_id: Optional[str] = None,
            vswitch_id: Optional[str] = None) -> VpcEndpointLinkedVpc
    func GetVpcEndpointLinkedVpc(ctx *Context, name string, id IDInput, state *VpcEndpointLinkedVpcState, opts ...ResourceOption) (*VpcEndpointLinkedVpc, error)
    public static VpcEndpointLinkedVpc Get(string name, Input<string> id, VpcEndpointLinkedVpcState? state, CustomResourceOptions? opts = null)
    public static VpcEndpointLinkedVpc get(String name, Output<String> id, VpcEndpointLinkedVpcState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    EnableCreateDnsRecordInPvzt bool
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    InstanceId string
    The ID of the instance.
    ModuleName string
    The name of the module that you want to access. Valid Values:
    Status string
    The status of the Vpc Endpoint Linked Vpc.
    VpcId string
    The ID of the VPC.
    VswitchId string
    The ID of the vSwitch.
    EnableCreateDnsRecordInPvzt bool
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    InstanceId string
    The ID of the instance.
    ModuleName string
    The name of the module that you want to access. Valid Values:
    Status string
    The status of the Vpc Endpoint Linked Vpc.
    VpcId string
    The ID of the VPC.
    VswitchId string
    The ID of the vSwitch.
    enableCreateDnsRecordInPvzt Boolean
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instanceId String
    The ID of the instance.
    moduleName String
    The name of the module that you want to access. Valid Values:
    status String
    The status of the Vpc Endpoint Linked Vpc.
    vpcId String
    The ID of the VPC.
    vswitchId String
    The ID of the vSwitch.
    enableCreateDnsRecordInPvzt boolean
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instanceId string
    The ID of the instance.
    moduleName string
    The name of the module that you want to access. Valid Values:
    status string
    The status of the Vpc Endpoint Linked Vpc.
    vpcId string
    The ID of the VPC.
    vswitchId string
    The ID of the vSwitch.
    enable_create_dns_record_in_pvzt bool
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instance_id str
    The ID of the instance.
    module_name str
    The name of the module that you want to access. Valid Values:
    status str
    The status of the Vpc Endpoint Linked Vpc.
    vpc_id str
    The ID of the VPC.
    vswitch_id str
    The ID of the vSwitch.
    enableCreateDnsRecordInPvzt Boolean
    Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
    instanceId String
    The ID of the instance.
    moduleName String
    The name of the module that you want to access. Valid Values:
    status String
    The status of the Vpc Endpoint Linked Vpc.
    vpcId String
    The ID of the VPC.
    vswitchId String
    The ID of the vSwitch.

    Import

    CR Vpc Endpoint Linked Vpc can be imported using the id, e.g.

    $ pulumi import alicloud:cr/vpcEndpointLinkedVpc:VpcEndpointLinkedVpc example <instance_id>:<vpc_id>:<vswitch_id>:<module_name>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi