opened
pure1-sre
username_0
Is there a way to specify in /etc/salt/cloud.profiles.d/my-ec2-profile.conf that salt-cloud should not provision a public IP for an EC2 instance?  I am using the below settings, but the instance still comes online with a public IP address: (AssociatePublicIpAddress may be for an Elastic IP)

 network_interfaces:
      - DeviceIndex: 0
        PrivateIpAddresses:
          - Primary: True
        AssociatePublicIpAddress: False

In my /etc/salt/cloud.providers.d/aws.conf I have specified the following:

ssh_interface: private_ips

But the above is to ask Salt to use the private ip and not public IP when connecting to the instance.
Do not provision a public ip address (not elastic IP, but interface public IP)
issue
created
rallytime
username_1
@username_0 Can you also post the output of `salt-cloud --versions-report`? I feel like there is a way to do this, but I can't remember/find that option just now.
comment
created
pure1-sre
username_0
I have also tried to spin-up instances in private subnets in my VPC, but they are still getting a public IP along with a private IP.

$ sudo salt-cloud --versions-report
Salt Version:
            Salt: 2015.8.1

Dependency Versions:
 Apache Libcloud: 0.15.1
          Jinja2: 2.7.2
        M2Crypto: Not Installed
            Mako: 0.9.1
          PyYAML: 3.10
           PyZMQ: 14.4.0
          Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
            RAET: Not Installed
         Tornado: 4.2.1
             ZMQ: 4.0.4
            cffi: Not Installed
        cherrypy: Not Installed
        dateutil: 2.4.2
           gitdb: 0.5.4
       gitpython: 0.3.2 RC1
           ioflo: Not Installed
         libnacl: Not Installed
    msgpack-pure: Not Installed
  msgpack-python: 0.3.0
    mysql-python: 1.2.3
       pycparser: Not Installed
        pycrypto: 2.6.1
          pygit2: Not Installed
    python-gnupg: Not Installed
           smmap: 0.8.2
         timelib: Not Installed

System Versions:
            dist: Ubuntu 14.04 trusty
         machine: x86_64
         release: 3.13.0-48-generic
          system: Ubuntu 14.04 trusty
comment
created
rallytime
username_1
@techhat Do you remember if there is a way to do this?
comment
closed
pure1-sre
username_0
issue
created
pure1-sre
username_0
I think I found the solution, basically I thought I was deploying the AWS EC2 instance in a private subnet, but I was not, and that is why AWS was assigning a public IP. Once I changed the subnet-id to be  one that is truly a private subnet, AWS did not assign a public IP to it. I don't think we need anything on the salt-cloud end here.
comment
created
rallytime
username_1
Oh, awesome! I'm glad you got it figured out! :)
comment