-
Notifications
You must be signed in to change notification settings - Fork 75
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
Make it possible to override log configuration options #83
Conversation
variable "log_configuration_options_overrides" { | ||
description = "Overrides for log configuration options" | ||
default = {} | ||
type = any |
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.
type = any | |
type = map |
Not quite sure how terraform whould handle maps vs objects 🤔
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.
At least when declaring a i.e. object({key1: string, key2: number})
, it will only pass on the declared ones, so if I sent in var_name = { keyNotDeclared = "someValue" }
it wouldn't be included where it was used.
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.
So it might work with map
. I will take a look.
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.
You need to specify everything inside map({ ... })
:/
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.
There is a defined number of options available for the hard coded awslogs driver in the module. These are documented here:
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html#create_awslogs_logdriver_options
We are currently setting the awslogs-group
, awslogs-region
and awslogs-stream-prefix
options.
And, as you can see, we have already provided a way to override the awslogs-group
option. Maybe you can use the same method to override awslogs-region
and awslogs-stream-prefix
instead?
Can you provide an example of why you need this?
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.
I just had a look at your other #81 PR, and I think these two PRs should be handled together. Since, if you override the log driver, then the default options listed above are wrong.
Fargate supports three different log drivers: awslogs, splunk, and awsfirelens. If we want to support those, then I think we need a conditional for adding the awslogs options that we add by default.
Also, I think we don't want to merge()
these other options in with the awslogs options, but rather replace the content of the options
key og the logConfiguration
altogether.
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.
I agree with everything you write. It is way more than I initially needed, so lets just close this PR and also #81.
This resolves #76