alicloud.cr.VpcEndpointLinkedVpc
Explore with Pulumi AI
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";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const defaultInteger = new random.index.Integer("default", {
min: 100000,
max: 999999,
});
const default = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: `${name}-${defaultInteger.result}`,
cidrBlock: "10.4.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: `${name}-${defaultInteger.result}`,
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}-${defaultInteger.result}`,
});
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
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default_integer = random.index.Integer("default",
min=100000,
max=999999)
default = alicloud.get_zones(available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("default",
vpc_name=f"{name}-{default_integer['result']}",
cidr_block="10.4.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=f"{name}-{default_integer['result']}",
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=f"{name}-{default_integer['result']}")
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 (
"fmt"
"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-random/sdk/v4/go/random"
"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
}
defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 100000,
Max: 999999,
})
if err != nil {
return err
}
_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.Sprintf("%v-%v", name, defaultInteger.Result),
CidrBlock: pulumi.String("10.4.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
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.Sprintf("%v-%v", name, defaultInteger.Result),
})
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;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var defaultInteger = new Random.Index.Integer("default", new()
{
Min = 100000,
Max = 999999,
});
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = $"{name}-{defaultInteger.Result}",
CidrBlock = "10.4.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = $"{name}-{defaultInteger.Result}",
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}-{defaultInteger.Result}",
});
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.random.integer;
import com.pulumi.random.IntegerArgs;
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");
var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
.min(100000)
.max(999999)
.build());
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(String.format("%s-%s", name,defaultInteger.result()))
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(String.format("%s-%s", name,defaultInteger.result()))
.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(String.format("%s-%s", name,defaultInteger.result()))
.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:
defaultInteger:
type: random:integer
name: default
properties:
min: 100000
max: 999999
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
vpcName: ${name}-${defaultInteger.result}
cidrBlock: 10.4.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vswitchName: ${name}-${defaultInteger.result}
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}-${defaultInteger.result}
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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VpcEndpointLinkedVpc resource accepts the following input properties:
- Instance
Id string - The ID of the instance.
- Module
Name string - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- Vpc
Id string - The ID of the VPC.
- Vswitch
Id string - The ID of the vSwitch.
- Enable
Create boolDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- Instance
Id string - The ID of the instance.
- Module
Name string - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- Vpc
Id string - The ID of the VPC.
- Vswitch
Id string - The ID of the vSwitch.
- Enable
Create boolDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- instance
Id String - The ID of the instance.
- module
Name String - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- vpc
Id String - The ID of the VPC.
- vswitch
Id String - The ID of the vSwitch.
- enable
Create BooleanDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- instance
Id string - The ID of the instance.
- module
Name string - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- vpc
Id string - The ID of the VPC.
- vswitch
Id string - The ID of the vSwitch.
- enable
Create booleanDns Record In Pvzt - 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:
Registry
: the image repository.Chart
: a Helm chart.
- vpc_
id str - The ID of the VPC.
- vswitch_
id str - The ID of the vSwitch.
- enable_
create_ booldns_ record_ in_ pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- instance
Id String - The ID of the instance.
- module
Name String - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- vpc
Id String - The ID of the VPC.
- vswitch
Id String - The ID of the vSwitch.
- enable
Create BooleanDns Record In Pvzt - 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:
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.
- Enable
Create boolDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- Instance
Id string - The ID of the instance.
- Module
Name string - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- Status string
- The status of the Vpc Endpoint Linked Vpc.
- Vpc
Id string - The ID of the VPC.
- Vswitch
Id string - The ID of the vSwitch.
- Enable
Create boolDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- Instance
Id string - The ID of the instance.
- Module
Name string - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- Status string
- The status of the Vpc Endpoint Linked Vpc.
- Vpc
Id string - The ID of the VPC.
- Vswitch
Id string - The ID of the vSwitch.
- enable
Create BooleanDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- instance
Id String - The ID of the instance.
- module
Name String - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- status String
- The status of the Vpc Endpoint Linked Vpc.
- vpc
Id String - The ID of the VPC.
- vswitch
Id String - The ID of the vSwitch.
- enable
Create booleanDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- instance
Id string - The ID of the instance.
- module
Name string - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- status string
- The status of the Vpc Endpoint Linked Vpc.
- vpc
Id string - The ID of the VPC.
- vswitch
Id string - The ID of the vSwitch.
- enable_
create_ booldns_ record_ in_ pvzt - 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:
Registry
: the image repository.Chart
: a Helm chart.
- 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.
- enable
Create BooleanDns Record In Pvzt - Specifies whether to automatically create an Alibaba Cloud DNS PrivateZone record. Valid Values:
- instance
Id String - The ID of the instance.
- module
Name String - The name of the module that you want to access. Valid Values:
Registry
: the image repository.Chart
: a Helm chart.
- status String
- The status of the Vpc Endpoint Linked Vpc.
- vpc
Id String - The ID of the VPC.
- vswitch
Id 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.