Currently, the .sed files and sed commands in our CloudFormation::Init metadata for EC2 instances are not very extendable. They only match on patterns in the default files that they edit, making it impossible to tweak values in future template updates. Since we're usually using sed to edit config files, we need to be able to look up specific lines by some keyword, and then match on the entire line, regardless of the value after that keyword.
For example, in the yum-cron.conf configuration file, we want to match on the email_from line, regardless of whether the current value of email_from is the default, or some previous value that we used.
Currently, the
.sed
files andsed
commands in ourCloudFormation::Init
metadata for EC2 instances are not very extendable. They only match on patterns in the default files that they edit, making it impossible to tweak values in future template updates. Since we're usually usingsed
to edit config files, we need to be able to look up specific lines by some keyword, and then match on the entire line, regardless of the value after that keyword.For example, in the
yum-cron.conf
configuration file, we want to match on theemail_from
line, regardless of whether the current value ofemail_from
is the default, or some previous value that we used.