https://pulumi.com logo
m

modern-ram-22318

08/28/2019, 3:59 PM
Hey all. I'm new to Pulumi and am working on deploying some tasks to AWS with ECS. When I do
pulumi up
all executes fine, but my LaunchConfiguration and AutoScalingGroup never actually get created in AWS, don't show up in my stack Resources. Everything else so far seems to be working fine. Any ideas on why that would be? Also, any idea if it's possible to add Metadata to LaunchConfiguration resources?
w

white-balloon-205

08/28/2019, 4:04 PM
Did you see a failure during your
pulumi up
?
m

modern-ram-22318

08/28/2019, 4:12 PM
Nope, no failures. If I miss a required parameter or something like that, I do get an error. But when all is 'correct', as far as I can tell, there are no errors.
@white-balloon-205 I am seeing this problem when I use python to define and deploy a stack. I just did a test using JS and the awsx module to create an AutoscalingGroup and LaunchConfiguration. It seems to work when using that method..
w

white-balloon-205

08/28/2019, 10:18 PM
Do you have a code example you could share by any chance? Or a small repro derived from it? Feel free to open an issue or DM me as well if either is easier.
m

modern-ram-22318

08/28/2019, 11:03 PM
example code of python bug
that should do it I think.
Copy code
+   pulumi:pulumi:Stack                         infrastructure-staging     create
 +   ├─ aws:ec2:Vpc                              platform-staging           create
 +   ├─ aws:ec2:Eip                              elasticIp                  create
 +   ├─ aws:ec2:InternetGateway                  internetGateway            create
 +   ├─ aws:ec2:Subnet                           publicSubnet1              create
 +   ├─ aws:ec2:Subnet                           publicSubnet2              create
 +   ├─ aws:ec2:Subnet                           privateSubnet1             create
 +   pulumi:pulumi:Stack                         infrastructure-staging     create
 +   ├─ aws:ec2:RouteTable                       publicRouteTable           create
 +   ├─ aws:ec2:RouteTable                       privateRouteTable          create
 +   ├─ aws:ec2:NatGateway                       natGateway                 create
 +   ├─ aws:ec2:RouteTableAssociation            publicSubnetRoute1         create
 +   ├─ aws:ec2:RouteTableAssociation            publicSubnetRoute2         create
 +   ├─ aws:ec2:Route                            publicRoute                create
 +   ├─ aws:ec2:RouteTableAssociation            privateSubnetRoute1        create
 +   ├─ aws:ec2:RouteTableAssociation            privateSubnetRoute2        create
 +   ├─ aws:ec2:Route                            privateRoute               create
 +   ├─ aws:s3:Bucket                            mediaBucket                create
 +   ├─ aws:ec2:SecurityGroup                    bastionSecurityGroup       create
 +   ├─ aws:iam:Role                             bastionIamRole             create
 +   ├─ aws:ec2:SecurityGroup                    loadBalancerSecurityGroup  create
 +   ├─ aws:iam:Role                             loadBalancingTaskRole      create
 +   ├─ aws:iam:Role                             ecsIamRole                 create
 +   ├─ aws:iam:Role                             ecsScalingRole             create
 +   ├─ aws:ecs:Cluster                          ecsCluster                 create
 +   ├─ aws:sns:Topic                            ecsLifecycleTopic          create
 +   ├─ aws:iam:Role                             lifecycleIamRole           create
 +   ├─ aws:iam:Role                             lifecycleLambdaIamRole     create
 +   ├─ aws:iam:InstanceProfile                  bastionInstanceProfile     create
 +   ├─ aws:ec2:SecurityGroup                    ecsSecurityGroup           create
 +   ├─ aws:elasticloadbalancingv2:LoadBalancer  clientLoadBalancer         create
 +   ├─ aws:elasticloadbalancingv2:LoadBalancer  serverLoadBalancer         create
 +   ├─ aws:elasticloadbalancingv2:LoadBalancer  websocketLoadBalancer      create
 +   ├─ aws:iam:RolePolicy                       taskPolicy                 create
 +   ├─ aws:iam:RolePolicy                       ecsPolicy-staging          create
 +   ├─ aws:iam:InstanceProfile                  ecsInstanceProfile         create
 +   ├─ aws:iam:RolePolicy                       ecsAutoscalingPolicy       create
 +   ├─ aws:iam:RolePolicyAttachment             snsASNRole                 create
 +   ├─ aws:iam:RolePolicy                       lifecycleLambdaPolicy      create
 +   ├─ aws:iam:RolePolicyAttachment             lambdaASNRole              create
 +   └─ aws:iam:RolePolicy                       lifecycleSnsPolicy         create
sorry for the bad formatting. you'll see the LaunchConfig and ScalingGroup don't show up in the list of resources to create
@white-balloon-205 sorry, forgot to DM so I'm tagging you here
w

white-balloon-205

08/29/2019, 10:01 PM
Thanks for the repro @modern-ram-22318! We looked into this, and it actually uncovered a pretty serious bug which we are working on a fix for now: https://github.com/pulumi/pulumi/issues/3162. The root problem though is that your code was raising an exception "ValueError: unexpected input of type bytes", which is because you need to
.decode("utf-8")
on
lc_user_data
in your code. If you add that, this should work for you. However, that exception was getting swallowed by the Pulumi Python SDK, which we need to ensure never happens.
m

modern-ram-22318

08/30/2019, 6:51 AM
Thanks for the feedback!