Class Zone
Manages a Route53 Hosted Zone.
Example Usage
Public Zone
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var primary = new Aws.Route53.Zone("primary", new Aws.Route53.ZoneArgs
{
});
}
}
Public Subdomain Zone
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var main = new Aws.Route53.Zone("main", new Aws.Route53.ZoneArgs
{
});
var dev = new Aws.Route53.Zone("dev", new Aws.Route53.ZoneArgs
{
Tags =
{
{ "Environment", "dev" },
},
});
var dev_ns = new Aws.Route53.Record("dev-ns", new Aws.Route53.RecordArgs
{
Name = "dev.example.com",
Records =
{
dev.NameServers.Apply(nameServers => nameServers[0]),
dev.NameServers.Apply(nameServers => nameServers[1]),
dev.NameServers.Apply(nameServers => nameServers[2]),
dev.NameServers.Apply(nameServers => nameServers[3]),
},
Ttl = "30",
Type = "NS",
ZoneId = main.ZoneId,
});
}
}
Private Zone
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var @private = new Aws.Route53.Zone("private", new Aws.Route53.ZoneArgs
{
Vpcs =
{
new Aws.Route53.Inputs.ZoneVpcArgs
{
VpcId = aws_vpc.Example.Id,
},
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Route53
Assembly: Pulumi.Aws.dll
Syntax
public class Zone : CustomResource
Constructors
View SourceZone(String, ZoneArgs, CustomResourceOptions)
Create a Zone resource with the given unique name, arguments, and options.
Declaration
public Zone(string name, ZoneArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ZoneArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceComment
A comment for the hosted zone. Defaults to 'Managed by Pulumi'.
Declaration
public Output<string> Comment { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DelegationSetId
The ID of the reusable delegation set whose NS records you want to assign to the hosted zone. Conflicts with vpc as delegation sets can only be used for public zones.
Declaration
public Output<string> DelegationSetId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ForceDestroy
Whether to destroy all records (possibly managed outside of this provider) in the zone when destroying the zone.
Declaration
public Output<bool?> ForceDestroy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Name
This is the name of the hosted zone.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NameServers
A list of name servers in associated (or default) delegation set. Find more about delegation sets in AWS docs.
Declaration
public Output<ImmutableArray<string>> NameServers { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
A mapping of tags to assign to the zone.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Vpcs
Configuration block(s) specifying VPC(s) to associate with a private hosted zone. Conflicts with the delegation_set_id argument in this resource and any aws.route53.ZoneAssociation resource specifying the same zone ID. Detailed below.
Declaration
public Output<ImmutableArray<ZoneVpc>> Vpcs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ZoneVpc>> |
ZoneId
The Hosted Zone ID. This can be referenced by zone records.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ZoneState, CustomResourceOptions)
Get an existing Zone resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Zone Get(string name, Input<string> id, ZoneState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ZoneState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Zone |