github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/avd_docs/aws/apigateway/AVD-AWS-0190/Terraform.md (about)

     1  
     2  Enable cache
     3  
     4  ```hcl
     5   resource "aws_api_gateway_rest_api" "example" {
     6  	
     7   }
     8  
     9   resource "aws_api_gateway_stage" "example" {
    10  
    11   }
    12  
    13   resource "aws_api_gateway_method_settings" "good_example" {
    14     rest_api_id = aws_api_gateway_rest_api.example.id
    15     stage_name  = aws_api_gateway_stage.example.stage_name
    16     method_path = "path1/GET"
    17   
    18     settings {
    19       metrics_enabled = true
    20       logging_level   = "INFO"
    21       caching_enabled = true
    22     }
    23   }
    24   
    25  ```
    26  
    27  #### Remediation Links
    28   - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method_settings#cache_enabled
    29