【问题标题】:Template is not valid: Invalid template resource property 'WebServerScaleUpPolicy'模板无效:模板资源属性“WebServerScaleUpPolicy”无效
【发布时间】:2020-10-21 13:12:17
【问题描述】:
{
    "AWSTemplateFormatVersion": "2010-09-09",

    "Parameters": {
        "VpcId": {
            "Type": "AWS::EC2::VPC::Id",
            "Description": "VpcId of your existing Virtual Private Cloud (VPC)",
            "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud."
        },
        "Subnets": {
            "Type": "List<AWS::EC2::Subnet::Id>",
            "Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)"
        },
        "InstanceType": {
            "Description": "WebServer EC2 instance type",
            "Type": "String",
            "Default": "t2.small",
            "AllowedValues": [
                "t1.micro",
                "t2.nano",
                "t2.micro",
                "t2.small",
                "t2.medium",
                "t2.large",
                "m1.small",
                "m1.medium",
                "cg1.4xlarge"
            ],
            "ConstraintDescription": "must be a valid EC2 instance type."
        },
         "KeyName": {
            "Description": "The EC2 Key Pair to allow SSH access to the instances",
            "Type": "AWS::EC2::KeyPair::KeyName",
            "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
        },
        "SSHLocation": {
            "Description": "The IP address range that can be used to SSH to the EC2 instances",
            "Type": "String",
            "MinLength": "9",
            "MaxLength": "18",
            "Default": "0.0.0.0/0",
            "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
            "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
        }
    },
    "Mappings": {
        "AWSInstanceType2Arch": {
            "t1.micro": {
                "Arch": "HVM64"
            },
            "t2.nano": {
                "Arch": "HVM64"
            },
            "t2.micro": {
                "Arch": "HVM64"
            },
            "t2.small": {
                "Arch": "HVM64"
            },
            "t2.medium": {
                "Arch": "HVM64"
            },
            "t2.large": {
                "Arch": "HVM64"
            },
            "m1.small": {
                "Arch": "HVM64"
            },
            "m1.medium": {
                "Arch": "HVM64"
            },
            "m1.large": {
                "Arch": "HVM64"
            },
            "d2.xlarge": {
                "Arch": "HVM64"
            }
           },
        "AWSInstanceType2NATArch": {
            "t1.micro": {
                "Arch": "NATHVM64"
            },
            "t2.nano": {
                "Arch": "NATHVM64"
            },
            "t2.micro": {
                "Arch": "NATHVM64"
            },
            "t2.small": {
                "Arch": "NATHVM64"
            },
            "t2.medium": {
                "Arch": "NATHVM64"
            },
            "t2.large": {
                "Arch": "NATHVM64"
            },
            "m1.small": {
                "Arch": "NATHVM64"
            }
        },
        "AWSRegionArch2AMI": {
            
        }
    },
    "Resources": {
        "WebServerGroup": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "VPCZoneIdentifier": {
                    "Ref": "Subnets"
                },
                "LaunchConfigurationName": {
                    "Ref": "LaunchConfig"
                },
                "MinSize": "1",
                "MaxSize": "8",
                "TargetGroupARNs": [
                    {
                        "Ref": "ALBTargetGroup"
                    }
                ]
            },
            "CreationPolicy": {
                "ResourceSignal": {
                    "Timeout": "PT15M",
                    "Count": "1"
                }
            },
            "UpdatePolicy": {
                "AutoScalingRollingUpdate": {
                    "MinInstancesInService": "1",
                    "MaxBatchSize": "1",
                    "PauseTime": "PT15M",
                    "WaitOnResourceSignals": "true"
                }
            }
        },
        "LaunchConfig": {
            "Type": "AWS::AutoScaling::LaunchConfiguration",
            "Properties": {
                "KeyName": { "Ref": "KeyName" },
                "ImageId": "ami-00932e4c143f3fdf0",
                "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ],
                "InstanceType" : { "Ref" : "InstanceType" }
                },
        "WebServerScaleUpPolicy": {
            "Type": "AWS::AutoScaling::ScalingPolicy",
            "Properties": {
                "AdjustmentType": "ChangeInCapacity",
                "AutoScalingGroupName": {
                    "Ref": "WebServerGroup"
                },
                "Cooldown": "60",
                "ScalingAdjustment": "1"
            }
        },
        "WebServerScaleDownPolicy": {
            "Type": "AWS::AutoScaling::ScalingPolicy",
            "Properties": {
                "AdjustmentType": "ChangeInCapacity",
                "AutoScalingGroupName": {
                    "Ref": "WebServerGroup"
                },
                "Cooldown": "60",
                "ScalingAdjustment": "-1"
            }
        },
        "CPUAlarmHigh": {
            "Type": "AWS::CloudWatch::Alarm",
            "Properties": {
                "AlarmDescription": "Scale-up if CPU > 70% for 5 minutes",
                "MetricName": "CPUUtilization",
                "Namespace": "AWS/EC2",
                "Statistic": "Average",
                "Period": "300",
                "EvaluationPeriods": "2",
                "Threshold": "70",
                "AlarmActions": [
                    {
                        "Ref": "WebServerScaleUpPolicy"
                    }
                ],
                "Dimensions": [
                    {
                        "Name": "AutoScalingGroupName",
                        "Value": {
                            "Ref": "WebServerGroup"
                        }
                    }
                ],
                "ComparisonOperator": "GreaterThanThreshold"
            }
        },
        "CPUAlarmLow": {
            "Type": "AWS::CloudWatch::Alarm",
            "Properties": {
                "AlarmDescription": "Scale-down if CPU < 40% for 5 minutes",
                "MetricName": "CPUUtilization",
                "Namespace": "AWS/EC2",
                "Statistic": "Average",
                "Period": "300",
                "EvaluationPeriods": "2",
                "Threshold": "40",
                "AlarmActions": [
                    {
                        "Ref": "WebServerScaleDownPolicy"
                    }
                ],
                "Dimensions": [
                    {
                        "Name": "AutoScalingGroupName",
                        "Value": {
                            "Ref": "WebServerGroup"
                        }
                    }
                ],
                "ComparisonOperator": "LessThanThreshold"
            }
        },
        "ApplicationLoadBalancer": {
            "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
            "Properties": {
                "Subnets": {
                    "Ref": "Subnets"
                }
            }
        },
        "ALBListener": {
            "Type": "AWS::ElasticLoadBalancingV2::Listener",
            "Properties": {
                "DefaultActions": [
                    {
                        "Type": "forward",
                        "TargetGroupArn": {
                            "Ref": "ALBTargetGroup"
                        }
                    }
                ],
                "LoadBalancerArn": {
                    "Ref": "ApplicationLoadBalancer"
                },
                "Port": "80",
                "Protocol": "HTTP"
            }
        },
        "ALBTargetGroup": {
            "Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
            "Properties": {
                "HealthCheckIntervalSeconds": 30,
                "HealthCheckTimeoutSeconds": 5,
                "HealthyThresholdCount": 3,
                "Port": 80,
                "Protocol": "HTTP",
                "UnhealthyThresholdCount": 5,
                "VpcId": {
                    "Ref": "VpcId"
                }
            }
        },
        "InstanceSecurityGroup": {
            "Type": "AWS::EC2::SecurityGroup",
            "Properties": {
                "GroupDescription": "Enable SSH access and HTTP from the load balancer only",
                "SecurityGroupIngress": [
                    {
                        "IpProtocol": "tcp",
                        "FromPort": "22",
                        "ToPort": "22",
                        "CidrIp": {
                            "Ref": "SSHLocation"
                        }
                    },
                    {
                        "IpProtocol": "tcp",
                        "FromPort": "80",
                        "ToPort": "80",
                        "SourceSecurityGroupId": {
                            "Fn::Select": [
                                0,
                                {
                                    "Fn::GetAtt": [
                                        "ApplicationLoadBalancer",
                                        "SecurityGroups"
                                    ]
                                }
                            ]
                        }
                    }
                ],
                "VpcId": {
                    "Ref": "VpcId"
                }
            }
        }
    },
    "Outputs": {
        "URL": {
            "Description": "The URL of the website",
            "Value": {
                "Fn::Join": [
                    "",
                    [
                        "http://",
                        {
                            "Fn::GetAtt": [
                                "ApplicationLoadBalancer",
                                "DNSName"
                            ]
                        }
                    ]
                ]
            }
        }
    }
}
}

