Skip to content

Commit

Permalink
fix: firelens configFileValue is optional
Browse files Browse the repository at this point in the history
aws/aws-for-fluent-bit#352

Signed-off-by: Wesley Pettit <wppttt@amazon.com>
  • Loading branch information
PettitWesley committed May 18, 2022
1 parent c50d60c commit 39d588a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ecs/lib/firelens-log-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface FirelensOptions {
/**
* Custom configuration file, S3 ARN or a file path
*/
readonly configFileValue: string;
readonly configFileValue?: string;
}

/**
Expand Down Expand Up @@ -203,7 +203,7 @@ export class FirelensLogRouter extends ContainerDefinition {
if (options) {
const enableECSLogMetadata = options.enableECSLogMetadata || options.enableECSLogMetadata === undefined;
const configFileType = (options.configFileType === undefined || options.configFileType === FirelensConfigFileType.S3) &&
(cdk.Token.isUnresolved(options.configFileValue) || /arn:aws[a-zA-Z-]*:s3:::.+/.test(options.configFileValue))
(cdk.Token.isUnresolved(options.configFileValue) || /arn:aws[a-zA-Z-]*:s3:::.+/.test(options.configFileValue || ""))
? FirelensConfigFileType.S3 : FirelensConfigFileType.FILE;
this.firelensConfig = {
type: props.firelensConfig.type,
Expand All @@ -226,7 +226,7 @@ export class FirelensLogRouter extends ContainerDefinition {
actions: [
's3:GetBucketLocation',
],
resources: [options.configFileValue.split('/')[0]],
resources: [(options.configFileValue || "").split('/')[0]],
}));
}
} else {
Expand Down

0 comments on commit 39d588a

Please sign in to comment.