Skip to content

Adjust warning patterns #1550

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

Merged
merged 3 commits into from
May 13, 2025
Merged

Adjust warning patterns #1550

merged 3 commits into from
May 13, 2025

Conversation

james03160927
Copy link
Contributor

@james03160927 james03160927 commented May 6, 2025

Description

Fixes #1549.

to test:
add this to terraform.Options on terraform_aws_s3_example_test.go

WarningsAsErrors: map[string]string{
			".*deprecated.*": "Fix the deprecation shown in the log.",
		},

add this to examples/terraform-aws-s3-example/main.tf line 31.

# --- START DEPRECATED BLOCK ---
  # Using the deprecated server_side_encryption_configuration block directly
  # within the bucket resource.
  # This should trigger a deprecation warning in Terraform.
  server_side_encryption_configuration {
    rule {
      apply_server_side_encryption_by_default {
        sse_algorithm     = "AES256"
      }
    }
  }
  # --- END DEPRECATED BLOCK ---

run test go test -run TestTerraformAwsS3Example github.com/gruntwork-io/terratest/test

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.
  • Make a plan for release of the functionality in this PR. If it delivers value to an end user, you are responsible for ensuring it is released promptly, and correctly. If you are not a maintainer, you are responsible for finding a maintainer to do this for you.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

@james03160927 james03160927 self-assigned this May 6, 2025
Copy link
Member

@denis256 denis256 left a comment

Choose a reason for hiding this comment

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

I think will be helpful to add tests to track this pattern too

@james03160927
Copy link
Contributor Author

I think will be helpful to add tests to track this pattern too

SGTM. Let me update the PR with a unit test.

@james03160927
Copy link
Contributor Author

Hi @denis256, added unit test. PTAL

@james03160927 james03160927 merged commit b32b217 into main May 13, 2025
2 of 3 checks passed
@james03160927 james03160927 deleted the issue-1549 branch May 13, 2025 12:33
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.

WarningAsErrors does not work for deprecation warnings from Terraform
2 participants