• 沒有找到結果。

KMSArn key policy example

在文檔中 Amazon Route 53 (頁 60-71)

The following is an example of a KeyManagementServiceArn key policy that grants the correct permissions for DNSSEC.

{ "Version": "2012-10-17", "Id": "key-consolepolicy-3", "Statement": [

{

"Sid": "Allow use of the customer managed key for DNSSEC", "Effect": "Allow",

"Principal": {

"Service": "dnssec-route53.amazonaws.com"

},

"Action": [

"kms:DescribeKey", "kms:GetPublicKey", "kms:Sign",

"kms:Verify"

],

"Resource": "*"

}, {

"Sid": "Allow full access for Key Administrators", "Effect": "Allow",

"Principal": {

"AWS": "arn:aws:iam::1234567891234:role/admin"

},

"Action": "*", "Resource": "*"

} ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

CreateQueryLoggingConfig

Service: Amazon Route 53

Creates a configuration for DNS query logging. After you create a query logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group.

DNS query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such as the following:

• Route 53 edge location that responded to the DNS query

• Domain or subdomain that was requested

• DNS record type, such as A or AAAA

• DNS response code, such as NoError or ServFail

Log Group and Resource Policy

Before you create a query logging configuration, perform the following operations.

NoteIf you create a query logging configuration using the Route 53 console, Route 53 performs these operations automatically.

1. Create a CloudWatch Logs log group, and make note of the ARN, which you specify when you create a query logging configuration. Note the following:

• You must create the log group in the us-east-1 region.

• You must use the same AWS account to create the log group and the hosted zone that you want to configure query logging for.

• When you create log groups for query logging, we recommend that you use a consistent prefix, for example:

/aws/route53/hosted zone name

In the next step, you'll create a resource policy, which controls access to one or more log groups and the associated AWS resources, such as Route 53 hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same resource policy for all the log groups that you create for query logging.

2. Create a CloudWatch Logs resource policy, and give it the permissions that Route 53 needs to create log streams and to send query logs to log streams. For the value of Resource, specify the ARN for the log group that you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you created for query logging configurations, replace the hosted zone name with *, for example:

arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/*

To avoid the confused deputy problem, a security issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the following values:

• For aws:SourceArn, supply the hosted zone ARN used in creating the query logging

configuration. For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID.

• For aws:SourceAccount, supply the account ID for the account that creates the query logging configuration. For example, aws:SourceAccount:111111111111.

For more information, see The confused deputy problem in the AWS IAM User Guide.

NoteYou can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI.

Log Streams and Edge Locations

When Route 53 finishes creating the configuration for DNS query logging, it does the following:

• Creates a log stream for an edge location the first time that the edge location responds to DNS queries for the specified hosted zone. That log stream is used to log all queries that Route 53 responds to for that edge location.

• Begins to send query logs to the applicable log stream.

The name of each log stream is in the following format:

hosted zone ID/edge location code

The edge location code is a three-letter code and an arbitrarily assigned number, for example, DFW3.

The three-letter code typically corresponds with the International Air Transport Association airport code for an airport near the edge location. (These abbreviations might change in the future.) For a list of edge locations, see "The Route 53 Global Network" on the Route 53 Product Details page.

Queries That Are Logged

Query logs contain only the queries that DNS resolvers forward to Route 53. If a DNS resolver has already cached the response to a query (such as the IP address for a load balancer for example.com), the resolver will continue to return the cached response. It doesn't forward another query to Route 53 until the TTL for the corresponding resource record set expires. Depending on how many DNS queries are submitted for a resource record set, and depending on the TTL for that resource record set, query logs might contain information about only one query out of every several thousand queries that are submitted to DNS. For more information about how DNS works, see Routing Internet Traffic to Your Website or Web Application in the Amazon Route 53 Developer Guide.

Log File Format

For a list of the values in each query log and the format of each value, see Logging DNS Queries in the Amazon Route 53 Developer Guide.

Pricing

For information about charges for query logs, see Amazon CloudWatch Pricing.

How to Stop Logging

If you want Route 53 to stop sending query logs to CloudWatch Logs, delete the query logging configuration. For more information, see DeleteQueryLoggingConfig.

Request Syntax

POST /2013-04-01/queryloggingconfig HTTP/1.1

<?xml version="1.0" encoding="UTF-8"?>

<CreateQueryLoggingConfigRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">

<CloudWatchLogsLogGroupArn>string</CloudWatchLogsLogGroupArn>

<HostedZoneId>string</HostedZoneId>

</CreateQueryLoggingConfigRequest>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in XML format.

CreateQueryLoggingConfigRequest (p. 56)

Root level tag for the CreateQueryLoggingConfigRequest parameters.

Required: Yes

CloudWatchLogsLogGroupArn (p. 56)

The Amazon Resource Name (ARN) for the log group that you want to Amazon Route 53 to send query logs to. This is the format of the ARN:

arn:aws:logs:region:account-id:log-group:log_group_name

To get the ARN for a log group, you can use the CloudWatch console, the DescribeLogGroups API action, the describe-log-groups command, or the applicable command in one of the AWS SDKs.

Type: String Required: Yes HostedZoneId (p. 56)

The ID of the hosted zone that you want to log queries for. You can log queries only for public hosted zones.

Type: String

Length Constraints: Maximum length of 32.

Required: Yes

Response Syntax

HTTP/1.1 201 Location: Location

<?xml version="1.0" encoding="UTF-8"?>

<CreateQueryLoggingConfigResponse>

<QueryLoggingConfig>

<CloudWatchLogsLogGroupArn>string</CloudWatchLogsLogGroupArn>

<HostedZoneId>string</HostedZoneId>

<Id>string</Id>

</QueryLoggingConfig>

</CreateQueryLoggingConfigResponse>

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The response returns the following HTTP headers.

Location (p. 57)

The unique URL representing the new query logging configuration.

Length Constraints: Maximum length of 1024.

The following data is returned in XML format by the service.

CreateQueryLoggingConfigResponse (p. 57)

Root level tag for the CreateQueryLoggingConfigResponse parameters.

Required: Yes

QueryLoggingConfig (p. 57)

A complex type that contains the ID for a query logging configuration, the ID of the hosted zone that you want to log queries for, and the ARN for the log group that you want Amazon Route 53 to send query logs to.

Type: QueryLoggingConfig (p. 634) object

Errors

For information about the errors that are common to all actions, see Common Errors (p. 728).

ConcurrentModification

Another user submitted a request to create, update, or delete the object at the same time that you did. Retry the request.

HTTP Status Code: 400

InsufficientCloudWatchLogsResourcePolicy

Amazon Route 53 doesn't have the permissions required to create log streams and send query logs to log streams. Possible causes include the following:

• There is no resource policy that specifies the log group ARN in the value for Resource.

• The resource policy that includes the log group ARN in the value for Resource doesn't have the necessary permissions.

• The resource policy hasn't finished propagating yet.

• The Key management service (KMS) key you specified doesn’t exist or it can’t be used with the log group associated with query log. Update or provide a resource policy to grant permissions for the KMS key.

HTTP Status Code: 400 InvalidInput

The input is not valid.

HTTP Status Code: 400

NoSuchCloudWatchLogsLogGroup

There is no CloudWatch Logs log group with the specified ARN.

HTTP Status Code: 404 NoSuchHostedZone

No hosted zone exists with the ID that you specified.

HTTP Status Code: 404

QueryLoggingConfigAlreadyExists

You can create only one query logging configuration for a hosted zone, and a query logging configuration already exists for this hosted zone.

HTTP Status Code: 409

Examples

Example Request

The following request creates a configuration for the hosted zone Z1D633PJN98FT9. DNS query logs are sent to the log group with the ARN arn:aws:logs:us-east-1:111111111111:log-group:example.com:*.

POST /2013-04-01/queryloggingconfig HTTP/1.1

<?xml version="1.0" encoding="UTF-8"?>

<CreateQueryLoggingConfigRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">

<CloudWatchLogsLogGroupArn>arn:aws:logs:us-east-1:111111111111:log-group:/aws/route53/

example.com</CloudWatchLogsLogGroupArn>

<HostedZoneId>Z1D633PJN98FT9</HostedZoneId>

</CreateQueryLoggingConfigRequest>

Example Response

This example illustrates one usage of CreateQueryLoggingConfig.

HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>

<CreateQueryLoggingConfigResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">

<QueryLoggingConfig>

<CloudWatchLogsLogGroupArn>arn:aws:logs:us-east-1:111111111111:log-group:/aws/

route53/example.com</CloudWatchLogsLogGroupArn>

<HostedZoneId>Z1D633PJN98FT9</HostedZoneId>

<Id>87654321-dcba-1234-abcd-1a2b3c4d5e6f</Id>

</QueryLoggingConfig>

</CreateQueryLoggingConfigResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

CreateReusableDelegationSet

Service: Amazon Route 53

Creates a delegation set (a group of four name servers) that can be reused by multiple hosted zones that were created by the same AWS account.

You can also create a reusable delegation set that uses the four name servers that are associated with an existing hosted zone. Specify the hosted zone ID in the CreateReusableDelegationSet request.

NoteYou can't associate a reusable delegation set with a private hosted zone.

For information about using a reusable delegation set to configure white label name servers, see Configuring White Label Name Servers.

The process for migrating existing hosted zones to use a reusable delegation set is comparable to the process for configuring white label name servers. You need to perform the following steps:

1. Create a reusable delegation set.

2. Recreate hosted zones, and reduce the TTL to 60 seconds or less.

3. Recreate resource record sets in the new hosted zones.

4. Change the registrar's name servers to use the name servers for the new hosted zones.

5. Monitor traffic for the website or application.

6. Change TTLs back to their original values.

If you want to migrate existing hosted zones to use a reusable delegation set, the existing hosted zones can't use any of the name servers that are assigned to the reusable delegation set. If one or more hosted zones do use one or more name servers that are assigned to the reusable delegation set, you can do one of the following:

• For small numbers of hosted zones—up to a few hundred—it's relatively easy to create reusable delegation sets until you get one that has four name servers that don't overlap with any of the name servers in your hosted zones.

• For larger numbers of hosted zones, the easiest solution is to use more than one reusable delegation set.

• For larger numbers of hosted zones, you can also migrate hosted zones that have overlapping name servers to hosted zones that don't have overlapping name servers, then migrate the hosted zones again to use the reusable delegation set.

Request Syntax

POST /2013-04-01/delegationset HTTP/1.1

<?xml version="1.0" encoding="UTF-8"?>

<CreateReusableDelegationSetRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">

<CallerReference>string</CallerReference>

<HostedZoneId>string</HostedZoneId>

</CreateReusableDelegationSetRequest>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in XML format.

CreateReusableDelegationSetRequest (p. 60)

Root level tag for the CreateReusableDelegationSetRequest parameters.

Required: Yes CallerReference (p. 60)

A unique string that identifies the request, and that allows you to retry failed

CreateReusableDelegationSet requests without the risk of executing the operation twice. You must use a unique CallerReference string every time you submit a

CreateReusableDelegationSet request. CallerReference can be any unique string, for example a date/time stamp.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: Yes HostedZoneId (p. 60)

If you want to mark the delegation set for an existing hosted zone as reusable, the ID for that hosted zone.

Type: String

Length Constraints: Maximum length of 32.

Required: No

Response Syntax

HTTP/1.1 201 Location: Location

<?xml version="1.0" encoding="UTF-8"?>

<CreateReusableDelegationSetResponse>

<DelegationSet>

<CallerReference>string</CallerReference>

<Id>string</Id>

<NameServers>

<NameServer>string</NameServer>

</NameServers>

</DelegationSet>

</CreateReusableDelegationSetResponse>

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The response returns the following HTTP headers.

Location (p. 61)

The unique URL representing the new reusable delegation set.

Length Constraints: Maximum length of 1024.

The following data is returned in XML format by the service.

CreateReusableDelegationSetResponse (p. 61)

Root level tag for the CreateReusableDelegationSetResponse parameters.

Required: Yes DelegationSet (p. 61)

A complex type that contains name server information.

Type: DelegationSet (p. 604) object

Errors

For information about the errors that are common to all actions, see Common Errors (p. 728).

DelegationSetAlreadyCreated

A delegation set with the same owner and caller reference combination has already been created.

HTTP Status Code: 400 DelegationSetAlreadyReusable

The specified delegation set has already been marked as reusable.

HTTP Status Code: 400 DelegationSetNotAvailable

You can create a hosted zone that has the same name as an existing hosted zone (example.com is common), but there is a limit to the number of hosted zones that have the same name. If you get this error, Amazon Route 53 has reached that limit. If you own the domain name and Route 53 generates this error, contact Customer Support.

HTTP Status Code: 400 HostedZoneNotFound

The specified HostedZone can't be found.

HTTP Status Code: 400 InvalidArgument

Parameter name is not valid.

HTTP Status Code: 400 InvalidInput

The input is not valid.

HTTP Status Code: 400 LimitsExceeded

This operation can't be completed either because the current account has reached the limit on reusable delegation sets that it can create or because you've reached the limit on the number of Amazon VPCs that you can associate with a private hosted zone. To get the current limit on the number of reusable delegation sets, see GetAccountLimit. To get the current limit on the number of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit. To request a higher limit, create a case with the AWS Support Center.

HTTP Status Code: 400

Examples

Example Request

This example illustrates one usage of CreateReusableDelegationSet.

POST /2013-04-01/delegationset HTTP/1.1

<?xml version="1.0" encoding="UTF-8"?>

<CreateReusableDelegationSetRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">

<CallerReference>2017-03-15T01:36:41.958Z</CallerReference>

<HostedZoneId>Z1D633PEXAMPLE</HostedZoneId>

</CreateReusableDelegationSetRequest>

Example Response

This example illustrates one usage of CreateReusableDelegationSet.

HTTP/1.1 201 Created

<?xml version="1.0" encoding="UTF-8"?>

<CreateReusableDelegationSetResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">

<DelegationSet>

<Id>/delegationset/N1PA6795SAMPLE</Id>

<CallerReference>2017-03-15T01:36:41.958Z</CallerReference>

<NameServers>

<NameServer>ns-2048.awsdns-64.com</NameServer>

<NameServer>ns-2049.awsdns-65.net</NameServer>

<NameServer>ns-2050.awsdns-66.org</NameServer>

<NameServer>ns-2051.awsdns-67.co.uk</NameServer>

</NameServers>

</DelegationSet>

</CreateReusableDelegationSetResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

在文檔中 Amazon Route 53 (頁 60-71)