Skip to content

Latest commit

 

History

History
1940 lines (1089 loc) · 34 KB

File metadata and controls

1940 lines (1089 loc) · 34 KB

README

@cloudcomponents/cdk-codepipeline-merge-action

@cloudcomponents/cdk-codepipeline-merge-action

Table of contents

Classes

Interfaces

Code Pipeline Merge Action

@cloudcomponents/cdk-codepipeline-merge-action / CodePipelineMergeAction

Class: CodePipelineMergeAction

Represents a reference to a CodePipelineMergeAction.

Hierarchy

  • Action

    CodePipelineMergeAction

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new CodePipelineMergeAction(props)

Parameters

Name Type
props CodePipelineMergeActionProps

Overrides

Action.constructor

Properties

props

Private Readonly props: CodePipelineMergeActionProps


providedActionProperties

Protected Readonly providedActionProperties: ActionProperties

This is a renamed version of the {@link IAction.actionProperties} property.

stability stable

Inherited from

Action.providedActionProperties

Accessors

_pipeline

Private get _pipeline(): any

Returns

any

Inherited from

Action._pipeline


_scope

Private get _scope(): any

Retrieves the Construct scope of this Action. Only available after the Action has been added to a Stage, and that Stage to a Pipeline.

Returns

any

Inherited from

Action._scope


_stage

Private get _stage(): any

Returns

any

Inherited from

Action._stage


actionProperties

get actionProperties(): ActionProperties

The simple properties of the Action, like its Owner, name, etc.

Note that this accessor will be called before the bind callback.

stability stable

Returns

ActionProperties

Inherited from

Action.actionProperties

Methods

bind

bind(scope, stage, options): ActionConfig

The callback invoked when this Action is added to a Pipeline.

stability stable

Parameters

Name Type
scope Construct
stage IStage
options ActionBindOptions

Returns

ActionConfig

Inherited from

Action.bind


bound

Protected bound(scope, _stage, options): ActionConfig

Parameters

Name Type
scope Construct
_stage IStage
options ActionBindOptions

Returns

ActionConfig

Overrides

Action.bound


onStateChange

onStateChange(name, target?, options?): Rule

Creates an Event that will be triggered whenever the state of this Action changes.

stability stable

Parameters

Name Type
name string
target? IRuleTarget
options? RuleProps

Returns

Rule

Inherited from

Action.onStateChange


variableExpression

Protected variableExpression(variableName): string

stability stable

Parameters

Name Type
variableName string

Returns

string

Inherited from

Action.variableExpression

Merge Branches Function

@cloudcomponents/cdk-codepipeline-merge-action / MergeBranchesFunction

Class: MergeBranchesFunction

Hierarchy

  • Function

    MergeBranchesFunction

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new MergeBranchesFunction(scope, id, props)

Parameters

Name Type
scope Construct
id string
props MergeBranchesFunctionProps

Overrides

Function.constructor

Properties

_connections

Protected Optional _connections: Connections

Actual connections object for this Lambda

May be unset, in which case this Lambda is not configured use in a VPC.

internal

Inherited from

Function._connections


_invocationGrants

Protected _invocationGrants: Record<string, Grant>

Mapping of invocation principals to grants. Used to de-dupe grantInvoke() calls.

internal

Inherited from

Function._invocationGrants


architecture

Readonly architecture: Architecture

The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).

stability stable

Inherited from

Function.architecture


canCreatePermissions

Protected Readonly canCreatePermissions: true

Whether the addPermission() call adds any permissions.

True for new Lambdas, false for version $LATEST and imported Lambdas from different accounts.

stability stable

Inherited from

Function.canCreatePermissions


deadLetterQueue

Optional Readonly deadLetterQueue: IQueue

The DLQ associated with this Lambda Function (this is an optional attribute).

stability stable

Inherited from

Function.deadLetterQueue


env

Readonly env: 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.

stability stable

Inherited from

Function.env


functionArn

Readonly functionArn: string

ARN of this function.

