Interface ICodeCommitSourceActionProps
Construction properties of the CodeCommitSourceAction CodeCommit source CodePipeline Action
.
Inherited Members
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICodeCommitSourceActionProps : ICommonAwsActionProps, ICommonActionProps
Syntax (vb)
Public Interface ICodeCommitSourceActionProps
Inherits ICommonAwsActionProps, ICommonActionProps
Remarks
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
Properties
Branch | |
CodeBuildCloneOutput | Whether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building. |
CustomEventRule | You can pass a |
EventRole | Role to be used by on commit event rule. |
Output | |
Repository | The CodeCommit repository. |
Trigger | How should CodePipeline detect source changes for this Action. |
Properties
Branch
virtual string Branch { get; }
Property Value
System.String
Remarks
Default: 'master'
CodeBuildCloneOutput
Whether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building.
virtual Nullable<bool> CodeBuildCloneOutput { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Note: if this option is true,
then only CodeBuild actions can use the resulting output
.
Default: false
See: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeCommit.html
CustomEventRule
You can pass a customEventRule
to set up a custom event rule for the CodeCommit source action.
virtual ICustomEventRule CustomEventRule { get; }
Property Value
Remarks
You must provide the eventPattern
and target
properties in the customEventRule
object.
Check which eventPattern
to use: https://docs.aws.amazon.com/codecommit/latest/userguide/monitoring-events.html
Default: Event rule which is triggered by CodeCommit repository on commit
EventRole
Role to be used by on commit event rule.
virtual IRole EventRole { get; }
Property Value
Remarks
Used only when trigger value is CodeCommitTrigger.EVENTS.
Default: a new role will be created.
Output
Repository
Trigger
How should CodePipeline detect source changes for this Action.
virtual Nullable<CodeCommitTrigger> Trigger { get; }
Property Value
System.Nullable<CodeCommitTrigger>
Remarks
Default: CodeCommitTrigger.EVENTS