faas

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const COMPOSE_TEMPLATE string = `services:
  lambda:
    build: .
    ports:
      - 9000:8080
    env_file:
      - .env`
View Source
const DOCKERFILE_TEMPLATE string = `FROM %s:%s

%s

CMD [ "%s" ]`
View Source
const FAAS_CONFIG_FILE string = "faas.yaml"
View Source
const GOLANG_DOCKERFILE_COPY string = `COPY bootstrap ${LAMBDA_TASK_ROOT}`
View Source
const JAVA_DOCKERFILE_COPY string = `COPY target/classes ${LAMBDA_TASK_ROOT}
COPY target/dependency/* ${LAMBDA_TASK_ROOT}/lib/`
View Source
const NODEJS_DOCKERFILE_COPY string = `COPY node_modules ${LAMBDA_TASK_ROOT}/node_modules
COPY dist ${LAMBDA_TASK_ROOT}/dist
COPY package.json ${LAMBDA_TASK_ROOT}`
View Source
const PYTHON_DOCKERFILE_COPY string = `COPY app.py ${LAMBDA_TASK_ROOT}`

Variables

View Source
var BASIC_LAMBDA_POLICY_ARN = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
View Source
var CREATE_LAMBDA_REPOSITORY string = "create-lambda-repository"
View Source
var CheckAWSLogin func() (bool, error)
View Source
var ConfigPath = "."
View Source
var FaasRootCmd = &cobra.Command{
	Use:   "faas",
	Short: "Execute FaaS commands",
	Long:  "Configure, Create, and Execute Functions as a Service (AWS Lambdas)",
}
View Source
var LAMBDA_BASIC_EXECUTION_ROLE string = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"

Basic execution policy for Lambda Functions.

View Source
var S3_BUCKET_NAME string = "example-lambda-apps"

Name of the S3 bucket which holds all example lambda zips

View Source
var TEMPLATE_REPO_OWNER string = "obscurelyme"

Owner of the template repos

View Source
var TRUST_POLICY_DOC string = `` /* 192-byte string literal not displayed */

Functions

func CreateFaasResource added in v0.0.8

func CreateFaasResource(input CreateFaaSResourceInput) error

Creates the Lambda Function, this function can take some time due to having to wait for the AWS Policies and Role to take effect so that the lambda may assume the role.

func CreateLambdaRole added in v0.0.8

func CreateLambdaRole(input *CreateFaaSResourceInput) (string, string, error)

func DeleteFaaSRepo added in v0.0.9

func DeleteFaaSRepo(cfg aws.Config, name string) error

func DeleteFaaSResource added in v0.0.8

func DeleteFaaSResource(cfg aws.Config) error

func DeleteFaaSResourceRole added in v0.0.8

func DeleteFaaSResourceRole(cfg aws.Config) error

func DetachFaaSPolicies added in v0.0.8

func DetachFaaSPolicies(cfg aws.Config) error

func ListLambdas added in v0.0.8

func ListLambdas() error

func ProvisionFaasRepo added in v0.0.8

func ProvisionFaasRepo(input CreateFaaSResourceInput) error

func ReadLambdaConfig added in v0.0.9

func ReadLambdaConfig() (*viper.Viper, error)

func TryMakeFaaSResource added in v0.0.8

func TryMakeFaaSResource(client *lambda.Client, functionCode types.FunctionCode, defaultTimeout int32, roleArn string, input *CreateFaaSResourceInput) (bool, error)

func ValidateFunctionName added in v0.0.8

func ValidateFunctionName(input string) error

Types

type CreateFaaSResourceInput added in v0.0.8

type CreateFaaSResourceInput struct {
	FunctionName string
	Runtime      *LambdaRuntime
}

type DeleteRepositoryPayload added in v0.0.9

type DeleteRepositoryPayload struct {
	RepositoryOwner string `json:"repositoryOwner"`
	RepositoryName  string `json:"repositoryName"`
}

Payload to send when deleting a repository after deleting an FaaS resource

type DockerImage added in v0.0.9

type DockerImage string
const (
	DockerImageNodeJS DockerImage = "amazon/aws-lambda-nodejs"
	DockerImageJava   DockerImage = "amazon/aws-lambda-java"
	DockerImagePython DockerImage = "amazon/aws-lambda-python"
	DockerImageGo     DockerImage = "amazon/aws-lambda-go"
)

type LambdaLanguage added in v0.0.8

type LambdaLanguage string
const Golang LambdaLanguage = "golang"
const Java LambdaLanguage = "java"
const NodeJs LambdaLanguage = "nodejs"
const Python LambdaLanguage = "python"

type LambdaRuntime added in v0.0.8

type LambdaRuntime struct {
	// Internal AWS runtime for the lambda function
	AWSRuntime lambdaTypes.Runtime
	Language   LambdaLanguage
	// Handler for the lambda function
	Handler string
	// Name of the S3 key (zip file) stored in in the examples S3 bucket
	Example string
	// Template repository from which a new repo will be provisioned from
	TemplateRepo string
}

type Payload added in v0.0.8

type Payload struct {
	TemplateRepo          string `json:"templateRepo"`
	TemplateOwner         string `json:"templateOwner"`
	Owner                 string `json:"owner"`
	RepositoryName        string `json:"repositoryName"`
	RepositoryDescription string `json:"repositoryDescription"`
	Visibility            string `json:"visibility"`
}

Payload to send when provisioning a new template repository for a new FaaS resource

Jump to

Keyboard shortcuts

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