My CloudFormation template got quite a bit of time. One reason is because my AWS::CloudFormation::Init section has become quite huge. This is a very small sample of what I have:
"ConfigDisk": { "commands": { "01formatFS": { "command": "/sbin/mkfs.ext4 /dev/xvdf" }, "02mountFS": { "command": "/bin/mount /dev/xvdf /var/lib/jenkins" }, "03changePerms": { "command": "/bin/chown jenkins:jenkins /var/lib/jenkins" }, "04updateFStab": { "command": "/bin/echo /dev/xvdf /var/lib/jenkins ext4 defaults 1 1 >> /etc/fstab" } } },
Wouldn't it be better to just put this in the userdata section as a bunch of commands?
/sbin/mkfs.ext4 /dev/xvdf /bin/mount /dev/xvdf /var/lib/jenkins /bin/chown jenkins:jenkins /var/lib/jenkins /bin/echo /dev/xvdf /var/lib/jenkins ext4 defaults 1 1 >> /etc/fstab
What are the benefits of leaving this in Initiation over user data?
source share