stability stable

Inherited from

Function.functionArn


functionName

Readonly functionName: string

Name of this function.

stability stable

Inherited from

Function.functionName


grantPrincipal

Readonly grantPrincipal: IPrincipal

The principal this Lambda Function is running as.

stability stable

Inherited from

Function.grantPrincipal


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Function.node


permissionsNode

Readonly permissionsNode: ConstructNode

The construct node where permissions are attached.

stability stable

Inherited from

Function.permissionsNode


physicalName

Protected Readonly physicalName: string

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

stability stable

Inherited from

Function.physicalName


role

Optional Readonly role: IRole

Execution role associated with this function.

stability stable

Inherited from

Function.role


runtime

Readonly runtime: Runtime

The runtime configured for this lambda.

stability stable

Inherited from

Function.runtime


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Inherited from

Function.stack


timeout

Optional Readonly timeout: Duration

The timeout configured for this lambda.

stability stable

Inherited from

Function.timeout


_VER_PROPS

Static _VER_PROPS: Object

internal

Index signature

▪ [key: string]: boolean

Inherited from

Function._VER_PROPS

Accessors

connections

get connections(): Connections

Access the Connections object.

Will fail if not a VPC-enabled Lambda Function

stability stable

Returns

Connections

Inherited from

Function.connections


currentVersion

get currentVersion(): 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.

stability stable

Returns

Version

Inherited from

Function.currentVersion


isBoundToVpc

get isBoundToVpc(): 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.

stability stable

Returns

boolean

Inherited from

Function.isBoundToVpc


latestVersion

get latestVersion(): 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.

stability stable

Returns

IVersion

Inherited from

Function.latestVersion


logGroup

get logGroup(): 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.

stability stable

Returns

ILogGroup

Inherited from

Function.logGroup

Methods

_checkEdgeCompatibility

_checkEdgeCompatibility(): void

internal

Returns

void

Inherited from

Function._checkEdgeCompatibility


_enableCrossEnvironment

_enableCrossEnvironment(): void

Called when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through it's absolute name/arn.

internal

Returns

void

Inherited from

Function._enableCrossEnvironment


_functionNode

Protected _functionNode(): ConstructNode

Returns the construct tree node that corresponds to the lambda function. For use internally for constructs, when the tree is set up in non-standard ways. Ex: SingletonFunction.

internal

Returns

ConstructNode

Inherited from

Function._functionNode


_isStackAccount

Protected _isStackAccount(): boolean

Given the function arn, check if the account id matches this account

Function ARNs look like this:

arn:aws:lambda:region:account-id:function:function-name

..which means that in order to extract the account-id component from the ARN, we can split the ARN using ":" and select the component in index 4.

internal

Returns

boolean

true if account id of function matches the account specified on the stack, false otherwise.

Inherited from

Function._isStackAccount


addEnvironment

addEnvironment(key, value, options?): MergeBranchesFunction

Adds an environment variable to this Lambda function.

If this is a ref to a Lambda function, this operation results in a no-op.

stability stable

Parameters

Name Type Description
key string The environment variable key.
value string The environment variable's value.
options? EnvironmentOptions Environment variable options.

Returns

MergeBranchesFunction

Inherited from

Function.addEnvironment


addEventSource

addEventSource(source): 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));

stability stable

Parameters

Name Type
source IEventSource

Returns

void

Inherited from

Function.addEventSource


addEventSourceMapping

addEventSourceMapping(id, options): EventSourceMapping

Adds an event source that maps to this AWS Lambda function.

stability stable

Parameters

Name Type
id string
options EventSourceMappingOptions

Returns

EventSourceMapping

Inherited from

Function.addEventSourceMapping


addLayers

addLayers(...layers): void

Adds one or more Lambda Layers to this Lambda function.

stability stable

throws if there are already 5 layers on this function, or the layer is incompatible with this function's runtime.

Parameters

Name Type Description
...layers ILayerVersion[] the layers to be added.

Returns

void

