generated from dynatrace-oss/template-project
-
Notifications
You must be signed in to change notification settings - Fork 5
/
dynatrace-aws-s3-log-forwarder-configuration.yaml
119 lines (103 loc) · 4.78 KB
/
dynatrace-aws-s3-log-forwarder-configuration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
AWSTemplateFormatVersion: "2010-09-09"
Description: |
dynatrace-aws-s3-log-forwarder-configuration
This template deploys log forwarding and log processing rules to be used by the dynatrace-aws-s3-log-forwarder
AWS Lambda function using AWS AppConfig hosted configurations. The template is provided with a default forward all rule.
You can modify this template to deploy your custom log forwarding and log processing rules that control the
behavior of the log forwarder. All changes are versioned in AWS AppConfig configuration profiles.
NOTE: There's a limit of 1 MB of size per configuration profile.
For more information: https://github.com/dynatrace-oss/dynatrace-aws-s3-log-forwarder
Metadata:
License:
Description: |
Copyright 2023 Dynatrace LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Version:
Description: dev
Instructions:
Description: |
This stack deploys your log forwarding and custom log processing log processing rules for the log forwarding AWS Lambda function.
To deploy, run the following AWS CLI:
aws cloudformation deploy \
--template-file dynatrace-aws-s3-log-forwarder-configuration.yaml \
--stack-name dynatrace-aws-s3-log-forwarder-configuration-{your-log-forwarder-stack-name-here} \
--parameter-overrides DynatraceAwsS3LogForwarderStackName={your-log-forwarder-stack-name-here}
Parameters:
DynatraceAwsS3LogForwarderStackName:
Type: String
Description: Name of the CloudFormation stack where you have deployed the dynatrace-aws-s3-log-forwarder
Resources:
LogForwardingRulesHostedConfiguration:
Type: AWS::AppConfig::HostedConfigurationVersion
Properties:
Description: dynatrace-aws-s3-log-forwarder log forwarding rules
ApplicationId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigApplicationId
ConfigurationProfileId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:LogForwardingConfigurationProfileId
ContentType: application/x-yaml
Content: |
---
bucket_name: default
log_forwarding_rules:
- name: default_forward_all
# Match any file in your buckets
prefix: ".*"
# Process as AWS-vended log (automatic fallback to generic text log ingestion if log is not recognized).
source: aws
LogProcessingRulesHostedConfiguration:
Type: AWS::AppConfig::HostedConfigurationVersion
Properties:
Description: dynatrace-aws-s3-log-forwarder log processing rules
ApplicationId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigApplicationId
ConfigurationProfileId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:LogProcessingConfigurationProfileId
ContentType: application/x-yaml
Content: |
---
LogForwardingRulesDeployment:
Type: AWS::AppConfig::Deployment
Properties:
ApplicationId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigApplicationId
ConfigurationProfileId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:LogForwardingConfigurationProfileId
DeploymentStrategyId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigDeploymentStrategyId
EnvironmentId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigEnvironmentId
ConfigurationVersion: !Ref LogForwardingRulesHostedConfiguration
LogProcessingRulesDeployment:
Type: AWS::AppConfig::Deployment
DependsOn: LogForwardingRulesDeployment
Properties:
ApplicationId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigApplicationId
ConfigurationProfileId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:LogProcessingConfigurationProfileId
DeploymentStrategyId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigDeploymentStrategyId
EnvironmentId:
Fn::ImportValue:
!Sub ${DynatraceAwsS3LogForwarderStackName}:AppConfigEnvironmentId
ConfigurationVersion: !Ref LogProcessingRulesHostedConfiguration