clcdk

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package clcdk contains reusable infrastructruce components using AWS CDK.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ScopeNameLeftBracket defined the left bracket for scope naming printing.
	ScopeNameLeftBracket = ""
	// ScopeNameRightBracket defined the right bracket for scope naming printing.
	ScopeNameRightBracket = ""
)

Functions

func InstanceFromScope

func InstanceFromScope(s constructs.Construct) int

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

func LookupBaseZoneAndCerts added in v0.15.3

func LookupBaseZoneAndCerts(scope constructs.Construct, name ScopeName, cfg Config) (
	awsroute53.IHostedZone,
	awscertificatemanager.ICertificate,
	awscertificatemanager.ICertificate,
)

LookupBaseZoneAndCerts implements the logic for fetching the main public hosted zone, the zone's regional wildcard certificate and the zone's edge certificate. These must be setup manually and provide to the stack.

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 Config,
	gateway awsapigateway.IRestApi,
	zone awsroute53.IHostedZone,
	cert awscertificatemanager.ICertificate,
	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 Config,
	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 Config,
	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 Config,
	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 Config, handler awslambda.IFunction,
) awsapigateway.IRestApi

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

Types

type Config added in v0.15.2

type Config interface {
	Copy(opts ...ConfigOpt) Config

	LogRetention() awslogs.RetentionDays
	DomainRecordTTL() awscdk.Duration

	GatewayThrottlingRateLimit() *float64
	GatewayThrottlingBurstLimit() *float64
	GatewayDisableExecuteApi() *bool

	LambdaTimeout() awscdk.Duration
	LambdaReservedConcurrency() *float64
	LambdaProvisionedConcurrency() *float64
	LambdaApplicationLogLevel() *string
	LambdaSystemLogLevel() *string

	MainDomainName() *string
	RegionalCertificateArn() *string
	EdgeCertificateArn() *string
}

Config describes the providing of resource configuration that is often convenient to be shared between branches of the resource tree.

func NewConfig added in v0.15.2

func NewConfig(opts ...ConfigOpt) Config

NewConfig initializes a config implementation given the provided values.

func NewStagingConfig added in v0.15.2

func NewStagingConfig() Config

NewStagingConfig provides a config that provides easy-to-use defeaults for a staging environment.

type ConfigOpt added in v0.15.4

type ConfigOpt func(*config)

ConfigOpts describes a configuration option.

func WithDomainRecordTTL added in v0.15.4

func WithDomainRecordTTL(v awscdk.Duration) ConfigOpt

WithDomainRecordTTL config.

func WithEdgeCertificateArn added in v0.15.4

func WithEdgeCertificateArn(v *string) ConfigOpt

WithEdgeCertificateArn config.

func WithGatewayDisableExecuteApi added in v0.15.4

func WithGatewayDisableExecuteApi(v *bool) ConfigOpt

WithGatewayDisableExecuteApi config.

func WithGatewayThrottlingBurstLimit added in v0.15.4

func WithGatewayThrottlingBurstLimit(v *float64) ConfigOpt

WithGatewayThrottlingBurstLimit config.

func WithGatewayThrottlingRateLimit added in v0.15.4

func WithGatewayThrottlingRateLimit(v *float64) ConfigOpt

WithGatewayThrottlingRateLimit config.

func WithLambdaApplicationLogLevel added in v0.15.4

func WithLambdaApplicationLogLevel(v *string) ConfigOpt

WithLambdaApplicationLogLevel config.

func WithLambdaProvisionedConcurrency added in v0.15.4

func WithLambdaProvisionedConcurrency(v *float64) ConfigOpt

WithLambdaProvisionedConcurrency config.

func WithLambdaReservedConcurrency added in v0.15.4

func WithLambdaReservedConcurrency(v *float64) ConfigOpt

WithLambdaReservedConcurrency config.

func WithLambdaSystemLogLevel added in v0.15.4

func WithLambdaSystemLogLevel(v *string) ConfigOpt

WithLambdaSystemLogLevel config.

func WithLambdaTimeout added in v0.15.4

func WithLambdaTimeout(v awscdk.Duration) ConfigOpt

WithLambdaTimeout config.

func WithLogRetention added in v0.15.4

func WithLogRetention(v awslogs.RetentionDays) ConfigOpt

WithLogRetention config.

func WithMainDomainName added in v0.15.4

func WithMainDomainName(v *string) ConfigOpt

WithMainDomainName config.

func WithRegionalCertificateArn added in v0.15.4

func WithRegionalCertificateArn(v *string) ConfigOpt

WithRegionalCertificateArn config.

type Conventions

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

Conventions describes the interface for retrieving info that needs to be consistent between the stack and the other programs, i.e: magefiles. Conventions are shared between all stacks, instances, accounts and regions.

func NewConventions

func NewConventions(qual, mainRegion string) Conventions

NewConventions inits a convention instance.

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

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