Documentation ¶
Index ¶
- Constants
- func AssetCodeGo(compiler Compiler) awslambda.Code
- func NewContainerGo(scope constructs.Construct, id *string, spec *ContainerGoProps) awslambda.Function
- func NewFunction(scope constructs.Construct, id *string, spec FunctionProps) awslambda.Function
- func NewFunctionGo(scope constructs.Construct, id *string, spec *FunctionGoProps) awslambda.Function
- type AuthorizerIAM
- type AuthorizerJwt
- type Compiler
- type ContainerGoProps
- type FunctionGoProps
- type FunctionProps
- type Gateway
- type GatewayProps
- type GoCompiler
Constants ¶
const Version = "v0.10.1"
Variables ¶
This section is empty.
Functions ¶
func AssetCodeGo ¶
AssetCodeGo bundles lambda function from source code
func NewContainerGo ¶ added in v0.8.4
func NewContainerGo(scope constructs.Construct, id *string, spec *ContainerGoProps) awslambda.Function
func NewFunction ¶ added in v0.10.1
func NewFunction(scope constructs.Construct, id *string, spec FunctionProps) awslambda.Function
func NewFunctionGo ¶
func NewFunctionGo(scope constructs.Construct, id *string, spec *FunctionGoProps) awslambda.Function
NewFunctionGo creates Golang Lambda Function from "inline" code
Types ¶
type AuthorizerIAM ¶ added in v0.8.0
type AuthorizerIAM struct { constructs.Construct RestAPI apigw2.HttpApi // contains filtered or unexported fields }
func (*AuthorizerIAM) AddResource ¶ added in v0.8.0
func (api *AuthorizerIAM) AddResource( endpoint string, handler awslambda.Function, grantee awsiam.IGrantable, ) *AuthorizerIAM
Associate a Lambda function with a REST API path. It uses the specified path as a prefix, enabling the association of the Lambda function with all subpaths under that prefix.
Protect access to resource only for AWS IAM principals.
type AuthorizerJwt ¶ added in v0.8.0
type AuthorizerJwt struct { constructs.Construct RestAPI apigw2.HttpApi // contains filtered or unexported fields }
func (*AuthorizerJwt) AddResource ¶ added in v0.8.0
func (api *AuthorizerJwt) AddResource( endpoint string, handler awslambda.Function, accessScope ...string, ) *AuthorizerJwt
Associate a Lambda function with a REST API path. It uses the specified path as a prefix, enabling the association of the Lambda function with all subpaths under that prefix.
Protect access to resource only for principals with valid JWT token.
type ContainerGoProps ¶ added in v0.8.4
type ContainerGoProps struct { *awslambda.DockerImageFunctionProps // Canonical name of Golang module that containing the function // SourceCodeModule: "github.com/fogfish/scud", SourceCodeModule string // Path to lambda function relative to the module // SourceCodeLambda: "test/lambda/go" SourceCodeLambda string // The version of software asset passed as linker flag // -ldflags '-X main.version=...' SourceCodeVersion string // Variables and its values passed as linker flags // -ldflags '-X key1=val1 -X key2=val2 ...' GoVar map[string]string // Go environment, default includes // GOOS=linux // GOARCH=arm64 // CGO_ENABLED=0 GoEnv map[string]string // Static files included into container, the path is relative to module StaticAssets []string // Linux Alpine Packages (apk) to be installed within the container Packages []string }
func (*ContainerGoProps) Type ¶ added in v0.10.1
func (*ContainerGoProps) Type(awslambda.Function)
type FunctionGoProps ¶
type FunctionGoProps struct { *awslambda.FunctionProps // Canonical name of Golang module that containing the function // SourceCodeModule: "github.com/fogfish/scud", SourceCodeModule string // Path to lambda function relative to the module // SourceCodeLambda: "test/lambda/go" SourceCodeLambda string // The version of software asset passed as linker flag // -ldflags '-X main.version=...' SourceCodeVersion string // Variables and its values passed as linker flags // -ldflags '-X key1=val1 -X key2=val2 ...' GoVar map[string]string // Go environment, default includes // GOOS=linux // GOARCH=arm64 // CGO_ENABLED=0 GoEnv map[string]string }
FunctionGoProps is properties of the function
func (*FunctionGoProps) Type ¶ added in v0.10.1
func (*FunctionGoProps) Type(awslambda.Function)
type FunctionProps ¶ added in v0.10.1
type Gateway ¶
type Gateway struct { constructs.Construct RestAPI apigw2.HttpApi // contains filtered or unexported fields }
func NewGateway ¶
func NewGateway(scope constructs.Construct, id *string, props *GatewayProps) *Gateway
NewGateway creates new instance of Gateway
func (*Gateway) AddResource ¶
Associate a Lambda function with a REST API path. It uses the specified path as a prefix, enabling the association of the Lambda function with all subpaths under that prefix.
func (*Gateway) NewAuthorizerCognito ¶ added in v0.8.0
func (gw *Gateway) NewAuthorizerCognito(cognitoArn string) *AuthorizerJwt
Creates integration with AWS Cognito to authorize incoming requests. This integration allows you to manage user authentication and authorization seamlessly. By utilizing AWS Cognito, you can implement robust user sign-up, sign-in, and access control mechanisms. The library ensures that only authenticated users with valid tokens can access your API endpoints, providing an additional layer of security and user management capabilities.
func (*Gateway) NewAuthorizerIAM ¶ added in v0.8.0
func (gw *Gateway) NewAuthorizerIAM() *AuthorizerIAM
Creates integration with AWS IAM to authorize incoming requests. This integration ensures that only authenticated and authorized principals can access the resources and functionalities provided by your Lambda functions. By leveraging AWS IAM policies and roles, the library enforces fine-grained access control, enhancing the security of your API endpoints.
func (*Gateway) NewAuthorizerJwt ¶ added in v0.8.0
func (gw *Gateway) NewAuthorizerJwt(iss string, aud ...string) *AuthorizerJwt
Creates integration with Single Sign On provider (e.g. Auth0) to authorize incoming requests using JWT tokens. This integration allows you to leverage external identity providers for user authentication, ensuring secure and seamless access to your API endpoints. By validating JWT tokens issued by the SSO provider, the library ensures that only authenticated users can access your resources. Additionally, this setup can support various SSO standards and providers, enhancing flexibility and security in managing user identities and permissions.
type GatewayProps ¶ added in v0.7.0
type GatewayProps struct { *apigw2.HttpApiProps Host *string TlsArn *string }
type GoCompiler ¶ added in v0.6.0
type GoCompiler struct {
// contains filtered or unexported fields
}
func NewGoCompiler ¶ added in v0.6.0
func (*GoCompiler) SourceCodeLambda ¶ added in v0.6.0
func (g *GoCompiler) SourceCodeLambda() string
func (*GoCompiler) SourceCodeModule ¶ added in v0.8.3
func (g *GoCompiler) SourceCodeModule() string
func (*GoCompiler) SourceCodeVersion ¶ added in v0.8.3
func (g *GoCompiler) SourceCodeVersion() string
func (*GoCompiler) TryBundle ¶ added in v0.6.0
func (g *GoCompiler) TryBundle(outputDir *string, options *awscdk.BundlingOptions) *bool