aws-cdk-lib.aws_codepipeline_actions.EcrSourceAction

class EcrSourceAction

LanguageType name
.NETAmazon.CDK.AWS.CodePipeline.Actions.EcrSourceAction
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#EcrSourceAction
Javasoftware.amazon.awscdk.services.codepipeline.actions.EcrSourceAction
Pythonaws_cdk.aws_codepipeline_actions.EcrSourceAction
TypeScript (source)aws-cdk-lib » aws_codepipeline_actions » EcrSourceAction

Implements IAction

Extends Action

The ECR Repository source CodePipeline Action.

Will trigger the pipeline as soon as the target tag in the repository changes, but only if there is a CloudTrail Trail in the account that captures the ECR event.

Example

import * as ecr from 'aws-cdk-lib/aws-ecr';

declare const ecrRepository: ecr.Repository;
const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.EcrSourceAction({
  actionName: 'ECR',
  repository: ecrRepository,
  imageTag: 'some-tag', // optional, default: 'latest'
  output: sourceOutput,
});
pipeline.addStage({
  stageName: 'Source',
  actions: [sourceAction],
});

Initializer

new EcrSourceAction(props: EcrSourceActionProps)

Parameters

  • props EcrSourceActionProps

Properties

NameTypeDescription
actionPropertiesActionPropertiesThe simple properties of the Action, like its Owner, name, etc.
variablesEcrSourceVariablesThe variables emitted by this action.

actionProperties

Type: ActionProperties

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

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


variables

Type: EcrSourceVariables

The variables emitted by this action.

Methods

NameDescription
bind(scope, stage, options)The callback invoked when this Action is added to a Pipeline.
onStateChange(name, target?, options?)Creates an Event that will be triggered whenever the state of this Action changes.
protected bound(scope, stage, options)This is a renamed version of the IAction.bind method.

bind(scope, stage, options)

public bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig

Parameters

  • scope Construct
  • stage IStage
  • options ActionBindOptions

Returns

  • ActionConfig

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


onStateChange(name, target?, options?)

public onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Rule

Parameters

  • name string
  • target IRuleTarget
  • options RuleProps

Returns

  • Rule

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


protected bound(scope, stage, options)

protected bound(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig

Parameters

  • scope Construct
  • stage IStage
  • options ActionBindOptions

Returns

  • ActionConfig

This is a renamed version of the IAction.bind method.