Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EdgeFunction_IsConstruct ¶
func EdgeFunction_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead
func EdgeFunction_IsResource ¶
func EdgeFunction_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func NewEdgeFunction_Override ¶
func NewEdgeFunction_Override(e EdgeFunction, scope constructs.Construct, id *string, props *EdgeFunctionProps)
Types ¶
type EdgeFunction ¶
type EdgeFunction interface {
awscdk.Resource
awslambda.IVersion
Connections() awsec2.Connections
CurrentVersion() awslambda.IVersion
EdgeArn() *string
Env() *awscdk.ResourceEnvironment
FunctionArn() *string
FunctionName() *string
GrantPrincipal() awsiam.IPrincipal
IsBoundToVpc() *bool
Lambda() awslambda.IFunction
LatestVersion() awslambda.IVersion
Node() constructs.Node
PermissionsNode() constructs.Node
PhysicalName() *string
Role() awsiam.IRole
Stack() awscdk.Stack
Version() *string
AddAlias(aliasName *string, options *awslambda.AliasOptions) awslambda.Alias
AddEventSource(source awslambda.IEventSource)
AddEventSourceMapping(id *string, options *awslambda.EventSourceMappingOptions) awslambda.EventSourceMapping
AddPermission(id *string, permission *awslambda.Permission)
AddToRolePolicy(statement awsiam.PolicyStatement)
ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
ConfigureAsyncInvoke(options *awslambda.EventInvokeConfigOptions)
GeneratePhysicalName() *string
GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
GetResourceNameAttribute(nameAttr *string) *string
GrantInvoke(identity awsiam.IGrantable) awsiam.Grant
Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
MetricDuration(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
MetricErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
MetricInvocations(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
MetricThrottles(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
ToString() *string
}
A Lambda@Edge function.
Convenience resource for requesting a Lambda function in the 'us-east-1' region for use with Lambda@Edge. Implements several restrictions enforced by Lambda@Edge.
Note that this construct requires that the 'us-east-1' region has been bootstrapped. See https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html or 'cdk bootstrap --help' for options.
TODO: EXAMPLE
func NewEdgeFunction ¶
func NewEdgeFunction(scope constructs.Construct, id *string, props *EdgeFunctionProps) EdgeFunction
type EdgeFunctionProps ¶
type EdgeFunctionProps struct {
// The maximum age of a request that Lambda sends to a function for processing.
//
// Minimum: 60 seconds
// Maximum: 6 hours
MaxEventAge awscdk.Duration `json:"maxEventAge"`
// The destination for failed invocations.
OnFailure awslambda.IDestination `json:"onFailure"`
// The destination for successful invocations.
OnSuccess awslambda.IDestination `json:"onSuccess"`
// The maximum number of times to retry when the function returns an error.
//
// Minimum: 0
// Maximum: 2
RetryAttempts *float64 `json:"retryAttempts"`
// Whether to allow the Lambda to send all network traffic.
//
// If set to false, you must individually add traffic rules to allow the
// Lambda to connect to network targets.
AllowAllOutbound *bool `json:"allowAllOutbound"`
// Lambda Functions in a public subnet can NOT access the internet.
//
// Use this property to acknowledge this limitation and still place the function in a public subnet.
// See: https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841
//
AllowPublicSubnet *bool `json:"allowPublicSubnet"`
// The system architectures compatible with this lambda function.
Architecture awslambda.Architecture `json:"architecture"`
// Code signing config associated with this function.
CodeSigningConfig awslambda.ICodeSigningConfig `json:"codeSigningConfig"`
// Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method.
CurrentVersionOptions *awslambda.VersionOptions `json:"currentVersionOptions"`
// The SQS queue to use if DLQ is enabled.
DeadLetterQueue awssqs.IQueue `json:"deadLetterQueue"`
// Enabled DLQ.
//
// If `deadLetterQueue` is undefined,
// an SQS queue with default options will be defined for your Function.
DeadLetterQueueEnabled *bool `json:"deadLetterQueueEnabled"`
// A description of the function.
Description *string `json:"description"`
// Key-value pairs that Lambda caches and makes available for your Lambda functions.
//
// Use environment variables to apply configuration changes, such
// as test and production environment configurations, without changing your
// Lambda function source code.
Environment *map[string]*string `json:"environment"`
// The AWS KMS key that's used to encrypt your function's environment variables.
EnvironmentEncryption awskms.IKey `json:"environmentEncryption"`
// Event sources for this function.
//
// You can also add event sources using `addEventSource`.
Events *[]awslambda.IEventSource `json:"events"`
// The filesystem configuration for the lambda function.
Filesystem awslambda.FileSystem `json:"filesystem"`
// A name for the function.
FunctionName *string `json:"functionName"`
// Initial policy statements to add to the created Lambda Role.
//
// You can call `addToRolePolicy` to the created lambda to add statements post creation.
InitialPolicy *[]awsiam.PolicyStatement `json:"initialPolicy"`
// Specify the version of CloudWatch Lambda insights to use for monitoring.
// See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html
//
InsightsVersion awslambda.LambdaInsightsVersion `json:"insightsVersion"`
// A list of layers to add to the function's execution environment.
//
// You can configure your Lambda function to pull in
// additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies
// that can be used by multiple functions.
Layers *[]awslambda.ILayerVersion `json:"layers"`
// The number of days log events are kept in CloudWatch Logs.
//
// When updating
// this property, unsetting it doesn't remove the log retention policy. To
// remove the retention policy, set the value to `INFINITE`.
LogRetention awslogs.RetentionDays `json:"logRetention"`
// When log retention is specified, a custom resource attempts to create the CloudWatch log group.
//
// These options control the retry policy when interacting with CloudWatch APIs.
LogRetentionRetryOptions *awslambda.LogRetentionRetryOptions `json:"logRetentionRetryOptions"`
// The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
LogRetentionRole awsiam.IRole `json:"logRetentionRole"`
// The amount of memory, in MB, that is allocated to your Lambda function.
//
// Lambda uses this value to proportionally allocate the amount of CPU
// power. For more information, see Resource Model in the AWS Lambda
// Developer Guide.
MemorySize *float64 `json:"memorySize"`
// Enable profiling.
// See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
//
Profiling *bool `json:"profiling"`
// Profiling Group.
// See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
//
ProfilingGroup awscodeguruprofiler.IProfilingGroup `json:"profilingGroup"`
// The maximum of concurrent executions you want to reserve for the function.
// See: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html
//
ReservedConcurrentExecutions *float64 `json:"reservedConcurrentExecutions"`
// Lambda execution role.
//
// This is the role that will be assumed by the function upon execution.
// It controls the permissions that the function will have. The Role must
// be assumable by the 'lambda.amazonaws.com' service principal.
//
// The default Role automatically has permissions granted for Lambda execution. If you
// provide a Role, you must add the relevant AWS managed policies yourself.
//
// The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and
// "service-role/AWSLambdaVPCAccessExecutionRole".
Role awsiam.IRole `json:"role"`
// The list of security groups to associate with the Lambda's network interfaces.
//
// Only used if 'vpc' is supplied.
SecurityGroups *[]awsec2.ISecurityGroup `json:"securityGroups"`
// The function execution time (in seconds) after which Lambda terminates the function.
//
// Because the execution time affects cost, set this value
// based on the function's expected execution time.
Timeout awscdk.Duration `json:"timeout"`
// Enable AWS X-Ray Tracing for Lambda Function.
Tracing awslambda.Tracing `json:"tracing"`
// VPC network to place Lambda network interfaces.
//
// Specify this if the Lambda function needs to access resources in a VPC.
Vpc awsec2.IVpc `json:"vpc"`
// Where to place the network interfaces within the VPC.
//
// Only used if 'vpc' is supplied. Note: internet access for Lambdas
// requires a NAT gateway, so picking Public subnets is not allowed.
VpcSubnets *awsec2.SubnetSelection `json:"vpcSubnets"`
// The source code of your Lambda function.
//
// You can point to a file in an
// Amazon Simple Storage Service (Amazon S3) bucket or specify your source
// code as inline text.
Code awslambda.Code `json:"code"`
// The name of the method within your code that Lambda calls to execute your function.
//
// The format includes the file name. It can also include
// namespaces and other qualifiers, depending on the runtime.
// For more information, see https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-features.html#gettingstarted-features-programmingmodel.
//
// Use `Handler.FROM_IMAGE` when defining a function from a Docker image.
//
// NOTE: If you specify your source code as inline text by specifying the
// ZipFile property within the Code property, specify index.function_name as
// the handler.
Handler *string `json:"handler"`
// The runtime environment for the Lambda function that you are uploading.
//
// For valid values, see the Runtime property in the AWS Lambda Developer
// Guide.
//
// Use `Runtime.FROM_IMAGE` when when defining a function from a Docker image.
Runtime awslambda.Runtime `json:"runtime"`
// The stack ID of Lambda@Edge function.
StackId *string `json:"stackId"`
}
Properties for creating a Lambda@Edge function.
TODO: EXAMPLE