ec2-instance-exists

Description

Create an instance on Amazon EC2, if it doesn't exist yet.

For now, the 'instance_name' variable is required, because otherwise the underlying Ansible module errors out if no tags dict (or an empty one) is provided. Need to investigate how to do this best.

Variables

Name Type Default Description

instance_name

string --

The Name tag for the instance. Required

region

string --

The AWS region to use. Required

aws_access_key

string --

The AWS access key.

aws_secret_key

string --

The AWS secret key.

image_id

string ami-08d658f84a6d84a80

An image to use for the instance.

instance_type

string t2.micro

Instance type to use for the instance.

key_name

string --

Name of the SSH access key to assign to the instance - must exist in the region the instance is created.

register_var

string ec2_instance

The name of the variable to register the result of this frecklet.

security_groups

list --

A list of security group IDs or names (strings).

tags

dict --

A hash/dictionary of tags to add to the new instance or to add/remove from an existing one.

wait

boolean True

Wait for the instance to be created.

If set to 'false', no result will be registered as the details of this instance won't be known.

wait_timeout

integer 600

How long to wait (in seconds) for the instance to finish booting/terminating.

Command-line

frecklecute --community ec2-instance-exists --help

Usage: frecklecute ec2-instance-exists [OPTIONS]

  Create an instance on Amazon EC2, if it doesn't exist yet.

  For now, the 'instance_name' variable is required, because otherwise the
  underlying Ansible module errors out if no tags dict (or an empty one) is
  provided. Need to investigate how to do this best.

Options:
  --instance-name INSTANCE_NAME   The Name tag for the instance.  [required]
  --region REGION                 The AWS region to use.  [required]
  --aws-access-key AWS_ACCESS_KEY
                                  The AWS access key.
  --aws-secret-key AWS_SECRET_KEY
                                  The AWS secret key.
  --image-id IMAGE_ID             An image to use for the instance.  [default:
                                  ami-08d658f84a6d84a80]
  --instance-type INSTANCE_TYPE   Instance type to use for the instance.
                                  [default: t2.micro]
  --key-name KEY_NAME             Name of the SSH access key to assign to the
                                  instance - must exist in the region the
                                  instance is created.
  --register-var VAR_NAME         The name of the variable to register the
                                  result of this frecklet.  [default:
                                  ec2_instance]
  -g, --security-group SECURITY_GROUPS
                                  A list of security group IDs or names
                                  (strings).
  --tags TAGS                     A hash/dictionary of tags to add to the new
                                  instance or to add/remove from an existing
                                  one.
  --wait / --no-wait              Wait for the instance to be created.
  --wait-timeout WAIT_TIMEOUT     How long to wait (in seconds) for the
                                  instance to finish booting/terminating.
                                  [default: 600]
  --help                          Show this message and exit.