Class CodeCommitSourceAction
CodePipeline Source that is provided by an AWS CodeCommit repository.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CodeCommitSourceAction : Action, IAction
Syntax (vb)
Public Class CodeCommitSourceAction
Inherits Action
Implements IAction
Remarks
If the CodeCommit repository is in a different account, you must use
CodeCommitTrigger.EVENTS
to trigger the pipeline.
(That is because the Pipeline structure normally only has a RepositoryName
field, and that is not enough for the pipeline to locate the repository's
source account. However, if the pipeline is triggered via an EventBridge
event, the event itself has the full repository ARN in there, allowing the
pipeline to locate the repository).
ExampleMetadata: lit=aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts infused
Examples
// Source stage: read from repository
var repo = new Repository(stack, "TemplateRepo", new RepositoryProps {
RepositoryName = "template-repo"
});
var sourceOutput = new Artifact("SourceArtifact");
var source = new CodeCommitSourceAction(new CodeCommitSourceActionProps {
ActionName = "Source",
Repository = repo,
Output = sourceOutput,
Trigger = CodeCommitTrigger.POLL
});
IDictionary<string, object> sourceStage = new Dictionary<string, object> {
{ "stageName", "Source" },
{ "actions", new [] { source } }
};
// Deployment stage: create and deploy changeset with manual approval
var stackName = "OurStack";
var changeSetName = "StagedChangeSet";
IDictionary<string, object> prodStage = new Dictionary<string, object> {
{ "stageName", "Deploy" },
{ "actions", new [] {
new CloudFormationCreateReplaceChangeSetAction(new CloudFormationCreateReplaceChangeSetActionProps {
ActionName = "PrepareChanges",
StackName = stackName,
ChangeSetName = changeSetName,
AdminPermissions = true,
TemplatePath = sourceOutput.AtPath("template.yaml"),
RunOrder = 1
}),
new ManualApprovalAction(new ManualApprovalActionProps {
ActionName = "ApproveChanges",
RunOrder = 2
}),
new CloudFormationExecuteChangeSetAction(new CloudFormationExecuteChangeSetActionProps {
ActionName = "ExecuteChanges",
StackName = stackName,
ChangeSetName = changeSetName,
RunOrder = 3
}) } }
};
new Pipeline(stack, "Pipeline", new PipelineProps {
CrossAccountKeys = true,
Stages = new [] { sourceStage, prodStage }
});
Synopsis
Constructors
CodeCommitSourceAction(ICodeCommitSourceActionProps) | |
CodeCommitSourceAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CodeCommitSourceAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Variables | The variables emitted by this action. |
Methods
Bound(Construct, IStage, IActionBindOptions) | This is a renamed version of the |
Constructors
CodeCommitSourceAction(ICodeCommitSourceActionProps)
public CodeCommitSourceAction(ICodeCommitSourceActionProps props)
Parameters
CodeCommitSourceAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CodeCommitSourceAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CodeCommitSourceAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CodeCommitSourceAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Variables
The variables emitted by this action.
public virtual ICodeCommitSourceVariables Variables { get; }
Property Value
Methods
Bound(Construct, IStage, IActionBindOptions)
This is a renamed version of the IAction.bind
method.
protected override IActionConfig Bound(Construct scope, IStage stage, IActionBindOptions options)
Parameters
- scope Constructs.Construct
- stage IStage
- options IActionBindOptions
Returns