Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Option to associate public ip address in ec2 run-instance #479

Closed
bluskool opened this Issue · 4 comments

4 participants

@bluskool

There doesn't seem to be any way to associate a public ip address without also adding a network interface with the --network-interfaces parameter. Is it possible for this to be a top level parameter?

@garnaat garnaat was assigned
@garnaat

Yes, I agree that would be useful.

@garnaat garnaat closed this in e331f98
@jamesls jamesls referenced this issue from a commit
@jamesls jamesls Merge branch 'release-1.2.5'
* release-1.2.5:
  Bumping version to 1.2.5
  Update completer unit tests with new changes
  Update CHANGELOG with latest features
  Add high level operations for cloudtrail
  Add a --associate-public-ip-address boolean option.  Fixes #479.
  Remove debugging code used in BaseAWSCommandParamsTest
  Add a new s3 website command
  Remove unused variables
  Remove trailing whitespace
7f8b88b
@bluskool

Thanks for adding it! I tried it out, but I ran into a problem. It seems that I can't run --associate-public-ip-address and specify a subnet id for some reason.

$ aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type m1.medium --security-group-ids "sg-xxxxxxxx" "sg-xxxxxxxx" "sg-xxxxxxxx" --subnet-id subnet-xxxxxxxx --associate-public-ip-address
A client error (InvalidParameterCombination) occurred: Network interfaces and an instance-level subnet ID may not be specified on the same request
@ryuzee

Thanks for adding this feature but I got this error too. the command is as follows.

aws ec2 run-instances --output text --debug \
--region ap-northeast-1 \
--image-id ami-b1fe9bb0 \
--key-name keypair1 \
--security-group-ids sg-xxxxxxx \
--instance-type t1.micro \
--subnet-id subnet-xxxxxxxx \
--private-ip-address 10.0.0.222 \
--associate-public-ip-address \
--count 1

and the error message is ...

A client error (InvalidParameterCombination) occurred: Network interfaces and an instance-level subnet ID may not be specified on the same request

any comments would be appreciated.

@JPalmerGithub

Check this kind page out
http://drewblas.com/2012/08/24/aws-vpc-error-client-invalidparametercombination/
As he states as below:

Luckily, my company has premium AWS support and a quick 10 minute chat got the answer I needed. You must use the --network-attachment param, which takes the place of --group, --private-ip-address, and --subnet

The resulting command looks like this:

ec2-run-instances ami-abc123 \
--network-attachment :0:subnet-abc123::10.0.1.10:sg-abc123::
.... your other params

Good luck, I hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.