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

fix(ecs): configFileValue on FirelensOptions should be an optional property #16856

Closed
wants to merge 4 commits into from

Conversation

david-doyle-as24
Copy link
Contributor

@david-doyle-as24 david-doyle-as24 commented Oct 7, 2021


Firelens config mistakenly requires configFileType, when this documentation allows that any of firelens config options can be set or unset. This PR fixes this bug and sets the "enable-ecs-log-metadata" field by default to true, even when the options field is not set.

Closes #16594

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Oct 7, 2021

@david-doyle-as24 david-doyle-as24 changed the title fix: resolving bug in firelens fix(ecs): resolving bug in firelens Oct 7, 2021
@peterwoodworth peterwoodworth changed the title fix(ecs): resolving bug in firelens fix(ecs): resolving bug in firelens Oct 21, 2021
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Oct 21, 2021
Copy link
Contributor

@upparekh upparekh left a comment

Choose a reason for hiding this comment

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

Hi @david-doyle-as24 , awesome PR! Thanks for working on this.

I just have two small suggestions!

@@ -78,7 +79,7 @@ export interface FirelensConfig {

/**
* Firelens options
* @default - no additional options
* @default - EnableECSLogMetadata option is set to true
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: @default - ECS log metadata enabled

Comment on lines +232 to +233
} else if (options?.configFileType && !options?.configFileValue) {
throw new Error('Firelens Config Error: Config file value cannot be undefined when config file type is declared.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also add a unit test to assert this error being thrown?

@@ -116,7 +117,7 @@ function renderFirelensConfig(firelensConfig: FirelensConfig): CfnTaskDefinition
options: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can also remove the if-else condition here to always return the firelens config in the else part (as the enable-ecs-log-metadata in the options will always be present now).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: b1945a5
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@upparekh
Copy link
Contributor

It seems from the Build Logs like the integ.all-service-addons.js test is failing. You need to update the test as well.

@madeline-k madeline-k changed the title fix(ecs): resolving bug in firelens fix(ecs): configFileValue on FirelensOptions should be an optional property Nov 24, 2021
@rix0rrr rix0rrr added bug This issue is a bug. p2 and removed @aws-cdk/aws-ecs Related to Amazon Elastic Container labels Mar 4, 2022
@madeline-k
Copy link
Contributor

Hello, I am closing this PR since it is in a build-failing state, and has not been touched in a long time. If anyone is still interested to contribute a fix here, please open a new PR.

@madeline-k madeline-k closed this Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-ecs): configFileValue should be optional in FirelensOptions
5 participants