调用时出现ECS CLI密钥对错误

问题描述 投票:1回答:4

我正在尝试使用Amazon的ECS cli来创建集群。我一直收到错误:

 reason="The key pair 'my-key-pair' does not exist" resourceType="AWS::AutoScaling::LaunchConfiguration"

我也跑了:

ecs-cli configure profile --profile-name grantspilsbury --access-key foo --secret-key bar
ecs-cli configure --cluster cluster_test --region us-east-1 --config-name myclusterconfig

我已将我的密钥对添加到ECS和EC2。

完整的日志是:

~ $ ecs-cli up --keypair my-key-pair --capability-iam --size 2 --instance-type t2.small --force
INFO[0002] Created cluster                               cluster=default region=us-east-1
INFO[0003] Waiting for your CloudFormation stack resources to be deleted...
INFO[0003] Cloudformation stack status                   stackStatus="DELETE_IN_PROGRESS"
INFO[0038] Waiting for your cluster resources to be created...
INFO[0038] Cloudformation stack status                   stackStatus="CREATE_IN_PROGRESS"
INFO[0101] Cloudformation stack status                   stackStatus="CREATE_IN_PROGRESS"
INFO[0164] Cloudformation stack status                   stackStatus="CREATE_IN_PROGRESS"
ERRO[0197] Failure event                                 reason="The key pair 'my-key-pair' does not exist" resourceType="AWS::AutoScaling::LaunchConfiguration"
FATA[0197] Error executing 'up': Cloudformation failure waiting for 'CREATE_COMPLETE'. State is 'ROLLBACK_IN_PROGRESS'
amazon-ec2 docker-compose amazon-ecs
4个回答
3
投票

我遇到了同样的问题。我的问题是我给它的pem文件的完整路径,而不是key on EC2 (link to Ohio region)的名称。车削

ecs-cli up --keypair /home/me/keyPair.pem --capability-iam --size 2 --instance-type t2.medium --cluster-config ec2-tutorial --force

ecs-cli up --keypair keyPair --capability-iam --size 2 --instance-type t2.medium --cluster-config ec2-tutorial --force

只要EC2上有一个名为keyPair的密钥对就可以工作


0
投票

您的密钥可能与您尝试创建映像的区域位于不同的区域。杰夫的回答给了我线索,我的密钥对是在默认实例(俄亥俄州),但我在我的本地区域创建我的实例。


0
投票

我的问题是我传递的文件名(keypair.pem)而不是AWS上的密钥对的名称。确保您传递了在AWS上看到的密钥对名称,而不是文件名。


-1
投票

这意味着您的EC2帐户中不存在密钥对名称。

Simply create it with s per the aws guide

© www.soinside.com 2019 - 2024. All rights reserved.