builder

package
v0.0.0-...-213f0f4 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AquaLambdaURL = "https://github.com/ArjenSchwarz/aqua/releases/download/latest/aqua_lambda.zip"

AquaLambdaURL is the URL to the Lambda installation file for Aqua

View Source
var AquaRole = `` /* 514-byte string literal not displayed */

AquaRole is the IAM Role configuration required for Aqua to run

View Source
var BasicRole = `` /* 246-byte string literal not displayed */

BasicRole is the IAM Role configuration for a basic Lambda role

View Source
var Helloworld64 = "" /* 356-byte string literal not displayed */

Helloworld64 is a base64 encoded Hello World NodeJS app (zipfile)

View Source
var S3Role = `` /* 411-byte string literal not displayed */

S3Role is the IAM Role configuration for a Lambda role with S3 access

View Source
var TrustDocument = `` /* 160-byte string literal not displayed */

TrustDocument is a Lambda trustdocument for Role creation

Functions

func CreateAPIKey

func CreateAPIKey(name string, description string, enabled bool, apikey string, region *string) (*apigateway.ApiKey, error)

CreateAPIKey creates a new API key

func CreateIAMRole

func CreateIAMRole(roleTemplate string, roleName *string) error

CreateIAMRole creates an IAM Role based on the provided template

func CreateSchedule

func CreateSchedule(settings *Config, schedule string) error

CreateSchedule creates a schedule for a Lambda function

func GetRole

func GetRole(name *string) (*iam.GetRoleOutput, error)

GetRole retrieves the IAM role with the provided name

func GetRoles

func GetRoles() (*iam.ListRolesOutput, error)

GetRoles returns all the roles the caller has access to

func ListAPIKeys

func ListAPIKeys(settings *Config) (*apigateway.GetApiKeysOutput, error)

ListAPIKeys shows the available API keys

Types

type Config

type Config struct {
	FunctionName   *string
	RoleName       *string
	Region         *string
	FilePath       *string
	Authentication *string
	JSONOutput     *bool
	ApikeyRequired *bool
	Runtime        *string
	RoleType       *string
	HTTPMethod     *string
	RoleFilename   *string
	NoGateway      *bool
}

Config contains all the provided settings

func (Config) CleanName

func (config Config) CleanName() string

CleanName returns a cleaned up version of the FunctionName

func (Config) IsWebPath

func (config Config) IsWebPath() bool

IsWebPath checks if the provided filepath is a web address

type GatewayBuilder

type GatewayBuilder struct {
	Lambda       *lambda.FunctionConfiguration
	APIGateway   *apigateway.RestApi
	RootResource *apigateway.Resource
	Resource     *apigateway.Resource
	Settings     *Config
}

GatewayBuilder contains the resources needed for creating the Gateway

func (*GatewayBuilder) APIARN

func (builder *GatewayBuilder) APIARN() string

APIARN returns the ARN of the API

func (*GatewayBuilder) AddPermissions

func (builder *GatewayBuilder) AddPermissions() error

AddPermissions adds test and production permissions for the Gateway to the Lambda function

func (*GatewayBuilder) AddResources

func (builder *GatewayBuilder) AddResources() error

AddResources adds a Resource (endpoint) to the API Gateway and attaches it to the GatewayBuilder

func (*GatewayBuilder) ConfigureResources

func (builder *GatewayBuilder) ConfigureResources() error

ConfigureResources configures the Resource in the GatewayBuilder to be set up for receiving POST messages and translate them into simple JSON messages

func (*GatewayBuilder) CreateAPIGateway

func (builder *GatewayBuilder) CreateAPIGateway() error

CreateAPIGateway creates an API Gateway and attaches it to the GatewayBuilder

func (*GatewayBuilder) DeployAPI

func (builder *GatewayBuilder) DeployAPI() error

DeployAPI deploys the API attached to the GatewayBuilder

func (*GatewayBuilder) Endpoint

func (builder *GatewayBuilder) Endpoint() string

Endpoint returns the endpoint of the API Gateway

func (*GatewayBuilder) EnsureLambdaFunction

func (builder *GatewayBuilder) EnsureLambdaFunction() error

EnsureLambdaFunction retrieves an existing Lambda function or creates a new one

Jump to

Keyboard shortcuts

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