AWS CloudFormation能否创build一个KeyPair以便在启动实例时随后使用?

我想使用作为CloudFormation一部分创build的密钥对启动我的堆栈。

那可能吗?

.... "Resources": { "ReverseProxyKeyPair": { "Type": "AWS::EC2::KeyPair", "Properties": { "KeyName": "reverse_proxy" } }, .... 

是一个猜测,但没有奏效。 我还没有跟踪CloudFormation的模式,说这是不可能的。

大多数例子都假设一个KeyPair已经被创build – 我假设,因为在创build时只有一个机会来下载它。 但我想dynamic创build一个,然后将其用作输出并将其转储到S3(比如说)。

或者,这是一个愚蠢的想法?

这是CloudFormation支持的所有资源types的列表; 密钥对没有列出:

http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html