Documentation
¶
Overview ¶
Package clcdk contains reusable infrastructruce components using AWS CDK.
Index ¶
- Variables
- func InstanceFromScope(s constructs.Construct) int
- func LookupBaseZoneAndCerts(scope constructs.Construct, name ScopeName, inp BaseInputs) (awsroute53.IHostedZone, awscertificatemanager.ICertificate, ...)
- func NewInstancedStack(scope constructs.Construct, conv Conventions, account string) awscdk.Stack
- func WithGatewayDomain(scope constructs.Construct, name ScopeName, cfg Config, ...) awsapigateway.IDomainName
- func WithNativeLambda(scope constructs.Construct, name ScopeName, cfg Config, ...) awslambda.IFunction
- func WithNodeLambbda(scope constructs.Construct, name ScopeName, cfg Config, ...) awslambda.IFunction
- func WithOpenApiGateway(scope constructs.Construct, name ScopeName, cfg Config, ...) awsapigateway.IRestApi
- func WithProxyGateway(scope constructs.Construct, name ScopeName, cfg Config, ...) awsapigateway.IRestApi
- type BaseInputs
- type Config
- type Conventions
- type ScopeName
Constants ¶
This section is empty.
Variables ¶
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, inp BaseInputs) ( 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 BaseInputs ¶ added in v0.15.3
BaseInputs are references to resources that are expected to exist in the AWS account before the stack is created.
func NewBaseInputs ¶ added in v0.15.3
func NewBaseInputs( mainDomainName string, regionalCertArn string, edgeCertArn string, ) BaseInputs
NewBaseInputs creates a base input from its resource references.
type Config ¶ added in v0.15.2
type Config interface { LogRetention() awslogs.RetentionDays GatewayThrottlingRateLimit() *float64 GatewayThrottlingBurstLimit() *float64 DomainRecordTTL() awscdk.Duration LambdaTimeout() awscdk.Duration LambdaReservedConcurrency() *float64 LambdaProvisionedConcurrency() *float64 LambdaApplicationLogLevel() string LambdaSystemLogLevel() 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( logRetention awslogs.RetentionDays, gatewayThrottlingRateLimit *float64, gatewayThrottlingBurstLimit *float64, domainRecordTTL awscdk.Duration, lambdaTimeout awscdk.Duration, lambdaReservedConcurrency *float64, lambdaProvisionedConcurrency *float64, lambdaApplicationLogLevel string, lambdaSystemLogLevel string, ) 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 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.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package postgresresource implements a custom resource for Postgres
|
Package postgresresource implements a custom resource for Postgres |