您好,这是我使用负载均衡器自动扩展的模板,我还附加了带有扩展/缩减策略的 cpu 警报,但是每当我要创建堆栈时,我都会收到一个错误,即无效的模板资源属性“WebServerScaleUpPolicy” .所以请让我知道我在这方面缺乏什么。

请帮帮我。 {AWS CloudFormation 模板 AutoScalingMultiAZ:创建在 nginx Web 服务器上运行的多可用区、负载平衡和自动扩展的示例网站。该应用程序配置为跨区域中的所有可用区,并根据 Web 服务器的 CPU 利用率自动扩展。

通过针对默认网页的简单运行状况检查对实例进行负载平衡。

【问题讨论】:

  • “创建一个多可用、负载平衡和自动缩放的示例......”这是一些家庭作业或工作分配的一部分吗?因此,您收到了一个损坏的模板并负责修复它?
  • 因为我正在创建一个 cloudformation 模板,它基本上是工作的一部分。我在这个问题上面临这样的问题,因为我是 Cloud-formation 的新手。如果你能帮我解决这个问题,我真的很感激
  • 如果您是 CloudFormation 新手,建议查看 CloudFormation Linter
  • 投票结束,因为这只是一个语法错误。

标签: json linux amazon-web-services amazon-cloudformation


【解决方案1】:

“LaunchConfig”末尾缺少 }

 "LaunchConfig": {
            "Type": "AWS::AutoScaling::LaunchConfiguration",
            "Properties": {
                "KeyName": { "Ref": "KeyName" },
                "ImageId": "ami-00932e4c143f3fdf0",
                "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ],
                "InstanceType" : { "Ref" : "InstanceType" }
                }
            }, <---
        "WebServerScaleUpPolicy": {
            "Type": "AWS::AutoScaling::ScalingPolicy",
            "Properties": {
                "AdjustmentType": "ChangeInCapacity",
                "AutoScalingGroupName": {
                    "Ref": "WebServerGroup"
                },
                "Cooldown": "60",
                "ScalingAdjustment": "1"
            }
        },

