0

I am reading throught the cli documentation and it seems like this should be possible, based on some of the outputs, but I can't seem to get the following option to work with run instance.

aws ec2 run-instances \
   --image-id ami-8d534dc8 \
   --region us-west-1 \
   --count 1 \
   --instance-type t2.medium \
   --private-dns-name test.us-west-1.compute.internal

This is the error that I am getting:

Unknown options: --private-dns-name, test.us-west-1.compute.internal

Has anybody been able to get this working?

jmreicha
  • 790
  • 1
  • 16
  • 29

2 Answers2

1

you can do this, and make whatever other server changes in general (ie sign into puppet), with cloud-init and passing --user-data at launch.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

nandoP
  • 2,021
  • 14
  • 15
  • Hmm, hadn't thought of going the cloud-init route. Looks like it should be possible but I don't see a good example in there? – jmreicha Jan 16 '15 at 21:35
-1

Here is a list of acceptable switches to use with aws ec2 run-instances, as you can see --private-dns-name is not one of them.

SYNOPSIS
        run-instances
      [--dry-run | --no-dry-run]
      --image-id <value>
      [--key-name <value>]
      [--security-groups <value>]
      [--security-group-ids <value>]
      [--user-data <value>]
      [--instance-type <value>]
      [--placement <value>]
      [--kernel-id <value>]
      [--ramdisk-id <value>]
      [--block-device-mappings <value>]
      [--monitoring <value>]
      [--subnet-id <value>]
      [--disable-api-termination | --enable-api-termination]
      [--instance-initiated-shutdown-behavior <value>]
      [--private-ip-address <value>]
      [--client-token <value>]
      [--additional-info <value>]
      [--network-interfaces <value>]
      [--iam-instance-profile <value>]
      [--ebs-optimized | --no-ebs-optimized]
      [--count <value>]
      [--secondary-private-ip-addresses <value>]
      [--secondary-private-ip-address-count <value>]
      [--associate-public-ip-address | --no-associate-public-ip-address]
      [--cli-input-json <value>]
      [--generate-cli-skeleton]
Optichip
  • 357
  • 1
  • 7