AWS Security ChangesHomeSearch

AWS cli documentation change

Service: cli · 2025-05-25 · Documentation medium

File: cli/v1/userguide/cli_elastic-load-balancing-v2_code_examples.md

Summary

Modified ELB v2 code examples: corrected action formatting, added ARN/port details, improved redirect configuration syntax, and enhanced certificate change example

Security assessment

The changes demonstrate security best practices by: 1) Using HTTPS in redirect configurations (preventing plaintext redirects) 2) Showing proper certificate management 3) Adding security-related parameters like StatusCode=HTTP_302. While these improve security documentation, there's no evidence of addressing a specific reported vulnerability.

Diff

diff --git a/cli/v1/userguide/cli_elastic-load-balancing-v2_code_examples.md b/cli/v1/userguide/cli_elastic-load-balancing-v2_code_examples.md
index 7c48afc22..e0065d547 100644
--- a//cli/v1/userguide/cli_elastic-load-balancing-v2_code_examples.md
+++ b//cli/v1/userguide/cli_elastic-load-balancing-v2_code_examples.md
@@ -1696 +1696 @@ The following code example shows how to use `modify-listener`.
-The following `modify-listener` example changes the default action (to a **forward** action)for the specified listener.
+The following `modify-listener` example changes the default action to a `forward` action for the specified listener.
@@ -1709,0 +1710,2 @@ Output:
+                "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2",
+                "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
@@ -1710,0 +1713 @@ Output:
+                "Port": 80,
@@ -1713,2 +1716,2 @@ Output:
-                        "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f",
-                        "Type": "forward"
+                        "Type": "forward",
+                        "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f"
@@ -1716,4 +1719 @@ Output:
-                ],
-                "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
-                "Port": 80,
-                "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"
+                ]
@@ -1726 +1726 @@ Output:
-The following `modify-listener` example changes the default action to a **redirect** action for the specified listener.
+The following `modify-listener` example changes the default action to a `redirect` action for the specified listener.
@@ -1731 +1731 @@ The following `modify-listener` example changes the default action to a **redire
-        --default-actions Type=redirect,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f
+        --default-actions Type=redirect, RedirectConfig='{Protocol=HTTPS,StatusCode=HTTP_302}'
@@ -1739,0 +1740,2 @@ Output:
+                "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2",
+                "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
@@ -1740,0 +1743 @@ Output:
+                "Port": 80,
@@ -1743,2 +1746,8 @@ Output:
-                    "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f",
-                    "Type": "redirect"
+                        "Type": "redirect",
+                        "RedirectConfig": {
+                            "Protocol": "HTTPS",
+                            "Port": "#{port}",
+                            "Host": "#{host}",
+                            "Path": "/#{path}",
+                            "Query": "#{query}",
+                            "StatusCode": "HTTP_302",
@@ -1746,4 +1755,2 @@ Output:
-            ],
-            "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
-            "Port": 80,
-            "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"
+                    }
+                ]
@@ -1756 +1763 @@ Output:
-This example changes the server certificate for the specified HTTPS listener.
+The following `modify-listener` example changes the server certificate for the specified HTTPS listener.
@@ -1769,0 +1777,2 @@ Output:
+                "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65",
+                "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
@@ -1770,0 +1780 @@ Output:
+                "Port": 443,
@@ -1773,2 +1783,2 @@ Output:
-                        "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067",
-                        "Type": "forward"
+                        "Type": "forward",
+                        "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
@@ -1783,3 +1792,0 @@ Output:
-                "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
-                "Port": 443,
-                "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65"
@@ -1789,0 +1797,2 @@ Output:
+For more information, see [Listener rules](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-rules) in the _Application Load Balancers User Guide_.
+