AWS Security ChangesHomeSearch

AWS AWSCloudFormation documentation change

Service: AWSCloudFormation · 2025-05-22 · Documentation low

File: AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.md

Summary

Added examples for creating Application and Network Load Balancers with deletion protection enabled

Security assessment

The examples demonstrate enabling deletion_protection.enabled attribute, which is a security best practice to prevent accidental resource deletion. However, there is no evidence of addressing a specific security vulnerability.

Diff

diff --git a/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.md b/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.md
index e7e61c4f5..d3cbedf8b 100644
--- a//AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.md
+++ b//AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.md
@@ -3 +3 @@
-SyntaxPropertiesReturn valuesSee also
+SyntaxPropertiesReturn valuesExamplesSee also
@@ -304,0 +305,123 @@ The IDs of the security groups for the load balancer.
+## Examples
+
+To get started with Elastic Load Balancer create a load balancer. After you create your load balancer, add a listener using [AWS::ElasticLoadBalancingV2::Listener](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listener.html).
+
+###### 
+
+  * Create an Application Load Balancer
+
+  * Create a Network Load Balancer
+
+
+
+
+### Create an Application Load Balancer
+
+The following example creates an internal Application Load Balancer with an associated security group and a load balancer attribute.
+
+#### YAML
+    
+    
+    myLoadBalancer:
+        Type: AWS::ElasticLoadBalancingV2::LoadBalancer
+        Properties:
+          Name: my-alb
+          Type: application
+          Scheme: internal
+          Subnets: 
+            - !Ref subnet-AZ1
+            - !Ref subnet-AZ2
+          SecurityGroups: 
+            - !Ref mySecurityGroup
+          LoadBalancerAttributes: 
+            - Key: deletion_protection.enabled
+              Value: true
+
+#### JSON
+    
+    
+    {
+        "myLoadBalancer": {
+            "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
+            "Properties": {
+                "Name": "my-alb",
+                "Type": "application",
+                "Scheme": "internal",
+                "Subnets": [
+                    {
+                        "Ref": "subnet-AZ1"
+                    },
+                    {
+                        "Ref": "subnet-AZ2"
+                    }
+                ],
+                "SecurityGroups": [
+                    {
+                        "Ref": "mySecurityGroup"
+                    }
+                ],
+                "LoadBalancerAttributes": [
+                    {
+                        "Key": "deletion_protection.enabled",
+                        "Value": true
+                    }
+                ]
+            }
+        }
+    }
+
+### Create a Network Load Balancer
+
+The following example creates an internal Network Load Balancer with an associated security group and a load balancer attribute.
+
+#### YAML
+    
+    
+    myLoadBalancer:
+        Type: AWS::ElasticLoadBalancingV2::LoadBalancer
+        Properties:
+          Name: my-nlb
+          Type: network
+          Scheme: internal
+          Subnets: 
+            - !Ref subnet-AZ1
+            - !Ref subnet-AZ2
+          SecurityGroups: 
+            - !Ref mySecurityGroup
+          LoadBalancerAttributes: 
+            - Key: deletion_protection.enabled
+              Value: true
+
+#### JSON
+    
+    
+    {
+        "myLoadBalancer": {
+            "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
+            "Properties": {
+                "Name": "my-alb",
+                "Type": "network",
+                "Scheme": "internal",
+                "Subnets": [
+                    {
+                        "Ref": "subnet-AZ1"
+                    },
+                    {
+                        "Ref": "subnet-AZ2"
+                    }
+                ],
+                "SecurityGroups": [
+                    {
+                        "Ref": "mySecurityGroup"
+                    }
+                ],
+                "LoadBalancerAttributes": [
+                    {
+                        "Key": "deletion_protection.enabled",
+                        "Value": true
+                    }
+                ]
+            }
+        }
+    }
+