鹽雲

2016-12-19 36 views
1

指定IP地址,如果我心裏有一個特定的私有IP地址的EC2實例,我怎麼能在鹽雲廓鹽雲

ec2_private_win_app1: 
    provider: company-nonpod-us-east-1 
    image: ami-xxxxxxxx 
    size: c4.large 
    network_interfaces: 
    - DeviceIndex: 0 
    SubnetId: subnet-xxxxxxxx 
    SecurityGroupId: sg-xxxxxxxx 
    PrivateIpAddresses: 
    - Primary: True 
    #auto assign public ip (not EIP) 
    AssociatePublicIpAddress: False 
    tag: {'Engagement': 'xxxxxxxxxxxxx', 'Owner': 'Tim', 'Name': 'production'} 

回答

0

希望你一切都好指定。

您目前的配置非常接近。 要指定配置文件中的私有IP,你要簡單地添加:

PrivateIpAddress: 192.168.133.105 

或W/E的地址,你希望它被分配。請注意,您需要這個以及

PrivateIpAddresses: 
    - primary: True 
+0

如果我嘗試添加你建議的方式,它打破了YAML和鹽雲的IP給蟒蛇堆棧跟蹤。如果我這樣定義IP地址:'PrivateIpAddresses: - Primary:True \t \t - ip:10.48.128.45' yaml工作。但ec2實例具有自動分配的IP。我如何正確指定> – bluethundr

+0

嗯,有趣。所以你有自動分配的EC2在該子網中啓用IP? –

+0

是的,就是這樣。 – bluethundr