Documentation ¶
Index ¶
- Variables
- func CreateAPIKey(name string, description string, enabled bool, apikey string, region *string) (*apigateway.ApiKey, error)
- func CreateIAMRole(roleTemplate string, roleName *string) error
- func CreateSchedule(settings *Config, schedule string) error
- func GetRole(name *string) (*iam.GetRoleOutput, error)
- func GetRoles() (*iam.ListRolesOutput, error)
- func ListAPIKeys(settings *Config) (*apigateway.GetApiKeysOutput, error)
- type Config
- type GatewayBuilder
- func (builder *GatewayBuilder) APIARN() string
- func (builder *GatewayBuilder) AddPermissions() error
- func (builder *GatewayBuilder) AddResources() error
- func (builder *GatewayBuilder) ConfigureResources() error
- func (builder *GatewayBuilder) CreateAPIGateway() error
- func (builder *GatewayBuilder) DeployAPI() error
- func (builder *GatewayBuilder) Endpoint() string
- func (builder *GatewayBuilder) EnsureLambdaFunction() error
Constants ¶
This section is empty.
Variables ¶
var AquaLambdaURL = "https://github.com/ArjenSchwarz/aqua/releases/download/latest/aqua_lambda.zip"
AquaLambdaURL is the URL to the Lambda installation file for Aqua
var AquaRole = `` /* 514-byte string literal not displayed */
AquaRole is the IAM Role configuration required for Aqua to run
var BasicRole = `` /* 246-byte string literal not displayed */
BasicRole is the IAM Role configuration for a basic Lambda role
var Helloworld64 = "" /* 356-byte string literal not displayed */
Helloworld64 is a base64 encoded Hello World NodeJS app (zipfile)
var S3Role = `` /* 411-byte string literal not displayed */
S3Role is the IAM Role configuration for a Lambda role with S3 access
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 ¶
CreateIAMRole creates an IAM Role based on the provided template
func CreateSchedule ¶
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
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