0
我正在VPC中使用cloudformation創建互聯網訪問的AWS EC2實例。基於JSON,我能夠按照預期創建EC2。但是看起來實例狀態在創建EC2後立即停止。我期待EC2能夠在創建後立即運行。創建AWS EC2時,AWS EC2進入停止狀態
有沒有人遇到過這個問題?
雖然我能夠轉到AWS控制檯並手動將實例設置爲運行狀態。
這裏是在您的模板EC2
"PublicEC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": {
"Fn::FindInMap": ["AWSRegionArch2AMI", {
"Ref": "AWS::Region"
},
"64"
]
},
"InstanceType": {
"Ref": "InstanceType"
},
"KeyName": {
"Ref": "KeyPair"
},
"BlockDeviceMappings": [{
"DeviceName": "/dev/sda1",
"Ebs": {
"VolumeSize": "8"
}
}, {
"DeviceName": "/dev/sdm",
"Ebs": {
"VolumeSize": "8"
}
}],
"Tags": [{
"Key": "Name",
"Value": "Sample-PublicEC2"
}],
"UserData": {
"Fn::Base64": {
"Ref": "WebServerPort"
}
},
"NetworkInterfaces": [{
"AssociatePublicIpAddress": "true",
"DeleteOnTermination": "true",
"DeviceIndex": "0",
"SubnetId": {
"Ref": "PublicSubnet"
},
"GroupSet": [{
"Ref": "PublicSecurityGroup"
}]
}]
}
}
THanks似乎確實是這個問題;我修復了我的用戶數據,並開始工作 –
很高興聽到它的工作。如果此答案有助於解決您的問題,那麼下一步是[將其標記爲已接受](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235)。歡迎來到堆棧溢出! – wjordan