Closed marios-zindilis closed 1 year ago
Copying from CloudTrail:
{
"eventVersion": "1.08",
"userIdentity": "...",
"eventTime": "2023-06-11T08:18:31Z",
"eventSource": "ec2.amazonaws.com",
"eventName": "ImportKeyPair",
"awsRegion": "eu-west-1",
"sourceIPAddress": "cloudformation.amazonaws.com",
"userAgent": "cloudformation.amazonaws.com",
"errorCode": "Client.InvalidKey.Format",
"errorMessage": "Key is not in valid OpenSSH public key format",
"requestParameters": {
"keyName": "keyName",
"publicKeyMaterial": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFDQVFDdFMvc1k5OFlrNlJxSlhyV1FJcU1yUm9lc1JLVEkwczZ4UlVsU1BKeng3RzhrYldLRUgxWVMra0UweEZPZmRiby9NcFhwVSx5RmY5dlRJS1M1SEVHNVpLaEZuTHBiaDNmQkJmRm1rRk5hekpjeHB5dTR5R1F5eThTRWhhdk04eE1sMU5DcEloQm1nOGZjY243OEZ3SFZqcndCRGFYbExrQ2tIa1FmNUFNK0ZneDJsRU91U056LDRObUl2REJBRXpKaThnaXhnS2xaTTV3bnlFT0hYeVVRMDRYcyt2UzZSSEx4bUJROTBuY21NZ2E5RmhmbHFmbVNDOHIvMXVNVlFZZ1crOC9wWE9HdmJNUm1keTl6eHhuSXo2RUJjTnRBeVdoR08sc1dCNzQzZmRYcENwYklxdGlNWElta3Bqbkl0VTE1YXI5aWordmtnQjVuS0JCcUZiSXZsUTBJS1laNVZKeFpNRmxwUk5aQVZ5RURlZGNEV1N2YzhBczVBUFlhdS9VZ2RFdjczaW5nRVpwcVpSNSxWY3BLUWZQNEYzcHNnSHRJTytjeVB2S3NzMFEwdktQTXdtcGw3ejVSUmNiS3hXR1hpenNRK0I5a3ZWczNIeks4Z3U0cWFEVzFSYkV5V2tkSXpPa1Yrb3ZuaHF6Ym45bzYwNzhoa2RJVTYyd2l4LGs3Zkk5dWdpT0VGTG9UaWlBVW8ySC9uUStaMDZJK3J4ck9nRjN1Y0dwQm1BbTZWYUlPMHVwanlzYktMK2cwNVdSajVCS3NIcDJhMkRmTWx6cCtUY0RicE1jeS80WVhZd0ErQkdJaWxJS2VGYlIsQWtXRFQ2TVAvbUxmaDB1ZDQreFpwZHltUzFRdnE0QXphc1JWUWF0VldacGFWV09wR3pqRjVLSmt6aFd6NERIQW5MNVE9PQ=="
},
"responseElements": null,
"requestID": "c5bf8f19-d84b-424a-b3bd-329b0b463a00",
"eventID": "d70b02ea-7571-47b4-bbcb-91436b6a25ed",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"recipientAccountId": "...",
"eventCategory": "Management"
}
Why is the public key material different from the one in the CDK and in the CloudFormation template?
Unfortunately this error is from cloudformation and is not from CDK. Please kindly report this error to cloudformation coverage roadmap to help the cloudformation team add this in their backlog.
I guess in your case you should use join('')
rather than join()
Thank you @pahud -- you are correct of course, it was a bug in my code. It worked with join('')
rather than join()
. I have created an issue in CloudFormation Coverage to surface a more helpful error: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1711
Closing this issue in favour of the one in cloudformation-coverage-roadmap.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
This is the entire stack:
This is the resulting CloudFormation template from
cdk synth
:Expected Behavior
If the key creation fails, we should get a meaningful error.
Current Behavior
The resource with name
MyCfnKeyPair
and typeAWS::EC2::KeyPair
fails to create with unhelpful error:Reproduction Steps
cdk deploy
the provided stack.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.77.0 (build 06a0b19)
Framework Version
No response
Node.js Version
v18.16.0
OS
Ubuntu 22.04
Language
Typescript
Language Version
4.9.5
Other information
No response