Open ckx opened 3 years ago
Yes, agree, using the built in KeyName will provide a list of existing keys in the account, which is handy, and easy, but I guess I assumed users would have atleat one keypair already... the best thing to do here is probably write a better description that points this out... "you must choose and existing keypair from your account.", and then of course mention this in the readme as part of the required bootstrap steps...
I agree we should look at each parameter and see which can be blank, which are required, and enforce pattern filters when it make sense to. All things we should do, but some of that patter work can be tedious to work on this early as things might change. But this is a good example of me assuming the user has something they might not, good catch...
I'm testing in a fresh AWS account with absolutely nothing on it. Right now the stack fails if no value is provided to
KeyNameParameter
. This is good & obvious behavior, and I don't think we should (or have a good way to) generate KeyPairs for users. That said, we should try to force an error when the parameter is left blank so that the stack doesn't get as far as trying to be created.The ways to force parameters are kind of janky, you have to define an
AllowedPattern
: https://stackoverflow.com/questions/62244549/make-parameter-input-required-in-cloudformation-template.For a non-blank pattern you can simply do
"AllowedPattern" : ".+"
.This doesn't give an error to a user until the very end step when they go to deploy the stack, but it's good enough as long as we make it clear it's required in an instructional readme somewhere.