Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to override the .go code of a resource argument in terraform?

There is a 1024 character restriction set for the AWS aws_alb_listener_rule resource that is imposed here. I need to parameterise this character limit as the message body I want to send in the response is longer than 1024 characters.

I am new to terraform, is it possible to make such alterations to the .go code somewhere and bring this through to the aws_lb_listener_rule resource used in my terraform project?

Ideally I would have a resource like:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

resource "aws_lb_listener_rule" "discovery" {
  listener_arn = aws_lb_listener.func.arn
    
  action {
    type = "fixed-response"
    
    fixed_response {
      content_type = "application/json"
      message_body = jsonencode(local.discovery)
      status_code  = "200",
      message_body_chr_limit = 2000,
    }
  }
    
  condition {
    path_pattern {
      values = [
        "/discovery"]
    }
  }
    
  tags = var.infra_tags
}

Is this possible to do? Or does it require PR to the AWS terraform project?

>Solution :

This is an AWS defined limit, so the answer is it cannot be done:

Length Constraints: Minimum length of 0. Maximum length of 1024.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading