"LoadBalancer": {
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
"Properties": {
"Name": "example-lb",
"Type": "application",
"Scheme": "internet-facing",
"IpAddressType": "ipv4",
"SecurityGroups": ["sg-XXXXXXX"],
"Subnets": ["subnet-XXXXXXX", "subnet-XXXXXXX"],
"LoadBalancerAttributes": [
{
"Key": "load_balancing.cross_zone.enabled",
"Value": "true"
}
],
"Tags": [
{
"Key": "Name",
"Value": "example-lb"
}
],
"Listeners": [
{
"Port": "80",
"Protocol": "HTTP",
"DefaultActions": [
{
"Type": "forward",
"TargetGroupArn": {"Ref" : "TargetGroup"}
}
]
}
]
}
},
"TargetGroup": {
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties": {
"Name": "example-tg",
"Port": "80",
"Protocol": "HTTP",
"VpcId": "vpc-XXXXXXX",
"TargetType": "instance",
"HealthCheckIntervalSeconds": 30,
"HealthCheckProtocol": "HTTP",
"HealthyThresholdCount": 2,
"UnhealthyThresholdCount": 2,
"HealthCheckPath": "/health-check",
"Matcher": {
"HttpCode": "200"
},
"StickinessEnabled": true,
"StickinessType": "lb_cookie",
"StickinessLBCookieDurationSeconds": 604800
}
}
aws cloudformation describe-stacks --stack-name --query "Stacks[].Outputs[?OutputKey=='DNSName'].OutputValue" --output text
aws route53 change-resource-record-sets --hosted-zone-id --change-batch file://t2.json
t2.json:
{
"Comment": "Update record TTL",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": ""
}