我已经创建了一个AWS CloudFormation脚本,它已经启动,但是当我查看日志时,显示以下错误:
ValidationError:堆栈stackarn处于CREATE_COMPLETE状态,无法发出信号
我查看了其他帖子的内容,这些帖子提到此错误可能是由于实例ID来自第一个实例或自动缩放组没有设置所需容量,但这些都不适用于我。
这是我的CloudFormation模板:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"90d29d54-61c0-4b64-8f16-bab58c2da737": {
"size": {
"width": 510,
"height": 330
},
"position": {
"x": 650,
"y": 200
},
"z": 0,
"embeds": [
"9da7a6f1-462f-45c1-bc0c-10fe6a297ea0",
"791e1b81-a4ed-4b9a-a1b6-e37f92201579",
"d4706141-a8d6-4d08-b092-cabedf2d351f",
"25f02a3f-31da-4e2a-8a3b-31cc9c860451"
]
},
"25f02a3f-31da-4e2a-8a3b-31cc9c860451": {
"size": {
"width": 250,
"height": 110
},
"position": {
"x": 850,
"y": 250
},
"z": 1,
"parent": "90d29d54-61c0-4b64-8f16-bab58c2da737",
"embeds": [
"9eb6713b-7a7f-46a2-8a53-76738c2069e7",
"ee1affdf-e6fe-453f-b754-cf2de003f1d8",
"e8849c27-1095-4667-906a-6f194c39e5bb"
]
},
"791e1b81-a4ed-4b9a-a1b6-e37f92201579": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 940,
"y": 450
},
"z": 1,
"parent": "90d29d54-61c0-4b64-8f16-bab58c2da737",
"embeds": []
},
"11d6e6db-f8bf-4162-83f4-3b4cdd3ecd9c": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 280,
"y": 340
},
"z": 0,
"embeds": []
},
"75f9474e-7e06-4879-8e2e-42f9063117bf": {
"source": {
"id": "90d29d54-61c0-4b64-8f16-bab58c2da737"
},
"target": {
"id": "11d6e6db-f8bf-4162-83f4-3b4cdd3ecd9c"
},
"z": 0
},
"9da7a6f1-462f-45c1-bc0c-10fe6a297ea0": {
"size": {
"width": 120,
"height": 120
},
"position": {
"x": 700,
"y": 270
},
"z": 1,
"parent": "90d29d54-61c0-4b64-8f16-bab58c2da737",
"embeds": [
"93a62438-214b-4c30-906d-c45d73f0a288"
]
},
"93a62438-214b-4c30-906d-c45d73f0a288": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 730,
"y": 310
},
"z": 2,
"parent": "9da7a6f1-462f-45c1-bc0c-10fe6a297ea0",
"embeds": [],
"isassociatedwith": [
"11d6e6db-f8bf-4162-83f4-3b4cdd3ecd9c"
]
"dependson": [
"75f9474e-7e06-4879-8e2e-42f9063117bf"
]
},
"e9956922-4cfe-4d1a-a4c9-814613d2517e": {
"source": {
"id": "9da7a6f1-462f-45c1-bc0c-10fe6a297ea0"
},
"target": {
"id": "25f02a3f-31da-4e2a-8a3b-31cc9c860451"
},
"z": 1
},
"e8849c27-1095-4667-906a-6f194c39e5bb": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 870,
"y": 280
},
"z": 2,
"parent": "25f02a3f-31da-4e2a-8a3b-31cc9c860451",
"embeds": [],
"isassociatedwith": [
"ee1affdf-e6fe-453f-b754-cf2de003f1d8",
"9eb6713b-7a7f-46a2-8a53-76738c2069e7"
]
"dependson": [
"93a62438-214b-4c30-906d-c45d73f0a288"
]
},
"9eb6713b-7a7f-46a2-8a53-76738c2069e7": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 940,
"y": 280
},
"z": 2,
"parent": "25f02a3f-31da-4e2a-8a3b-31cc9c860451",
"embeds": [],
"isassociatedwith": [
"d4706141-a8d6-4d08-b092-cabedf2d351f"
]
},
"ee1affdf-e6fe-453f-b754-cf2de003f1d8": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 1020,
"y": 280
},
"z": 2,
"parent": "25f02a3f-31da-4e2a-8a3b-31cc9c860451",
"embeds": [],
"isassociatedwith": [
"791e1b81-a4ed-4b9a-a1b6-e37f92201579"
]
},
"d4706141-a8d6-4d08-b092-cabedf2d351f": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 802.9767066348955,
"y": 452.6381721949601
},
"z": 1,
"parent": "90d29d54-61c0-4b64-8f16-bab58c2da737",
"embeds": []
},
"f2021951-c570-4233-8ccd-a05be043632c": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 1260,
"y": 210
},
"z": 0,
"embeds": []
},
"c892fb7e-40c0-4391-be11-3e005ed16251": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 1370,
"y": 210
},
"z": 0,
"embeds": []
},
"582ee47a-34d2-4faa-956f-72bbe48b5ca1": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 1260,
"y": 340
},
"z": 0,
"embeds": []
},
"68ddbe84-8848-4920-8700-df090e65d755": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 1370,
"y": 340
},
"z": 0,
"embeds": []
}
}
},
"Resources": {
"VPC": {
"Type": "AWS::EC2::VPC",
"Properties": {
"EnableDnsSupport": "true",
"EnableDnsHostnames": "true",
"CidrBlock": "10.0.0.0/16"
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "90d29d54-61c0-4b64-8f16-bab58c2da737"
}
}
},
"PublicSubnet": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "VPC"
},
"CidrBlock": "10.0.0.0/24"
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "25f02a3f-31da-4e2a-8a3b-31cc9c860451"
}
}
},
"PublicLoadBalancerSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Public Elastic Load Balancing security group with HTTP access on port 80 from the Internet",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "0.0.0.0/0"
}
],
"SecurityGroupEgress": [
{
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "0.0.0.0/0"
}
],
"VpcId": {
"Ref": "VPC"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "791e1b81-a4ed-4b9a-a1b6-e37f92201579"
}
}
},
"InternetGateway": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "11d6e6db-f8bf-4162-83f4-3b4cdd3ecd9c"
}
}
},
"EC2VPCG4YNHI": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": {
"Ref": "VPC"
},
"InternetGatewayId": {
"Ref": "InternetGateway"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "75f9474e-7e06-4879-8e2e-42f9063117bf"
}
}
},
"PublicRouteTable": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "VPC"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "9da7a6f1-462f-45c1-bc0c-10fe6a297ea0"
}
}
},
"PublicRoute": {
"Type": "AWS::EC2::Route",
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"RouteTableId": {
"Ref": "PublicRouteTable"
},
"GatewayId": {
"Ref": "InternetGateway"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "93a62438-214b-4c30-906d-c45d73f0a288"
}
},
"DependsOn": [
"EC2VPCG4YNHI"
]
},
"EC2SRTA188EJ": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "PublicRouteTable"
},
"SubnetId": {
"Ref": "PublicSubnet"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "e9956922-4cfe-4d1a-a4c9-814613d2517e"
}
}
},
"WebServerFleet": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"MinSize": "1",
"MaxSize": "10",
"DesiredCapacity": {
"Ref": "WebServerCount"
},
"VPCZoneIdentifier": [
{
"Ref": "PublicSubnet"
}
],
"LoadBalancerNames": [
{
"Ref": "PublicElasticLoadBalancer"
}
],
"LaunchConfigurationName": {
"Ref": "WebServerLaunchConfig"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "e8849c27-1095-4667-906a-6f194c39e5bb"
}
},
"DependsOn": [
"PublicRoute"
]
},
"WebServerLaunchConfig": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"InstanceType": {
"Ref": "InstanceType"
},
"ImageId": {
"Fn::FindInMap": [
"AWSRegionArch2AMI",
{
"Ref": "AWS::Region"
},
{
"Fn::FindInMap": [
"AWSInstanceType2Arch",
{
"Ref": "InstanceType"
},
"Arch"
]
}
]
},
"KeyName": {
"Ref": "KeyName"
},
"AssociatePublicIpAddress": "true",
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash -xe\n",
"yum install -y aws-cfn-bootstrap\n",
"# Install the files and packages from the metadata\n",
"/opt/aws/bin/cfn-init -v ",
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource WebServerLaunchConfig ",
" --configsets All ",
" --region ",
{
"Ref": "AWS::Region"
},
"\n",
"#Install Redis\n",
"#rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm\n",
"rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm\n",
"yum --enablerepo=remi,remi-test -y install redis\n",
"chkconfig --add redis\n",
"chkconfig --level 345 redis on\n",
"service redis start\n",
"# Clone GitHub Repository\n",
"git clone -b master https://",
{
"Ref": "GitHubUsername"
},
":",
{
"Ref": "GitHubPassword"
},
"@github.com/repo /var/www/html\n",
"# Update the httpd.conf file and restart the web server\n",
"mv -f /var/www/html/resources/conf/httpd.conf /etc/httpd/conf/httpd.conf \n",
"service httpd restart\n",
"# Install Composer\n",
"#chmod 755 -R /usr/local/bin\n",
"curl -sS https://getcomposer.org/installer > /tmp/installer\n",
"COMPOSER_HOME=/usr/local/composer php < /tmp/installer\n",
"mv composer.phar /usr/local/bin/composer.phar \n",
"groupadd www\n",
"usermod -a -G www ec2-user\n",
"usermod -a -G www apache\n",
"chown -R root:www /var/www\n",
"find /var/www -type d -exec chmod 2775 {} +\n",
"find /var/www -type f -exec chmod 0664 {} +\n",
"COMPOSER_HOME=/usr/local/composer /usr/local/bin/composer.phar install -d /var/www/html --no-plugins --no-scripts\n",
"mkdir /var/www/html/storage/framework\n",
"mkdir /var/www/html/storage/framework/views\n",
"mkdir /var/www/html/storage/framework/sessions\n",
"chmod -R 775 /var/www/html/storage\n",
"# Signal the status from cfn-init\n",
"/opt/aws/bin/cfn-signal -e $? ",
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource WebServerFleet ",
" --region ",
{
"Ref": "AWS::Region"
},
"\n"
]
]
}
},
"SecurityGroups": [
{
"Ref": "WebServerSecurityGroup"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "9eb6713b-7a7f-46a2-8a53-76738c2069e7"
},
"AWS::CloudFormation::Init": {
"configSets": {
"All": [
"installWebDependencies"
]
},
"installWebDependencies": {
"packages": {
"yum": {
"httpd24": [],
"php56": [],
"php56-pdo": [],
"php56-mbstring": [],
"php56-mcrypt": [],
"php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch": [],
"git": []
}
},
"services": {
"sysvinit": {
"httpd": {
"enabled": "true",
"ensureRunning": "true"
}
}
}
}
}
}
},
"PublicElasticLoadBalancer": {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties": {
"Listeners": [
{
"LoadBalancerPort": "80",
"InstancePort": "80",
"Protocol": "HTTP"
}
],
"HealthCheck": {
"Target": "HTTP:80/",
"HealthyThreshold": "3",
"UnhealthyThreshold": "5",
"Interval": "90",
"Timeout": "60"
},
"Subnets": [
{
"Ref": "PublicSubnet"
}
],
"SecurityGroups": [
{
"Ref": "PublicLoadBalancerSecurityGroup"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "ee1affdf-e6fe-453f-b754-cf2de003f1d8"
}
}
},
"WebServerSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Allow access from load balancer and SSH traffic",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"SourceSecurityGroupId": {
"Ref": "PublicLoadBalancerSecurityGroup"
}
},
{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": {
"Ref": "SSHLocation"
}
},
{
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "31.221.88.186/32"
}
],
"VpcId": {
"Ref": "VPC"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "d4706141-a8d6-4d08-b092-cabedf2d351f"
}
}
},
"AnvilQueue": {
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "phonehome-incident-anvil",
"DelaySeconds": 0,
"ReceiveMessageWaitTimeSeconds": 0,
"VisibilityTimeout": 30,
"MessageRetentionPeriod": 1209600
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "f2021951-c570-4233-8ccd-a05be043632c"
}
}
},
"ProcessQueue": {
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "phonehome-incident-process",
"DelaySeconds": 0,
"ReceiveMessageWaitTimeSeconds": 0,
"VisibilityTimeout": 30,
"MessageRetentionPeriod": 1209600
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "c892fb7e-40c0-4391-be11-3e005ed16251"
}
}
},
"QueueDepthAlarm": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmDescription": "Alarm if queue depth grows beyond 2000 messages",
"Namespace": "AWS/SQS",
"MetricName": "ApproximateNumberOfMessagesVisible",
"Dimensions": [
{
"Name": "AnvilQueue",
"Value": {
"Fn::GetAtt": [
"AnvilQueue",
"QueueName"
]
}
},
{
"Name": "ProcessQueue",
"Value": {
"Fn::GetAtt": [
"ProcessQueue",
"QueueName"
]
}
}
],
"Statistic": "Sum",
"Period": "300",
"EvaluationPeriods": "1",
"Threshold": "2000",
"ComparisonOperator": "GreaterThanThreshold",
"AlarmActions": [
{
"Ref": "AlarmTopic"
}
],
"InsufficientDataActions": [
{
"Ref": "AlarmTopic"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "582ee47a-34d2-4faa-956f-72bbe48b5ca1"
}
}
},
"AlarmTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"Subscription": [
{
"Endpoint": {
"Ref": "AlarmEmail"
},
"Protocol": "email"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "68ddbe84-8848-4920-8700-df090e65d755"
}
}
}
},
"Parameters": {
"AlarmEmail": {
"Default": "devops-geeks@foundry.com",
"Description": "Email address to notify if operational problems arise",
"Type": "String"
},
"InstanceType": {
"Description": "WebServer EC2 instance type",
"Type": "String",
"Default": "t2.micro",
"AllowedValues": [
"t1.micro",
"t2.micro",
"t2.small",
"t2.medium",
"m1.small",
"m1.medium",
"m1.large"
],
"ConstraintDescription": "must be a valid EC2 instance type."
},
"KeyName": {
"Description": "Name of an EC2 KeyPair to enable SSH access to the instance.",
"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 access the web server using SSH.",
"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."
},
"WebServerCount": {
"Description": "Number of Amazon EC2 instances to launch for the WebServer server",
"Type": "Number",
"Default": "1"
},
"GitHubPassword": {
"NoEcho": "true",
"Description": "GitHub Password",
"Type": "String"
},
"GitHubUsername": {
"Description": "GitHub Username ",
"Type": "String"
}
},
"Mappings": {
"AWSInstanceType2Arch": {
"t1.micro": {
"Arch": "PV64"
},
"t2.micro": {
"Arch": "HVM64"
},
"t2.small": {
"Arch": "HVM64"
},
"t2.medium": {
"Arch": "HVM64"
},
"m1.small": {
"Arch": "PV64"
},
"m1.medium": {
"Arch": "PV64"
},
"m1.large": {
"Arch": "PV64"
}
},
"AWSRegionArch2AMI": {
"eu-west-1": {
"PV64": "ami-bf0897c8",
"HVM64": "ami-a10897d6",
"HVMG2": "ami-d5bc24a2"
},
"eu-west-2": {
"PV64": "ami-896369ed",
"HVM64": "ami-896369ed",
"HVMG2": "ami-896369ed"
},
"eu-central-1": {
"PV64": "ami-ac221fb1",
"HVM64": "ami-a8221fb5",
"HVMG2": "ami-7cd2ef61"
}
}
},
"Outputs": {
"URL": {
"Value": {
"Fn::GetAtt": [
"PublicElasticLoadBalancer",
"DNSName"
]
},
"Description": "Newly created application URL"
}
}
}
注意:为了防止stackoverflow反馈文件过大,CF设计器代码已被排除在外。 有什么想法是什么原因导致了这个问题?