Class CodeCommitSourceActionProps
Construction properties of the {@link CodeCommitSourceAction CodeCommit source CodePipeline Action}.
Inheritance
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.AWS.CodePipeline.Actions.dll
Syntax (csharp)
public class CodeCommitSourceActionProps : Object, ICodeCommitSourceActionProps, ICommonAwsActionProps, ICommonActionProps
Syntax (vb)
Public Class CodeCommitSourceActionProps
Inherits Object
Implements ICodeCommitSourceActionProps, ICommonAwsActionProps, ICommonActionProps
Remarks
ExampleMetadata: lit=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 {
Stages = new [] { sourceStage, prodStage }
});
Synopsis
Constructors
CodeCommitSourceActionProps() |
Properties
ActionName | The physical, human-readable name of the Action. |
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. |
EventRole | Role to be used by on commit event rule. |
Output | |
Repository | The CodeCommit repository. |
Role | The Role in which context's this Action will be executing in. |
RunOrder | The runOrder property for this Action. |
Trigger | How should CodePipeline detect source changes for this Action. |
VariablesNamespace | The name of the namespace to use for variables emitted by this action. |
Constructors
CodeCommitSourceActionProps()
public CodeCommitSourceActionProps()
Properties
ActionName
The physical, human-readable name of the Action.
public string ActionName { get; set; }
Property Value
System.String
Remarks
Note that Action names must be unique within a single Stage.
Branch
public string Branch { get; set; }
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.
public Nullable<bool> CodeBuildCloneOutput { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Note: if this option is true, then only CodeBuild actions can use the resulting {@link output}.
Default: false
See: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeCommit.html
EventRole
Role to be used by on commit event rule.
public IRole EventRole { get; set; }
Property Value
Remarks
Used only when trigger value is CodeCommitTrigger.EVENTS.
Default: a new role will be created.
Output
Repository
Role
The Role in which context's this Action will be executing in.
public IRole Role { get; set; }
Property Value
Remarks
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
RunOrder
The runOrder property for this Action.
public Nullable<double> RunOrder { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
Trigger
How should CodePipeline detect source changes for this Action.
public Nullable<CodeCommitTrigger> Trigger { get; set; }
Property Value
System.Nullable<CodeCommitTrigger>
Remarks
Default: CodeCommitTrigger.EVENTS
VariablesNamespace
The name of the namespace to use for variables emitted by this action.
public string VariablesNamespace { get; set; }
Property Value
System.String
Remarks
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