gpt4 book ai didi

amazon-web-services - 云信息 : How to get SecondaryPrivateIP from an instance

转载 作者:行者123 更新时间:2023-12-03 07:46:24 26 4
gpt4 key购买 nike

在下面的模板中,任何人都可以帮助我如何在不创建外部网络接口(interface)的情况下从实例中查找 SecondryPrivateIP。

"radmachine": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-abcde123",
"InstanceType": "t2.micro",
"KeyName": "radkey",
"DisableApiTermination": "false",
"NetworkInterfaces": [{
"AssociatePublicIpAddress": "false",
"DeviceIndex": "0",
"DeleteOnTermination": "true",
"SubnetId": "123456",
"GroupSet": "sg-56789",
"SecondaryPrivateIpAddressCount": "1"
}],
"BlockDeviceMappings": [{"DeviceName": "/dev/xvda","Ebs": {"VolumeType": "gp2","DeleteOnTermination": "false","VolumeSize": "8"}}],
}
}

提前致谢。

最佳答案

通读:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-network-interface.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/MultipleIP.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI

了解其工作原理后,请查看:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html

您对以下内容感兴趣:AWS::EC2::NetworkInterface -> SecondaryPrivateIpAddresses

所以基本上,您请求将额外的辅助私有(private) ip 绑定(bind)到网络接口(interface),然后使用 Fn::GetAtt 来检索在构建时提供给机器/接口(interface)的值。

关于amazon-web-services - 云信息 : How to get SecondaryPrivateIP from an instance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34433361/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com