-
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
feat(logs): import a LogGroup from its name #5580
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
* Import an existing LogGroup given its name | ||
*/ | ||
public static fromLogGroupName(scope: Construct, id: string, logGroupName: string): ILogGroup { | ||
class Import extends LogGroupBase { |
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.
can we reuse fromLogGroupArn
?
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.
Why is that? Can you elaborate?
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.
Just less duplication (not that there is a lot, but still).
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.
public static fromLogGroupName(scope: Construct, id: string, logGroupName: string): ILogGroup {
return this.fromLogGroupArn(scope, id, Stack.of(scope).formatArn({
service: 'logs', resource: 'log-group', sep: ':', resourceName: logGroupName
});
}
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.
Not a fan of this actually. Doing this makes the ARN a Fn::Join
token and the loggroup name becomes a further token using more CF intrinsics.
While all of this is technically valid, it feels better, in this case, to tilt towards the reduction of token use.
I'd rather leave this as is.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This reverts commit 4916c66.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
please update PR description per guidelines
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license