alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.cen.PrivateZone

This topic describes how to configure PrivateZone access. PrivateZone is a VPC-based resolution and management service for private domain names. After you set a PrivateZone access, the Cloud Connect Network (CCN) and Virtual Border Router (VBR) attached to a CEN instance can access the PrivateZone service through CEN.

For information about CEN Private Zone and how to use it, see Manage CEN Private Zone.

NOTE: Available in 1.83.0+

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    // Create a cen Private Zone resource and use it.
    var defaultInstance = new AliCloud.Cen.Instance("defaultInstance");

    var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    {
        VpcName = "test_name",
        CidrBlock = "172.16.0.0/12",
    });

    var defaultInstanceAttachment = new AliCloud.Cen.InstanceAttachment("defaultInstanceAttachment", new()
    {
        InstanceId = defaultInstance.Id,
        ChildInstanceId = defaultNetwork.Id,
        ChildInstanceType = "VPC",
        ChildInstanceRegionId = "cn-hangzhou",
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            defaultInstance,
            defaultNetwork,
        },
    });

    var defaultPrivateZone = new AliCloud.Cen.PrivateZone("defaultPrivateZone", new()
    {
        AccessRegionId = "cn-hangzhou",
        CenId = defaultInstance.Id,
        HostRegionId = "cn-hangzhou",
        HostVpcId = defaultNetwork.Id,
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            defaultInstanceAttachment,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultInstance, err := cen.NewInstance(ctx, "defaultInstance", nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			VpcName:   pulumi.String("test_name"),
			CidrBlock: pulumi.String("172.16.0.0/12"),
		})
		if err != nil {
			return err
		}
		defaultInstanceAttachment, err := cen.NewInstanceAttachment(ctx, "defaultInstanceAttachment", &cen.InstanceAttachmentArgs{
			InstanceId:            defaultInstance.ID(),
			ChildInstanceId:       defaultNetwork.ID(),
			ChildInstanceType:     pulumi.String("VPC"),
			ChildInstanceRegionId: pulumi.String("cn-hangzhou"),
		}, pulumi.DependsOn([]pulumi.Resource{
			defaultInstance,
			defaultNetwork,
		}))
		if err != nil {
			return err
		}
		_, err = cen.NewPrivateZone(ctx, "defaultPrivateZone", &cen.PrivateZoneArgs{
			AccessRegionId: pulumi.String("cn-hangzhou"),
			CenId:          defaultInstance.ID(),
			HostRegionId:   pulumi.String("cn-hangzhou"),
			HostVpcId:      defaultNetwork.ID(),
		}, pulumi.DependsOn([]pulumi.Resource{
			defaultInstanceAttachment,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.Instance;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.cen.InstanceAttachment;
import com.pulumi.alicloud.cen.InstanceAttachmentArgs;
import com.pulumi.alicloud.cen.PrivateZone;
import com.pulumi.alicloud.cen.PrivateZoneArgs;
import com.pulumi.resources.CustomResourceOptions;
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 defaultInstance = new Instance("defaultInstance");

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
            .vpcName("test_name")
            .cidrBlock("172.16.0.0/12")
            .build());

        var defaultInstanceAttachment = new InstanceAttachment("defaultInstanceAttachment", InstanceAttachmentArgs.builder()        
            .instanceId(defaultInstance.id())
            .childInstanceId(defaultNetwork.id())
            .childInstanceType("VPC")
            .childInstanceRegionId("cn-hangzhou")
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    defaultInstance,
                    defaultNetwork)
                .build());

        var defaultPrivateZone = new PrivateZone("defaultPrivateZone", PrivateZoneArgs.builder()        
            .accessRegionId("cn-hangzhou")
            .cenId(defaultInstance.id())
            .hostRegionId("cn-hangzhou")
            .hostVpcId(defaultNetwork.id())
            .build(), CustomResourceOptions.builder()
                .dependsOn(defaultInstanceAttachment)
                .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

# Create a cen Private Zone resource and use it.
default_instance = alicloud.cen.Instance("defaultInstance")
default_network = alicloud.vpc.Network("defaultNetwork",
    vpc_name="test_name",
    cidr_block="172.16.0.0/12")
default_instance_attachment = alicloud.cen.InstanceAttachment("defaultInstanceAttachment",
    instance_id=default_instance.id,
    child_instance_id=default_network.id,
    child_instance_type="VPC",
    child_instance_region_id="cn-hangzhou",
    opts=pulumi.ResourceOptions(depends_on=[
            default_instance,
            default_network,
        ]))
default_private_zone = alicloud.cen.PrivateZone("defaultPrivateZone",
    access_region_id="cn-hangzhou",
    cen_id=default_instance.id,
    host_region_id="cn-hangzhou",
    host_vpc_id=default_network.id,
    opts=pulumi.ResourceOptions(depends_on=[default_instance_attachment]))
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Create a cen Private Zone resource and use it.
const defaultInstance = new alicloud.cen.Instance("defaultInstance", {});
const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
    vpcName: "test_name",
    cidrBlock: "172.16.0.0/12",
});
const defaultInstanceAttachment = new alicloud.cen.InstanceAttachment("defaultInstanceAttachment", {
    instanceId: defaultInstance.id,
    childInstanceId: defaultNetwork.id,
    childInstanceType: "VPC",
    childInstanceRegionId: "cn-hangzhou",
}, {
    dependsOn: [
        defaultInstance,
        defaultNetwork,
    ],
});
const defaultPrivateZone = new alicloud.cen.PrivateZone("defaultPrivateZone", {
    accessRegionId: "cn-hangzhou",
    cenId: defaultInstance.id,
    hostRegionId: "cn-hangzhou",
    hostVpcId: defaultNetwork.id,
}, {
    dependsOn: [defaultInstanceAttachment],
});
resources:
  # Create a cen Private Zone resource and use it.
  defaultInstance:
    type: alicloud:cen:Instance
  defaultNetwork:
    type: alicloud:vpc:Network
    properties:
      vpcName: test_name
      cidrBlock: 172.16.0.0/12
  defaultInstanceAttachment:
    type: alicloud:cen:InstanceAttachment
    properties:
      instanceId: ${defaultInstance.id}
      childInstanceId: ${defaultNetwork.id}
      childInstanceType: VPC
      childInstanceRegionId: cn-hangzhou
    options:
      dependson:
        - ${defaultInstance}
        - ${defaultNetwork}
  defaultPrivateZone:
    type: alicloud:cen:PrivateZone
    properties:
      accessRegionId: cn-hangzhou
      cenId: ${defaultInstance.id}
      hostRegionId: cn-hangzhou
      hostVpcId: ${defaultNetwork.id}
    options:
      dependson:
        - ${defaultInstanceAttachment}

Create PrivateZone Resource

new PrivateZone(name: string, args: PrivateZoneArgs, opts?: CustomResourceOptions);
@overload
def PrivateZone(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                access_region_id: Optional[str] = None,
                cen_id: Optional[str] = None,
                host_region_id: Optional[str] = None,
                host_vpc_id: Optional[str] = None)
@overload
def PrivateZone(resource_name: str,
                args: PrivateZoneArgs,
                opts: Optional[ResourceOptions] = None)
func NewPrivateZone(ctx *Context, name string, args PrivateZoneArgs, opts ...ResourceOption) (*PrivateZone, error)
public PrivateZone(string name, PrivateZoneArgs args, CustomResourceOptions? opts = null)
public PrivateZone(String name, PrivateZoneArgs args)
public PrivateZone(String name, PrivateZoneArgs args, CustomResourceOptions options)
type: alicloud:cen:PrivateZone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args PrivateZoneArgs
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 PrivateZoneArgs
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 PrivateZoneArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PrivateZoneArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args PrivateZoneArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

AccessRegionId string

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

CenId string

The ID of the CEN instance.

HostRegionId string

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

HostVpcId string

The VPC that belongs to the service region.

AccessRegionId string

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

CenId string

The ID of the CEN instance.

HostRegionId string

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

HostVpcId string

The VPC that belongs to the service region.

accessRegionId String

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cenId String

The ID of the CEN instance.

hostRegionId String

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

hostVpcId String

The VPC that belongs to the service region.

accessRegionId string

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cenId string

The ID of the CEN instance.

hostRegionId string

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

hostVpcId string

The VPC that belongs to the service region.

access_region_id str

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cen_id str

The ID of the CEN instance.

host_region_id str

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

host_vpc_id str

The VPC that belongs to the service region.

accessRegionId String

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cenId String

The ID of the CEN instance.

hostRegionId String

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

hostVpcId String

The VPC that belongs to the service region.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

Look up Existing PrivateZone Resource

Get an existing PrivateZone 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?: PrivateZoneState, opts?: CustomResourceOptions): PrivateZone
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_region_id: Optional[str] = None,
        cen_id: Optional[str] = None,
        host_region_id: Optional[str] = None,
        host_vpc_id: Optional[str] = None,
        status: Optional[str] = None) -> PrivateZone
