Help us shape the future of Go! Take the 2026 Go Developer Survey

lambda

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2016 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventSourceMapping = Resource{
	AwsType: "AWS::Lambda::EventSourceMapping",

	Properties: Properties{
		"BatchSize": Schema{
			Type:         ValueNumber,
			ValidateFunc: IntegerRangeValidate(1, 10000),
		},

		"Enabled": Schema{
			Type: ValueBool,
		},

		"EventSourceArn": Schema{
			Type:     ARN,
			Required: constraints.Always,
			ValidateFunc: RegexpValidate(
				`^arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)$`,
				"The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source of events.",
			),
		},

		"FunctionName": Schema{
			Type:     ValueString,
			Required: constraints.Always,
			ValidateFunc: RegexpValidate(
				`^(arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$`,
				"You can specify the function name (for example, Thumbnail) or you can specify Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).",
			),
		},

		"StartingPosition": Schema{
			Type: EnumValue{
				Description: "StartingPosition",
				Options:     []string{"TRIM_HORIZON", "LATEST"},
			},
			Required: constraints.Always,
		},
	},
}

see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html

View Source
var Function = Resource{
	AwsType: "AWS::Lambda::Function",

	Attributes: map[string]Schema{
		"Arn": Schema{
			Type: ARN,
		},
	},

	ReturnValue: Schema{
		Type: ValueString,
	},

	Properties: Properties{
		"Code": Schema{
			Type:     code,
			Required: constraints.Always,
		},

		"Description": Schema{
			Type: ValueString,
		},

		"Handler": Schema{
			Type:     ValueString,
			Required: constraints.Always,
			ValidateFunc: RegexpValidate(
				`^[^\s]{0,128}$`,
				"Minimum length of 0. Maximum length of 128.",
			),
		},

		"MemorySize": Schema{
			Type:         ValueNumber,
			ValidateFunc: IntegerRangeValidate(128, 1536),
		},

		"Role": Schema{
			Type:     ARN,
			Required: constraints.Always,
		},

		"Runtime": Schema{
			Type: EnumValue{
				Description: "Runtime",
				Options:     []string{"nodejs", "java8", "python2.7"},
			},
			Required: constraints.Always,
		},

		"Timeout": Schema{
			Type:    ValueNumber,
			Default: 3,
		},
	},
}

see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html

View Source
var Permission = Resource{
	AwsType: "AWS::Lambda::Permission",

	Properties: Properties{
		"Action": Schema{
			Type:     ValueString,
			Required: constraints.Always,
		},

		"FunctionName": Schema{
			Type:     ValueString,
			Required: constraints.Always,
		},

		"Principal": Schema{
			Type:     ValueString,
			Required: constraints.Always,
		},

		"SourceAccount": Schema{
			Type: ValueString,
		},

		"SourceArn": Schema{
			Type: ARN,
		},
	},
}

see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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