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

firehose integration should support firehose #7

Merged
merged 1 commit into from
Nov 20, 2024
Merged
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
16 changes: 11 additions & 5 deletions firehose-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Resources:
Properties:
Description: The New Relic license key, for sending telemetry
Name : !Join ['-', ['nr-license-key', !Select [4, !Split ['-', !Select [2, !Split ['/', !Ref AWS::StackId]]]]]]
SecretString: !Sub '{ "LicenseKey": "${LicenseKey}"}'
SecretString: !Sub '{ "api_key": "${LicenseKey}"}'

NewRelicLogsS3FirehoseEventsBucket:
Type: AWS::S3::Bucket
Expand Down Expand Up @@ -241,6 +241,12 @@ Resources:
else:
common_attributes = []

# Filter out AttributeNames that are needed for entity synthesis from common_attributes
existing_attribute_names = {attr['AttributeName'] for attr in additional_attributes}
common_attributes = [
attr for attr in common_attributes if attr['AttributeName'] not in existing_attribute_names
]

common_attributes.extend(additional_attributes)

log_group_config_json = json.loads(event_data.get('LogGroupConfig', '[]').strip() or '[]')
Expand Down Expand Up @@ -308,10 +314,10 @@ Resources:
EndpointConfiguration:
Name: New Relic
Url: !FindInMap [NewRelicDatacenterMap, Datacenter, !Ref NewRelicRegion]
AccessKey: !If
- ShouldCreateSecret
- !Sub '{{resolve:secretsmanager:${NewRelicLogsLicenseKeySecret}:SecretString:LicenseKey}}'
- !Ref LicenseKey
AccessKey: !If [ShouldCreateSecret, !Ref "AWS::NoValue",!Ref LicenseKey]
SecretsManagerConfiguration:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hrai-nr if ShouldCreateSecret is false then does it actually create secret manager but kept disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in case ShouldCreateSecret is false, it will use LicenseKey by storing it in the delivery stream.

Enabled: !If [ShouldCreateSecret, true, false]
SecretARN: !If [ShouldCreateSecret, !Ref NewRelicLogsLicenseKeySecret, !Ref "AWS::NoValue"]
BufferingHints:
IntervalInSeconds: 60
SizeInMBs: 1
Expand Down
Loading