diff --git a/aws/cloudformation-template-ipsec.json b/aws/cloudformation-template-ipsec.json index 95cc0c7..df8dc9b 100644 --- a/aws/cloudformation-template-ipsec.json +++ b/aws/cloudformation-template-ipsec.json @@ -401,7 +401,7 @@ "'''", "def handler(event, context):", " try:", - " keyName = 'setup-ipsec-vpn-' + ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(10)).lower()", + " keyName = 'setup-ipsec-vpn-' + ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(20)).lower()", " region = event['ResourceProperties']['Region']", " ec2 = boto3.client('ec2',region)", " response = ec2.create_key_pair(", @@ -724,10 +724,17 @@ "RegionalDomainName" ] }, - "/profiles.zip" + "/", + { + "Fn::GetAtt": [ + "KeyPairInfo", + "KeyName" + ] + }, + "-profiles.zip" ] ] } } } -} +} \ No newline at end of file