ec2

package
v0.30.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

README

Amazon Elastic Compute service

This service is github.com/aws/aws-sdk-go/service/ec2.EC2 proxy

To check all supported method run

    endly -s="aws/ec2"

To check method contract run endly -s="aws/ec2" -a=methodName

    endly -s="aws/ec2" -a='stopInstances'
Usage:
Starting instance

@start.yaml

init:
  instanceId: i-0064b6c35XXXXX
pipeline:
  start:
    info:
      action: aws/ec2:describeInstances
      logging: false
      credentials: aws
      instanceids:
       - $instanceId

    print:
      action: print
      message: Instance $instanceId is  $info.Reservations[0].Instances[0].State.Name

    check:
      when: $info.Reservations[0].Instances[0].State.Name = 'running'
      action: exit

    instanceUp:
      when: $info.Reservations[0].Instances[0].State.Name = 'stopped'
      action: aws/ec2:startInstances
      logging: false
      instanceids:
        - $instanceId

    waitForStart:
      action: nop
      logging: false
      sleepTimeMs: 5000

    gotoStart:
      action: goto
      task: start

Stop instance

@stop.yaml

init:
  instanceId: i-0064b6c35XXXXX
pipeline:
  stop:
    info:
      action: aws/ec2:describeInstances
      logging: false
      credentials: aws
      instanceids:
        - $instanceId

    print:
      action: print
      message: Instance $instanceId is  $info.Reservations[0].Instances[0].State.Name

    check:
      when: $info.Reservations[0].Instances[0].State.Name = 'stopped'
      action: exit

    instanceDown:
      when: $info.Reservations[0].Instances[0].State.Name = 'running'
      action: aws/ec2:stopInstances
      logging: false
      instanceids:
        - $instanceId
    waitForStop:
      action: nop
      logging: false
      sleepTimeMs: 5000
    gotoStop:
      action: goto
      task: stop

Documentation

Index

Constants

View Source
const (
	//ServiceID aws iam service id.
	ServiceID = "aws/ec2"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient(context *endly.Context) (*ec2.EC2, error)

GetClient returns ec2 client from context

func New

func New() endly.Service

New creates a new AWS IAM service.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL