https://pulumi.com logo
#aws
Title
# aws
b

bumpy-garden-89740

08/21/2020, 7:56 AM
Hi! Let me try to ask this questions here. Maybe somebody know how to deal with this I faced with two issues yesterday. Help please, it's painful... 1. Autoscaling group creation for ECS (with EC2 type), failed with next error.
Copy code
aws:cloudformation:Stack (sosafe-staging-sg):
    error: 1 error occurred:
    	* updating urn:pulumi:staging::ss-servers::awsx:x:ecs:Cluster$awsx:x:autoscaling:AutoScalingGroup$aws:cloudformation/stack:Stack::sosafe-staging-sg: ValidationError: Stack:arn:aws:cloudformation:eu-north-1:606515313688:stack/sosafe-staging-sg-211ef70/86ab6f70-e337-11ea-99ce-06cb12622298 is in ROLLBACK_COMPLETE state and can not be updated.
    	status code: 400, request id: 6e5d68df-e95c-486f-8ac1-f58ffeca0841
code:
Copy code
cluster.createAutoScalingGroup(`${ fullName }-002-sg`, {
    templateParameters: {
      minSize: 1,
      maxSize: 1,
      desiredCapacity: 1,
    },
    subnetIds: awsx.ec2.Vpc.getDefault().publicSubnetIds,
    launchConfigurationArgs: {
      imageId: 'ami-04fea96ede651e6f4',
      securityGroups: securityGroups,
      instanceType: 't3.medium',
      iamInstanceProfile: ec2InstanceProfile,
      keyName: 'sosafe_id_rsa',
    },
  });
Looks like I cannot path this user data to configuration (this code should notify cfn that instances was created):
Copy code
UserData:
        Fn::Base64: !Sub |
          #!/bin/bash -xe
          echo ECS_CLUSTER=${ECSCluster} >> /etc/ecs/ecs.config
          yum install -y aws-cfn-bootstrap
          /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource ECSAutoScalingGroup --region ${AWS::Region}