Skip to content

feat: add support for default ecs log driver mode on account level #42418

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

stefanfreitag
Copy link
Contributor

@stefanfreitag stefanfreitag commented Apr 29, 2025

Description

The default log driver mode for ECS is now configurable on account level (see References section for press release).
The allowed values are non-blocking and blocking .

At the moment and according to the AWS documentation the default value is blocking , but will change on Jun 25 2025 to non-blocking.

In this pull request I used already non-blocking as default. Please let me know your thoughts on this as the change in respect to the default behavior will take place in approx. two month.

The required Go SDK v2 version for setting the value is already used by the provider.

Relations

Closes #42405

References

Output from Acceptance Testing

make testacc TESTS=TestAccECSAccountSettingDefault_serial PKG=ecs
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSAccountSettingDefault_serial'  -timeout 360m -vet=off
2025/04/29 21:18:59 Initializing Terraform AWS Provider...
=== RUN   TestAccECSAccountSettingDefault_serial
=== PAUSE TestAccECSAccountSettingDefault_serial
=== CONT  TestAccECSAccountSettingDefault_serial
=== RUN   TestAccECSAccountSettingDefault_serial/fargateTaskRetirementWaitPeriod
=== RUN   TestAccECSAccountSettingDefault_serial/containerInstanceLongARNFormat
=== RUN   TestAccECSAccountSettingDefault_serial/defaultLogDriverMode
=== RUN   TestAccECSAccountSettingDefault_serial/serviceLongARNFormat
=== RUN   TestAccECSAccountSettingDefault_serial/taskLongARNFormat
=== RUN   TestAccECSAccountSettingDefault_serial/vpcTrunking
=== RUN   TestAccECSAccountSettingDefault_serial/containerInsights
--- PASS: TestAccECSAccountSettingDefault_serial (111.86s)
    --- PASS: TestAccECSAccountSettingDefault_serial/fargateTaskRetirementWaitPeriod (15.26s)
    --- PASS: TestAccECSAccountSettingDefault_serial/containerInstanceLongARNFormat (14.64s)
    --- PASS: TestAccECSAccountSettingDefault_serial/defaultLogDriverMode (23.65s)
    --- PASS: TestAccECSAccountSettingDefault_serial/serviceLongARNFormat (14.64s)
    --- PASS: TestAccECSAccountSettingDefault_serial/taskLongARNFormat (14.55s)
    --- PASS: TestAccECSAccountSettingDefault_serial/vpcTrunking (14.54s)
    --- PASS: TestAccECSAccountSettingDefault_serial/containerInsights (14.57s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecs        112.017s

Copy link

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link

github-actions bot commented Apr 29, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ecs Issues and PRs that pertain to the ecs service. size/M Managed by automation to categorize the size of a PR. external-maintainer Contribution from a trusted external contributor. labels Apr 29, 2025
@stefanfreitag stefanfreitag marked this pull request as ready for review April 29, 2025 19:50
@stefanfreitag stefanfreitag requested a review from a team as a code owner April 29, 2025 19:50
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Apr 29, 2025
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 29, 2025
@stefanfreitag
Copy link
Contributor Author

The tflint check fails because of the new value defaultLogDriverMode used in the example.
I am not sure if I need to fix the issue (the how is also unclear)

@tabito-hara
Copy link
Contributor

tabito-hara commented Apr 30, 2025

@stefanfreitag

The tflint-ruleset-aws used by TFLint has been updated, and defaultLogDriverMode is now included as a valid value.

Reference:
https://github.com/terraform-linters/tflint-ruleset-aws/blob/5ca13abb32c573530ad00895d0ce32d66aa24952/rules/models/aws_ecs_account_setting_default_invalid_name.go#L37

In the terraform-provider-aws repository, the version of tflint-ruleset-aws is specified here:

version = "0.37.0"

If the version is updated to 0.39.0, the error related to defaultLogDriverMode will be resolved.

However, new rules (e.g., aws_iam_role_deprecated_policy_attributes, which flags the use of managed_policy_arns and inline_policy in aws_iam_role) have also been introduced in this version.
Fixing the version in the code is straightforward, but it's important to check whether these changes affect other parts of the codebase.

I’m currently running TFLint with the updated tflint-ruleset-aws in my local environment using your branch.

@tabito-hara
Copy link
Contributor

@stefanfreitag

PR #42427, which fixes the TFLint issue, has been merged.
Your TFLint job should complete successfully once you merge the latest main branch into your branch and trigger the CI by pushing the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. external-maintainer Contribution from a trusted external contributor. service/ecs Issues and PRs that pertain to the ecs service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocking/Non-Blocking mode for ECS account settings
3 participants