を持っている必要があります。現在、私はtroposphereを使用して次のJSONを作成できました。エラー 'Parameters:[KeyPair]に値が必要です。私はこの「価値観」が何であるべきか分かりません。パラメータ:[キーペア]私はcloudformationを使用して、私のEC2インスタンスを反映しようとしていた値
私は、エラーを理解するが、溶液何かわかりません。
{
"Outputs": {
"InstanceAccess": {
"Description": "",
"Value": {
"Fn::Join": [
"",
[
"ssh -i ",
{
"Ref": "KeyPair"
},
" [email protected]",
{
"Fn::GetAtt": [
"MyInstance",
"PublicDnsName"
]
}
]
]
}
}
},
"Parameters": {
"KeyPair": {
"Description": "jj",
"Type": "AWS::EC2::KeyPair::launch"
}
},
"Resources": {
"MyInstance": {
"Properties": {
"ImageId": "< my image id goes here>",
"InstanceType": "t1.micro",
"KeyName": {
"Ref": "KeyPair"
},
"SecurityGroups": [
{
"Ref": "SecurityGroup"
}
]
},
"Type": "AWS::EC2::Instance"
},
"SecurityGroup": {
"Properties": {
"GroupDescription": "Allow access to MyInstance",
"SecurityGroupIngress": [
{
"CidrIp": "0.0.0.0/0",
"FromPort": "22",
"IpProtocol": "tcp",
"ToPort": "22"
},
{
"CidrIp": "0.0.0.0/0",
"FromPort": "80",
"IpProtocol": "tcp",
"ToPort": "80"
},
{
"CidrIp": "0.0.0.0/0",
"FromPort": "8080",
"IpProtocol": "tcp",
"ToPort": "8080"
},
{
"CidrIp": "0.0.0.0/0",
"FromPort": "443",
"IpProtocol": "tcp",
"ToPort": "443"
}
]
},
"Type": "AWS::EC2::SecurityGroup"
}
}
}
私は、以前のことを試してみました。あなたの解決策には次のエラーがあります: 'パラメータ:[KeyPair]には値が必要です ' –
Fyi、" launch "は私のkeyPairの名前です。私はどこにでも置く必要がありますか? –
テンプレートにありません。キーペアはパラメータであるため、テンプレートを使用してスタックを作成する場合(たとえば、WebコンソールまたはCLIを使用して)、有効なキーペア名を引数として渡す必要があります。 – rbarni