【讨论】:

    【解决方案2】:

    您似乎还没有关闭LaunchConfig 的大括号。我已经修复了下面的语法,AWS 抛出了这个错误,因为 WebServerScaleUp 不是 AWS::AutoScaling::LaunchConfiguration 类型的属性。

    {
        "AWSTemplateFormatVersion": "2010-09-09",
    
        "Parameters": {
            "VpcId": {
                "Type": "AWS::EC2::VPC::Id",
                "Description": "VpcId of your existing Virtual Private Cloud (VPC)",
                "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud."
            },
            "Subnets": {
                "Type": "List<AWS::EC2::Subnet::Id>",
                "Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)"
            },
            "InstanceType": {
                "Description": "WebServer EC2 instance type",
                "Type": "String",
                "Default": "t2.small",
                "AllowedValues": [
                    "t1.micro",
                    "t2.nano",
                    "t2.micro",
                    "t2.small",
                    "t2.medium",
                    "t2.large",
                    "m1.small",
                    "m1.medium",
                    "cg1.4xlarge"
                ],
                "ConstraintDescription": "must be a valid EC2 instance type."
            },
            "OperatorEMail": {
                "Description": "EMail address to notify if there are any scaling operations",
                "Type": "String",
                "AllowedPattern": "([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)",
                "ConstraintDescription": "must be a valid email address."
            },
            "KeyName": {
                "Description": "The EC2 Key Pair to allow SSH access to the instances",
                "Type": "AWS::EC2::KeyPair::KeyName",
                "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
            },
            "SSHLocation": {
                "Description": "The IP address range that can be used to SSH to the EC2 instances",
                "Type": "String",
                "MinLength": "9",
                "MaxLength": "18",
                "Default": "0.0.0.0/0",
                "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
                "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
            }
        },
        "Resources": {
            "WebServerGroup": {
                "Type": "AWS::AutoScaling::AutoScalingGroup",
                "Properties": {
                    "VPCZoneIdentifier": {
                        "Ref": "Subnets"
                    },
                    "LaunchConfigurationName": {
                        "Ref": "LaunchConfig"
                    },
                    "MinSize": "1",
                    "MaxSize": "8",
                    "TargetGroupARNs": [{
                        "Ref": "ALBTargetGroup"
                    }]
                },
                "CreationPolicy": {
                    "ResourceSignal": {
                        "Timeout": "PT15M",
                        "Count": "1"
                    }
                },
                "UpdatePolicy": {
                    "AutoScalingRollingUpdate": {
                        "MinInstancesInService": "1",
                        "MaxBatchSize": "1",
                        "PauseTime": "PT15M",
                        "WaitOnResourceSignals": "true"
                    }
                }
            },
            "LaunchConfig": {
                "Type": "AWS::AutoScaling::LaunchConfiguration",
                "Properties": {
                    "KeyName": {
                        "Ref": "KeyName"
                    },
                    "ImageId": "ami-00932e4c143f3fdf0",
                    "SecurityGroups": [{
                        "Ref": "InstanceSecurityGroup"
                    }],
                    "InstanceType": {
                        "Ref": "InstanceType"
                    }
                }
            },
            "WebServerScaleUpPolicy": {
                "Type": "AWS::AutoScaling::ScalingPolicy",
                "Properties": {
                    "AdjustmentType": "ChangeInCapacity",
                    "AutoScalingGroupName": {
                        "Ref": "WebServerGroup"
                    },
                    "Cooldown": "60",
                    "ScalingAdjustment": "1"
                }
            },
            "WebServerScaleDownPolicy": {
                "Type": "AWS::AutoScaling::ScalingPolicy",
                "Properties": {
                    "AdjustmentType": "ChangeInCapacity",
                    "AutoScalingGroupName": {
                        "Ref": "WebServerGroup"
                    },
                    "Cooldown": "60",
                    "ScalingAdjustment": "-1"
                }
            },
            "CPUAlarmHigh": {
                "Type": "AWS::CloudWatch::Alarm",
                "Properties": {
                    "AlarmDescription": "Scale-up if CPU > 70% for 5 minutes",
                    "MetricName": "CPUUtilization",
                    "Namespace": "AWS/EC2",
                    "Statistic": "Average",
                    "Period": "300",
                    "EvaluationPeriods": "2",
                    "Threshold": "70",
                    "AlarmActions": [{
                        "Ref": "WebServerScaleUpPolicy"
                    }],
                    "Dimensions": [{
                        "Name": "AutoScalingGroupName",
                        "Value": {
                            "Ref": "WebServerGroup"
                        }
                    }],
                    "ComparisonOperator": "GreaterThanThreshold"
                }
            },
            "CPUAlarmLow": {
                "Type": "AWS::CloudWatch::Alarm",
                "Properties": {
                    "AlarmDescription": "Scale-down if CPU < 40% for 5 minutes",
                    "MetricName": "CPUUtilization",
                    "Namespace": "AWS/EC2",
                    "Statistic": "Average",
                    "Period": "300",
                    "EvaluationPeriods": "2",
                    "Threshold": "40",
                    "AlarmActions": [{
                        "Ref": "WebServerScaleDownPolicy"
                    }],
                    "Dimensions": [{
                        "Name": "AutoScalingGroupName",
                        "Value": {
                            "Ref": "WebServerGroup"
                        }
                    }],
                    "ComparisonOperator": "LessThanThreshold"
                }
            },
            "ApplicationLoadBalancer": {
                "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
                "Properties": {
                    "Subnets": {
                        "Ref": "Subnets"
                    }
                }
            },
            "ALBListener": {
                "Type": "AWS::ElasticLoadBalancingV2::Listener",
                "Properties": {
                    "DefaultActions": [{
                        "Type": "forward",
                        "TargetGroupArn": {
                            "Ref": "ALBTargetGroup"
                        }
                    }],
                    "LoadBalancerArn": {
                        "Ref": "ApplicationLoadBalancer"
                    },
                    "Port": "80",
                    "Protocol": "HTTP"
                }
            },
            "ALBTargetGroup": {
                "Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
                "Properties": {
                    "HealthCheckIntervalSeconds": 30,
                    "HealthCheckTimeoutSeconds": 5,
                    "HealthyThresholdCount": 3,
                    "Port": 80,
                    "Protocol": "HTTP",
                    "UnhealthyThresholdCount": 5,
                    "VpcId": {
                        "Ref": "VpcId"
                    }
                }
            },
            "InstanceSecurityGroup": {
                "Type": "AWS::EC2::SecurityGroup",
                "Properties": {
                    "GroupDescription": "Enable SSH access and HTTP from the load balancer only",
                    "SecurityGroupIngress": [{
                            "IpProtocol": "tcp",
                            "FromPort": "22",
                            "ToPort": "22",
                            "CidrIp": {
                                "Ref": "SSHLocation"
                            }
                        },
                        {
                            "IpProtocol": "tcp",
                            "FromPort": "80",
                            "ToPort": "80",
                            "SourceSecurityGroupId": {
                                "Fn::Select": [
                                    0,
                                    {
                                        "Fn::GetAtt": [
                                            "ApplicationLoadBalancer",
                                            "SecurityGroups"
                                        ]
                                    }
                                ]
                            }
                        }
                    ],
                    "VpcId": {
                        "Ref": "VpcId"
                    }
                }
            }
        },
        "Outputs": {
            "URL": {
                "Description": "The URL of the website",
                "Value": {
                    "Fn::Join": [
                        "",
                        [
                            "http://",
                            {
                                "Fn::GetAtt": [
                                    "ApplicationLoadBalancer",
                                    "DNSName"
                                ]
                            }
                        ]
                    ]
                }
            }
        }
    }
    

    【讨论】:

    • 没有写入Json 请检查jsoneditoronline.org这个URL
    • JSON 是有效的,但您将它嵌套在错误的级别:)
    • 请您更正一下。感谢您的帮助。并让您知道我正在使用现有的 AMI
    • 嗨@Chris Williams 请找到错误谢谢您的帮助不我收到“模板无效:模板格式错误:映射元素计数 0 应大于 0”
    • @shubhamkamboj 您在模板中有一个空的AWSRegionArch2AMI 映射。如果您不需要它,请删除它(似乎是这种情况)。
    【解决方案3】:
      "AWSTemplateFormatVersion": "2010-09-09",
      "Parameters": {
        "VpcId": {
          "Type": "AWS::EC2::VPC::Id",
          "Description": "VpcId of your existing Virtual Private Cloud (VPC)",
          "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud."
        },
        "Subnets": {
          "Type": "List<AWS::EC2::Subnet::Id>",
          "Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)"
        },
        "InstanceType": {
          "Description": "WebServer EC2 instance type",
          "Type": "String",
          "Default": "t2.small",
          "AllowedValues": [
            "t1.micro",
            "t2.nano",
            "t2.micro",
            "t2.small",
            "t2.medium",
            "t2.large",
            "m1.small",
            "m1.medium",
            "cg1.4xlarge"
          ],
          "ConstraintDescription": "must be a valid EC2 instance type."
        },
        "OperatorEMail": {
          "Description": "EMail address to notify if there are any scaling operations",
          "Type": "String",
          "AllowedPattern": "([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)",
          "ConstraintDescription": "must be a valid email address."
        },
        "KeyName": {
          "Description": "The EC2 Key Pair to allow SSH access to the instances",
          "Type": "AWS::EC2::KeyPair::KeyName",
          "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
        },
        "SSHLocation": {
          "Description": "The IP address range that can be used to SSH to the EC2 instances",
          "Type": "String",
          "MinLength": "9",
          "MaxLength": "18",
          "Default": "0.0.0.0/0",
          "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
          "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
        }
      },
      "Mappings": {
        "AWSInstanceType2Arch": {
          "t1.micro": {
            "Arch": "HVM64"
          },
          "t2.nano": {
            "Arch": "HVM64"
          },
          "t2.micro": {
            "Arch": "HVM64"
          },
          "t2.small": {
            "Arch": "HVM64"
          },
          "t2.medium": {
            "Arch": "HVM64"
          },
          "t2.large": {
            "Arch": "HVM64"
          },
          "m1.small": {
            "Arch": "HVM64"
          },
          "m1.medium": {
            "Arch": "HVM64"
          },
          "m1.large": {
            "Arch": "HVM64"
          },
          "d2.xlarge": {
            "Arch": "HVM64"
          }
        },
        "AWSInstanceType2NATArch": {
          "t1.micro": {
            "Arch": "NATHVM64"
          },
          "t2.nano": {
            "Arch": "NATHVM64"
          },
          "t2.micro": {
            "Arch": "NATHVM64"
          },
          "t2.small": {
            "Arch": "NATHVM64"
          },
          "t2.medium": {
            "Arch": "NATHVM64"
          },
          "t2.large": {
            "Arch": "NATHVM64"
          },
          "m1.small": {
            "Arch": "NATHVM64"
          }
        },
        "AWSRegionArch2AMI": {}
      },
      "Resources": {
        "WebServerGroup": {
          "Type": "AWS::AutoScaling::AutoScalingGroup",
          "Properties": {
            "VPCZoneIdentifier": {
              "Ref": "Subnets"
            },
            "LaunchConfigurationName": {
              "Ref": "LaunchConfig"
            },
            "MinSize": "1",
            "MaxSize": "8",
            "TargetGroupARNs": [
              {
                "Ref": "ALBTargetGroup"
              }
            ]
          },
          "CreationPolicy": {
            "ResourceSignal": {
              "Timeout": "PT15M",
              "Count": "1"
            }
          },
          "UpdatePolicy": {
            "AutoScalingRollingUpdate": {
              "MinInstancesInService": "1",
              "MaxBatchSize": "1",
              "PauseTime": "PT15M",
              "WaitOnResourceSignals": "true"
            }
          }
        },
        "LaunchConfig": {
          "Type": "AWS::AutoScaling::LaunchConfiguration",
          "Properties": {
            "KeyName": {
              "Ref": "KeyName"
            },
            "ImageId": "ami-00932e4c143f3fdf0",
            "SecurityGroups": [
              {
                "Ref": "InstanceSecurityGroup"
              }
            ],
            "InstanceType": {
              "Ref": "InstanceType"
            }
          }
        },
        "WebServerScaleUpPolicy": {
          "Type": "AWS::AutoScaling::ScalingPolicy",
          "Properties": {
            "AdjustmentType": "ChangeInCapacity",
            "AutoScalingGroupName": {
              "Ref": "WebServerGroup"
            },
            "Cooldown": "60",
            "ScalingAdjustment": "1"
          }
        },
        "WebServerScaleDownPolicy": {
          "Type": "AWS::AutoScaling::ScalingPolicy",
          "Properties": {
            "AdjustmentType": "ChangeInCapacity",
            "AutoScalingGroupName": {
              "Ref": "WebServerGroup"
            },
            "Cooldown": "60",
            "ScalingAdjustment": "-1"
          }
        },
        "CPUAlarmHigh": {
          "Type": "AWS::CloudWatch::Alarm",
          "Properties": {
            "AlarmDescription": "Scale-up if CPU > 70% for 5 minutes",
            "MetricName": "CPUUtilization",
            "Namespace": "AWS/EC2",
            "Statistic": "Average",
            "Period": "300",
            "EvaluationPeriods": "2",
            "Threshold": "70",
            "AlarmActions": [
              {
                "Ref": "WebServerScaleUpPolicy"
              }
            ],
            "Dimensions": [
              {
                "Name": "AutoScalingGroupName",
                "Value": {
                  "Ref": "WebServerGroup"
                }
              }
            ],
            "ComparisonOperator": "GreaterThanThreshold"
          }
        },
        "CPUAlarmLow": {
          "Type": "AWS::CloudWatch::Alarm",
          "Properties": {
            "AlarmDescription": "Scale-down if CPU < 40% for 5 minutes",
            "MetricName": "CPUUtilization",
            "Namespace": "AWS/EC2",
            "Statistic": "Average",
            "Period": "300",
            "EvaluationPeriods": "2",
            "Threshold": "40",
            "AlarmActions": [
              {
                "Ref": "WebServerScaleDownPolicy"
              }
            ],
            "Dimensions": [
              {
                "Name": "AutoScalingGroupName",
                "Value": {
                  "Ref": "WebServerGroup"
                }
              }
            ],
            "ComparisonOperator": "LessThanThreshold"
          }
        },
        "ApplicationLoadBalancer": {
          "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
          "Properties": {
            "Subnets": {
              "Ref": "Subnets"
            }
          }
        },
        "ALBListener": {
          "Type": "AWS::ElasticLoadBalancingV2::Listener",
          "Properties": {
            "DefaultActions": [
              {
                "Type": "forward",
                "TargetGroupArn": {
                  "Ref": "ALBTargetGroup"
                }
              }
            ],
            "LoadBalancerArn": {
              "Ref": "ApplicationLoadBalancer"
            },
            "Port": "80",
            "Protocol": "HTTP"
          }
        },
        "ALBTargetGroup": {
          "Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
          "Properties": {
            "HealthCheckIntervalSeconds": 30,
            "HealthCheckTimeoutSeconds": 5,
            "HealthyThresholdCount": 3,
            "Port": 80,
            "Protocol": "HTTP",
            "UnhealthyThresholdCount": 5,
            "VpcId": {
              "Ref": "VpcId"
            }
          }
        },
        "InstanceSecurityGroup": {
          "Type": "AWS::EC2::SecurityGroup",
          "Properties": {
            "GroupDescription": "Enable SSH access and HTTP from the load balancer only",
            "SecurityGroupIngress": [
              {
                "IpProtocol": "tcp",
                "FromPort": "22",
                "ToPort": "22",
                "CidrIp": {
                  "Ref": "SSHLocation"
                }
              },
              {
                "IpProtocol": "tcp",
                "FromPort": "80",
                "ToPort": "80",
                "SourceSecurityGroupId": {
                  "Fn::Select": [
                    0,
                    {
                      "Fn::GetAtt": [
                        "ApplicationLoadBalancer",
                        "SecurityGroups"
                      ]
                    }
                  ]
                }
              }
            ],
            "VpcId": {
              "Ref": "VpcId"
            }
          }
        }
      },
      "Outputs": {
        "URL": {
          "Description": "The URL of the website",
          "Value": {
            "Fn::Join": [
              "",
              [
                "http://",
                {
                  "Fn::GetAtt": [
                    "ApplicationLoadBalancer",
                    "DNSName"
                  ]
                }
              ]
            ]
          }
        }
      }
    }
    

    【讨论】:

    • 问题在于现在的映射
    • 您好 Govind,谢谢您的帮助 不,我收到“模板无效:模板格式错误:映射元素计数 0 应大于 0”
    • 好像可以了,请问您对映射做了哪些更改?
    • 缩进有问题,你在资源部分也犯了一些错误
    • 检查您使用的ami是否已经正确配置了nginx。
    【解决方案4】:
    {
      "AWSTemplateFormatVersion": "2010-09-09",
      "Description": "",
      "Parameters": {
        "OperatorEMail": {
          "Description": "EMail address to notify if there are any scaling operations",
          "Type": "String",
          "AllowedPattern": "([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)",
          "ConstraintDescription": "must be a valid email address."
        },
        "VpcId": {
          "Type": "AWS::EC2::VPC::Id",
          "Description": "VpcId of your existing Virtual Private Cloud (VPC)",
          "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud."
        },
        "Subnets": {
          "Type": "List<AWS::EC2::Subnet::Id>",
          "Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)",
          "ConstraintDescription": "must be a list of at least two existing subnets associated with at least two different availability zones. They should be residing in the selected Virtual Private Cloud."
        },
        "KeyName": {
          "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
          "Type": "AWS::EC2::KeyPair::KeyName",
          "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
        },
        "WebServerCapacity": {
          "Default": "2",
          "Description": "The initial number of WebServer instances",
          "Type": "Number",
          "MinValue": "1",
          "MaxValue": "10",
          "ConstraintDescription": "must be between 1 and 10 EC2 instances."
        },
        "InstanceType": {
          "Description": "WebServer EC2 instance type",
          "Type": "String",
          "Default": "t2.small",
          "AllowedValues": [
            "t1.micro",
            "t2.nano",
            "t2.micro",
            "t2.small",
            "t2.medium",
            "t2.large",
            "m1.small",
            "m1.medium",
            "m1.large",
            "m1.xlarge",
            "m2.xlarge",
            "m2.2xlarge",
            "m2.4xlarge",
            "m3.medium",
            "m3.large",
            "m3.xlarge",
            "m3.2xlarge",
            "m4.large",
            "m4.xlarge",
            "m4.2xlarge",
            "m4.4xlarge",
            "m4.10xlarge",
            "c1.medium",
            "c1.xlarge",
            "c3.large",
            "c3.xlarge",
            "c3.2xlarge",
            "c3.4xlarge",
            "c3.8xlarge",
            "c4.large",
            "c4.xlarge",
            "c4.2xlarge",
            "c4.4xlarge",
            "c4.8xlarge",
            "g2.2xlarge",
            "g2.8xlarge",
            "r3.large",
            "r3.xlarge",
            "r3.2xlarge",
            "r3.4xlarge",
            "r3.8xlarge",
            "i2.xlarge",
            "i2.2xlarge",
            "i2.4xlarge",
            "i2.8xlarge",
            "d2.xlarge",
            "d2.2xlarge",
            "d2.4xlarge",
            "d2.8xlarge",
            "hi1.4xlarge",
            "hs1.8xlarge",
            "cr1.8xlarge",
            "cc2.8xlarge",
            "cg1.4xlarge"
          ],
          "ConstraintDescription": "must be a valid EC2 instance type."
        },
        "SSHLocation": {
          "Description": " The IP address range that can be used to SSH to the EC2 instances",
          "Type": "String",
          "MinLength": "9",
          "MaxLength": "18",
          "Default": "0.0.0.0/0",
          "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
          "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
        }
      },
      "Mappings": {
        "AWSInstanceType2Arch": {
          "t1.micro": {
            "Arch": "HVM64"
          },
          "t2.nano": {
            "Arch": "HVM64"
          },
          "t2.micro": {
            "Arch": "HVM64"
          },
          "t2.small": {
            "Arch": "HVM64"
          },
          "t2.medium": {
            "Arch": "HVM64"
          },
          "t2.large": {
            "Arch": "HVM64"
          },
          "m1.small": {
            "Arch": "HVM64"
          },
          "m1.medium": {
            "Arch": "HVM64"
          },
          "m1.large": {
            "Arch": "HVM64"
          },
          "m1.xlarge": {
            "Arch": "HVM64"
          },
          "m2.xlarge": {
            "Arch": "HVM64"
          },
          "m2.2xlarge": {
            "Arch": "HVM64"
          },
          "m2.4xlarge": {
            "Arch": "HVM64"
          },
          "m3.medium": {
            "Arch": "HVM64"
          },
          "m3.large": {
            "Arch": "HVM64"
          },
          "m3.xlarge": {
            "Arch": "HVM64"
          },
          "m3.2xlarge": {
            "Arch": "HVM64"
          },
          "m4.large": {
            "Arch": "HVM64"
          },
          "m4.xlarge": {
            "Arch": "HVM64"
          },
          "m4.2xlarge": {
            "Arch": "HVM64"
          },
          "m4.4xlarge": {
            "Arch": "HVM64"
          },
          "m4.10xlarge": {
            "Arch": "HVM64"
          },
          "c1.medium": {
            "Arch": "HVM64"
          },
          "c1.xlarge": {
            "Arch": "HVM64"
          },
          "c3.large": {
            "Arch": "HVM64"
          },
          "c3.xlarge": {
            "Arch": "HVM64"
          },
          "c3.2xlarge": {
            "Arch": "HVM64"
          },
          "c3.4xlarge": {
            "Arch": "HVM64"
          },
          "c3.8xlarge": {
            "Arch": "HVM64"
          },
          "c4.large": {
            "Arch": "HVM64"
          },
          "c4.xlarge": {
            "Arch": "HVM64"
          },
          "c4.2xlarge": {
            "Arch": "HVM64"
          },
          "c4.4xlarge": {
            "Arch": "HVM64"
          },
          "c4.8xlarge": {
            "Arch": "HVM64"
          },
          "g2.2xlarge": {
            "Arch": "HVMG2"
          },
          "g2.8xlarge": {
            "Arch": "HVMG2"
          },
          "r3.large": {
            "Arch": "HVM64"
          },
          "r3.xlarge": {
            "Arch": "HVM64"
          },
          "r3.2xlarge": {
            "Arch": "HVM64"
          },
          "r3.4xlarge": {
            "Arch": "HVM64"
          },
          "r3.8xlarge": {
            "Arch": "HVM64"
          },
          "i2.xlarge": {
            "Arch": "HVM64"
          },
          "i2.2xlarge": {
            "Arch": "HVM64"
          },
          "i2.4xlarge": {
            "Arch": "HVM64"
          },
          "i2.8xlarge": {
            "Arch": "HVM64"
          },
          "d2.xlarge": {
            "Arch": "HVM64"
          },
          "d2.2xlarge": {
            "Arch": "HVM64"
          },
          "d2.4xlarge": {
            "Arch": "HVM64"
          },
          "d2.8xlarge": {
            "Arch": "HVM64"
          },
          "hi1.4xlarge": {
            "Arch": "HVM64"
          },
          "hs1.8xlarge": {
            "Arch": "HVM64"
          },
          "cr1.8xlarge": {
            "Arch": "HVM64"
          },
          "cc2.8xlarge": {
            "Arch": "HVM64"
          }
        },
        "AWSRegionArch2AMI": {
          "us-east-1": {
            "HVM64": "ami-0080e4c5bc078760e",
            "HVMG2": "ami-0aeb704d503081ea6"
          },
          "us-west-2": {
            "HVM64": "ami-01e24be29428c15b2",
            "HVMG2": "ami-0fe84a5b4563d8f27"
          },
          "us-west-1": {
            "HVM64": "ami-0ec6517f6edbf8044",
            "HVMG2": "ami-0a7fc72dc0e51aa77"
          },
          "eu-west-1": {
            "HVM64": "ami-08935252a36e25f85",
            "HVMG2": "ami-0d5299b1c6112c3c7"
          },
          "eu-west-2": {
            "HVM64": "ami-01419b804382064e4",
            "HVMG2": "NOT_SUPPORTED"
          },
          "eu-west-3": {
            "HVM64": "ami-0dd7e7ed60da8fb83",
            "HVMG2": "NOT_SUPPORTED"
          },
          "eu-central-1": {
            "HVM64": "ami-0cfbf4f6db41068ac",
            "HVMG2": "ami-0aa1822e3eb913a11"
          },
          "eu-north-1": {
            "HVM64": "ami-86fe70f8",
            "HVMG2": "ami-32d55b4c"
          },
          "ap-northeast-1": {
            "HVM64": "ami-00a5245b4816c38e6",
            "HVMG2": "ami-09d0e0e099ecabba2"
          },
          "ap-northeast-2": {
            "HVM64": "ami-00dc207f8ba6dc919",
            "HVMG2": "NOT_SUPPORTED"
          },
          "ap-northeast-3": {
            "HVM64": "ami-0b65f69a5c11f3522",
            "HVMG2": "NOT_SUPPORTED"
          },
          "ap-southeast-1": {
            "HVM64": "ami-05b3bcf7f311194b3",
            "HVMG2": "ami-0e46ce0d6a87dc979"
          },
          "ap-southeast-2": {
            "HVM64": "ami-02fd0b06f06d93dfc",
            "HVMG2": "ami-0c0ab057a101d8ff2"
          },
          "ap-south-1": {
            "HVM64": "ami-0ad42f4f66f6c1cc9",
            "HVMG2": "ami-0244c1d42815af84a"
          },
          "us-east-2": {
            "HVM64": "ami-0cd3dfa4e37921605",
            "HVMG2": "NOT_SUPPORTED"
          },
          "ca-central-1": {
            "HVM64": "ami-07423fb63ea0a0930",
            "HVMG2": "NOT_SUPPORTED"
          },
          "sa-east-1": {
            "HVM64": "ami-05145e0b28ad8e0b2",
            "HVMG2": "NOT_SUPPORTED"
          },
          "cn-north-1": {
            "HVM64": "ami-053617c9d818c1189",
            "HVMG2": "NOT_SUPPORTED"
          },
          "cn-northwest-1": {
            "HVM64": "ami-0f7937761741dc640",
            "HVMG2": "NOT_SUPPORTED"
          }
        }
      },
      "Resources": {
        "NotificationTopic": {
          "Type": "AWS::SNS::Topic",
          "Properties": {
            "Subscription": [
              {
                "Endpoint": {
                  "Ref": "OperatorEMail"
                },
                "Protocol": "email"
              }
            ]
          }
        },
        "WebServerScaleUpPolicy": {
          "Type": "AWS::AutoScaling::ScalingPolicy",
          "Properties": {
            "AdjustmentType": "ChangeInCapacity",
            "AutoScalingGroupName": {
              "Ref": "WebServerGroup"
            },
            "Cooldown": "60",
            "ScalingAdjustment": "1"
          }
        },
        "WebServerScaleDownPolicy": {
          "Type": "AWS::AutoScaling::ScalingPolicy",
          "Properties": {
            "AdjustmentType": "ChangeInCapacity",
            "AutoScalingGroupName": {
              "Ref": "WebServerGroup"
            },
            "Cooldown": "60",
            "ScalingAdjustment": "-1"
          }
        },
        "CPUAlarmHigh": {
          "Type": "AWS::CloudWatch::Alarm",
          "Properties": {
            "AlarmDescription": "Scale-up if CPU > 60% for 10 minutes",
            "MetricName": "CPUUtilization",
            "Namespace": "AWS/EC2",
            "Statistic": "Average",
            "Period": "300",
            "EvaluationPeriods": "2",
            "Threshold": "60",
            "AlarmActions": [
              {
                "Ref": "WebServerScaleUpPolicy"
              }
            ],
            "Dimensions": [
              {
                "Name": "AutoScalingGroupName",
                "Value": {
                  "Ref": "WebServerGroup"
                }
              }
            ],
            "ComparisonOperator": "GreaterThanThreshold"
          }
        },
        "CPUAlarmLow": {
          "Type": "AWS::CloudWatch::Alarm",
          "Properties": {
            "AlarmDescription": "Scale-down if CPU < 40% for 10 minutes",
            "MetricName": "CPUUtilization",
            "Namespace": "AWS/EC2",
            "Statistic": "Average",
            "Period": "300",
            "EvaluationPeriods": "2",
            "Threshold": "40",
            "AlarmActions": [
              {
                "Ref": "WebServerScaleDownPolicy"
              }
            ],
            "Dimensions": [
              {
                "Name": "AutoScalingGroupName",
                "Value": {
                  "Ref": "WebServerGroup"
                }
              }
            ],
            "ComparisonOperator": "LessThanThreshold"
          }
        },
        "ApplicationLoadBalancer": {
          "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
          "Properties": {
            "Subnets": {
              "Ref": "Subnets"
            }
          }
        },
        "ALBListener": {
          "Type": "AWS::ElasticLoadBalancingV2::Listener",
          "Properties": {
            "DefaultActions": [
              {
                "Type": "forward",
                "TargetGroupArn": {
                  "Ref": "ALBTargetGroup"
                }
              }
            ],
            "LoadBalancerArn": {
              "Ref": "ApplicationLoadBalancer"
            },
            "Port": "80",
            "Protocol": "HTTP"
          }
        },
        "ALBTargetGroup": {
          "Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
          "Properties": {
            "HealthCheckIntervalSeconds": 10,
            "HealthCheckTimeoutSeconds": 5,
            "HealthyThresholdCount": 2,
            "Port": 80,
            "Protocol": "HTTP",
            "UnhealthyThresholdCount": 5,
            "VpcId": {
              "Ref": "VpcId"
            },
            "TargetGroupAttributes": [
              {
                "Key": "stickiness.enabled",
                "Value": "true"
              },
              {
                "Key": "stickiness.type",
                "Value": "lb_cookie"
              },
              {
                "Key": "stickiness.lb_cookie.duration_seconds",
                "Value": "30"
              }
            ]
          }
        },
        "WebServerGroup": {
          "Type": "AWS::AutoScaling::AutoScalingGroup",
          "Properties": {
            "VPCZoneIdentifier": {
              "Ref": "Subnets"
            },
            "LaunchConfigurationName": {
              "Ref": "LaunchConfig"
            },
            "MinSize": "1",
            "MaxSize": "10",
            "DesiredCapacity": {
              "Ref": "WebServerCapacity"
            },
            "TargetGroupARNs": [
              {
                "Ref": "ALBTargetGroup"
              }
            ],
            "NotificationConfiguration": {
              "TopicARN": {
                "Ref": "NotificationTopic"
              },
              "NotificationTypes": [
                "autoscaling:EC2_INSTANCE_LAUNCH",
                "autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
                "autoscaling:EC2_INSTANCE_TERMINATE",
                "autoscaling:EC2_INSTANCE_TERMINATE_ERROR"
              ]
            }
          },
          "CreationPolicy": {
            "ResourceSignal": {
              "Timeout": "PT5M",
              "Count": {
                "Ref": "WebServerCapacity"
              }
            }
          },
          "UpdatePolicy": {
            "AutoScalingRollingUpdate": {
              "MinInstancesInService": "1",
              "MaxBatchSize": "1",
              "PauseTime": "PT5M",
              "WaitOnResourceSignals": "true"
            }
          }
        },
        "LaunchConfig": {
          "Type": "AWS::AutoScaling::LaunchConfiguration",
          "Metadata": {
            "Comment": "Configure the bootstrap helpers to install the Nginx Web Server",
            "AWS::CloudFormation::Init": {
              "config": {
                "packages": {
                  "yum": {
                    "java-1.6.0-openjdk-devel": []
                  }
                },
                "files": {
                  "/etc/cfn/cfn-hup.conf": {
                    "content": {
                      "Fn::Join": [
                        "",
                        [
                          "[main]\n",
                          "stack=",
                          {
                            "Ref": "AWS::StackId"
                          },
                          "\n",
                          "region=",
                          {
                            "Ref": "AWS::Region"
                          },
                          "\n"
                        ]
                      ]
                    },
                    "mode": "000400",
                    "owner": "root",
                    "group": "root"
                  },
                  "/etc/cfn/hooks.d/cfn-auto-reloader.conf": {
                    "content": {
                      "Fn::Join": [
                        "",
                        [
                          "[cfn-auto-reloader-hook]\n",
                          "triggers=post.update\n",
                          "path=Resources.LaunchConfig.Metadata.AWS::CloudFormation::Init\n",
                          "action=/opt/aws/bin/cfn-init -v ",
                          "         --stack ",
                          {
                            "Ref": "AWS::StackName"
                          },
                          "         --resource LaunchConfig ",
                          "         --region ",
                          {
                            "Ref": "AWS::Region"
                          },
                          "\n",
                          "runas=root\n"
                        ]
                      ]
                    },
                    "mode": "000400",
                    "owner": "root",
                    "group": "root"
                  }
                },
                "services": {
                  "sysvinit": {
                    "cfn-hup": {
                      "enabled": "true",
                      "ensureRunning": "true",
                      "files": [
                        "/etc/cfn/cfn-hup.conf",
                        "/etc/cfn/hooks.d/cfn-auto-reloader.conf"
                      ]
                    }
                  }
                }
              }
            }
          },
          "Properties": {
            "ImageId": {
              "Fn::FindInMap": [
                "AWSRegionArch2AMI",
                {
                  "Ref": "AWS::Region"
                },
                {
                  "Fn::FindInMap": [
                    "AWSInstanceType2Arch",
                    {
                      "Ref": "InstanceType"
                    },
                    "Arch"
                  ]
                }
              ]
            },
            "InstanceType": {
              "Ref": "InstanceType"
            },
            "SecurityGroups": [
              {
                "Ref": "WebServerSecurityGroup"
              }
            ],
            "KeyName": {
              "Ref": "KeyName"
            },
            "UserData": {
              "Fn::Base64": {
                "Fn::Join": [
                  "",
                  [
                    "#!/bin/bash -xe\n",
                    "yum install nginx -y; service nginx start; chkconfig nginx on;",
                    "yum update -y aws-cfn-bootstrap;",
                    "# Install the files and packages from the metadata\n",
                    "/opt/aws/bin/cfn-init -v ",
                    "         --stack ",
                    {
                      "Ref": "AWS::StackName"
                    },
                    "         --resource LaunchConfig ",
                    "         --region ",
                    {
                      "Ref": "AWS::Region"
                    },
                    "\n",
                    "# Signal the status from cfn-init\n",
                    "/opt/aws/bin/cfn-signal -e $? ",
                    "         --stack ",
                    {
                      "Ref": "AWS::StackName"
                    },
                    "         --resource WebServerGroup ",
                    "         --region ",
                    {
                      "Ref": "AWS::Region"
                    },
                    "\n"
                  ]
                ]
              }
            }
          }
        },
        "WebServerSecurityGroup": {
          "Type": "AWS::EC2::SecurityGroup",
          "Properties": {
            "GroupDescription": "Enable HTTP access via port 80 locked down to the ELB and SSH access",
            "SecurityGroupIngress": [
              {
                "IpProtocol": "tcp",
                "FromPort": "80",
                "ToPort": "80",
                "SourceSecurityGroupId": {
                  "Fn::Select": [
                    0,
                    {
                      "Fn::GetAtt": [
                        "ApplicationLoadBalancer",
                        "SecurityGroups"
                      ]
                    }
                  ]
                }
              },
              {
                "IpProtocol": "tcp",
                "FromPort": "22",
                "ToPort": "22",
                "CidrIp": {
                  "Ref": "SSHLocation"
                }
              }
            ],
            "VpcId": {
              "Ref": "VpcId"
            }
          }
        }
      },
      "Outputs": {
        "WebsiteURL": {
          "Description": "URL for newly Nginx stack",
          "Value": {
            "Fn::Join": [
              "",
              [
                "http://",
                {
                  "Fn::GetAtt": [
                    "ApplicationLoadBalancer",
                    "DNSName"
                  ]
                }
              ]
            ]
          }
        }
      }
    }
    

    【讨论】:

    • 我已经检查了这个模板。实际上,我想使用我的 AMI,我已经安装了一些软件包并想添加 CPU 警报
    • AWS::AutoScaling::AutoScalingGroup DELETE_IN_PROGRESS 我在警报中得到了这个
    • Govind 我可以得到你的电子邮件 ID 以便我可以和你聊天吗?
    • 你可以访问 www.elngovind.com 去获取它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-15
    • 2021-08-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-26
    • 2017-12-23
    • 2019-10-28
    相关资源
    最近更新 更多