Hi there! I'm running into some issues when trying...
# aws
c
Hi there! I'm running into some issues when trying to set up an ECS cluster with an AutoScalingGroup using a VPC defined in another stack. I've created a minimal reproduction example to illustrate the issue. The output is pretty opaque, I'm really blind here as to what seems to be the problem... https://github.com/eordano/autosg-repro Would really appreciate some help! More info in thread:
The VPC definition is pretty straightforward: https://github.com/eordano/autosg-repro/blob/main/infra/index.ts
Copy code
export const vpc = new awsx.ec2.Vpc('infra-vpc', {
  numberOfAvailabilityZones: 2,
  subnets: [
    { type: 'public', name: 'pub' },
    { type: 'private', name: 'priv' },
  ]
})
export const vpcId = vpc.id;
The autoscaling group definition also has some minimum values: https://github.com/eordano/autosg-repro/blob/main/service/index.ts
Copy code
const infra = new pulumi.StackReference('infra-repro')
const vpcId = infra.getOutputValue('vpcId')
const vpc = awsx.ec2.Vpc.fromExistingIds(`my-vpc-ref`, {
  vpcId
})
const myCluster = new awsx.ecs.Cluster('mycluster', {
  vpc
});

myCluster.createAutoScalingGroup('autoscaling', {
  vpc,
  templateParameters: {
    minSize: 1,
    desiredCapacity: 1
  },
  launchConfigurationArgs: {
    associatePublicIpAddress: false,
    rootBlockDevice: {
      volumeSize: 50
    },
    instanceType: "t3.xlarge",
  },
})
The issue I'm getting:
Copy code
Diagnostics:
  aws:ec2:LaunchConfiguration (autoscaling):
    error: Preview failed: transport is closing
 
  pulumi:pulumi:Stack (service-repro-service-repro):
    error: preview failed
 
    panic: interface conversion: interface {} is string, not bool
(more logs in the README: https://github.com/eordano/autosg-repro)
I'm using pulumi
v2.13.2
Note: this does not happen if I leave the vpc fields empty -- but I don't want to use the default VPC
b
I'm using the following to rehydrate. I don't recall seeing a
fromExistingIds
method when I did it. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/awsx/ec2/#Vpc-fromExistingIds
Copy code
const vpc = new awsx.ec2.Vpc('appVpc', { vpcId })
c
@colossal-librarian-55280, I’ve can replicate the problem and have opened up this issue: https://github.com/pulumi/pulumi/issues/5770