Inherited from

Function.addLayers


addPermission

addPermission(id, permission): void

Adds a permission to the Lambda resource policy.

see Permission for details.

stability stable

Parameters

Name Type Description
id string The id for the permission construct.
permission Permission The permission to grant to this Lambda function.

Returns

void

Inherited from

Function.addPermission


addToRolePolicy

addToRolePolicy(statement): void

Adds a statement to the IAM role assumed by the instance.

stability stable

Parameters

Name Type
statement PolicyStatement

Returns

void

Inherited from

Function.addToRolePolicy


addVersion

addVersion(name, codeSha256?, description?, provisionedExecutions?, asyncInvokeConfig?): Version

(deprecated) Add a new version for this Lambda.

If you want to deploy through CloudFormation and use aliases, you need to add a new version (with a new name) to your Lambda every time you want to deploy an update. An alias can then refer to the newly created Version.

All versions should have distinct names, and you should not delete versions as long as your Alias needs to refer to them.

deprecated This method will create an AWS::Lambda::Version resource which snapshots the AWS Lambda function at the time of its creation and it won't get updated when the function changes. Instead, use this.currentVersion to obtain a reference to a version resource that gets automatically recreated when the function configuration (or code) changes.

Parameters

Name Type Description
name string A unique name for this version.
codeSha256? string The SHA-256 hash of the most recently deployed Lambda source code, or omit to skip validation.
description? string A description for this version.
provisionedExecutions? number A provisioned concurrency configuration for a function's version.
asyncInvokeConfig? EventInvokeConfigOptions configuration for this version when it is invoked asynchronously.

Returns

Version

A new Version object.

Inherited from

Function.addVersion


applyRemovalPolicy

applyRemovalPolicy(policy): 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).

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Inherited from

Function.applyRemovalPolicy


configureAsyncInvoke

configureAsyncInvoke(options): void

Configures options for asynchronous invocation.

stability stable

Parameters

Name Type
options EventInvokeConfigOptions

Returns

void

Inherited from

Function.configureAsyncInvoke


generatePhysicalName

Protected generatePhysicalName(): string

stability stable

Returns

string

Inherited from

Function.generatePhysicalName


getResourceArnAttribute

Protected getResourceArnAttribute(arnAttr, arnComponents): string

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

stability stable

Parameters

Name Type Description
arnAttr string The CFN attribute which resolves to the ARN of the resource.
arnComponents ArnComponents The format of the ARN of this resource.

Returns

string

Inherited from

Function.getResourceArnAttribute


getResourceNameAttribute

Protected getResourceNameAttribute(nameAttr): string

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

stability stable

Parameters

Name Type Description
nameAttr string The CFN attribute which resolves to the resource's name.

Returns

string

Inherited from

Function.getResourceNameAttribute


grantInvoke

grantInvoke(grantee): Grant

Grant the given identity permissions to invoke this Lambda.

stability stable

Parameters

Name Type
grantee IGrantable

Returns

Grant

Inherited from

Function.grantInvoke


metric

metric(metricName, props?): Metric

Return the given named metric for this Function.

stability stable

Parameters

Name Type
metricName string
props? MetricOptions

Returns

Metric

Inherited from

Function.metric


metricDuration

metricDuration(props?): Metric

How long execution of this Lambda takes.

Average over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricDuration


metricErrors

metricErrors(props?): Metric

How many invocations of this Lambda fail.

Sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricErrors


metricInvocations

metricInvocations(props?): Metric

How often this Lambda is invoked.

Sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricInvocations


metricThrottles

metricThrottles(props?): Metric

How often this Lambda is throttled.

Sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricThrottles


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Function.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Function.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Function.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Function.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Function.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Function.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Function.validate


classifyVersionProperty

Static classifyVersionProperty(propertyName, locked): void

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.

stability stable

Parameters

Name Type Description
propertyName string The property to classify.
locked boolean whether the property should be associated to the version or not.

Returns

void

Inherited from

Function.classifyVersionProperty


