Im using AWS::CloudFormation::Init to deploy services and packages within a AWS EC2-Instance. By default, Cloud Formation ist using AWS's repository which installs old versions like PHP 5.4.16 in my case. I told cfn-init to install remi and epel repositories but it seams I have to tell yum the same. In a bash I would do this like:
sudo yum --enablerepo=remi,remi-php71 install httpd php php-common
Sure, I could do the same in the UserData section as well but want to avoid as long as there's no way in configSets possible.
"install_apache2": {
"packages": {
"rpm":{
"remi" : "http://rpms.famillecollet.com/enterprise/remi-release-7.rpm",
"epel" : "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
},
"yum": {
"php": [],
"php-mysql": [],
"php-mcrypt": [],
"php-gd": [],
"php-pear": [],
"httpd": [],
"nano": [],
"git": []
}
},
here ist a short cut from my cfn-init-cmd.log:
P7691 [INFO] ===============================================================================
P7691 [INFO] Package Arch Version Repository Size
P7691 [INFO] ===============================================================================
P7691 [INFO] Installing:
P7691 [INFO] git x86_64 1.8.3.1-20.el7 rhui-REGION-rhel-server-releases 4.4 M
P7691 [INFO] httpd x86_64 2.4.6-88.el7 rhui-REGION-rhel-server-releases 1.2 M
P7691 [INFO] nano x86_64 2.3.1-10.el7 rhui-REGION-rhel-server-releases 440 k
P7691 [INFO] php x86_64 5.4.16-46.el7 rhui-REGION-rhel-server-releases 1.4 M
P7691 [INFO] php-gd x86_64 5.4.16-46.el7 rhui-REGION-rhel-server-releases 128 k
P7691 [INFO] php-mcrypt x86_64 5.4.16-7.el7 epel 20 k
P7691 [INFO] php-mysql x86_64 5.4.16-46.el7 rhui-REGION-rhel-server-releases 102 k
P7691 [INFO] php-pear noarch 1:1.9.4-21.el7 rhui-REGION-rhel-server-releases 357 k