Skip to content

Commit 04c77ec

Browse files
authored
AWS-1786 Add ability to not set ReservedConcurrency on log forwarder lambda (#610)
* AWS-1786 Add ability to not set ReservedConcurrency on log forwarder lambda * AWS-1786 update CURRENT_VERSION grep to work with gnu grep
1 parent 49920ad commit 04c77ec

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

aws/logs_monitoring/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
LAYER_NAME="Datadog-Forwarder"
88

99
# Read the current version
10-
CURRENT_VERSION=$(grep -o 'Version: \d\+\.\d\+\.\d\+' template.yaml | cut -d' ' -f2)
10+
CURRENT_VERSION=$(grep -E -o 'Version: [0-9]+\.[0-9]+\.[0-9]+' template.yaml | cut -d' ' -f2)
1111

1212
# Read the desired version
1313
if [ -z "$1" ]; then

aws/logs_monitoring/template.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ Parameters:
217217
Type: String
218218
Default: ""
219219
Description: The name of the forwarder bucket to create. If not provided, AWS will generate a unique name.
220+
UseReservedConcurrency:
221+
Type: String
222+
Default: true
223+
AllowedValues:
224+
- true
225+
- false
226+
Description: Configure the Datadog Forwarder Lambda to use reserved concurrency. Set to false to use unreserved account concurrency.
220227
Conditions:
221228
IsAWSChina:
222229
Fn::Equals:
@@ -397,6 +404,10 @@ Conditions:
397404
- Fn::Equals:
398405
- Ref: DdForwarderBucketName
399406
- ""
407+
SetReservedConcurrentExecutions:
408+
Fn::Equals:
409+
- Ref: UseReservedConcurrency
410+
- true
400411
Rules:
401412
MustSetDdApiKey:
402413
Assertions:
@@ -618,7 +629,10 @@ Resources:
618629
- Ref: DdTraceIntakeUrl
619630
- Ref: AWS::NoValue
620631
ReservedConcurrentExecutions:
621-
Ref: ReservedConcurrency
632+
Fn::If:
633+
- SetReservedConcurrentExecutions
634+
- Ref: ReservedConcurrency
635+
- Ref: AWS::NoValue
622636
VpcConfig:
623637
Fn::If:
624638
- UseVPC
@@ -1052,6 +1066,7 @@ Metadata:
10521066
- DdTraceIntakeUrl
10531067
- AdditionalTargetLambdaArns
10541068
- DdForwarderBucketName
1069+
- UseReservedConcurrency
10551070
ParameterLabels:
10561071
DdApiKey:
10571072
default: "DdApiKey *"

aws/logs_monitoring/tools/installation_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN_ID=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c10)
2525
# Since we never run the log forwarder, api key can be anything.
2626
DD_API_KEY=RUN_ID
2727

28-
CURRENT_VERSION="$(grep -o 'Version: \d\+\.\d\+\.\d\+' template.yaml | cut -d' ' -f2)"
28+
CURRENT_VERSION="$(grep -E -o 'Version: [0-9]+\.[0-9]+\.[0-9]+' template.yaml | cut -d' ' -f2)"
2929

3030
function aws-login() {
3131
cfg=( "$@" )
@@ -78,4 +78,4 @@ RUN_ID=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c10)
7878
echo
7979
echo "Running Publish with Layer test"
8080
LAYER_ARN="arn:aws:lambda:${AWS_REGION}:${CURRENT_ACCOUNT}:layer:${LAYER_NAME}:${LAYER_VERSION}"
81-
publish_test $(param LayerARN \"${LAYER_ARN}\")
81+
publish_test $(param LayerARN \"${LAYER_ARN}\")

0 commit comments

Comments
 (0)