Sam*_*amy 5 amazon-ec2 amazon-web-services aws-cloudformation
我知道我可以key/tag在cloudformation模板的启动配置中设置名称对,如下所示
"SaltMasterGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"DesiredCapacity": "1",
"LaunchConfigurationName": { "Ref": "SaltMasterLaunchConfig" },
"Tags" : [ {
"Key" : "Name",
"Value" : "saltmaster.lab.example.com",
"PropagateAtLaunch" : "true"}
]
}
}
Run Code Online (Sandbox Code Playgroud)
hostname但是我可以使用 CFN 模板设置私有吗?正如你所看到的,我正在使用盐,所以我准备使用盐来设置名称,但我希望有一个 CFN 解决方案。
您可以使用 userdata 设置主机名
sudo hostname myhost
echo myhost > /etc/hostname
Run Code Online (Sandbox Code Playgroud)
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
| 归档时间: |
|
| 查看次数: |
6110 次 |
| 最近记录: |