specify IP address in salt cloud

525 Views Asked by At

If I have a specific private IP address in mind for an ec2 instance, how can I specify it in a salt cloud profile

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'}
1

There are 1 best solutions below

4
On

Hope you are well.

Your current config is very close. To specify a private IP in a profile, you'll want to simply add:

PrivateIpAddress: 192.168.133.105

Or w/e address you wish it to be assigned. Note that you'll need this AS WELL AS

PrivateIpAddresses:
  - primary: True