## CDK CodePipeline Extensions
This project is for use in the workshop DOP 401: Get better at building AWS CDK constructs.
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## License
This project is licensed under the Apache-2.0 License.
# API Reference
## Constructs
### CalendarSetupFunction
An AWS Lambda function which executes src/time-windows/calendar/calendar-setup.
#### Initializers
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
new CalendarSetupFunction(scope: Construct, id: string, props?: CalendarSetupFunctionProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| constructs.Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| CalendarSetupFunctionProps
| *No description.* |
---
##### `scope`Required
- *Type:* constructs.Construct
---
##### `id`Required
- *Type:* string
---
##### `props`Optional
- *Type:* CalendarSetupFunctionProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addEventSource
| Adds an event source to this function. |
| addEventSourceMapping
| Adds an event source that maps to this AWS Lambda function. |
| addFunctionUrl
| Adds a url to this lambda function. |
| addPermission
| Adds a permission to the Lambda resource policy. |
| addToRolePolicy
| Adds a statement to the IAM role assumed by the instance. |
| configureAsyncInvoke
| Configures options for asynchronous invocation. |
| considerWarningOnInvokeFunctionPermissions
| A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. |
| grantInvoke
| Grant the given identity permissions to invoke this Lambda. |
| grantInvokeUrl
| Grant the given identity permissions to invoke this Lambda Function URL. |
| metric
| Return the given named metric for this Function. |
| metricDuration
| How long execution of this Lambda takes. |
| metricErrors
| How many invocations of this Lambda fail. |
| metricInvocations
| How often this Lambda is invoked. |
| metricThrottles
| How often this Lambda is throttled. |
| addAlias
| Defines an alias for this function. |
| addEnvironment
| Adds an environment variable to this Lambda function. |
| addLayers
| Adds one or more Lambda Layers to this Lambda function. |
---
##### `toString`
```typescript
public toString(): string
```
Returns a string representation of this construct.
##### `applyRemovalPolicy`
```typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
```
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
###### `policy`Required
- *Type:* aws-cdk-lib.RemovalPolicy
---
##### `addEventSource`
```typescript
public addEventSource(source: IEventSource): void
```
Adds an event source to this function.
Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module.
The following example adds an SQS Queue as an event source:
```
import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources';
myFunction.addEventSource(new SqsEventSource(myQueue));
```
###### `source`Required
- *Type:* aws-cdk-lib.aws_lambda.IEventSource
---
##### `addEventSourceMapping`
```typescript
public addEventSourceMapping(id: string, options: EventSourceMappingOptions): EventSourceMapping
```
Adds an event source that maps to this AWS Lambda function.
###### `id`Required
- *Type:* string
---
###### `options`Required
- *Type:* aws-cdk-lib.aws_lambda.EventSourceMappingOptions
---
##### `addFunctionUrl`
```typescript
public addFunctionUrl(options?: FunctionUrlOptions): FunctionUrl
```
Adds a url to this lambda function.
###### `options`Optional
- *Type:* aws-cdk-lib.aws_lambda.FunctionUrlOptions
---
##### `addPermission`
```typescript
public addPermission(id: string, permission: Permission): void
```
Adds a permission to the Lambda resource policy.
> [Permission for details.](Permission for details.)
###### `id`Required
- *Type:* string
The id for the permission construct.
---
###### `permission`Required
- *Type:* aws-cdk-lib.aws_lambda.Permission
The permission to grant to this Lambda function.
---
##### `addToRolePolicy`
```typescript
public addToRolePolicy(statement: PolicyStatement): void
```
Adds a statement to the IAM role assumed by the instance.
###### `statement`Required
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement
---
##### `configureAsyncInvoke`
```typescript
public configureAsyncInvoke(options: EventInvokeConfigOptions): void
```
Configures options for asynchronous invocation.
###### `options`Required
- *Type:* aws-cdk-lib.aws_lambda.EventInvokeConfigOptions
---
##### `considerWarningOnInvokeFunctionPermissions`
```typescript
public considerWarningOnInvokeFunctionPermissions(scope: Construct, action: string): void
```
A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function.
function.currentVersion is invoked before or after the permission is created.
This applies only to permissions on Lambda functions, not versions or aliases.
This function is overridden as a noOp for QualifiedFunctionBase.
###### `scope`Required
- *Type:* constructs.Construct
---
###### `action`Required
- *Type:* string
---
##### `grantInvoke`
```typescript
public grantInvoke(grantee: IGrantable): Grant
```
Grant the given identity permissions to invoke this Lambda.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
##### `grantInvokeUrl`
```typescript
public grantInvokeUrl(grantee: IGrantable): Grant
```
Grant the given identity permissions to invoke this Lambda Function URL.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
##### `metric`
```typescript
public metric(metricName: string, props?: MetricOptions): Metric
```
Return the given named metric for this Function.
###### `metricName`Required
- *Type:* string
---
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricDuration`
```typescript
public metricDuration(props?: MetricOptions): Metric
```
How long execution of this Lambda takes.
Average over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricErrors`
```typescript
public metricErrors(props?: MetricOptions): Metric
```
How many invocations of this Lambda fail.
Sum over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricInvocations`
```typescript
public metricInvocations(props?: MetricOptions): Metric
```
How often this Lambda is invoked.
Sum over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricThrottles`
```typescript
public metricThrottles(props?: MetricOptions): Metric
```
How often this Lambda is throttled.
Sum over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `addAlias`
```typescript
public addAlias(aliasName: string, options?: AliasOptions): Alias
```
Defines an alias for this function.
The alias will automatically be updated to point to the latest version of
the function as it is being updated during a deployment.
```ts
declare const fn: lambda.Function;
fn.addAlias('Live');
// Is equivalent to
new lambda.Alias(this, 'AliasLive', {
aliasName: 'Live',
version: fn.currentVersion,
});
```
###### `aliasName`Required
- *Type:* string
The name of the alias.
---
###### `options`Optional
- *Type:* aws-cdk-lib.aws_lambda.AliasOptions
Alias options.
---
##### `addEnvironment`
```typescript
public addEnvironment(key: string, value: string, options?: EnvironmentOptions): Function
```
Adds an environment variable to this Lambda function.
If this is a ref to a Lambda function, this operation results in a no-op.
###### `key`Required
- *Type:* string
The environment variable key.
---
###### `value`Required
- *Type:* string
The environment variable's value.
---
###### `options`Optional
- *Type:* aws-cdk-lib.aws_lambda.EnvironmentOptions
Environment variable options.
---
##### `addLayers`
```typescript
public addLayers(layers: ILayerVersion): void
```
Adds one or more Lambda Layers to this Lambda function.
###### `layers`Required
- *Type:* aws-cdk-lib.aws_lambda.ILayerVersion
the layers to be added.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if `x` is a construct. |
| isOwnedResource
| Returns true if the construct was created by CDK, and false otherwise. |
| isResource
| Check whether the given construct is a Resource. |
| classifyVersionProperty
| Record whether specific properties in the `AWS::Lambda::Function` resource should also be associated to the Version resource. |
| fromFunctionArn
| Import a lambda function into the CDK using its ARN. |
| fromFunctionAttributes
| Creates a Lambda function object which represents a function not defined within this stack. |
| fromFunctionName
| Import a lambda function into the CDK using its name. |
| metricAll
| Return the given named metric for this Lambda. |
| metricAllConcurrentExecutions
| Metric for the number of concurrent executions across all Lambdas. |
| metricAllDuration
| Metric for the Duration executing all Lambdas. |
| metricAllErrors
| Metric for the number of Errors executing all Lambdas. |
| metricAllInvocations
| Metric for the number of invocations of all Lambdas. |
| metricAllThrottles
| Metric for the number of throttled invocations of all Lambdas. |
| metricAllUnreservedConcurrentExecutions
| Metric for the number of unreserved concurrent executions across all Lambdas. |
---
##### ~~`isConstruct`~~
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.isConstruct(x: any)
```
Checks if `x` is a construct.
###### `x`Required
- *Type:* any
Any object.
---
##### `isOwnedResource`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.isOwnedResource(construct: IConstruct)
```
Returns true if the construct was created by CDK, and false otherwise.
###### `construct`Required
- *Type:* constructs.IConstruct
---
##### `isResource`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.isResource(construct: IConstruct)
```
Check whether the given construct is a Resource.
###### `construct`Required
- *Type:* constructs.IConstruct
---
##### `classifyVersionProperty`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.classifyVersionProperty(propertyName: string, locked: boolean)
```
Record whether specific properties in the `AWS::Lambda::Function` resource should also be associated to the Version resource.
See 'currentVersion' section in the module README for more details.
###### `propertyName`Required
- *Type:* string
The property to classify.
---
###### `locked`Required
- *Type:* boolean
whether the property should be associated to the version or not.
---
##### `fromFunctionArn`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.fromFunctionArn(scope: Construct, id: string, functionArn: string)
```
Import a lambda function into the CDK using its ARN.
###### `scope`Required
- *Type:* constructs.Construct
---
###### `id`Required
- *Type:* string
---
###### `functionArn`Required
- *Type:* string
---
##### `fromFunctionAttributes`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.fromFunctionAttributes(scope: Construct, id: string, attrs: FunctionAttributes)
```
Creates a Lambda function object which represents a function not defined within this stack.
###### `scope`Required
- *Type:* constructs.Construct
The parent construct.
---
###### `id`Required
- *Type:* string
The name of the lambda construct.
---
###### `attrs`Required
- *Type:* aws-cdk-lib.aws_lambda.FunctionAttributes
the attributes of the function to import.
---
##### `fromFunctionName`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.fromFunctionName(scope: Construct, id: string, functionName: string)
```
Import a lambda function into the CDK using its name.
###### `scope`Required
- *Type:* constructs.Construct
---
###### `id`Required
- *Type:* string
---
###### `functionName`Required
- *Type:* string
---
##### `metricAll`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAll(metricName: string, props?: MetricOptions)
```
Return the given named metric for this Lambda.
###### `metricName`Required
- *Type:* string
---
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllConcurrentExecutions`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAllConcurrentExecutions(props?: MetricOptions)
```
Metric for the number of concurrent executions across all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllDuration`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAllDuration(props?: MetricOptions)
```
Metric for the Duration executing all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllErrors`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAllErrors(props?: MetricOptions)
```
Metric for the number of Errors executing all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllInvocations`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAllInvocations(props?: MetricOptions)
```
Metric for the number of invocations of all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllThrottles`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAllThrottles(props?: MetricOptions)
```
Metric for the number of throttled invocations of all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllUnreservedConcurrentExecutions`
```typescript
import { CalendarSetupFunction } from '@cdklabs/cdk-codepipeline-extensions'
CalendarSetupFunction.metricAllUnreservedConcurrentExecutions(props?: MetricOptions)
```
Metric for the number of unreserved concurrent executions across all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| constructs.Node
| The tree node. |
| env
| aws-cdk-lib.ResourceEnvironment
| The environment this resource belongs to. |
| stack
| aws-cdk-lib.Stack
| The stack in which this resource is defined. |
| architecture
| aws-cdk-lib.aws_lambda.Architecture
| The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64). |
| connections
| aws-cdk-lib.aws_ec2.Connections
| Access the Connections object. |
| functionArn
| string
| ARN of this function. |
| functionName
| string
| Name of this function. |
| grantPrincipal
| aws-cdk-lib.aws_iam.IPrincipal
| The principal this Lambda Function is running as. |
| isBoundToVpc
| boolean
| Whether or not this Lambda function was bound to a VPC. |
| latestVersion
| aws-cdk-lib.aws_lambda.IVersion
| The `$LATEST` version of this function. |
| permissionsNode
| constructs.Node
| The construct node where permissions are attached. |
| resourceArnsForGrantInvoke
| string[]
| The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). |
| role
| aws-cdk-lib.aws_iam.IRole
| Execution role associated with this function. |
| currentVersion
| aws-cdk-lib.aws_lambda.Version
| Returns a `lambda.Version` which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes. |
| logGroup
| aws-cdk-lib.aws_logs.ILogGroup
| The LogGroup where the Lambda function's logs are made available. |
| runtime
| aws-cdk-lib.aws_lambda.Runtime
| The runtime configured for this lambda. |
| deadLetterQueue
| aws-cdk-lib.aws_sqs.IQueue
| The DLQ (as queue) associated with this Lambda Function (this is an optional attribute). |
| deadLetterTopic
| aws-cdk-lib.aws_sns.ITopic
| The DLQ (as topic) associated with this Lambda Function (this is an optional attribute). |
| timeout
| aws-cdk-lib.Duration
| The timeout configured for this lambda. |
---
##### `node`Required
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
##### `env`Required
```typescript
public readonly env: ResourceEnvironment;
```
- *Type:* aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### `stack`Required
```typescript
public readonly stack: Stack;
```
- *Type:* aws-cdk-lib.Stack
The stack in which this resource is defined.
---
##### `architecture`Required
```typescript
public readonly architecture: Architecture;
```
- *Type:* aws-cdk-lib.aws_lambda.Architecture
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
---
##### `connections`Required
```typescript
public readonly connections: Connections;
```
- *Type:* aws-cdk-lib.aws_ec2.Connections
Access the Connections object.
Will fail if not a VPC-enabled Lambda Function
---
##### `functionArn`Required
```typescript
public readonly functionArn: string;
```
- *Type:* string
ARN of this function.
---
##### `functionName`Required
```typescript
public readonly functionName: string;
```
- *Type:* string
Name of this function.
---
##### `grantPrincipal`Required
```typescript
public readonly grantPrincipal: IPrincipal;
```
- *Type:* aws-cdk-lib.aws_iam.IPrincipal
The principal this Lambda Function is running as.
---
##### `isBoundToVpc`Required
```typescript
public readonly isBoundToVpc: boolean;
```
- *Type:* boolean
Whether or not this Lambda function was bound to a VPC.
If this is is `false`, trying to access the `connections` object will fail.
---
##### `latestVersion`Required
```typescript
public readonly latestVersion: IVersion;
```
- *Type:* aws-cdk-lib.aws_lambda.IVersion
The `$LATEST` version of this function.
Note that this is reference to a non-specific AWS Lambda version, which
means the function this version refers to can return different results in
different invocations.
To obtain a reference to an explicit version which references the current
function configuration, use `lambdaFunction.currentVersion` instead.
---
##### `permissionsNode`Required
```typescript
public readonly permissionsNode: Node;
```
- *Type:* constructs.Node
The construct node where permissions are attached.
---
##### `resourceArnsForGrantInvoke`Required
```typescript
public readonly resourceArnsForGrantInvoke: string[];
```
- *Type:* string[]
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
---
##### `role`Optional
```typescript
public readonly role: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
Execution role associated with this function.
---
##### `currentVersion`Required
```typescript
public readonly currentVersion: Version;
```
- *Type:* aws-cdk-lib.aws_lambda.Version
Returns a `lambda.Version` which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes.
You can specify options for this version using the `currentVersionOptions`
prop when initializing the `lambda.Function`.
---
##### `logGroup`Required
```typescript
public readonly logGroup: ILogGroup;
```
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
The LogGroup where the Lambda function's logs are made available.
If either `logRetention` is set or this property is called, a CloudFormation custom resource is added to the stack that
pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention
period (never expire, by default).
Further, if the log group already exists and the `logRetention` is not set, the custom resource will reset the log retention
to never expire even if it was configured with a different value.
---
##### `runtime`Required
```typescript
public readonly runtime: Runtime;
```
- *Type:* aws-cdk-lib.aws_lambda.Runtime
The runtime configured for this lambda.
---
##### `deadLetterQueue`Optional
```typescript
public readonly deadLetterQueue: IQueue;
```
- *Type:* aws-cdk-lib.aws_sqs.IQueue
The DLQ (as queue) associated with this Lambda Function (this is an optional attribute).
---
##### `deadLetterTopic`Optional
```typescript
public readonly deadLetterTopic: ITopic;
```
- *Type:* aws-cdk-lib.aws_sns.ITopic
The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).
---
##### `timeout`Optional
```typescript
public readonly timeout: Duration;
```
- *Type:* aws-cdk-lib.Duration
The timeout configured for this lambda.
---
### ChangeController
A change controller.
When added to a stage in a pipeline, this will check against
a calendar and enable or disable the stage transition based off that calendar,
defaulting to closed when the calendar cannot be found or when
the check against it fails. It also checks to against alarms.
#### Initializers
```typescript
import { ChangeController } from '@cdklabs/cdk-codepipeline-extensions'
new ChangeController(scope: Construct, id: string, props: ChangeControllerProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| constructs.Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| ChangeControllerProps
| *No description.* |
---
##### `scope`Required
- *Type:* constructs.Construct
---
##### `id`Required
- *Type:* string
---
##### `props`Required
- *Type:* ChangeControllerProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
---
##### `toString`
```typescript
public toString(): string
```
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if `x` is a construct. |
---
##### ~~`isConstruct`~~
```typescript
import { ChangeController } from '@cdklabs/cdk-codepipeline-extensions'
ChangeController.isConstruct(x: any)
```
Checks if `x` is a construct.
###### `x`Required
- *Type:* any
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| constructs.Node
| The tree node. |
---
##### `node`Required
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
### ChangeControllerFunction
An AWS Lambda function which executes src/time-windows/change-controller/change-controller.
#### Initializers
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
new ChangeControllerFunction(scope: Construct, id: string, props?: ChangeControllerFunctionProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| constructs.Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| ChangeControllerFunctionProps
| *No description.* |
---
##### `scope`Required
- *Type:* constructs.Construct
---
##### `id`Required
- *Type:* string
---
##### `props`Optional
- *Type:* ChangeControllerFunctionProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addEventSource
| Adds an event source to this function. |
| addEventSourceMapping
| Adds an event source that maps to this AWS Lambda function. |
| addFunctionUrl
| Adds a url to this lambda function. |
| addPermission
| Adds a permission to the Lambda resource policy. |
| addToRolePolicy
| Adds a statement to the IAM role assumed by the instance. |
| configureAsyncInvoke
| Configures options for asynchronous invocation. |
| considerWarningOnInvokeFunctionPermissions
| A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function. |
| grantInvoke
| Grant the given identity permissions to invoke this Lambda. |
| grantInvokeUrl
| Grant the given identity permissions to invoke this Lambda Function URL. |
| metric
| Return the given named metric for this Function. |
| metricDuration
| How long execution of this Lambda takes. |
| metricErrors
| How many invocations of this Lambda fail. |
| metricInvocations
| How often this Lambda is invoked. |
| metricThrottles
| How often this Lambda is throttled. |
| addAlias
| Defines an alias for this function. |
| addEnvironment
| Adds an environment variable to this Lambda function. |
| addLayers
| Adds one or more Lambda Layers to this Lambda function. |
---
##### `toString`
```typescript
public toString(): string
```
Returns a string representation of this construct.
##### `applyRemovalPolicy`
```typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
```
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
###### `policy`Required
- *Type:* aws-cdk-lib.RemovalPolicy
---
##### `addEventSource`
```typescript
public addEventSource(source: IEventSource): void
```
Adds an event source to this function.
Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module.
The following example adds an SQS Queue as an event source:
```
import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources';
myFunction.addEventSource(new SqsEventSource(myQueue));
```
###### `source`Required
- *Type:* aws-cdk-lib.aws_lambda.IEventSource
---
##### `addEventSourceMapping`
```typescript
public addEventSourceMapping(id: string, options: EventSourceMappingOptions): EventSourceMapping
```
Adds an event source that maps to this AWS Lambda function.
###### `id`Required
- *Type:* string
---
###### `options`Required
- *Type:* aws-cdk-lib.aws_lambda.EventSourceMappingOptions
---
##### `addFunctionUrl`
```typescript
public addFunctionUrl(options?: FunctionUrlOptions): FunctionUrl
```
Adds a url to this lambda function.
###### `options`Optional
- *Type:* aws-cdk-lib.aws_lambda.FunctionUrlOptions
---
##### `addPermission`
```typescript
public addPermission(id: string, permission: Permission): void
```
Adds a permission to the Lambda resource policy.
> [Permission for details.](Permission for details.)
###### `id`Required
- *Type:* string
The id for the permission construct.
---
###### `permission`Required
- *Type:* aws-cdk-lib.aws_lambda.Permission
The permission to grant to this Lambda function.
---
##### `addToRolePolicy`
```typescript
public addToRolePolicy(statement: PolicyStatement): void
```
Adds a statement to the IAM role assumed by the instance.
###### `statement`Required
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement
---
##### `configureAsyncInvoke`
```typescript
public configureAsyncInvoke(options: EventInvokeConfigOptions): void
```
Configures options for asynchronous invocation.
###### `options`Required
- *Type:* aws-cdk-lib.aws_lambda.EventInvokeConfigOptions
---
##### `considerWarningOnInvokeFunctionPermissions`
```typescript
public considerWarningOnInvokeFunctionPermissions(scope: Construct, action: string): void
```
A warning will be added to functions under the following conditions: - permissions that include `lambda:InvokeFunction` are added to the unqualified function.
function.currentVersion is invoked before or after the permission is created.
This applies only to permissions on Lambda functions, not versions or aliases.
This function is overridden as a noOp for QualifiedFunctionBase.
###### `scope`Required
- *Type:* constructs.Construct
---
###### `action`Required
- *Type:* string
---
##### `grantInvoke`
```typescript
public grantInvoke(grantee: IGrantable): Grant
```
Grant the given identity permissions to invoke this Lambda.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
##### `grantInvokeUrl`
```typescript
public grantInvokeUrl(grantee: IGrantable): Grant
```
Grant the given identity permissions to invoke this Lambda Function URL.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
##### `metric`
```typescript
public metric(metricName: string, props?: MetricOptions): Metric
```
Return the given named metric for this Function.
###### `metricName`Required
- *Type:* string
---
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricDuration`
```typescript
public metricDuration(props?: MetricOptions): Metric
```
How long execution of this Lambda takes.
Average over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricErrors`
```typescript
public metricErrors(props?: MetricOptions): Metric
```
How many invocations of this Lambda fail.
Sum over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricInvocations`
```typescript
public metricInvocations(props?: MetricOptions): Metric
```
How often this Lambda is invoked.
Sum over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricThrottles`
```typescript
public metricThrottles(props?: MetricOptions): Metric
```
How often this Lambda is throttled.
Sum over 5 minutes
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `addAlias`
```typescript
public addAlias(aliasName: string, options?: AliasOptions): Alias
```
Defines an alias for this function.
The alias will automatically be updated to point to the latest version of
the function as it is being updated during a deployment.
```ts
declare const fn: lambda.Function;
fn.addAlias('Live');
// Is equivalent to
new lambda.Alias(this, 'AliasLive', {
aliasName: 'Live',
version: fn.currentVersion,
});
```
###### `aliasName`Required
- *Type:* string
The name of the alias.
---
###### `options`Optional
- *Type:* aws-cdk-lib.aws_lambda.AliasOptions
Alias options.
---
##### `addEnvironment`
```typescript
public addEnvironment(key: string, value: string, options?: EnvironmentOptions): Function
```
Adds an environment variable to this Lambda function.
If this is a ref to a Lambda function, this operation results in a no-op.
###### `key`Required
- *Type:* string
The environment variable key.
---
###### `value`Required
- *Type:* string
The environment variable's value.
---
###### `options`Optional
- *Type:* aws-cdk-lib.aws_lambda.EnvironmentOptions
Environment variable options.
---
##### `addLayers`
```typescript
public addLayers(layers: ILayerVersion): void
```
Adds one or more Lambda Layers to this Lambda function.
###### `layers`Required
- *Type:* aws-cdk-lib.aws_lambda.ILayerVersion
the layers to be added.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if `x` is a construct. |
| isOwnedResource
| Returns true if the construct was created by CDK, and false otherwise. |
| isResource
| Check whether the given construct is a Resource. |
| classifyVersionProperty
| Record whether specific properties in the `AWS::Lambda::Function` resource should also be associated to the Version resource. |
| fromFunctionArn
| Import a lambda function into the CDK using its ARN. |
| fromFunctionAttributes
| Creates a Lambda function object which represents a function not defined within this stack. |
| fromFunctionName
| Import a lambda function into the CDK using its name. |
| metricAll
| Return the given named metric for this Lambda. |
| metricAllConcurrentExecutions
| Metric for the number of concurrent executions across all Lambdas. |
| metricAllDuration
| Metric for the Duration executing all Lambdas. |
| metricAllErrors
| Metric for the number of Errors executing all Lambdas. |
| metricAllInvocations
| Metric for the number of invocations of all Lambdas. |
| metricAllThrottles
| Metric for the number of throttled invocations of all Lambdas. |
| metricAllUnreservedConcurrentExecutions
| Metric for the number of unreserved concurrent executions across all Lambdas. |
---
##### ~~`isConstruct`~~
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.isConstruct(x: any)
```
Checks if `x` is a construct.
###### `x`Required
- *Type:* any
Any object.
---
##### `isOwnedResource`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.isOwnedResource(construct: IConstruct)
```
Returns true if the construct was created by CDK, and false otherwise.
###### `construct`Required
- *Type:* constructs.IConstruct
---
##### `isResource`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.isResource(construct: IConstruct)
```
Check whether the given construct is a Resource.
###### `construct`Required
- *Type:* constructs.IConstruct
---
##### `classifyVersionProperty`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.classifyVersionProperty(propertyName: string, locked: boolean)
```
Record whether specific properties in the `AWS::Lambda::Function` resource should also be associated to the Version resource.
See 'currentVersion' section in the module README for more details.
###### `propertyName`Required
- *Type:* string
The property to classify.
---
###### `locked`Required
- *Type:* boolean
whether the property should be associated to the version or not.
---
##### `fromFunctionArn`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.fromFunctionArn(scope: Construct, id: string, functionArn: string)
```
Import a lambda function into the CDK using its ARN.
###### `scope`Required
- *Type:* constructs.Construct
---
###### `id`Required
- *Type:* string
---
###### `functionArn`Required
- *Type:* string
---
##### `fromFunctionAttributes`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.fromFunctionAttributes(scope: Construct, id: string, attrs: FunctionAttributes)
```
Creates a Lambda function object which represents a function not defined within this stack.
###### `scope`Required
- *Type:* constructs.Construct
The parent construct.
---
###### `id`Required
- *Type:* string
The name of the lambda construct.
---
###### `attrs`Required
- *Type:* aws-cdk-lib.aws_lambda.FunctionAttributes
the attributes of the function to import.
---
##### `fromFunctionName`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.fromFunctionName(scope: Construct, id: string, functionName: string)
```
Import a lambda function into the CDK using its name.
###### `scope`Required
- *Type:* constructs.Construct
---
###### `id`Required
- *Type:* string
---
###### `functionName`Required
- *Type:* string
---
##### `metricAll`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAll(metricName: string, props?: MetricOptions)
```
Return the given named metric for this Lambda.
###### `metricName`Required
- *Type:* string
---
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllConcurrentExecutions`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAllConcurrentExecutions(props?: MetricOptions)
```
Metric for the number of concurrent executions across all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllDuration`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAllDuration(props?: MetricOptions)
```
Metric for the Duration executing all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllErrors`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAllErrors(props?: MetricOptions)
```
Metric for the number of Errors executing all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllInvocations`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAllInvocations(props?: MetricOptions)
```
Metric for the number of invocations of all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllThrottles`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAllThrottles(props?: MetricOptions)
```
Metric for the number of throttled invocations of all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
##### `metricAllUnreservedConcurrentExecutions`
```typescript
import { ChangeControllerFunction } from '@cdklabs/cdk-codepipeline-extensions'
ChangeControllerFunction.metricAllUnreservedConcurrentExecutions(props?: MetricOptions)
```
Metric for the number of unreserved concurrent executions across all Lambdas.
###### `props`Optional
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| constructs.Node
| The tree node. |
| env
| aws-cdk-lib.ResourceEnvironment
| The environment this resource belongs to. |
| stack
| aws-cdk-lib.Stack
| The stack in which this resource is defined. |
| architecture
| aws-cdk-lib.aws_lambda.Architecture
| The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64). |
| connections
| aws-cdk-lib.aws_ec2.Connections
| Access the Connections object. |
| functionArn
| string
| ARN of this function. |
| functionName
| string
| Name of this function. |
| grantPrincipal
| aws-cdk-lib.aws_iam.IPrincipal
| The principal this Lambda Function is running as. |
| isBoundToVpc
| boolean
| Whether or not this Lambda function was bound to a VPC. |
| latestVersion
| aws-cdk-lib.aws_lambda.IVersion
| The `$LATEST` version of this function. |
| permissionsNode
| constructs.Node
| The construct node where permissions are attached. |
| resourceArnsForGrantInvoke
| string[]
| The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). |
| role
| aws-cdk-lib.aws_iam.IRole
| Execution role associated with this function. |
| currentVersion
| aws-cdk-lib.aws_lambda.Version
| Returns a `lambda.Version` which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes. |
| logGroup
| aws-cdk-lib.aws_logs.ILogGroup
| The LogGroup where the Lambda function's logs are made available. |
| runtime
| aws-cdk-lib.aws_lambda.Runtime
| The runtime configured for this lambda. |
| deadLetterQueue
| aws-cdk-lib.aws_sqs.IQueue
| The DLQ (as queue) associated with this Lambda Function (this is an optional attribute). |
| deadLetterTopic
| aws-cdk-lib.aws_sns.ITopic
| The DLQ (as topic) associated with this Lambda Function (this is an optional attribute). |
| timeout
| aws-cdk-lib.Duration
| The timeout configured for this lambda. |
---
##### `node`Required
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
##### `env`Required
```typescript
public readonly env: ResourceEnvironment;
```
- *Type:* aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### `stack`Required
```typescript
public readonly stack: Stack;
```
- *Type:* aws-cdk-lib.Stack
The stack in which this resource is defined.
---
##### `architecture`Required
```typescript
public readonly architecture: Architecture;
```
- *Type:* aws-cdk-lib.aws_lambda.Architecture
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
---
##### `connections`Required
```typescript
public readonly connections: Connections;
```
- *Type:* aws-cdk-lib.aws_ec2.Connections
Access the Connections object.
Will fail if not a VPC-enabled Lambda Function
---
##### `functionArn`Required
```typescript
public readonly functionArn: string;
```
- *Type:* string
ARN of this function.
---
##### `functionName`Required
```typescript
public readonly functionName: string;
```
- *Type:* string
Name of this function.
---
##### `grantPrincipal`Required
```typescript
public readonly grantPrincipal: IPrincipal;
```
- *Type:* aws-cdk-lib.aws_iam.IPrincipal
The principal this Lambda Function is running as.
---
##### `isBoundToVpc`Required
```typescript
public readonly isBoundToVpc: boolean;
```
- *Type:* boolean
Whether or not this Lambda function was bound to a VPC.
If this is is `false`, trying to access the `connections` object will fail.
---
##### `latestVersion`Required
```typescript
public readonly latestVersion: IVersion;
```
- *Type:* aws-cdk-lib.aws_lambda.IVersion
The `$LATEST` version of this function.
Note that this is reference to a non-specific AWS Lambda version, which
means the function this version refers to can return different results in
different invocations.
To obtain a reference to an explicit version which references the current
function configuration, use `lambdaFunction.currentVersion` instead.
---
##### `permissionsNode`Required
```typescript
public readonly permissionsNode: Node;
```
- *Type:* constructs.Node
The construct node where permissions are attached.
---
##### `resourceArnsForGrantInvoke`Required
```typescript
public readonly resourceArnsForGrantInvoke: string[];
```
- *Type:* string[]
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
---
##### `role`Optional
```typescript
public readonly role: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
Execution role associated with this function.
---
##### `currentVersion`Required
```typescript
public readonly currentVersion: Version;
```
- *Type:* aws-cdk-lib.aws_lambda.Version
Returns a `lambda.Version` which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes.
You can specify options for this version using the `currentVersionOptions`
prop when initializing the `lambda.Function`.
---
##### `logGroup`Required
```typescript
public readonly logGroup: ILogGroup;
```
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
The LogGroup where the Lambda function's logs are made available.
If either `logRetention` is set or this property is called, a CloudFormation custom resource is added to the stack that
pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention
period (never expire, by default).
Further, if the log group already exists and the `logRetention` is not set, the custom resource will reset the log retention
to never expire even if it was configured with a different value.
---
##### `runtime`Required
```typescript
public readonly runtime: Runtime;
```
- *Type:* aws-cdk-lib.aws_lambda.Runtime
The runtime configured for this lambda.
---
##### `deadLetterQueue`Optional
```typescript
public readonly deadLetterQueue: IQueue;
```
- *Type:* aws-cdk-lib.aws_sqs.IQueue
The DLQ (as queue) associated with this Lambda Function (this is an optional attribute).
---
##### `deadLetterTopic`Optional
```typescript
public readonly deadLetterTopic: ITopic;
```
- *Type:* aws-cdk-lib.aws_sns.ITopic
The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).
---
##### `timeout`Optional
```typescript
public readonly timeout: Duration;
```
- *Type:* aws-cdk-lib.Duration
The timeout configured for this lambda.
---
### PipelineWithChangeControl
A pipeline with a change controller.
#### Initializers
```typescript
import { PipelineWithChangeControl } from '@cdklabs/cdk-codepipeline-extensions'
new PipelineWithChangeControl(scope: Construct, id: string, props: PipelineWithChangeControlProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| constructs.Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| PipelineWithChangeControlProps
| *No description.* |
---
##### `scope`Required
- *Type:* constructs.Construct
---
##### `id`Required
- *Type:* string
---
##### `props`Required
- *Type:* PipelineWithChangeControlProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
---
##### `toString`
```typescript
public toString(): string
```
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if `x` is a construct. |
---
##### ~~`isConstruct`~~
```typescript
import { PipelineWithChangeControl } from '@cdklabs/cdk-codepipeline-extensions'
PipelineWithChangeControl.isConstruct(x: any)
```
Checks if `x` is a construct.
###### `x`Required
- *Type:* any
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| constructs.Node
| The tree node. |
---
##### `node`Required
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
## Structs
### AggregateAlarmState
#### Initializer
```typescript
import { AggregateAlarmState } from '@cdklabs/cdk-codepipeline-extensions'
const aggregateAlarmState: AggregateAlarmState = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| alarmDetails
| IAlarmDetail[]
| *No description.* |
| state
| AlarmState
| *No description.* |
| summary
| string
| *No description.* |
---
##### `alarmDetails`Required
```typescript
public readonly alarmDetails: IAlarmDetail[];
```
- *Type:* IAlarmDetail[]
---
##### `state`Required
```typescript
public readonly state: AlarmState;
```
- *Type:* AlarmState
---
##### `summary`Required
```typescript
public readonly summary: string;
```
- *Type:* string
---
### CalendarLocationOptionsBase
Options for creating a calendar object.
#### Initializer
```typescript
import { CalendarLocationOptionsBase } from '@cdklabs/cdk-codepipeline-extensions'
const calendarLocationOptionsBase: CalendarLocationOptionsBase = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| calendarName
| string
| The name of the calendar file. |
---
##### `calendarName`Required
```typescript
public readonly calendarName: string;
```
- *Type:* string
The name of the calendar file.
---
### CalendarSetupFunctionProps
Props for CalendarSetupFunction.
#### Initializer
```typescript
import { CalendarSetupFunctionProps } from '@cdklabs/cdk-codepipeline-extensions'
const calendarSetupFunctionProps: CalendarSetupFunctionProps = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| maxEventAge
| aws-cdk-lib.Duration
| The maximum age of a request that Lambda sends to a function for processing. |
| onFailure
| aws-cdk-lib.aws_lambda.IDestination
| The destination for failed invocations. |
| onSuccess
| aws-cdk-lib.aws_lambda.IDestination
| The destination for successful invocations. |
| retryAttempts
| number
| The maximum number of times to retry when the function returns an error. |
| allowAllOutbound
| boolean
| Whether to allow the Lambda to send all network traffic. |
| allowPublicSubnet
| boolean
| Lambda Functions in a public subnet can NOT access the internet. |
| architecture
| aws-cdk-lib.aws_lambda.Architecture
| The system architectures compatible with this lambda function. |
| codeSigningConfig
| aws-cdk-lib.aws_lambda.ICodeSigningConfig
| Code signing config associated with this function. |
| currentVersionOptions
| aws-cdk-lib.aws_lambda.VersionOptions
| Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. |
| deadLetterQueue
| aws-cdk-lib.aws_sqs.IQueue
| The SQS queue to use if DLQ is enabled. |
| deadLetterQueueEnabled
| boolean
| Enabled DLQ. |
| deadLetterTopic
| aws-cdk-lib.aws_sns.ITopic
| The SNS topic to use as a DLQ. |
| description
| string
| A description of the function. |
| environment
| {[ key: string ]: string}
| Key-value pairs that Lambda caches and makes available for your Lambda functions. |
| environmentEncryption
| aws-cdk-lib.aws_kms.IKey
| The AWS KMS key that's used to encrypt your function's environment variables. |
| ephemeralStorageSize
| aws-cdk-lib.Size
| The size of the function’s /tmp directory in MiB. |
| events
| aws-cdk-lib.aws_lambda.IEventSource[]
| Event sources for this function. |
| filesystem
| aws-cdk-lib.aws_lambda.FileSystem
| The filesystem configuration for the lambda function. |
| functionName
| string
| A name for the function. |
| initialPolicy
| aws-cdk-lib.aws_iam.PolicyStatement[]
| Initial policy statements to add to the created Lambda Role. |
| insightsVersion
| aws-cdk-lib.aws_lambda.LambdaInsightsVersion
| Specify the version of CloudWatch Lambda insights to use for monitoring. |
| layers
| aws-cdk-lib.aws_lambda.ILayerVersion[]
| A list of layers to add to the function's execution environment. |
| logRetention
| aws-cdk-lib.aws_logs.RetentionDays
| The number of days log events are kept in CloudWatch Logs. |
| logRetentionRetryOptions
| aws-cdk-lib.aws_lambda.LogRetentionRetryOptions
| When log retention is specified, a custom resource attempts to create the CloudWatch log group. |
| logRetentionRole
| aws-cdk-lib.aws_iam.IRole
| The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
| memorySize
| number
| The amount of memory, in MB, that is allocated to your Lambda function. |
| profiling
| boolean
| Enable profiling. |
| profilingGroup
| aws-cdk-lib.aws_codeguruprofiler.IProfilingGroup
| Profiling Group. |
| reservedConcurrentExecutions
| number
| The maximum of concurrent executions you want to reserve for the function. |
| role
| aws-cdk-lib.aws_iam.IRole
| Lambda execution role. |
| securityGroups
| aws-cdk-lib.aws_ec2.ISecurityGroup[]
| The list of security groups to associate with the Lambda's network interfaces. |
| timeout
| aws-cdk-lib.Duration
| The function execution time (in seconds) after which Lambda terminates the function. |
| tracing
| aws-cdk-lib.aws_lambda.Tracing
| Enable AWS X-Ray Tracing for Lambda Function. |
| vpc
| aws-cdk-lib.aws_ec2.IVpc
| VPC network to place Lambda network interfaces. |
| vpcSubnets
| aws-cdk-lib.aws_ec2.SubnetSelection
| Where to place the network interfaces within the VPC. |
---
##### `maxEventAge`Optional
```typescript
public readonly maxEventAge: Duration;
```
- *Type:* aws-cdk-lib.Duration
- *Default:* Duration.hours(6)
The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds
Maximum: 6 hours
---
##### `onFailure`Optional
```typescript
public readonly onFailure: IDestination;
```
- *Type:* aws-cdk-lib.aws_lambda.IDestination
- *Default:* no destination
The destination for failed invocations.
---
##### `onSuccess`Optional
```typescript
public readonly onSuccess: IDestination;
```
- *Type:* aws-cdk-lib.aws_lambda.IDestination
- *Default:* no destination
The destination for successful invocations.
---
##### `retryAttempts`Optional
```typescript
public readonly retryAttempts: number;
```
- *Type:* number
- *Default:* 2
The maximum number of times to retry when the function returns an error.
Minimum: 0
Maximum: 2
---
##### `allowAllOutbound`Optional
```typescript
public readonly allowAllOutbound: boolean;
```
- *Type:* boolean
- *Default:* true
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.
---
##### `allowPublicSubnet`Optional
```typescript
public readonly allowPublicSubnet: boolean;
```
- *Type:* boolean
- *Default:* false
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.
> [https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841](https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841)
---
##### `architecture`Optional
```typescript
public readonly architecture: Architecture;
```
- *Type:* aws-cdk-lib.aws_lambda.Architecture
- *Default:* Architecture.X86_64
The system architectures compatible with this lambda function.
---
##### `codeSigningConfig`Optional
```typescript
public readonly codeSigningConfig: ICodeSigningConfig;
```
- *Type:* aws-cdk-lib.aws_lambda.ICodeSigningConfig
- *Default:* Not Sign the Code
Code signing config associated with this function.
---
##### `currentVersionOptions`Optional
```typescript
public readonly currentVersionOptions: VersionOptions;
```
- *Type:* aws-cdk-lib.aws_lambda.VersionOptions
- *Default:* default options as described in `VersionOptions`
Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method.
---
##### `deadLetterQueue`Optional
```typescript
public readonly deadLetterQueue: IQueue;
```
- *Type:* aws-cdk-lib.aws_sqs.IQueue
- *Default:* SQS queue with 14 day retention period if `deadLetterQueueEnabled` is `true`
The SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify `deadLetterTopic` property instead.
---
##### `deadLetterQueueEnabled`Optional
```typescript
public readonly deadLetterQueueEnabled: boolean;
```
- *Type:* boolean
- *Default:* false unless `deadLetterQueue` is set, which implies DLQ is enabled.
Enabled DLQ.
If `deadLetterQueue` is undefined,
an SQS queue with default options will be defined for your Function.
---
##### `deadLetterTopic`Optional
```typescript
public readonly deadLetterTopic: ITopic;
```
- *Type:* aws-cdk-lib.aws_sns.ITopic
- *Default:* no SNS topic
The SNS topic to use as a DLQ.
Note that if `deadLetterQueueEnabled` is set to `true`, an SQS queue will be created
rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.
---
##### `description`Optional
```typescript
public readonly description: string;
```
- *Type:* string
- *Default:* No description.
A description of the function.
---
##### `environment`Optional
```typescript
public readonly environment: {[ key: string ]: string};
```
- *Type:* {[ key: string ]: string}
- *Default:* No environment variables.
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.
---
##### `environmentEncryption`Optional
```typescript
public readonly environmentEncryption: IKey;
```
- *Type:* aws-cdk-lib.aws_kms.IKey
- *Default:* AWS Lambda creates and uses an AWS managed customer master key (CMK).
The AWS KMS key that's used to encrypt your function's environment variables.
---
##### `ephemeralStorageSize`Optional
```typescript
public readonly ephemeralStorageSize: Size;
```
- *Type:* aws-cdk-lib.Size
- *Default:* 512 MiB
The size of the function’s /tmp directory in MiB.
---
##### `events`Optional
```typescript
public readonly events: IEventSource[];
```
- *Type:* aws-cdk-lib.aws_lambda.IEventSource[]
- *Default:* No event sources.
Event sources for this function.
You can also add event sources using `addEventSource`.
---
##### `filesystem`Optional
```typescript
public readonly filesystem: FileSystem;
```
- *Type:* aws-cdk-lib.aws_lambda.FileSystem
- *Default:* will not mount any filesystem
The filesystem configuration for the lambda function.
---
##### `functionName`Optional
```typescript
public readonly functionName: string;
```
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.
A name for the function.
---
##### `initialPolicy`Optional
```typescript
public readonly initialPolicy: PolicyStatement[];
```
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement[]
- *Default:* No policy statements are added to the created Lambda role.
Initial policy statements to add to the created Lambda Role.
You can call `addToRolePolicy` to the created lambda to add statements post creation.
---
##### `insightsVersion`Optional
```typescript
public readonly insightsVersion: LambdaInsightsVersion;
```
- *Type:* aws-cdk-lib.aws_lambda.LambdaInsightsVersion
- *Default:* No Lambda Insights
Specify the version of CloudWatch Lambda insights to use for monitoring.
> [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html)
---
##### `layers`Optional
```typescript
public readonly layers: ILayerVersion[];
```
- *Type:* aws-cdk-lib.aws_lambda.ILayerVersion[]
- *Default:* No layers.
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.
---
##### `logRetention`Optional
```typescript
public readonly logRetention: RetentionDays;
```
- *Type:* aws-cdk-lib.aws_logs.RetentionDays
- *Default:* logs.RetentionDays.INFINITE
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`.
---
##### `logRetentionRetryOptions`Optional
```typescript
public readonly logRetentionRetryOptions: LogRetentionRetryOptions;
```
- *Type:* aws-cdk-lib.aws_lambda.LogRetentionRetryOptions
- *Default:* Default AWS SDK retry options.
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.
---
##### `logRetentionRole`Optional
```typescript
public readonly logRetentionRole: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
- *Default:* A new role is created.
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
---
##### `memorySize`Optional
```typescript
public readonly memorySize: number;
```
- *Type:* number
- *Default:* 128
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.
---
##### `profiling`Optional
```typescript
public readonly profiling: boolean;
```
- *Type:* boolean
- *Default:* No profiling.
Enable profiling.
> [https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)
---
##### `profilingGroup`Optional
```typescript
public readonly profilingGroup: IProfilingGroup;
```
- *Type:* aws-cdk-lib.aws_codeguruprofiler.IProfilingGroup
- *Default:* A new profiling group will be created if `profiling` is set.
Profiling Group.
> [https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)
---
##### `reservedConcurrentExecutions`Optional
```typescript
public readonly reservedConcurrentExecutions: number;
```
- *Type:* number
- *Default:* No specific limit - account limit.
The maximum of concurrent executions you want to reserve for the function.
> [https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)
---
##### `role`Optional
```typescript
public readonly role: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
- *Default:* A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling `addToRolePolicy`.
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".
---
##### `securityGroups`Optional
```typescript
public readonly securityGroups: ISecurityGroup[];
```
- *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup[]
- *Default:* If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
The list of security groups to associate with the Lambda's network interfaces.
Only used if 'vpc' is supplied.
---
##### `timeout`Optional
```typescript
public readonly timeout: Duration;
```
- *Type:* aws-cdk-lib.Duration
- *Default:* Duration.seconds(3)
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.
---
##### `tracing`Optional
```typescript
public readonly tracing: Tracing;
```
- *Type:* aws-cdk-lib.aws_lambda.Tracing
- *Default:* Tracing.Disabled
Enable AWS X-Ray Tracing for Lambda Function.
---
##### `vpc`Optional
```typescript
public readonly vpc: IVpc;
```
- *Type:* aws-cdk-lib.aws_ec2.IVpc
- *Default:* Function is not placed within a VPC.
VPC network to place Lambda network interfaces.
Specify this if the Lambda function needs to access resources in a VPC.
This is required when `vpcSubnets` is specified.
---
##### `vpcSubnets`Optional
```typescript
public readonly vpcSubnets: SubnetSelection;
```
- *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
- *Default:* the Vpc default strategy if not specified
Where to place the network interfaces within the VPC.
This requires `vpc` to be specified in order for interfaces to actually be
placed in the subnets. If `vpc` is not specify, this will raise an error.
Note: Internet access for Lambda Functions requires a NAT Gateway, so picking
public subnets is not allowed (unless `allowPublicSubnet` is set to `true`).
---
### ChangeControllerEvent
The event inputs required for the ChangeController lambda function.
#### Initializer
```typescript
import { ChangeControllerEvent } from '@cdklabs/cdk-codepipeline-extensions'
const changeControllerEvent: ChangeControllerEvent = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| calendar
| Calendar
| The calendar used to determine whether a stage transition should be opened or closed. |
| pipelineName
| string
| The name of the pipeline the Change Controller will be added to. |
| searchTerms
| string[]
| The terms in alarm descriptions to seach for to determine if alarms should be checked. |
| stageName
| string
| The name of the stage the Change Controller will be added to. |
---
##### `calendar`Required
```typescript
public readonly calendar: Calendar;
```
- *Type:* Calendar
The calendar used to determine whether a stage transition should be opened or closed.
---
##### `pipelineName`Required
```typescript
public readonly pipelineName: string;
```
- *Type:* string
The name of the pipeline the Change Controller will be added to.
---
##### `searchTerms`Required
```typescript
public readonly searchTerms: string[];
```
- *Type:* string[]
The terms in alarm descriptions to seach for to determine if alarms should be checked.
If any of the alarms matching these search terms are in ALARM state, the stage transition will be closed.
---
##### `stageName`Required
```typescript
public readonly stageName: string;
```
- *Type:* string
The name of the stage the Change Controller will be added to.
---
### ChangeControllerFunctionProps
Props for ChangeControllerFunction.
#### Initializer
```typescript
import { ChangeControllerFunctionProps } from '@cdklabs/cdk-codepipeline-extensions'
const changeControllerFunctionProps: ChangeControllerFunctionProps = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| maxEventAge
| aws-cdk-lib.Duration
| The maximum age of a request that Lambda sends to a function for processing. |
| onFailure
| aws-cdk-lib.aws_lambda.IDestination
| The destination for failed invocations. |
| onSuccess
| aws-cdk-lib.aws_lambda.IDestination
| The destination for successful invocations. |
| retryAttempts
| number
| The maximum number of times to retry when the function returns an error. |
| allowAllOutbound
| boolean
| Whether to allow the Lambda to send all network traffic. |
| allowPublicSubnet
| boolean
| Lambda Functions in a public subnet can NOT access the internet. |
| architecture
| aws-cdk-lib.aws_lambda.Architecture
| The system architectures compatible with this lambda function. |
| codeSigningConfig
| aws-cdk-lib.aws_lambda.ICodeSigningConfig
| Code signing config associated with this function. |
| currentVersionOptions
| aws-cdk-lib.aws_lambda.VersionOptions
| Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. |
| deadLetterQueue
| aws-cdk-lib.aws_sqs.IQueue
| The SQS queue to use if DLQ is enabled. |
| deadLetterQueueEnabled
| boolean
| Enabled DLQ. |
| deadLetterTopic
| aws-cdk-lib.aws_sns.ITopic
| The SNS topic to use as a DLQ. |
| description
| string
| A description of the function. |
| environment
| {[ key: string ]: string}
| Key-value pairs that Lambda caches and makes available for your Lambda functions. |
| environmentEncryption
| aws-cdk-lib.aws_kms.IKey
| The AWS KMS key that's used to encrypt your function's environment variables. |
| ephemeralStorageSize
| aws-cdk-lib.Size
| The size of the function’s /tmp directory in MiB. |
| events
| aws-cdk-lib.aws_lambda.IEventSource[]
| Event sources for this function. |
| filesystem
| aws-cdk-lib.aws_lambda.FileSystem
| The filesystem configuration for the lambda function. |
| functionName
| string
| A name for the function. |
| initialPolicy
| aws-cdk-lib.aws_iam.PolicyStatement[]
| Initial policy statements to add to the created Lambda Role. |
| insightsVersion
| aws-cdk-lib.aws_lambda.LambdaInsightsVersion
| Specify the version of CloudWatch Lambda insights to use for monitoring. |
| layers
| aws-cdk-lib.aws_lambda.ILayerVersion[]
| A list of layers to add to the function's execution environment. |
| logRetention
| aws-cdk-lib.aws_logs.RetentionDays
| The number of days log events are kept in CloudWatch Logs. |
| logRetentionRetryOptions
| aws-cdk-lib.aws_lambda.LogRetentionRetryOptions
| When log retention is specified, a custom resource attempts to create the CloudWatch log group. |
| logRetentionRole
| aws-cdk-lib.aws_iam.IRole
| The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
| memorySize
| number
| The amount of memory, in MB, that is allocated to your Lambda function. |
| profiling
| boolean
| Enable profiling. |
| profilingGroup
| aws-cdk-lib.aws_codeguruprofiler.IProfilingGroup
| Profiling Group. |
| reservedConcurrentExecutions
| number
| The maximum of concurrent executions you want to reserve for the function. |
| role
| aws-cdk-lib.aws_iam.IRole
| Lambda execution role. |
| securityGroups
| aws-cdk-lib.aws_ec2.ISecurityGroup[]
| The list of security groups to associate with the Lambda's network interfaces. |
| timeout
| aws-cdk-lib.Duration
| The function execution time (in seconds) after which Lambda terminates the function. |
| tracing
| aws-cdk-lib.aws_lambda.Tracing
| Enable AWS X-Ray Tracing for Lambda Function. |
| vpc
| aws-cdk-lib.aws_ec2.IVpc
| VPC network to place Lambda network interfaces. |
| vpcSubnets
| aws-cdk-lib.aws_ec2.SubnetSelection
| Where to place the network interfaces within the VPC. |
---
##### `maxEventAge`Optional
```typescript
public readonly maxEventAge: Duration;
```
- *Type:* aws-cdk-lib.Duration
- *Default:* Duration.hours(6)
The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds
Maximum: 6 hours
---
##### `onFailure`Optional
```typescript
public readonly onFailure: IDestination;
```
- *Type:* aws-cdk-lib.aws_lambda.IDestination
- *Default:* no destination
The destination for failed invocations.
---
##### `onSuccess`Optional
```typescript
public readonly onSuccess: IDestination;
```
- *Type:* aws-cdk-lib.aws_lambda.IDestination
- *Default:* no destination
The destination for successful invocations.
---
##### `retryAttempts`Optional
```typescript
public readonly retryAttempts: number;
```
- *Type:* number
- *Default:* 2
The maximum number of times to retry when the function returns an error.
Minimum: 0
Maximum: 2
---
##### `allowAllOutbound`Optional
```typescript
public readonly allowAllOutbound: boolean;
```
- *Type:* boolean
- *Default:* true
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.
---
##### `allowPublicSubnet`Optional
```typescript
public readonly allowPublicSubnet: boolean;
```
- *Type:* boolean
- *Default:* false
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.
> [https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841](https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841)
---
##### `architecture`Optional
```typescript
public readonly architecture: Architecture;
```
- *Type:* aws-cdk-lib.aws_lambda.Architecture
- *Default:* Architecture.X86_64
The system architectures compatible with this lambda function.
---
##### `codeSigningConfig`Optional
```typescript
public readonly codeSigningConfig: ICodeSigningConfig;
```
- *Type:* aws-cdk-lib.aws_lambda.ICodeSigningConfig
- *Default:* Not Sign the Code
Code signing config associated with this function.
---
##### `currentVersionOptions`Optional
```typescript
public readonly currentVersionOptions: VersionOptions;
```
- *Type:* aws-cdk-lib.aws_lambda.VersionOptions
- *Default:* default options as described in `VersionOptions`
Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method.
---
##### `deadLetterQueue`Optional
```typescript
public readonly deadLetterQueue: IQueue;
```
- *Type:* aws-cdk-lib.aws_sqs.IQueue
- *Default:* SQS queue with 14 day retention period if `deadLetterQueueEnabled` is `true`
The SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify `deadLetterTopic` property instead.
---
##### `deadLetterQueueEnabled`Optional
```typescript
public readonly deadLetterQueueEnabled: boolean;
```
- *Type:* boolean
- *Default:* false unless `deadLetterQueue` is set, which implies DLQ is enabled.
Enabled DLQ.
If `deadLetterQueue` is undefined,
an SQS queue with default options will be defined for your Function.
---
##### `deadLetterTopic`Optional
```typescript
public readonly deadLetterTopic: ITopic;
```
- *Type:* aws-cdk-lib.aws_sns.ITopic
- *Default:* no SNS topic
The SNS topic to use as a DLQ.
Note that if `deadLetterQueueEnabled` is set to `true`, an SQS queue will be created
rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.
---
##### `description`Optional
```typescript
public readonly description: string;
```
- *Type:* string
- *Default:* No description.
A description of the function.
---
##### `environment`Optional
```typescript
public readonly environment: {[ key: string ]: string};
```
- *Type:* {[ key: string ]: string}
- *Default:* No environment variables.
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.
---
##### `environmentEncryption`Optional
```typescript
public readonly environmentEncryption: IKey;
```
- *Type:* aws-cdk-lib.aws_kms.IKey
- *Default:* AWS Lambda creates and uses an AWS managed customer master key (CMK).
The AWS KMS key that's used to encrypt your function's environment variables.
---
##### `ephemeralStorageSize`Optional
```typescript
public readonly ephemeralStorageSize: Size;
```
- *Type:* aws-cdk-lib.Size
- *Default:* 512 MiB
The size of the function’s /tmp directory in MiB.
---
##### `events`Optional
```typescript
public readonly events: IEventSource[];
```
- *Type:* aws-cdk-lib.aws_lambda.IEventSource[]
- *Default:* No event sources.
Event sources for this function.
You can also add event sources using `addEventSource`.
---
##### `filesystem`Optional
```typescript
public readonly filesystem: FileSystem;
```
- *Type:* aws-cdk-lib.aws_lambda.FileSystem
- *Default:* will not mount any filesystem
The filesystem configuration for the lambda function.
---
##### `functionName`Optional
```typescript
public readonly functionName: string;
```
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.
A name for the function.
---
##### `initialPolicy`Optional
```typescript
public readonly initialPolicy: PolicyStatement[];
```
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement[]
- *Default:* No policy statements are added to the created Lambda role.
Initial policy statements to add to the created Lambda Role.
You can call `addToRolePolicy` to the created lambda to add statements post creation.
---
##### `insightsVersion`Optional
```typescript
public readonly insightsVersion: LambdaInsightsVersion;
```
- *Type:* aws-cdk-lib.aws_lambda.LambdaInsightsVersion
- *Default:* No Lambda Insights
Specify the version of CloudWatch Lambda insights to use for monitoring.
> [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html)
---
##### `layers`Optional
```typescript
public readonly layers: ILayerVersion[];
```
- *Type:* aws-cdk-lib.aws_lambda.ILayerVersion[]
- *Default:* No layers.
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.
---
##### `logRetention`Optional
```typescript
public readonly logRetention: RetentionDays;
```
- *Type:* aws-cdk-lib.aws_logs.RetentionDays
- *Default:* logs.RetentionDays.INFINITE
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`.
---
##### `logRetentionRetryOptions`Optional
```typescript
public readonly logRetentionRetryOptions: LogRetentionRetryOptions;
```
- *Type:* aws-cdk-lib.aws_lambda.LogRetentionRetryOptions
- *Default:* Default AWS SDK retry options.
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.
---
##### `logRetentionRole`Optional
```typescript
public readonly logRetentionRole: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
- *Default:* A new role is created.
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
---
##### `memorySize`Optional
```typescript
public readonly memorySize: number;
```
- *Type:* number
- *Default:* 128
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.
---
##### `profiling`Optional
```typescript
public readonly profiling: boolean;
```
- *Type:* boolean
- *Default:* No profiling.
Enable profiling.
> [https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)
---
##### `profilingGroup`Optional
```typescript
public readonly profilingGroup: IProfilingGroup;
```
- *Type:* aws-cdk-lib.aws_codeguruprofiler.IProfilingGroup
- *Default:* A new profiling group will be created if `profiling` is set.
Profiling Group.
> [https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)
---
##### `reservedConcurrentExecutions`Optional
```typescript
public readonly reservedConcurrentExecutions: number;
```
- *Type:* number
- *Default:* No specific limit - account limit.
The maximum of concurrent executions you want to reserve for the function.
> [https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)
---
##### `role`Optional
```typescript
public readonly role: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
- *Default:* A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling `addToRolePolicy`.
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".
---
##### `securityGroups`Optional
```typescript
public readonly securityGroups: ISecurityGroup[];
```
- *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup[]
- *Default:* If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
The list of security groups to associate with the Lambda's network interfaces.
Only used if 'vpc' is supplied.
---
##### `timeout`Optional
```typescript
public readonly timeout: Duration;
```
- *Type:* aws-cdk-lib.Duration
- *Default:* Duration.seconds(3)
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.
---
##### `tracing`Optional
```typescript
public readonly tracing: Tracing;
```
- *Type:* aws-cdk-lib.aws_lambda.Tracing
- *Default:* Tracing.Disabled
Enable AWS X-Ray Tracing for Lambda Function.
---
##### `vpc`Optional
```typescript
public readonly vpc: IVpc;
```
- *Type:* aws-cdk-lib.aws_ec2.IVpc
- *Default:* Function is not placed within a VPC.
VPC network to place Lambda network interfaces.
Specify this if the Lambda function needs to access resources in a VPC.
This is required when `vpcSubnets` is specified.
---
##### `vpcSubnets`Optional
```typescript
public readonly vpcSubnets: SubnetSelection;
```
- *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
- *Default:* the Vpc default strategy if not specified
Where to place the network interfaces within the VPC.
This requires `vpc` to be specified in order for interfaces to actually be
placed in the subnets. If `vpc` is not specify, this will raise an error.
Note: Internet access for Lambda Functions requires a NAT Gateway, so picking
public subnets is not allowed (unless `allowPublicSubnet` is set to `true`).
---
### ChangeControllerProps
Properties used to create change controller.
#### Initializer
```typescript
import { ChangeControllerProps } from '@cdklabs/cdk-codepipeline-extensions'
const changeControllerProps: ChangeControllerProps = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| calendar
| Calendar
| The calendar object. |
| schedule
| aws-cdk-lib.aws_events.Schedule
| The schedule on which to check the calendar and alarm state. |
| searchTerms
| string[]
| The terms to search for in alarm descriptions. |
| stage
| aws-cdk-lib.aws_codepipeline.IStage
| The pipeline stage. |
---
##### `calendar`Required
```typescript
public readonly calendar: Calendar;
```
- *Type:* Calendar
The calendar object.
---
##### `schedule`Required
```typescript
public readonly schedule: Schedule;
```
- *Type:* aws-cdk-lib.aws_events.Schedule
The schedule on which to check the calendar and alarm state.
---
##### `searchTerms`Required
```typescript
public readonly searchTerms: string[];
```
- *Type:* string[]
The terms to search for in alarm descriptions.
These if these alarms are in ALARM state, the change controller will close
the pipeline stage.
---
##### `stage`Required
```typescript
public readonly stage: IStage;
```
- *Type:* aws-cdk-lib.aws_codepipeline.IStage
The pipeline stage.
---
### GetAlarmStateOptions
searchTerms: a list of terms to match in the alarm description.
#### Initializer
```typescript
import { GetAlarmStateOptions } from '@cdklabs/cdk-codepipeline-extensions'
const getAlarmStateOptions: GetAlarmStateOptions = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| searchTerms
| string[]
| *No description.* |
---
##### `searchTerms`Required
```typescript
public readonly searchTerms: string[];
```
- *Type:* string[]
---
### LocalPathOptions
Options for creating a calendar from a local file path.
#### Initializer
```typescript
import { LocalPathOptions } from '@cdklabs/cdk-codepipeline-extensions'
const localPathOptions: LocalPathOptions = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| calendarName
| string
| The name of the calendar file. |
| calendarPath
| string
| The relative path to the calendar file. |
---
##### `calendarName`Required
```typescript
public readonly calendarName: string;
```
- *Type:* string
The name of the calendar file.
---
##### `calendarPath`Required
```typescript
public readonly calendarPath: string;
```
- *Type:* string
The relative path to the calendar file.
---
### PipelineWithChangeControlProps
Props for creating a pipeline with a change controller.
#### Initializer
```typescript
import { PipelineWithChangeControlProps } from '@cdklabs/cdk-codepipeline-extensions'
const pipelineWithChangeControlProps: PipelineWithChangeControlProps = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| changeControlCalendar
| Calendar
| The calendar used for determining time windows. |
| changeControlCheckSchedule
| aws-cdk-lib.aws_events.Schedule
| The schedule on which to check the calendar. |
| pipelineName
| string
| The name of the pipeline. |
| searchTerms
| string[]
| The terms in the alarm descriptions to search for. |
| sourceRepository
| aws-cdk-lib.aws_codecommit.IRepository
| The AWS CodeCommit repository to be used as the source stage. |
| pipelineRole
| aws-cdk-lib.aws_iam.IRole
| The role used for running the pipeline. |
---
##### `changeControlCalendar`Required
```typescript
public readonly changeControlCalendar: Calendar;
```
- *Type:* Calendar
The calendar used for determining time windows.
---
##### `changeControlCheckSchedule`Required
```typescript
public readonly changeControlCheckSchedule: Schedule;
```
- *Type:* aws-cdk-lib.aws_events.Schedule
The schedule on which to check the calendar.
---
##### `pipelineName`Required
```typescript
public readonly pipelineName: string;
```
- *Type:* string
The name of the pipeline.
---
##### `searchTerms`Required
```typescript
public readonly searchTerms: string[];
```
- *Type:* string[]
The terms in the alarm descriptions to search for.
These if the alarms containing those search terms are in ALARM,
the stage transition will be closed.
---
##### `sourceRepository`Required
```typescript
public readonly sourceRepository: IRepository;
```
- *Type:* aws-cdk-lib.aws_codecommit.IRepository
The AWS CodeCommit repository to be used as the source stage.
---
##### `pipelineRole`Optional
```typescript
public readonly pipelineRole: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
- *Default:* A new role is created when the pipeline is created.
The role used for running the pipeline.
---
### S3LocationOptions
Options for creating a calendar from a file in a S3 Bucket.
#### Initializer
```typescript
import { S3LocationOptions } from '@cdklabs/cdk-codepipeline-extensions'
const s3LocationOptions: S3LocationOptions = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| calendarName
| string
| The name of the calendar file. |
| bucket
| aws-cdk-lib.aws_s3.IBucket
| The bucket where the calendar is stored. |
| role
| aws-cdk-lib.aws_iam.IRole
| The role used for getting the calendar file. |
---
##### `calendarName`Required
```typescript
public readonly calendarName: string;
```
- *Type:* string
The name of the calendar file.
---
##### `bucket`Required
```typescript
public readonly bucket: IBucket;
```
- *Type:* aws-cdk-lib.aws_s3.IBucket
The bucket where the calendar is stored.
---
##### `role`Optional
```typescript
public readonly role: IRole;
```
- *Type:* aws-cdk-lib.aws_iam.IRole
- *Default:* A role created by the Custom Resource.
The role used for getting the calendar file.
---
## Classes
### Calendar
The calendar for determining if pipeline stage should be open or closed.
#### Initializers
```typescript
import { Calendar } from '@cdklabs/cdk-codepipeline-extensions'
new Calendar()
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| path
| Creates a calendar from a local file. |
| s3Location
| Creates a calendar from a S3 bucket. |
---
##### `path`
```typescript
import { Calendar } from '@cdklabs/cdk-codepipeline-extensions'
Calendar.path(options: LocalPathOptions)
```
Creates a calendar from a local file.
###### `options`Required
- *Type:* LocalPathOptions
---
##### `s3Location`
```typescript
import { Calendar } from '@cdklabs/cdk-codepipeline-extensions'
Calendar.s3Location(options: S3LocationOptions)
```
Creates a calendar from a S3 bucket.
###### `options`Required
- *Type:* S3LocationOptions
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| calendarArn
| string
| The ARN of the calendar in SSM. |
| calendarName
| string
| The name of the calendar. |
---
##### `calendarArn`Required
```typescript
public readonly calendarArn: string;
```
- *Type:* string
The ARN of the calendar in SSM.
---
##### `calendarName`Required
```typescript
public readonly calendarName: string;
```
- *Type:* string
The name of the calendar.
---
## Protocols
### IAlarmDetail
- *Implemented By:* IAlarmDetail
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| state
| string
| *No description.* |
| alarmArn
| string
| *No description.* |
| alarmDescription
| string
| *No description.* |
| reason
| string
| *No description.* |
---
##### `state`Required
```typescript
public readonly state: string;
```
- *Type:* string
---
##### `alarmArn`Optional
```typescript
public readonly alarmArn: string;
```
- *Type:* string
---
##### `alarmDescription`Optional
```typescript
public readonly alarmDescription: string;
```
- *Type:* string
---
##### `reason`Required
```typescript
public readonly reason: string;
```
- *Type:* string
---
## Enums
### AlarmState
#### Members
| **Name** | **Description** |
| --- | --- |
| OK
| *No description.* |
| ALARM
| *No description.* |
| INSUFFICIENT_DATA
| *No description.* |
---
##### `OK`
---
##### `ALARM`
---
##### `INSUFFICIENT_DATA`
---
### CalendarSourceType
The source types for the calendar file.
#### Members
| **Name** | **Description** |
| --- | --- |
| S3_OBJECT
| The calendar source is an S3 Bucket. |
| PATH
| The calendar source is a local path. |
---
##### `S3_OBJECT`
The calendar source is an S3 Bucket.
---
##### `PATH`
The calendar source is a local path.
---