func GetPrivateZone(ctx *Context, name string, id IDInput, state *PrivateZoneState, opts ...ResourceOption) (*PrivateZone, error)
public static PrivateZone Get(string name, Input<string> id, PrivateZoneState? state, CustomResourceOptions? opts = null)
public static PrivateZone get(String name, Output<String> id, PrivateZoneState 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:
AccessRegionId string

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

CenId string

The ID of the CEN instance.

HostRegionId string

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

HostVpcId string

The VPC that belongs to the service region.

Status string

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

AccessRegionId string

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

CenId string

The ID of the CEN instance.

HostRegionId string

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

HostVpcId string

The VPC that belongs to the service region.

Status string

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

accessRegionId String

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cenId String

The ID of the CEN instance.

hostRegionId String

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

hostVpcId String

The VPC that belongs to the service region.

status String

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

accessRegionId string

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cenId string

The ID of the CEN instance.

hostRegionId string

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

hostVpcId string

The VPC that belongs to the service region.

status string

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

access_region_id str

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cen_id str

The ID of the CEN instance.

host_region_id str

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

host_vpc_id str

The VPC that belongs to the service region.

status str

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

accessRegionId String

The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.

cenId String

The ID of the CEN instance.

hostRegionId String

The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.

hostVpcId String

The VPC that belongs to the service region.

status String

The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].

Import

CEN Private Zone can be imported using the id, e.g.

 $ pulumi import alicloud:cen/privateZone:PrivateZone example cen-abc123456:cn-hangzhou

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.