I have a cloudformation stack where I create instance with 2 EBS volumes, 1 main/root and 1 that has a lot of test data. The only reason to attach the test data is top load the data into hadoop in the beginning after stack creation. After that I have no point in keeping that EBS volume attached and paying money for it. But if I delete it manually or using boto3 library, will it cause problems with cloudformation stack later if I try to update it or delete it? Like deletion failed because it failed to find resources or if I try to update stack with a new tag, it will fail because it finds a resource missing. Any guidance is appreciated.
Update: Seems like cloudformation does not create a resource for my volume in stack resources because I cannot see it there. However when I click on instance, it has /dev/sda1 for block device and when I hover over it, it shows the EBS ID of the volume I created it with in my cloudformation.
My cloudformation template:
###################
### Master node ###
###################
MasterNode:
Type: AWS::EC2::Instance
Properties:
ImageId: !FindInMap [RegionMap, !Ref "AWS::Region", ami]
InstanceType: r3.large
KeyName: !FindInMap [RegionMap, !Ref "AWS::Region", key]
SubnetId: !FindInMap [RegionMap, !Ref "AWS::Region", subnet]
IamInstanceProfile: !Ref MasterNodeProfile
SecurityGroupIds:
- !Ref SecurityGroup
- !Ref InternalSecurityGroup
Tags:
-
Key: Name
Value: Master for XYZ
BlockDeviceMappings:
- DeviceName: /dev/sda1
Ebs:
VolumeSize: 20
DeleteOnTermination: True
VolumeType: gp2
UserData:
Fn::Base64: !Sub |
#!/bin/bash -xe
yum install epel-release -y
yum install python-pip -y
pip install awscli