0

We are using using cloud formation script to create and setup a windows instance for our application. Instance is created using AWS::AutoScaling::LaunchConfiguration.

Now we have a requirement to attach a previously created volume to this instance using the same cloud formation script. Tried using AWS::EC2::VolumeAttachment but was unsuccessful as we do not have the instance id information that is required.

Any inputs?

AsteriK
  • 39
  • 1
  • 9

1 Answers1

0

My suggestion would be that the AMI which you're using to launch your ASG members should include this volume as part of the image if possible.

Chris Pollard
  • 1,625
  • 8
  • 11
  • We could not use that approach because we have APIs to stop/ start instance in our test environment when required. As instances are within autoscaling group, it gets terminated when stopped. So if we make it part of AMI, it will create new volumes every time instance comes up but we want to mount the same volume always. – AsteriK Jun 30 '18 at 16:21
  • That smells of bad architecture...Have you looked into using Elastic File System (EFS) instead of EBS volumes? – Chris Pollard Jun 30 '18 at 17:11