Skip to content

Commit

Permalink
add optional access logs target bucket Resolves #764 (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
xnick123 authored May 30, 2024
1 parent 61f1670 commit 7f551c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aws/logs_monitoring/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ Parameters:
Type: String
Default: ""
Description: The name of the forwarder bucket to create. If not provided, AWS will generate a unique name.
DdForwarderBucketsAccessLogsTarget:
Type: String
Default: ""
Description: (Optional) The name of the S3 bucket to store access logs. Leave empty if access logging is not needed.
DdStoreFailedEvents:
Type: String
Default: false
Expand Down Expand Up @@ -433,6 +437,7 @@ Conditions:
- Fn::Equals:
- Ref: ReservedConcurrency
- ""
ShouldUseAccessLogBucket: !Not [!Equals [!Ref DdForwarderBucketsAccessLogsTarget, ""]]
SetForwarderBucket:
Fn::Or:
- Condition: CreateS3Bucket
Expand Down Expand Up @@ -886,6 +891,13 @@ Resources:
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
LoggingConfiguration:
!If
- ShouldUseAccessLogBucket
-
DestinationBucketName: !Ref DdForwarderBucketsAccessLogsTarget
LogFilePrefix: "datadog-forwarder/"
- !Ref "AWS::NoValue"
LifecycleConfiguration:
Rules:
- Id: delete-incomplete-mpu-7days
Expand Down

0 comments on commit 7f551c3

Please sign in to comment.