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, cfg Config) (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 Config
- type ConfigOpt
- func WithDomainRecordTTL(v awscdk.Duration) ConfigOpt
- func WithEdgeCertificateArn(v *string) ConfigOpt
- func WithGatewayDisableExecuteApi(v *bool) ConfigOpt
- func WithGatewayThrottlingBurstLimit(v *float64) ConfigOpt
- func WithGatewayThrottlingRateLimit(v *float64) ConfigOpt
- func WithLambdaApplicationLogLevel(v *string) ConfigOpt
- func WithLambdaProvisionedConcurrency(v *float64) ConfigOpt
- func WithLambdaReservedConcurrency(v *float64) ConfigOpt
- func WithLambdaSystemLogLevel(v *string) ConfigOpt
- func WithLambdaTimeout(v awscdk.Duration) ConfigOpt
- func WithLogRetention(v awslogs.RetentionDays) ConfigOpt
- func WithMainDomainName(v *string) ConfigOpt
- func WithRegionalCertificateArn(v *string) ConfigOpt
- 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, 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
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
WithEdgeCertificateArn config.
func WithGatewayDisableExecuteApi ¶ added in v0.15.4
WithGatewayDisableExecuteApi config.
func WithGatewayThrottlingBurstLimit ¶ added in v0.15.4
WithGatewayThrottlingBurstLimit config.
func WithGatewayThrottlingRateLimit ¶ added in v0.15.4
WithGatewayThrottlingRateLimit config.
func WithLambdaApplicationLogLevel ¶ added in v0.15.4
WithLambdaApplicationLogLevel config.
func WithLambdaProvisionedConcurrency ¶ added in v0.15.4
WithLambdaProvisionedConcurrency config.
func WithLambdaReservedConcurrency ¶ added in v0.15.4
WithLambdaReservedConcurrency config.
func WithLambdaSystemLogLevel ¶ added in v0.15.4
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
WithMainDomainName config.
func WithRegionalCertificateArn ¶ added in v0.15.4
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.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package postgresresource implements a custom resource for Postgres
|
Package postgresresource implements a custom resource for Postgres |