Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudformation-template): allow to set a static prefix to stack exports #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions aws/logs_monitoring/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ Parameters:
Type: String
Default: ""
Description: The name of the forwarder bucket to create. If not provided, AWS will generate a unique name.
StaticExportsPrefix:
Type: String
Default: ""
Description: "Sets a static prefix the stack exports rather than prefixing with the stack name (useful when deploying via StackSets)"
Conditions:
IsAWSChina:
Fn::Equals:
Expand Down Expand Up @@ -378,6 +382,11 @@ Conditions:
- Fn::Equals:
- Ref: DdForwarderBucketName
- ""
SetStaticExportsPrefix:
Fn::Not:
- Fn::Equals:
- Ref: StaticExportsPrefix
- ""
Rules:
MustSetDdApiKey:
Assertions:
Expand Down Expand Up @@ -941,22 +950,31 @@ Outputs:
- Arn
Export:
Name:
Fn::Sub: ${AWS::StackName}-ForwarderArn
Fn::If:
- SetStaticExportsPrefix
- Fn::Sub: ${StaticExportsPrefix}-ForwarderArn
- Fn::Sub: ${AWS::StackName}-ForwarderArn
DdApiKeySecretArn:
Description: ARN of SecretsManager Secret with Datadog API Key
Value:
Ref: DdApiKeySecret
Export:
Name:
Fn::Sub: ${AWS::StackName}-ApiKeySecretArn
Fn::If:
- SetStaticExportsPrefix
- Fn::Sub: ${StaticExportsPrefix}-ApiKeySecretArn
- Fn::Sub: ${AWS::StackName}-ApiKeySecretArn
Condition: CreateDdApiKeySecret
ForwarderBucketName:
Description: Name of the S3 bucket used by the Forwarder
Value:
Ref: ForwarderBucket
Export:
Name:
Fn::Sub: ${AWS::StackName}-ForwarderBucketName
Fn::If:
- SetStaticExportsPrefix
- Fn::Sub: ${StaticExportsPrefix}-ForwarderBucketName
- Fn::Sub: ${AWS::StackName}-ForwarderBucketName
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
Expand Down Expand Up @@ -1019,6 +1037,7 @@ Metadata:
- DdTraceIntakeUrl
- AdditionalTargetLambdaArns
- DdForwarderBucketName
- StaticExportsPrefix
ParameterLabels:
DdApiKey:
default: "DdApiKey *"
Expand Down