ec2.KeyPair how to label a generated Private Key? #30049
Replies: 1 comment
-
I think one of the things biting me is the private_key returned is a IStringParameter instead of a StringParameter, and thus doesn't have a If cdk creating extra objects behind the scenes is anything like "importing" objects, they can't be edited either. It looks like Since |
Beta Was this translation helpful? Give feedback.
-
In the console, you can use the EC2 KeyPairs screen to find the ID and look up the private key in the Parameter store. How do you go the other direction? On the private key Parameter Store screen, how do you find which KeyPair / Stack it belongs to? I'm trying to add tags and/or a description to the SSM parameter key.
I deploy multiple of the same stack, and it's a pain to cross reference the list, instead of being able to populate the Description / Tags of the private key with this info (Or best yet, being able to give the private key a custom name that contains the stack it's deployed with. I'm guessing this is much harder though...)
Generate a Key Pair:
Some idea's I've tried:
I just learned about escape hatches, to try to override the Description to include the stack name:
https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html#develop-customize-override
But that gives
AttributeError: 'NoneType' object has no attribute 'add_property_override'
.Printing the private key to the console gives
<jsii._reference_map.InterfaceDynamicProxy object at 0x7f8bf477dbb0>
, and not the normal CDK import class I'm used to, maybe that's a hint?Beta Was this translation helpful? Give feedback.
All reactions