Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
pycklets / resources / frecklet / ec2-instance-exists.frecklet
Size: Mime:
doc:
  short_help: Create an instance on Amazon EC2, if it doesn't exist yet.

args:
  instance_name:
    doc:
      short_help: The Name tag for the instance.
    type: string
    required: false
  aws_access_key:
    doc:
      short_help: The AWS access key.
    type: string
    required: true
  aws_secret_key:
    doc:
      short_help: The AWS secret key.
    type: string
    secret: true
    required: true
  security_groups:
    doc:
      short_help: A list of security group IDs or names (strings).
    type: list
    schema:
      type: string
    empty: true
    required: false
    cli:
      param_decls:
      - --security-group
      - -g
  region:
    doc:
      short_help: The AWS region to use.
      references:
        AWS region documentation: https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region
    type: string
    required: true
  instance_type:
    doc:
      short_help: Instance type to use for the instance.
      references:
        AWS instance type documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html
    type: string
    default: t2.micro
  image_id:
    doc:
      short_help: An image to use for the instance.
    required: true
    type: string
    default: ami-08d658f84a6d84a80
  key_name:
    doc:
      short_help: Name of the SSH access key to assign to the instance - must exist in the region the instance is created.
    type: string
    required: false
  register_var:
    doc:
      short_help: The name of the variable to register the result of this frecklet.
    type: string
    required: false
    default: ec2_instance
    cli:
      metavar: VAR_NAME
  wait:
    doc:
      short_help: Wait for the instance to be created.
      help: |
        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.
    type: boolean
    required: false
    default: true
  wait_timeout:
    doc:
      short_help: How long to wait (in seconds) for the instance to finish booting/terminating.
    type: integer
    required: false
    default: 600

frecklets:
- frecklet:
    name: ec2_instance
    type: ansible-module
    properties:
      elevated: false
      idempotent: true
      internet: true
    register: '{{:: register_var ::}}'
    desc:
      short: "create EC2 '{{:: instance_type ::}}' instance"
  task:
    include-type: include
    pip_dependencies:
    - boto
    - boto3
    - botocore
  vars:
    name: '{{:: instance_name ::}}'
    aws_access_key: '{{:: aws_access_key ::}}'
    aws_secret_key: '{{:: aws_secret_key ::}}'
    security_groups: '{{:: security_groups ::}}'
    region: '{{:: region ::}}'
    instance_type: '{{:: instance_type ::}}'
    image_id: '{{:: image_id ::}}'
    key_name: '{{:: key_name ::}}'
    wait: '{{:: wait ::}}'
    wait_timeout: '{{:: wait_timeout ::}}'
    state: running

meta: {}