问题
Amazon's Windows Roles and Features template demonstrates how to install features on a server. But can anyone tell me how would I install an application/feature that is not present in this list, such as WebDeploy? I appreciate I could create a custom AMI, but I'm looking to do this entirely at template-level.
Thanks in advance.
回答1:
For your example of WebDeploy, you could add this:
"C:\\Webdeploy\\WebDeploy_amd64_en-US.msi" : {
"source" : "http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi"
}
as a element of this section of the template
"WindowsServer": {
"Type" : "AWS::EC2::Instance",
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"files" : {
You could then add this command:
"1-installwebdeploy" : {
"command" : "msiexec.exe /i C:\\Webdeploy\\WebDeploy_amd64_en-US.msi ADDLOCAL=ALL /qn /norestart"
}
to the list of commands.
回答2:
There's a slightly easier mechanism if it's just a bog stock msi installation...
"packages" : {
"msi" : {
"urlrewrite" : "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
}
},
Means you don't need the "command" section.
来源:https://stackoverflow.com/questions/17728869/installing-windows-applications-extensions-with-amazon-cloudformation