cwl

package
v0.0.0-...-18ab262 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 8 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckJobFunc3

func CheckJobFunc3(event JobGuid) (string, error)

CheckJobFunc3 checks and returns the status of the job identified by event.JobID. If a technical error is encountered an empty string and non-nil error are returned. The return string parameter is mapped to: "ResultPath": "%.status" in the State Machine Definition.

func EC2InstancesReboot

func EC2InstancesReboot(event EC2InstancesRebootEvent) (string, error)

EC2InstancesReboot is a test function, the purpose of which is to reboot the named EC2 Instances. The function does not attempt to determine the status of the named instances prior to executing the reboot attempts. Determination of instance status should be performed prior to calling this function.

func EC2InstancesStart

func EC2InstancesStart(event EC2InstancesStartEvent) (*ec2.StartInstancesOutput, error)

EC2InstancesStart is a test function, the purpose of which is to start the named EC2 Instances. The function does not attempt to determine the status of the named instances prior to executing the start attempts. Determination of instance status should be performed prior to calling this function.

func EC2InstancesStop

func EC2InstancesStop(event EC2InstancesStopEvent) (*ec2.StopInstancesOutput, error)

EC2InstancesStop is a test function, the purpose of which is to stop the named EC2 Instances. The function does not attempt to determine the status of the named instances prior to executing the stop attempts. Determination of instance status should be performed prior to calling this function.

func EC2IssueCmd

func EC2IssueCmd(event EC2IssueCmdEvent) (*ssm.Command, error)

EC2IssueCmd runs the specified command on the specified EC2 instances.

func EC2ListCmd

func EC2ListCmd(event EC2ListCmdEvent) (*ssm.ListCommandsOutput, error)

EC2ListCmd lists the specified command status/properties

func GetEC2Instances

func GetEC2Instances(event GetEC2InstancesEvent) (string, error)

GetEC2Instances is a test method for Lambda->EC2 AWS SDK access

func GetEC2Instances2

func GetEC2Instances2(event GetEC2InstancesEvent2) (string, error)

GetEC2Instances2 is a test method for Lambda->EC2 AWS SDK access

func GetEC2Statuses

func GetEC2Statuses(event GetEC2StatusesEvent) ([]*ec2.InstanceStatus, error)

GetEC2Statuses is a test function for Lambda->EC2 AWS SDK access, the purpose of which is to write the statuses of the selected EC2 instances to stdout.

Types

type EC2InstancesRebootEvent

type EC2InstancesRebootEvent struct {
	Instances []string `json:"instances"`
}

EC2InstancesRebootEvent triggers function cwl.EC2InstancesReboot.

type EC2InstancesStartEvent

type EC2InstancesStartEvent struct {
	Instances []string `json:"instances"`
}

EC2InstancesStartEvent triggers function cwl.EC2InstancesStart.

type EC2InstancesStopEvent

type EC2InstancesStopEvent struct {
	Instances []string `json:"instances"`
	Force     bool     `json:"force"`
}

EC2InstancesStopEvent triggers function cwl.EC2InstancesStop.

type EC2IssueCmdEvent

type EC2IssueCmdEvent struct {
	Instances []string `json:"instances"`
	Cmd       string   `json:"cmd"`
}

EC2IssueCmdEvent triggers function cwl.EC2IssueCmd.

type EC2ListCmdEvent

type EC2ListCmdEvent struct {
	Cmd       string   `json:"cmd"`
	Instances []string `json:"instances"`
}

EC2ListCmdEvent triggers function cwl.EC2ListCmd

type GetEC2InstancesEvent

type GetEC2InstancesEvent struct {
	Instance string `json:"instance"`
}

GetEC2InstancesEvent is a test event structure for Lambda->EC2 access.

type GetEC2InstancesEvent2

type GetEC2InstancesEvent2 struct {
	Instances []string `json:"instances"`
}

GetEC2InstancesEvent2 is a test event structure for Lambda->EC2 access.

type GetEC2StatusesEvent

type GetEC2StatusesEvent struct {
	Instances []string `json:"instances"`
}

GetEC2StatusesEvent is a test event structure for Lambda->EC2 access.

type JobEvent

type JobEvent struct {
	JobName       string `json:"jobName"`
	JobDefinition string `json:"jobDefinition"`
	JobQueue      string `json:"jobQueue"`
	WaitTime      int    `json:"wait_time"`
}

JobEvent holds AWS Batch job definition details

type JobGuid

type JobGuid struct {
	JobID string `json:"jobID"`
}

JobGuid is the event input structure containing the one-and-only input parameter for this function.

func SubmitJobFunc3

func SubmitJobFunc3(event JobEvent) (JobGuid, error)

SubmitJobFunc3 submits a job to AWS Batch based on the incoming event structure. The Job must be defined in the AWS batch console (for this one anyway), and is part of the event struct. example input:

{
	  "jobName": "my-test-job-4d",
	  "jobDefinition": "arn:aws:batch:us-west-2:755561232688:job-definition/SampleJobDefinition-e3e85ee22b798f7:1",
	  "jobQueue": "arn:aws:batch:us-west-2:755561232688:job-queue/SampleJobQueue-40e2ee4d7b7d43b",
	  "wait_time": 60
}

Jump to

Keyboard shortcuts

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