AWS::ElasticLoadBalancingV2::LoadBalancer Tag - AWS CloudFormation

This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.

AWS::ElasticLoadBalancingV2::LoadBalancer Tag

Information about a tag.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Key" : String, "Value" : String }

YAML

Key: String Value: String

Properties

Key

The key of the tag.

Required: Yes

Type: String

Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Minimum: 1

Maximum: 128

Update requires: No interruption

Value

The value of the tag.

Required: No

Type: String

Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Minimum: 0

Maximum: 256

Update requires: No interruption

Examples

The following example creates a Network Load Balancer with two tags.

YAML

myLoadBalancer: Type: AWS::ElasticLoadBalancingV2::LoadBalancer Properties: Name: my-nlb Type: network Scheme: internal Subnets: - !Ref subnet-AZ1 - !Ref subnet-AZ2 SecurityGroups: - !Ref mySecurityGroup Tags: - Key: "department" Value: "123" - Key: "project" Value: "lima"

JSON

{ "myLoadBalancer": { "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", "Properties": { "Name": "my-alb", "Type": "network", "Scheme": "internal", "Subnets": [ { "Ref": "subnet-AZ1" }, { "Ref": "subnet-AZ2" } ], "SecurityGroups": [ { "Ref": "mySecurityGroup" } ], "Tags": [ { "Key": "department", "Value": "123" }, { "Key": "project", "Value": "lima" } ] } } }