I'm trying to create an AutoScalingGroup for EC2. I keep getting the following error:
Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement
The EC2 instance is being created but it is not getting a public IP or DNS.
I found this other thread about the same issue and one of the answers mentions "Verify that the subnets where AutoScalingGroup's instances will be installed can connect to Internet using either a NAT gateway or Internet gateway." I believe this is the problem, however I'm not sure how to resolve it.
My VPC already has an internet gateway but I'm not sure how to tell my AutoScaling group to use it.
PrivateSubnetOne:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
CidrBlock: !Ref PrivateSubnetOneCidr
AvailabilityZone:
Fn::Select:
- '0'
- Fn::GetAZs: ''
PrivateSubnetTwo:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
CidrBlock: !Ref PrivateSubnetTwoCidr
AvailabilityZone:
Fn::Select:
- '1'
- Fn::GetAZs: ''
WebServerAutoScalingGroup:
Type: AWS::AutoScaling::AutoScalingGroup
DependsOn:
- Db
- ElasticacheCluster
Properties:
AvailabilityZones:
- !GetAtt PrivateSubnetOne.AvailabilityZone
- !GetAtt PrivateSubnetTwo.AvailabilityZone
DesiredCapacity: 1
HealthCheckType: 'ELB'
HealthCheckGracePeriod: '300'
MinSize: '1'
MaxSize: '10'
LaunchConfigurationName: !Ref WebServer
LoadBalancerNames:
- !Ref WebServerElasticLoadBalancer
VPCZoneIdentifier:
- !Ref PrivateSubnetOne
- !Ref PrivateSubnetTwo
Tags:
- Key: Name
Value: Web Server
PropagateAtLaunch: true
CreationPolicy:
ResourceSignal:
Timeout: PT5M
Count: 1
UpdatePolicy:
AutoScalingRollingUpdate:
MinInstancesInService: 1
MaxBatchSize: '1'
PauseTime: PT5M
WaitOnResourceSignals: 'true'