-
Notifications
You must be signed in to change notification settings - Fork 17
/
AliasProps.go
82 lines (79 loc) · 2.94 KB
/
AliasProps.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package awslambda
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
)
// Properties for a new Lambda alias.
//
// Example:
// lambdaCode := lambda.Code_FromCfnParameters()
// func := lambda.NewFunction(this, jsii.String("Lambda"), &FunctionProps{
// Code: lambdaCode,
// Handler: jsii.String("index.handler"),
// Runtime: lambda.Runtime_NODEJS_LATEST(),
// })
// // used to make sure each CDK synthesis produces a different Version
// version := func.currentVersion
// alias := lambda.NewAlias(this, jsii.String("LambdaAlias"), &AliasProps{
// AliasName: jsii.String("Prod"),
// Version: Version,
// })
//
// codedeploy.NewLambdaDeploymentGroup(this, jsii.String("DeploymentGroup"), &LambdaDeploymentGroupProps{
// Alias: Alias,
// DeploymentConfig: codedeploy.LambdaDeploymentConfig_LINEAR_10PERCENT_EVERY_1MINUTE(),
// })
//
type AliasProps 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"`
// Additional versions with individual weights this alias points to.
//
// Individual additional version weights specified here should add up to
// (less than) one. All remaining weight is routed to the default
// version.
//
// For example, the config is
//
// version: "1"
// additionalVersions: [{ version: "2", weight: 0.05 }]
//
// Then 5% of traffic will be routed to function version 2, while
// the remaining 95% of traffic will be routed to function version 1.
// Default: No additional versions.
//
AdditionalVersions *[]*VersionWeight `field:"optional" json:"additionalVersions" yaml:"additionalVersions"`
// Description for the alias.
// Default: No description.
//
Description *string `field:"optional" json:"description" yaml:"description"`
// Specifies a provisioned concurrency configuration for a function's alias.
// Default: No provisioned concurrency.
//
ProvisionedConcurrentExecutions *float64 `field:"optional" json:"provisionedConcurrentExecutions" yaml:"provisionedConcurrentExecutions"`
// Name of this alias.
AliasName *string `field:"required" json:"aliasName" yaml:"aliasName"`
// Function version this alias refers to.
//
// Use lambda.currentVersion to reference a version with your latest changes.
Version IVersion `field:"required" json:"version" yaml:"version"`
}