clcdk

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package clcdk contains reusable infrastructruce components using AWS CDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstanceFromScope

func InstanceFromScope(s constructs.Construct) int

InstanceFromScope retrieves the instance name from the context or an empty string.

func NewInstancedStack

func NewInstancedStack(scope constructs.Construct, conv Conventions, account string) awscdk.Stack

NewInstancedStack requires a "instance" context variable to allow different copies of the stack to exist in the same AWS account.

func WithGatewayDomain

func WithGatewayDomain(
	scope constructs.Construct,
	name ScopeName,
	cfg gatewayConfig,
	gateway awsapigateway.IRestApi,
	zone awsroute53.IHostedZone,
	subDomain string,
	basePath *string,
) awsapigateway.IDomainName

WithGatewayDomain will setup a domain for the gateway on the provided hosted zone.

func WithNativeLambda

func WithNativeLambda(
	scope constructs.Construct,
	name ScopeName,
	cfg lambdaConfig,
	code awslambda.AssetCode,
	env *map[string]*string,
	logs awslogs.ILogGroup,
) awslambda.IFunction

WithNativeLambda creates a lambda for code that compiles Natively (such as Go).

func WithNodeLambbda

func WithNodeLambbda(
	scope constructs.Construct,
	name ScopeName,
	cfg lambdaConfig,
	code awslambda.AssetCode,
	env *map[string]*string,
	logs awslogs.ILogGroup,
) awslambda.IFunction

WithNodeLambbda creates a NodeJS lambda with a default alias.

func WithOpenApiGateway

func WithOpenApiGateway(
	scope constructs.Construct,
	name ScopeName,
	cfg gatewayConfig,
	handler awslambda.IFunction,
	schemaTmpl string,
) awsapigateway.IRestApi

WithOpenApiGateway creates a gateway that is defined by an OpenAPI definition while proxying all requests to a single Lambda Handler. This is done by treating the schema a template that will have certain values replaced. It will pick up changes to this schema and trigger a re-deploy, but changes to the templated values are not picked up (because they are still Cloudformation tokens at this stage.

func WithProxyGateway

func WithProxyGateway(
	scope constructs.Construct, name ScopeName, cfg gatewayConfig, handler awslambda.IFunction,
) awsapigateway.IRestApi

WithProxyGateway will setup a gateway that proxies all requests to a Lambda, with logging and tracing enabled.

Types

type Conventions

type Conventions interface {
	InstancedStackName(instance int) string
	Qualifier() string
	MainRegion() string
}

Conventions describes the interface for retrieving info that needs to be consistent between the stack and the other programs, i.e: magefiles.

func NewConventions

func NewConventions(qual, mainRegion string) Conventions

type ScopeName

type ScopeName string

ScopeName is the name of a scope.

func (ScopeName) ChildScope

func (sn ScopeName) ChildScope(parent constructs.Construct) constructs.Construct

ChildScope returns a new scope named 'name'.

func (ScopeName) String

func (sn ScopeName) String() string

type StagingConfig

type StagingConfig struct{}

StagingConfig provides static configuration based on something reasonable for staging.

func (StagingConfig) DomainRecordTTL

func (c StagingConfig) DomainRecordTTL() awscdk.Duration

DomainRecordTTL config.

func (StagingConfig) GatewayThrottlingBurstLimit

func (c StagingConfig) GatewayThrottlingBurstLimit() *float64

GatewayThrottlingBurstLimit config.

func (StagingConfig) GatewayThrottlingRateLimit

func (c StagingConfig) GatewayThrottlingRateLimit() *float64

GatewayThrottlingRateLimit config.

func (StagingConfig) LambdaApplicationLogLevel

func (c StagingConfig) LambdaApplicationLogLevel() string

LambdaApplicationLogLevel config.

func (StagingConfig) LambdaProvisionedConcurrency

func (c StagingConfig) LambdaProvisionedConcurrency() *float64

LambdaProvisionedConcurrency config.

func (StagingConfig) LambdaReservedConcurrency

func (c StagingConfig) LambdaReservedConcurrency() *float64

LambdaReservedConcurrency config.

func (StagingConfig) LambdaSystemLogLevel

func (c StagingConfig) LambdaSystemLogLevel() string

LambdaSystemLogLevel config.

func (StagingConfig) LambdaTimeout

func (c StagingConfig) LambdaTimeout() awscdk.Duration

LambdaTimeout config.

func (StagingConfig) LogRetention

func (c StagingConfig) LogRetention() awslogs.RetentionDays

LogRetention config.

Directories

Path Synopsis
Package postgresresource implements a custom resource for Postgres
Package postgresresource implements a custom resource for Postgres

Jump to

Keyboard shortcuts

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