amazonka-route53-1.5.0: Amazon Route 53 SDK.

Copyright(c) 2013-2017 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Route53.CreateQueryLoggingConfig

Contents

Description

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 Amazon Route 53 receives for a specified public hosted zone, such as the following:

  • Amazon 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.
  • 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:
awsroute53/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 Amazon 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.

  • Create a CloudWatch Logs resource policy, and give it the permissions that Amazon Route 53 needs to create log streams and to 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:awsroute53/*
  • Log Streams and Edge Locations * When Amazon 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 Amazon 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 Amazon Route 53 Global Network" on the Amazon Route 53 Product Details page.

  • Queries That Are Logged * Query logs contain only the queries that DNS resolvers forward to Amazon 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 Amazon 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 Amazon Route 53 to stop sending query logs to CloudWatch Logs, delete the query logging configuration. For more information, see DeleteQueryLoggingConfig .

Synopsis

Creating a Request

createQueryLoggingConfig Source #

Creates a value of CreateQueryLoggingConfig with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • cqlcHostedZoneId - The ID of the hosted zone that you want to log queries for. You can log queries only for public hosted zones.
  • cqlcCloudWatchLogsLogGroupARN - 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.

data CreateQueryLoggingConfig Source #

See: createQueryLoggingConfig smart constructor.

Instances

Eq CreateQueryLoggingConfig Source # 
Data CreateQueryLoggingConfig Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateQueryLoggingConfig -> c CreateQueryLoggingConfig #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateQueryLoggingConfig #

toConstr :: CreateQueryLoggingConfig -> Constr #

dataTypeOf :: CreateQueryLoggingConfig -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CreateQueryLoggingConfig) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateQueryLoggingConfig) #

gmapT :: (forall b. Data b => b -> b) -> CreateQueryLoggingConfig -> CreateQueryLoggingConfig #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateQueryLoggingConfig -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateQueryLoggingConfig -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateQueryLoggingConfig -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateQueryLoggingConfig -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateQueryLoggingConfig -> m CreateQueryLoggingConfig #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateQueryLoggingConfig -> m CreateQueryLoggingConfig #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateQueryLoggingConfig -> m CreateQueryLoggingConfig #

Read CreateQueryLoggingConfig Source # 
Show CreateQueryLoggingConfig Source # 
Generic CreateQueryLoggingConfig Source # 
Hashable CreateQueryLoggingConfig Source # 
NFData CreateQueryLoggingConfig Source # 
AWSRequest CreateQueryLoggingConfig Source # 
ToElement CreateQueryLoggingConfig Source # 
ToXML CreateQueryLoggingConfig Source # 
ToQuery CreateQueryLoggingConfig Source # 
ToPath CreateQueryLoggingConfig Source # 
ToHeaders CreateQueryLoggingConfig Source # 
type Rep CreateQueryLoggingConfig Source # 
type Rep CreateQueryLoggingConfig = D1 (MetaData "CreateQueryLoggingConfig" "Network.AWS.Route53.CreateQueryLoggingConfig" "amazonka-route53-1.5.0-A9em4xt2RK07uc01kiXLe0" False) (C1 (MetaCons "CreateQueryLoggingConfig'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_cqlcHostedZoneId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ResourceId)) (S1 (MetaSel (Just Symbol "_cqlcCloudWatchLogsLogGroupARN") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))
type Rs CreateQueryLoggingConfig Source # 

Request Lenses

cqlcHostedZoneId :: Lens' CreateQueryLoggingConfig ResourceId Source #

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

cqlcCloudWatchLogsLogGroupARN :: Lens' CreateQueryLoggingConfig Text Source #

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.

Destructuring the Response

createQueryLoggingConfigResponse Source #

Creates a value of CreateQueryLoggingConfigResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • cqlcrsResponseStatus - -- | The response status code.
  • cqlcrsQueryLoggingConfig - 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.
  • cqlcrsLocation - The unique URL representing the new query logging configuration.

data CreateQueryLoggingConfigResponse Source #

See: createQueryLoggingConfigResponse smart constructor.

Instances

Eq CreateQueryLoggingConfigResponse Source # 
Data CreateQueryLoggingConfigResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateQueryLoggingConfigResponse -> c CreateQueryLoggingConfigResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateQueryLoggingConfigResponse #

toConstr :: CreateQueryLoggingConfigResponse -> Constr #

dataTypeOf :: CreateQueryLoggingConfigResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CreateQueryLoggingConfigResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateQueryLoggingConfigResponse) #

gmapT :: (forall b. Data b => b -> b) -> CreateQueryLoggingConfigResponse -> CreateQueryLoggingConfigResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateQueryLoggingConfigResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateQueryLoggingConfigResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateQueryLoggingConfigResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateQueryLoggingConfigResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateQueryLoggingConfigResponse -> m CreateQueryLoggingConfigResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateQueryLoggingConfigResponse -> m CreateQueryLoggingConfigResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateQueryLoggingConfigResponse -> m CreateQueryLoggingConfigResponse #

Read CreateQueryLoggingConfigResponse Source # 
Show CreateQueryLoggingConfigResponse Source # 
Generic CreateQueryLoggingConfigResponse Source # 
NFData CreateQueryLoggingConfigResponse Source # 
type Rep CreateQueryLoggingConfigResponse Source # 
type Rep CreateQueryLoggingConfigResponse = D1 (MetaData "CreateQueryLoggingConfigResponse" "Network.AWS.Route53.CreateQueryLoggingConfig" "amazonka-route53-1.5.0-A9em4xt2RK07uc01kiXLe0" False) (C1 (MetaCons "CreateQueryLoggingConfigResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_cqlcrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)) ((:*:) (S1 (MetaSel (Just Symbol "_cqlcrsQueryLoggingConfig") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 QueryLoggingConfig)) (S1 (MetaSel (Just Symbol "_cqlcrsLocation") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))

Response Lenses

cqlcrsQueryLoggingConfig :: Lens' CreateQueryLoggingConfigResponse QueryLoggingConfig Source #

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.

cqlcrsLocation :: Lens' CreateQueryLoggingConfigResponse Text Source #

The unique URL representing the new query logging configuration.