-
Notifications
You must be signed in to change notification settings - Fork 17
/
CodeCommitSourceActionProps.go
128 lines (125 loc) · 5.33 KB
/
CodeCommitSourceActionProps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package awscodepipelineactions
import (
"github.com/aws/aws-cdk-go/awscdk/v2/awscodecommit"
"github.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline"
"github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
)
// Construction properties of the `CodeCommitSourceAction CodeCommit source CodePipeline Action`.
//
// Example:
// // Source stage: read from repository
// repo := codecommit.NewRepository(stack, jsii.String("TemplateRepo"), &RepositoryProps{
// RepositoryName: jsii.String("template-repo"),
// })
// sourceOutput := codepipeline.NewArtifact(jsii.String("SourceArtifact"))
// source := cpactions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{
// ActionName: jsii.String("Source"),
// Repository: repo,
// Output: sourceOutput,
// Trigger: cpactions.CodeCommitTrigger_POLL,
// })
// sourceStage := map[string]interface{}{
// "stageName": jsii.String("Source"),
// "actions": []CodeCommitSourceAction{
// source,
// },
// }
//
// // Deployment stage: create and deploy changeset with manual approval
// stackName := "OurStack"
// changeSetName := "StagedChangeSet"
//
// prodStage := map[string]interface{}{
// "stageName": jsii.String("Deploy"),
// "actions": []interface{}{
// cpactions.NewCloudFormationCreateReplaceChangeSetAction(&CloudFormationCreateReplaceChangeSetActionProps{
// "actionName": jsii.String("PrepareChanges"),
// "stackName": jsii.String(stackName),
// "changeSetName": jsii.String(changeSetName),
// "adminPermissions": jsii.Boolean(true),
// "templatePath": sourceOutput.atPath(jsii.String("template.yaml")),
// "runOrder": jsii.Number(1),
// }),
// cpactions.NewManualApprovalAction(&ManualApprovalActionProps{
// "actionName": jsii.String("ApproveChanges"),
// "runOrder": jsii.Number(2),
// }),
// cpactions.NewCloudFormationExecuteChangeSetAction(&CloudFormationExecuteChangeSetActionProps{
// "actionName": jsii.String("ExecuteChanges"),
// "stackName": jsii.String(stackName),
// "changeSetName": jsii.String(changeSetName),
// "runOrder": jsii.Number(3),
// }),
// },
// }
//
// codepipeline.NewPipeline(stack, jsii.String("Pipeline"), &PipelineProps{
// CrossAccountKeys: jsii.Boolean(true),
// Stages: []stageProps{
// sourceStage,
// prodStage,
// },
// })
//
type CodeCommitSourceActionProps struct {
// The physical, human-readable name of the Action.
//
// Note that Action names must be unique within a single Stage.
ActionName *string `field:"required" json:"actionName" yaml:"actionName"`
// The runOrder property for this Action.
//
// RunOrder determines the relative order in which multiple Actions in the same Stage execute.
// See: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
//
// Default: 1.
//
RunOrder *float64 `field:"optional" json:"runOrder" yaml:"runOrder"`
// 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.
//
VariablesNamespace *string `field:"optional" json:"variablesNamespace" yaml:"variablesNamespace"`
// 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 `IAction.bind`
// method in the `ActionBindOptions.role` property.
// Default: a new Role will be generated.
//
Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
Output awscodepipeline.Artifact `field:"required" json:"output" yaml:"output"`
// The CodeCommit repository.
Repository awscodecommit.IRepository `field:"required" json:"repository" yaml:"repository"`
// Default: 'master'.
//
Branch *string `field:"optional" json:"branch" yaml:"branch"`
// 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.
//
// **Note**: if this option is true,
// then only CodeBuild actions can use the resulting `output`.
// See: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeCommit.html
//
// Default: false.
//
CodeBuildCloneOutput *bool `field:"optional" json:"codeBuildCloneOutput" yaml:"codeBuildCloneOutput"`
// You can pass a `customEventRule` to set up a custom event rule for the CodeCommit source action.
//
// 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.
//
CustomEventRule ICustomEventRule `field:"optional" json:"customEventRule" yaml:"customEventRule"`
// Role to be used by on commit event rule.
//
// Used only when trigger value is CodeCommitTrigger.EVENTS.
// Default: a new role will be created.
//
EventRole awsiam.IRole `field:"optional" json:"eventRole" yaml:"eventRole"`
// How should CodePipeline detect source changes for this Action.
// Default: CodeCommitTrigger.EVENTS
//
Trigger CodeCommitTrigger `field:"optional" json:"trigger" yaml:"trigger"`
}