-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(logs): move log destinations into 'aws-logs-destinations' #2655
Conversation
In accordance with new guidelines, we're centralizing cross-service integrations into their own package. In this case, centralizing CloudWatch Logs Subscription Destinations into @aws-cdk/aws-logs-destinations. Fixes #2444. BREAKING CHANGE: using a Lambda or Kinesis Stream as Log Subscription Destination now requires an integration object from the @aws-cdk/aws-logs-destinations package.
|
||
public bind(scope: Construct, _sourceLogGroup: logs.ILogGroup): logs.LogSubscriptionDestination { | ||
// Following example from https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#DestinationKinesisExample | ||
// Create a role to be assumed by CWL that can write to this stream and pass itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we want to bind two Kinesis streams? We need only a single role,
Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single role with multiple statements, yes. The role belongs conceptually to the log group, I would say.
Aren't we better off return an array of policystatements to be added to the role, instead of the role itself?
const logSubscriptionDestinationPolicyAddedFor: string[] = []; | ||
|
||
if (logSubscriptionDestinationPolicyAddedFor.indexOf(arn) === -1) { | ||
// NOTE: the use of {AWS::Region} limits this to the same region, which shouldn't really be an issue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note might be stale?
In accordance with new guidelines, we're centralizing cross-service
integrations into their own package. In this case, centralizing
CloudWatch Logs Subscription Destinations into
@aws-cdk/aws-logs-destinations.
Fixes #2444.
BREAKING CHANGE: using a Lambda or Kinesis Stream as Log Subscription
Destination now requires an integration
object from the @aws-cdk/aws-logs-destinations package.
Pull Request Checklist
design
folderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.