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:
- Access
Region stringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- Cen
Id string The ID of the CEN instance.
- Host
Region stringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- Host
Vpc stringId The VPC that belongs to the service region.
- Access
Region stringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- Cen
Id string The ID of the CEN instance.
- Host
Region stringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- Host
Vpc stringId The VPC that belongs to the service region.
- access
Region StringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- cen
Id String The ID of the CEN instance.
- host
Region StringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host
Vpc StringId The VPC that belongs to the service region.
- access
Region stringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- cen
Id string The ID of the CEN instance.
- host
Region stringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host
Vpc stringId The VPC that belongs to the service region.
- access_
region_ strid 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_ strid The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host_
vpc_ strid The VPC that belongs to the service region.
- access
Region StringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- cen
Id String The ID of the CEN instance.
- host
Region StringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host
Vpc StringId 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:
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.
- Access
Region stringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- Cen
Id string The ID of the CEN instance.
- Host
Region stringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- Host
Vpc stringId The VPC that belongs to the service region.
- Status string
The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].
- Access
Region stringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- Cen
Id string The ID of the CEN instance.
- Host
Region stringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- Host
Vpc stringId The VPC that belongs to the service region.
- Status string
The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].
- access
Region StringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- cen
Id String The ID of the CEN instance.
- host
Region StringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host
Vpc StringId The VPC that belongs to the service region.
- status String
The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].
- access
Region stringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- cen
Id string The ID of the CEN instance.
- host
Region stringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host
Vpc stringId The VPC that belongs to the service region.
- status string
The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].
- access_
region_ strid 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_ strid The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host_
vpc_ strid The VPC that belongs to the service region.
- status str
The status of the PrivateZone service. Valid values: ["Creating", "Active", "Deleting"].
- access
Region StringId The access region. The access region is the region of the cloud resource that accesses the PrivateZone service through CEN.
- cen
Id String The ID of the CEN instance.
- host
Region StringId The service region. The service region is the target region of the PrivateZone service to be accessed through CEN.
- host
Vpc StringId 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.