@cloudcomponents/cdk-codepipeline-merge-action
@cloudcomponents/cdk-codepipeline-merge-action / CodePipelineMergeAction
Represents a reference to a CodePipelineMergeAction.
-
Action↳
CodePipelineMergeAction
• new CodePipelineMergeAction(props)
| Name | Type |
|---|---|
props |
CodePipelineMergeActionProps |
Action.constructor
• Private Readonly props: CodePipelineMergeActionProps
• Protected Readonly providedActionProperties: ActionProperties
This is a renamed version of the {@link IAction.actionProperties} property.
stability stable
Action.providedActionProperties
• Private get _pipeline(): any
any
Action._pipeline
• 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.
any
Action._scope
• Private get _stage(): any
any
Action._stage
• 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
ActionProperties
Action.actionProperties
▸ bind(scope, stage, options): ActionConfig
The callback invoked when this Action is added to a Pipeline.
stability stable
| Name | Type |
|---|---|
scope |
Construct |
stage |
IStage |
options |
ActionBindOptions |
ActionConfig
Action.bind
▸ Protected bound(scope, _stage, options): ActionConfig
| Name | Type |
|---|---|
scope |
Construct |
_stage |
IStage |
options |
ActionBindOptions |
ActionConfig
Action.bound
▸ onStateChange(name, target?, options?): Rule
Creates an Event that will be triggered whenever the state of this Action changes.
stability stable
| Name | Type |
|---|---|
name |
string |
target? |
IRuleTarget |
options? |
RuleProps |
Rule
Action.onStateChange
▸ Protected variableExpression(variableName): string
stability stable
| Name | Type |
|---|---|
variableName |
string |
string
Action.variableExpression
@cloudcomponents/cdk-codepipeline-merge-action / MergeBranchesFunction
-
Function↳
MergeBranchesFunction
- _connections
- _invocationGrants
- architecture
- canCreatePermissions
- deadLetterQueue
- env
- functionArn
- functionName
- grantPrincipal
- node
- permissionsNode
- physicalName
- role
- runtime
- stack
- timeout
- _VER_PROPS
- _checkEdgeCompatibility
- _enableCrossEnvironment
- _functionNode
- _isStackAccount
- addEnvironment
- addEventSource
- addEventSourceMapping
- addLayers
- addPermission
- addToRolePolicy
- addVersion
- applyRemovalPolicy
- configureAsyncInvoke
- generatePhysicalName
- getResourceArnAttribute
- getResourceNameAttribute
- grantInvoke
- metric
- metricDuration
- metricErrors
- metricInvocations
- metricThrottles
- onPrepare
- onSynthesize
- onValidate
- prepare
- synthesize
- toString
- validate
- classifyVersionProperty
- fromFunctionArn
- fromFunctionAttributes
- isConstruct
- isResource
- metricAll
- metricAllConcurrentExecutions
- metricAllDuration
- metricAllErrors
- metricAllInvocations
- metricAllThrottles
- metricAllUnreservedConcurrentExecutions
• new MergeBranchesFunction(scope, id, props)
| Name | Type |
|---|---|
scope |
Construct |
id |
string |
props |
MergeBranchesFunctionProps |
Function.constructor
• 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
Function._connections
• Protected _invocationGrants: Record<string, Grant>
Mapping of invocation principals to grants. Used to de-dupe grantInvoke() calls.
internal
Function._invocationGrants
• Readonly architecture: Architecture
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
stability stable
Function.architecture
• 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
Function.canCreatePermissions
• Optional Readonly deadLetterQueue: IQueue
The DLQ associated with this Lambda Function (this is an optional attribute).
stability stable
Function.deadLetterQueue
• 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
Function.env
• Readonly functionArn: string
ARN of this function.
stability stable
Function.functionArn
• Readonly functionName: string
Name of this function.
stability stable
Function.functionName
• Readonly grantPrincipal: IPrincipal
The principal this Lambda Function is running as.
stability stable
Function.grantPrincipal
• Readonly node: ConstructNode
The construct tree node associated with this construct.
stability stable
Function.node
• Readonly permissionsNode: ConstructNode
The construct node where permissions are attached.
stability stable
Function.permissionsNode
• 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
Function.physicalName
• Optional Readonly role: IRole
Execution role associated with this function.
stability stable
Function.role
• Readonly runtime: Runtime
The runtime configured for this lambda.
stability stable
Function.runtime
• Readonly stack: Stack
The stack in which this resource is defined.
stability stable
Function.stack
• Optional Readonly timeout: Duration
The timeout configured for this lambda.
stability stable
Function.timeout
▪ Static _VER_PROPS: Object
internal
▪ [key: string]: boolean
Function._VER_PROPS
• get connections(): Connections
Access the Connections object.
Will fail if not a VPC-enabled Lambda Function
stability stable
Connections
Function.connections
• 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
Version
Function.currentVersion
• 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
boolean
Function.isBoundToVpc
• 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
IVersion
Function.latestVersion
• 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
ILogGroup
Function.logGroup
▸ _checkEdgeCompatibility(): void
internal
void
Function._checkEdgeCompatibility
▸ _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
void
Function._enableCrossEnvironment
▸ 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
ConstructNode
Function._functionNode
▸ 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
boolean
true if account id of function matches the account specified on the stack, false otherwise.
Function._isStackAccount
▸ 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
| Name | Type | Description |
|---|---|---|
key |
string |
The environment variable key. |
value |
string |
The environment variable's value. |
options? |
EnvironmentOptions |
Environment variable options. |
Function.addEnvironment
▸ 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
| Name | Type |
|---|---|
source |
IEventSource |
void
Function.addEventSource
▸ addEventSourceMapping(id, options): EventSourceMapping
Adds an event source that maps to this AWS Lambda function.
stability stable
| Name | Type |
|---|---|
id |
string |
options |
EventSourceMappingOptions |
EventSourceMapping
Function.addEventSourceMapping
▸ 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.
| Name | Type | Description |
|---|---|---|
...layers |
ILayerVersion[] |
the layers to be added. |
void
Function.addLayers
▸ addPermission(id, permission): void
Adds a permission to the Lambda resource policy.
see Permission for details.
stability stable
| Name | Type | Description |
|---|---|---|
id |
string |
The id for the permission construct. |
permission |
Permission |
The permission to grant to this Lambda function. |
void
Function.addPermission
▸ addToRolePolicy(statement): void
Adds a statement to the IAM role assumed by the instance.
stability stable
| Name | Type |
|---|---|
statement |
PolicyStatement |
void
Function.addToRolePolicy
▸ 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.
| 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. |
Version
A new Version object.
Function.addVersion
▸ 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
| Name | Type |
|---|---|
policy |
RemovalPolicy |
void
Function.applyRemovalPolicy
▸ configureAsyncInvoke(options): void
Configures options for asynchronous invocation.
stability stable
| Name | Type |
|---|---|
options |
EventInvokeConfigOptions |
void
Function.configureAsyncInvoke
▸ Protected generatePhysicalName(): string
stability stable
string
Function.generatePhysicalName
▸ 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
| 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. |
string
Function.getResourceArnAttribute
▸ 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
| Name | Type | Description |
|---|---|---|
nameAttr |
string |
The CFN attribute which resolves to the resource's name. |
string
Function.getResourceNameAttribute
▸ grantInvoke(grantee): Grant
Grant the given identity permissions to invoke this Lambda.
stability stable
| Name | Type |
|---|---|
grantee |
IGrantable |
Grant
Function.grantInvoke
▸ metric(metricName, props?): Metric
Return the given named metric for this Function.
stability stable
| Name | Type |
|---|---|
metricName |
string |
props? |
MetricOptions |
Metric
Function.metric
▸ metricDuration(props?): Metric
How long execution of this Lambda takes.
Average over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricDuration
▸ metricErrors(props?): Metric
How many invocations of this Lambda fail.
Sum over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricErrors
▸ metricInvocations(props?): Metric
How often this Lambda is invoked.
Sum over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricInvocations
▸ metricThrottles(props?): Metric
How often this Lambda is throttled.
Sum over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricThrottles
▸ 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
void
Function.onPrepare
▸ 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
| Name | Type | Description |
|---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Function.onSynthesize
▸ 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
string[]
An array of validation error messages, or an empty array if the construct is valid.
Function.onValidate
▸ 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
void
Function.prepare
▸ 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
| Name | Type | Description |
|---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Function.synthesize
▸ toString(): string
Returns a string representation of this construct.
stability stable
string
Function.toString
▸ 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
string[]
An array of validation error messages, or an empty array if the construct is valid.
Function.validate
▸ 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
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The property to classify. |
locked |
boolean |
whether the property should be associated to the version or not. |
void
Function.classifyVersionProperty
▸ Static fromFunctionArn(scope, id, functionArn): IFunction
Import a lambda function into the CDK using its ARN.
stability stable
| Name | Type |
|---|---|
scope |
Construct |
id |
string |
functionArn |
string |
IFunction
Function.fromFunctionArn
▸ Static fromFunctionAttributes(scope, id, attrs): IFunction
Creates a Lambda function object which represents a function not defined within this stack.
stability stable
| 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. |
IFunction
Function.fromFunctionAttributes
▸ Static isConstruct(x): x is Construct
Return whether the given object is a Construct.
stability stable
| Name | Type |
|---|---|
x |
any |
x is Construct
Function.isConstruct
▸ Static isResource(construct): construct is CfnResource
Check whether the given construct is a Resource.
stability stable
| Name | Type |
|---|---|
construct |
IConstruct |
construct is CfnResource
Function.isResource
▸ Static metricAll(metricName, props?): Metric
Return the given named metric for this Lambda.
stability stable
| Name | Type |
|---|---|
metricName |
string |
props? |
MetricOptions |
Metric
Function.metricAll
▸ Static metricAllConcurrentExecutions(props?): Metric
Metric for the number of concurrent executions across all Lambdas.
default max over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricAllConcurrentExecutions
▸ Static metricAllDuration(props?): Metric
Metric for the Duration executing all Lambdas.
default average over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricAllDuration
▸ Static metricAllErrors(props?): Metric
Metric for the number of Errors executing all Lambdas.
default sum over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricAllErrors
▸ Static metricAllInvocations(props?): Metric
Metric for the number of invocations of all Lambdas.
default sum over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricAllInvocations
▸ Static metricAllThrottles(props?): Metric
Metric for the number of throttled invocations of all Lambdas.
default sum over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricAllThrottles
▸ Static metricAllUnreservedConcurrentExecutions(props?): Metric
Metric for the number of unreserved concurrent executions across all Lambdas.
default max over 5 minutes
stability stable
| Name | Type |
|---|---|
props? |
MetricOptions |
Metric
Function.metricAllUnreservedConcurrentExecutions
@cloudcomponents/cdk-codepipeline-merge-action / CodePipelineMergeActionProps
-
CommonAwsActionProps↳
CodePipelineMergeActionProps
- actionName
- crossAccountRole
- destinationCommitSpecifier
- repository
- role
- runOrder
- sourceCommitSpecifier
- variablesNamespace
• Readonly actionName: string
The physical, human-readable name of the Action.
Note that Action names must be unique within a single Stage.
stability stable
CommonAwsActionProps.actionName
• Optional Readonly crossAccountRole: IRole
Role for crossAccount permission
• 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).
• Readonly repository: IRepository
The CodeCommit repository.
• 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
CommonAwsActionProps.role
• 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
CommonAwsActionProps.runOrder
• 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).
• 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
CommonAwsActionProps.variablesNamespace
@cloudcomponents/cdk-codepipeline-merge-action / MergeBranchesFunctionProps
• Optional Readonly crossAccountRole: IRole
Role for crossAccount permission
• Readonly repository: IRepository
The CodeCommit repository.