-
Notifications
You must be signed in to change notification settings - Fork 17
/
VersionOptions.go
65 lines (62 loc) · 2.24 KB
/
VersionOptions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package awslambda
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
)
// Options for `lambda.Version`.
//
// Example:
// fn := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{
// CurrentVersionOptions: &VersionOptions{
// RemovalPolicy: awscdk.RemovalPolicy_RETAIN,
// // retain old versions
// RetryAttempts: jsii.Number(1),
// },
// Runtime: lambda.Runtime_NODEJS_18_X(),
// Handler: jsii.String("index.handler"),
// Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
// })
//
// fn.AddAlias(jsii.String("live"))
//
type VersionOptions struct {
// The maximum age of a request that Lambda sends to a function for processing.
//
// Minimum: 60 seconds
// Maximum: 6 hours.
// Default: Duration.hours(6)
//
MaxEventAge awscdk.Duration `field:"optional" json:"maxEventAge" yaml:"maxEventAge"`
// The destination for failed invocations.
// Default: - no destination.
//
OnFailure IDestination `field:"optional" json:"onFailure" yaml:"onFailure"`
// The destination for successful invocations.
// Default: - no destination.
//
OnSuccess IDestination `field:"optional" json:"onSuccess" yaml:"onSuccess"`
// The maximum number of times to retry when the function returns an error.
//
// Minimum: 0
// Maximum: 2.
// Default: 2.
//
RetryAttempts *float64 `field:"optional" json:"retryAttempts" yaml:"retryAttempts"`
// SHA256 of the version of the Lambda source code.
//
// Specify to validate that you're deploying the right version.
// Default: No validation is performed.
//
CodeSha256 *string `field:"optional" json:"codeSha256" yaml:"codeSha256"`
// Description of the version.
// Default: Description of the Lambda.
//
Description *string `field:"optional" json:"description" yaml:"description"`
// Specifies a provisioned concurrency configuration for a function's version.
// Default: No provisioned concurrency.
//
ProvisionedConcurrentExecutions *float64 `field:"optional" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"`
// Whether to retain old versions of this function when a new version is created.
// Default: RemovalPolicy.DESTROY
//
RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"`
}