fromFunctionArn

Static fromFunctionArn(scope, id, functionArn): IFunction

Import a lambda function into the CDK using its ARN.

stability stable

Parameters

Name Type
scope Construct
id string
functionArn string

Returns

IFunction

Inherited from

Function.fromFunctionArn


fromFunctionAttributes

Static fromFunctionAttributes(scope, id, attrs): IFunction

Creates a Lambda function object which represents a function not defined within this stack.

stability stable

Parameters

Name Type Description
scope Construct The parent construct.
id string The name of the lambda construct.
attrs FunctionAttributes the attributes of the function to import.

Returns

IFunction

Inherited from

Function.fromFunctionAttributes


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Function.isConstruct


isResource

Static isResource(construct): construct is CfnResource

Check whether the given construct is a Resource.

stability stable

Parameters

Name Type
construct IConstruct

Returns

construct is CfnResource

Inherited from

Function.isResource


metricAll

Static metricAll(metricName, props?): Metric

Return the given named metric for this Lambda.

stability stable

Parameters

Name Type
metricName string
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAll


metricAllConcurrentExecutions

Static metricAllConcurrentExecutions(props?): Metric

Metric for the number of concurrent executions across all Lambdas.

default max over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAllConcurrentExecutions


metricAllDuration

Static metricAllDuration(props?): Metric

Metric for the Duration executing all Lambdas.

default average over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAllDuration


metricAllErrors

Static metricAllErrors(props?): Metric

Metric for the number of Errors executing all Lambdas.

default sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAllErrors


metricAllInvocations

Static metricAllInvocations(props?): Metric

Metric for the number of invocations of all Lambdas.

default sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAllInvocations


metricAllThrottles

Static metricAllThrottles(props?): Metric

Metric for the number of throttled invocations of all Lambdas.

default sum over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAllThrottles


metricAllUnreservedConcurrentExecutions

Static metricAllUnreservedConcurrentExecutions(props?): Metric

Metric for the number of unreserved concurrent executions across all Lambdas.

default max over 5 minutes

stability stable

Parameters

Name Type
props? MetricOptions

Returns

Metric

Inherited from

Function.metricAllUnreservedConcurrentExecutions

Code Pipeline Merge Action Props

@cloudcomponents/cdk-codepipeline-merge-action / CodePipelineMergeActionProps

Interface: CodePipelineMergeActionProps

Hierarchy

  • CommonAwsActionProps

    CodePipelineMergeActionProps

Table of contents

Properties

Properties

actionName

Readonly actionName: string

The physical, human-readable name of the Action.

Note that Action names must be unique within a single Stage.

stability stable

Inherited from

CommonAwsActionProps.actionName


crossAccountRole

Optional Readonly crossAccountRole: IRole

Role for crossAccount permission


destinationCommitSpecifier

Readonly destinationCommitSpecifier: string

The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).


repository

Readonly repository: IRepository

The CodeCommit repository.


role

Optional Readonly role: IRole

The Role in which context's this Action will be executing in.

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your {@link IAction.bind} method in the {@link ActionBindOptions.role} property.

default a new Role will be generated

stability stable

Inherited from

CommonAwsActionProps.role


runOrder

Optional Readonly runOrder: number

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

default 1

see https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html

stability stable

Inherited from

CommonAwsActionProps.runOrder


sourceCommitSpecifier

Readonly sourceCommitSpecifier: string

The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).


variablesNamespace

Optional Readonly variablesNamespace: string

The name of the namespace to use for variables emitted by this action.

default - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set

stability stable

Inherited from

CommonAwsActionProps.variablesNamespace

Merge Branches Function Props

@cloudcomponents/cdk-codepipeline-merge-action / MergeBranchesFunctionProps

Interface: MergeBranchesFunctionProps

Table of contents

Properties

Properties

crossAccountRole

Optional Readonly crossAccountRole: IRole

Role for crossAccount permission


repository

Readonly repository: IRepository

The CodeCommit repository.