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

feat: Add support for enable_waf_fail_open and desync_mitigation_mode #235

Merged

Conversation

kumartushar
Copy link
Contributor

@kumartushar kumartushar commented Feb 4, 2022

Description

Resource aws_lb support enable_waf_fail_open and desync_mitigation_mode, support for which is missing in this module.
I have added support for these options in current aws_lb resource implementation.
Also added the variables for these 2 options.

Motivation and Context

In some cases, it is needed to set enable_waf_fail_open to true. As for supporting critical services, lb should continue to forward requests to targets even if the communication to aws waf fails.

Breaking Changes

Does this break backwards compatibility with the current major version?
No
If so, please provide an explanation why it is necessary.
NA

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

  • Please describe in detail how you tested your changes.

      Terraform will perform the following actions:
    
      # module.coupa_alb.aws_lb.this[0] will be created
      + resource "aws_lb" "this" {
          + arn                        = (known after apply)
          + arn_suffix                 = (known after apply)
          + desync_mitigation_mode     = "defensive"
          + dns_name                   = (known after apply)
          + drop_invalid_header_fields = false
          + enable_deletion_protection = false
          + enable_http2               = true
          + enable_waf_fail_open       = true
          + id                         = (known after apply)
          + idle_timeout               = 60
          + internal                   = true
          + ip_address_type            = "ipv4"
          + load_balancer_type         = "application"
          + name                       =  "test-alb"
          + security_groups            = [
              + "sg-xxxxxxx",
            ]
          + subnets                    = [
              + "subnet-xxxxx",
              + "subnet-xxxxxx",
            ]
          + tags                       = {
              + "Name" = "test-alb"
            }
          + tags_all                   = {
              + "Name" = "test-alb"
            }
          + vpc_id                     = (known after apply)
          + zone_id                    = (known after apply)
    
          + subnet_mapping {
              + allocation_id        = (known after apply)
              + ipv6_address         = (known after apply)
              + outpost_id           = (known after apply)
              + private_ipv4_address = (known after apply)
              + subnet_id            = (known after apply)
            }
    
          + timeouts {
              + create = "10m"
              + delete = "10m"
              + update = "10m"
            }
        }
    
    Plan: 1 to add, 0 to change, 0 to destroy.
    
    Do you want to perform these actions?
      Terraform will perform the actions described above.
      Only 'yes' will be accepted to approve.
    
      Enter a value: yes
    
    module.coupa_alb.aws_lb.this[0]: Creating...
    module.coupa_alb.aws_lb.this[0]: Still creating... [10s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [20s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [30s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [40s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [50s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [1m0s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [1m10s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [1m20s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [1m30s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [1m40s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [1m50s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [2m0s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [2m10s elapsed]
    module.coupa_alb.aws_lb.this[0]: Still creating... [2m20s elapsed]
    module.coupa_alb.aws_lb.this[0]: Creation complete after 2m22s
    

@kumartushar kumartushar changed the title Add support for enable_waf_fail_open and desync_mitigation_mode feat: Add support for enable_waf_fail_open and desync_mitigation_mode Feb 4, 2022
@kumartushar
Copy link
Contributor Author

rerun tests

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Please verify the minimum version requirement for these attributes in versions.tf and update the docs by running pre-commit run -a.

@kumartushar
Copy link
Contributor Author

Please verify the minimum version requirement for these attributes in versions.tf and update the docs by running pre-commit run -a.

These attributes are introduced in https://github.com/hashicorp/terraform-provider-aws/releases/tag/v3.67.0

@antonbabenko
Copy link
Member

Please verify the minimum version requirement for these attributes in versions.tf and update the docs by running pre-commit run -a.

These attributes are introduced in hashicorp/terraform-provider-aws@v3.67.0 (release)

Then update min version here.

@kumartushar
Copy link
Contributor Author

pre-commit run -a

@antonbabenko Done

@antonbabenko antonbabenko merged commit a4a79df into terraform-aws-modules:master Feb 4, 2022
@antonbabenko
Copy link
Member

Awesome 🚢

antonbabenko pushed a commit that referenced this pull request Feb 4, 2022
## [6.7.0](v6.6.1...v6.7.0) (2022-02-04)

### Features

* Add support for enable_waf_fail_open and desync_mitigation_mode ([#235](#235)) ([a4a79df](a4a79df))
@antonbabenko
Copy link
Member

This PR is included in version 6.7.0 🎉

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants