Class QueryLog
Provides a Route53 query logging configuration resource.
NOTE: There are restrictions on the configuration of query logging. Notably, the CloudWatch log group must be in the
us-east-1region, a permissive CloudWatch log resource policy must be in place, and the Route53 hosted zone must be public. See Configuring Logging for DNS Queries for additional details.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var us_east_1 = new Aws.Provider("us-east-1", new Aws.ProviderArgs
{
Region = "us-east-1",
});
var awsRoute53ExampleCom = new Aws.CloudWatch.LogGroup("awsRoute53ExampleCom", new Aws.CloudWatch.LogGroupArgs
{
RetentionInDays = 30,
});
var route53_query_logging_policyPolicyDocument = Output.Create(Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
{
Statements =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
{
Actions =
{
"logs:CreateLogStream",
"logs:PutLogEvents",
},
Principals =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
{
Identifiers =
{
"route53.amazonaws.com",
},
Type = "Service",
},
},
Resources =
{
"arn:aws:logs:*:*:log-group:/aws/route53/*",
},
},
},
}));
var route53_query_logging_policyLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("route53-query-logging-policyLogResourcePolicy", new Aws.CloudWatch.LogResourcePolicyArgs
{
PolicyDocument = route53_query_logging_policyPolicyDocument.Apply(route53_query_logging_policyPolicyDocument => route53_query_logging_policyPolicyDocument.Json),
PolicyName = "route53-query-logging-policy",
});
var exampleComZone = new Aws.Route53.Zone("exampleComZone", new Aws.Route53.ZoneArgs
{
});
var exampleComQueryLog = new Aws.Route53.QueryLog("exampleComQueryLog", new Aws.Route53.QueryLogArgs
{
CloudwatchLogGroupArn = awsRoute53ExampleCom.Arn,
ZoneId = exampleComZone.ZoneId,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Route53
Assembly: Pulumi.Aws.dll
Syntax
public class QueryLog : CustomResource
Constructors
View SourceQueryLog(String, QueryLogArgs, CustomResourceOptions)
Create a QueryLog resource with the given unique name, arguments, and options.
Declaration
public QueryLog(string name, QueryLogArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| QueryLogArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCloudwatchLogGroupArn
CloudWatch log group ARN to send query logs.
Declaration
public Output<string> CloudwatchLogGroupArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ZoneId
Route53 hosted zone ID to enable query logs.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, QueryLogState, CustomResourceOptions)
Get an existing QueryLog resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static QueryLog Get(string name, Input<string> id, QueryLogState 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. |
| QueryLogState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| QueryLog |