Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use CreateHostedZone
with an Amazon SDK or CLI
The following code examples show how to use CreateHostedZone
.
- CLI
-
- Amazon CLI
-
To create a hosted zone
The following create-hosted-zone
command adds a hosted zone named example.com
using the caller reference 2014-04-01-18:47
. The optional comment includes a space, so it must be enclosed in quotation marks:
aws route53 create-hosted-zone --name example.com
--caller-reference 2014-04-01-18:47
--hosted-zone-config Comment="command-line version"
For more information, see Working with Hosted Zones in the Amazon Route 53 Developer Guide.
- PowerShell
-
- Tools for PowerShell
-
Example 1: Creates a new hosted zone named 'example.com', associated with a reusable delegation set. Note that you must supply a value for the CallerReference parameter so that requests that need to be retried if necessary without the risk of executing the operation twice. Because the hosted zone is being created in a VPC it is automatically private and you should not set the -HostedZoneConfig_PrivateZone parameter.
$params = @{
Name="example.com"
CallerReference="myUniqueIdentifier"
HostedZoneConfig_Comment="This is my first hosted zone"
DelegationSetId="NZ8X2CISAMPLE"
VPC_VPCId="vpc-1a2b3c4d"
VPC_VPCRegion="us-east-1"
}
New-R53HostedZone @params
For a complete list of Amazon SDK developer guides and code examples, see
Using Route 53 with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.