tencentcloud.PrivateDnsZoneVpcAttachment
Explore with Pulumi AI
Provides a resource to create a PrivateDns zone_vpc_attachment
NOTE: If you need to bind account A to account B’s VPC resources, you need to first grant role authorization to account A.
Example Usage
Append VPC associated with private dns zone
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const examplePrivateDnsZone = new tencentcloud.PrivateDnsZone("examplePrivateDnsZone", {
domain: "domain.com",
remark: "remark.",
dnsForwardStatus: "DISABLED",
cnameSpeedupStatus: "ENABLED",
tags: {
createdBy: "terraform",
},
});
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const examplePrivateDnsZoneVpcAttachment = new tencentcloud.PrivateDnsZoneVpcAttachment("examplePrivateDnsZoneVpcAttachment", {
zoneId: examplePrivateDnsZone.privateDnsZoneId,
vpcSet: {
uniqVpcId: vpc.vpcId,
region: "ap-guangzhou",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_private_dns_zone = tencentcloud.PrivateDnsZone("examplePrivateDnsZone",
domain="domain.com",
remark="remark.",
dns_forward_status="DISABLED",
cname_speedup_status="ENABLED",
tags={
"createdBy": "terraform",
})
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
example_private_dns_zone_vpc_attachment = tencentcloud.PrivateDnsZoneVpcAttachment("examplePrivateDnsZoneVpcAttachment",
zone_id=example_private_dns_zone.private_dns_zone_id,
vpc_set={
"uniq_vpc_id": vpc.vpc_id,
"region": "ap-guangzhou",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
examplePrivateDnsZone, err := tencentcloud.NewPrivateDnsZone(ctx, "examplePrivateDnsZone", &tencentcloud.PrivateDnsZoneArgs{
Domain: pulumi.String("domain.com"),
Remark: pulumi.String("remark."),
DnsForwardStatus: pulumi.String("DISABLED"),
CnameSpeedupStatus: pulumi.String("ENABLED"),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("terraform"),
},
})
if err != nil {
return err
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewPrivateDnsZoneVpcAttachment(ctx, "examplePrivateDnsZoneVpcAttachment", &tencentcloud.PrivateDnsZoneVpcAttachmentArgs{
ZoneId: examplePrivateDnsZone.PrivateDnsZoneId,
VpcSet: &tencentcloud.PrivateDnsZoneVpcAttachmentVpcSetArgs{
UniqVpcId: vpc.VpcId,
Region: pulumi.String("ap-guangzhou"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var examplePrivateDnsZone = new Tencentcloud.PrivateDnsZone("examplePrivateDnsZone", new()
{
Domain = "domain.com",
Remark = "remark.",
DnsForwardStatus = "DISABLED",
CnameSpeedupStatus = "ENABLED",
Tags =
{
{ "createdBy", "terraform" },
},
});
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
var examplePrivateDnsZoneVpcAttachment = new Tencentcloud.PrivateDnsZoneVpcAttachment("examplePrivateDnsZoneVpcAttachment", new()
{
ZoneId = examplePrivateDnsZone.PrivateDnsZoneId,
VpcSet = new Tencentcloud.Inputs.PrivateDnsZoneVpcAttachmentVpcSetArgs
{
UniqVpcId = vpc.VpcId,
Region = "ap-guangzhou",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PrivateDnsZone;
import com.pulumi.tencentcloud.PrivateDnsZoneArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.PrivateDnsZoneVpcAttachment;
import com.pulumi.tencentcloud.PrivateDnsZoneVpcAttachmentArgs;
import com.pulumi.tencentcloud.inputs.PrivateDnsZoneVpcAttachmentVpcSetArgs;
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 examplePrivateDnsZone = new PrivateDnsZone("examplePrivateDnsZone", PrivateDnsZoneArgs.builder()
.domain("domain.com")
.remark("remark.")
.dnsForwardStatus("DISABLED")
.cnameSpeedupStatus("ENABLED")
.tags(Map.of("createdBy", "terraform"))
.build());
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var examplePrivateDnsZoneVpcAttachment = new PrivateDnsZoneVpcAttachment("examplePrivateDnsZoneVpcAttachment", PrivateDnsZoneVpcAttachmentArgs.builder()
.zoneId(examplePrivateDnsZone.privateDnsZoneId())
.vpcSet(PrivateDnsZoneVpcAttachmentVpcSetArgs.builder()
.uniqVpcId(vpc.vpcId())
.region("ap-guangzhou")
.build())
.build());
}
}
resources:
examplePrivateDnsZone:
type: tencentcloud:PrivateDnsZone
properties:
domain: domain.com
remark: remark.
dnsForwardStatus: DISABLED
cnameSpeedupStatus: ENABLED
tags:
createdBy: terraform
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
examplePrivateDnsZoneVpcAttachment:
type: tencentcloud:PrivateDnsZoneVpcAttachment
properties:
zoneId: ${examplePrivateDnsZone.privateDnsZoneId}
vpcSet:
uniqVpcId: ${vpc.vpcId}
region: ap-guangzhou
Add VPC information for associated accounts in the private dns zone
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.PrivateDnsZoneVpcAttachment("example", {
zoneId: tencentcloud_private_dns_zone.example.id,
accountVpcSet: {
uniqVpcId: "vpc-82znjzn3",
region: "ap-guangzhou",
uin: "100017155920",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.PrivateDnsZoneVpcAttachment("example",
zone_id=tencentcloud_private_dns_zone["example"]["id"],
account_vpc_set={
"uniq_vpc_id": "vpc-82znjzn3",
"region": "ap-guangzhou",
"uin": "100017155920",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewPrivateDnsZoneVpcAttachment(ctx, "example", &tencentcloud.PrivateDnsZoneVpcAttachmentArgs{
ZoneId: pulumi.Any(tencentcloud_private_dns_zone.Example.Id),
AccountVpcSet: &tencentcloud.PrivateDnsZoneVpcAttachmentAccountVpcSetArgs{
UniqVpcId: pulumi.String("vpc-82znjzn3"),
Region: pulumi.String("ap-guangzhou"),
Uin: pulumi.String("100017155920"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.PrivateDnsZoneVpcAttachment("example", new()
{
ZoneId = tencentcloud_private_dns_zone.Example.Id,
AccountVpcSet = new Tencentcloud.Inputs.PrivateDnsZoneVpcAttachmentAccountVpcSetArgs
{
UniqVpcId = "vpc-82znjzn3",
Region = "ap-guangzhou",
Uin = "100017155920",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PrivateDnsZoneVpcAttachment;
import com.pulumi.tencentcloud.PrivateDnsZoneVpcAttachmentArgs;
import com.pulumi.tencentcloud.inputs.PrivateDnsZoneVpcAttachmentAccountVpcSetArgs;
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 example = new PrivateDnsZoneVpcAttachment("example", PrivateDnsZoneVpcAttachmentArgs.builder()
.zoneId(tencentcloud_private_dns_zone.example().id())
.accountVpcSet(PrivateDnsZoneVpcAttachmentAccountVpcSetArgs.builder()
.uniqVpcId("vpc-82znjzn3")
.region("ap-guangzhou")
.uin("100017155920")
.build())
.build());
}
}
resources:
example:
type: tencentcloud:PrivateDnsZoneVpcAttachment
properties:
zoneId: ${tencentcloud_private_dns_zone.example.id}
accountVpcSet:
uniqVpcId: vpc-82znjzn3
region: ap-guangzhou
uin: '100017155920'
Create PrivateDnsZoneVpcAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateDnsZoneVpcAttachment(name: string, args: PrivateDnsZoneVpcAttachmentArgs, opts?: CustomResourceOptions);
@overload
def PrivateDnsZoneVpcAttachment(resource_name: str,
args: PrivateDnsZoneVpcAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PrivateDnsZoneVpcAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
zone_id: Optional[str] = None,
account_vpc_set: Optional[PrivateDnsZoneVpcAttachmentAccountVpcSetArgs] = None,
private_dns_zone_vpc_attachment_id: Optional[str] = None,
vpc_set: Optional[PrivateDnsZoneVpcAttachmentVpcSetArgs] = None)
func NewPrivateDnsZoneVpcAttachment(ctx *Context, name string, args PrivateDnsZoneVpcAttachmentArgs, opts ...ResourceOption) (*PrivateDnsZoneVpcAttachment, error)
public PrivateDnsZoneVpcAttachment(string name, PrivateDnsZoneVpcAttachmentArgs args, CustomResourceOptions? opts = null)
public PrivateDnsZoneVpcAttachment(String name, PrivateDnsZoneVpcAttachmentArgs args)
public PrivateDnsZoneVpcAttachment(String name, PrivateDnsZoneVpcAttachmentArgs args, CustomResourceOptions options)
type: tencentcloud:PrivateDnsZoneVpcAttachment
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 PrivateDnsZoneVpcAttachmentArgs
- 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 PrivateDnsZoneVpcAttachmentArgs
- 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 PrivateDnsZoneVpcAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateDnsZoneVpcAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateDnsZoneVpcAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PrivateDnsZoneVpcAttachment 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 PrivateDnsZoneVpcAttachment resource accepts the following input properties:
- Zone
Id string - PrivateZone ID.
- Account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set - New add account vpc info.
- Private
Dns stringZone Vpc Attachment Id - ID of the resource.
- Vpc
Set PrivateDns Zone Vpc Attachment Vpc Set - New add vpc info.
- Zone
Id string - PrivateZone ID.
- Account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set Args - New add account vpc info.
- Private
Dns stringZone Vpc Attachment Id - ID of the resource.
- Vpc
Set PrivateDns Zone Vpc Attachment Vpc Set Args - New add vpc info.
- zone
Id String - PrivateZone ID.
- account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set - New add account vpc info.
- private
Dns StringZone Vpc Attachment Id - ID of the resource.
- vpc
Set PrivateDns Zone Vpc Attachment Vpc Set - New add vpc info.
- zone
Id string - PrivateZone ID.
- account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set - New add account vpc info.
- private
Dns stringZone Vpc Attachment Id - ID of the resource.
- vpc
Set PrivateDns Zone Vpc Attachment Vpc Set - New add vpc info.
- zone_
id str - PrivateZone ID.
- account_
vpc_ Privateset Dns Zone Vpc Attachment Account Vpc Set Args - New add account vpc info.
- private_
dns_ strzone_ vpc_ attachment_ id - ID of the resource.
- vpc_
set PrivateDns Zone Vpc Attachment Vpc Set Args - New add vpc info.
- zone
Id String - PrivateZone ID.
- account
Vpc Property MapSet - New add account vpc info.
- private
Dns StringZone Vpc Attachment Id - ID of the resource.
- vpc
Set Property Map - New add vpc info.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateDnsZoneVpcAttachment 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 PrivateDnsZoneVpcAttachment Resource
Get an existing PrivateDnsZoneVpcAttachment 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?: PrivateDnsZoneVpcAttachmentState, opts?: CustomResourceOptions): PrivateDnsZoneVpcAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_vpc_set: Optional[PrivateDnsZoneVpcAttachmentAccountVpcSetArgs] = None,
private_dns_zone_vpc_attachment_id: Optional[str] = None,
vpc_set: Optional[PrivateDnsZoneVpcAttachmentVpcSetArgs] = None,
zone_id: Optional[str] = None) -> PrivateDnsZoneVpcAttachment
func GetPrivateDnsZoneVpcAttachment(ctx *Context, name string, id IDInput, state *PrivateDnsZoneVpcAttachmentState, opts ...ResourceOption) (*PrivateDnsZoneVpcAttachment, error)
public static PrivateDnsZoneVpcAttachment Get(string name, Input<string> id, PrivateDnsZoneVpcAttachmentState? state, CustomResourceOptions? opts = null)
public static PrivateDnsZoneVpcAttachment get(String name, Output<String> id, PrivateDnsZoneVpcAttachmentState state, CustomResourceOptions options)
resources: _: type: tencentcloud:PrivateDnsZoneVpcAttachment 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.
- Account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set - New add account vpc info.
- Private
Dns stringZone Vpc Attachment Id - ID of the resource.
- Vpc
Set PrivateDns Zone Vpc Attachment Vpc Set - New add vpc info.
- Zone
Id string - PrivateZone ID.
- Account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set Args - New add account vpc info.
- Private
Dns stringZone Vpc Attachment Id - ID of the resource.
- Vpc
Set PrivateDns Zone Vpc Attachment Vpc Set Args - New add vpc info.
- Zone
Id string - PrivateZone ID.
- account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set - New add account vpc info.
- private
Dns StringZone Vpc Attachment Id - ID of the resource.
- vpc
Set PrivateDns Zone Vpc Attachment Vpc Set - New add vpc info.
- zone
Id String - PrivateZone ID.
- account
Vpc PrivateSet Dns Zone Vpc Attachment Account Vpc Set - New add account vpc info.
- private
Dns stringZone Vpc Attachment Id - ID of the resource.
- vpc
Set PrivateDns Zone Vpc Attachment Vpc Set - New add vpc info.
- zone
Id string - PrivateZone ID.
- account_
vpc_ Privateset Dns Zone Vpc Attachment Account Vpc Set Args - New add account vpc info.
- private_
dns_ strzone_ vpc_ attachment_ id - ID of the resource.
- vpc_
set PrivateDns Zone Vpc Attachment Vpc Set Args - New add vpc info.
- zone_
id str - PrivateZone ID.
- account
Vpc Property MapSet - New add account vpc info.
- private
Dns StringZone Vpc Attachment Id - ID of the resource.
- vpc
Set Property Map - New add vpc info.
- zone
Id String - PrivateZone ID.
Supporting Types
PrivateDnsZoneVpcAttachmentAccountVpcSet, PrivateDnsZoneVpcAttachmentAccountVpcSetArgs
- region str
- Vpc region.
- uin str
- Vpc owner uin. To grant role authorization to this account.
- uniq_
vpc_ strid - Uniq Vpc Id.
PrivateDnsZoneVpcAttachmentVpcSet, PrivateDnsZoneVpcAttachmentVpcSetArgs
- region str
- Vpc region.
- uniq_
vpc_ strid - Uniq Vpc Id.
Import
PrivateDns zone_vpc_attachment can be imported using the id, e.g.
$ pulumi import tencentcloud:index/privateDnsZoneVpcAttachment:PrivateDnsZoneVpcAttachment example zone-6t11lof0#vpc-jdx11z0t
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.