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

refactor: Refactor fargate-fluentbit addon module. #142

Merged
merged 7 commits into from
Apr 21, 2023

Conversation

rodrigobersa
Copy link
Contributor

What does this PR do?

  • Refactor fargate-fluentbit addon.

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I ran pre-commit run -a with this PR

For Moderators

  • E2E Test successfully complete before merge?

Additional Notes

terraform-aws-eks-blueprints-addons git:(refactor/fargate-fluentbit) ✗ pre-commit run -a
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
detect private key.......................................................Passed
detect aws credentials...................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Terraform validate with tflint...........................................Passed
Terraform validate.......................................................Passed
Terraform validate with tfsec............................................Passed

Additional notes

Not sure if this is the best way to refactor this module, since it does not use Helm charts. Feedbacks are welcome!

@rodrigobersa rodrigobersa requested a review from a team as a code owner April 20, 2023 18:04
main.tf Outdated
)
}

resource "kubernetes_namespace" "aws_observability" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
resource "kubernetes_namespace" "aws_observability" {
resource "kubernetes_namespace_v1" "aws_observability" {

main.tf Outdated
}

# fluent-bit-cloudwatch value as the name of the CloudWatch log group that is automatically created as soon as your apps start logging
resource "kubernetes_config_map" "aws_logging" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
resource "kubernetes_config_map" "aws_logging" {
resource "kubernetes_config_map_v1" "aws_logging" {

variables.tf Outdated
default = false
}

variable "fargate_fluentbit_config" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
variable "fargate_fluentbit_config" {
variable "fargate_fluentbit" {

main.tf Outdated Show resolved Hide resolved
main.tf Outdated
Comment on lines 2663 to 2664
fargate_fluentbit_cwlog_group = "/${var.cluster_name}/fargate-fluentbit-logs"
fargate_fluentbit_cwlog_stream_prefix = "fargate-logs-"
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets try to be consistent in how we are asking users to provide configuration values for addons. This should look something like...

Suggested change
fargate_fluentbit_cwlog_group = "/${var.cluster_name}/fargate-fluentbit-logs"
fargate_fluentbit_cwlog_stream_prefix = "fargate-logs-"
ffargate_fluentbit_cwlog_group = try(fargate_fluentbit.cwlog_group, "/${var.cluster_name}/fargate-fluentbit-logs")
fargate_fluentbit_cwlog_stream_prefix = try(fargate_fluentbit.cwlog_stream_prefix "fargate-logs-")

main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
@rodrigobersa rodrigobersa merged commit 8cfa9c5 into main Apr 21, 2023
@rodrigobersa rodrigobersa deleted the refactor/fargate-fluentbit branch April 21, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants