I’ve created an AWS launch template, but the autos...
# python
l
I’ve created an AWS launch template, but the autoscaling group can’t find it. Running this script as written fails to create either resource. I had to comment out the
asg
configuration, create the launch template separately, then go back and run the whole thing.
Copy code
➜ cat __main__.py
import pulumi

from pulumi_aws import autoscaling, ec2

lt = ec2.LaunchTemplate('launch-template',
        image_id = 'ami-032509850cf9ee54e',
        instance_type = 't2.micro',
        )

asg = autoscaling.Group('autoscaling-group',
        launch_template = {'name': lt.id},
        min_size = 1,
        max_size = 4,
        )

pulumi.export('launch-template', lt.id),
pulumi.export('autoscaling group', asg.id),
After creating it separately, the launch template is available
Copy code
➜ pulumi stack output launch-template
lt-01a8e3b45e7100203
But not to the autoscaling group apparently
Copy code
➜ pulumi up -y
[...]

Updating (dev):

     Type                      Name                                                 Status                  Info
     pulumi:pulumi:Stack       possible-bug_asg_launch-template-does-not-exist-dev
 +   └─ aws:autoscaling:Group  autoscaling-group                                    **creating failed**     1 error

Diagnostics:
  aws:autoscaling:Group (autoscaling-group):
    error: Plan apply failed: Error creating AutoScaling Group: ValidationError: The specified launch template, with template name lt-01a8e3b45e7100203, does not exist.
        status code: 400, request id: cd425ae2-45ac-11e9-bd93-5791f9b27b8e