/
Wave.go
161 lines (138 loc) · 3.03 KB
/
Wave.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package pipelines
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
"github.com/aws/aws-cdk-go/awscdk/v2"
)
// Multiple stages that are deployed in parallel.
//
// Example:
// var pipeline codePipeline
//
// europeWave := pipeline.AddWave(jsii.String("Europe"))
// europeWave.AddStage(NewMyApplicationStage(this, jsii.String("Ireland"), &stageProps{
// Env: &Environment{
// Region: jsii.String("eu-west-1"),
// },
// }))
// europeWave.AddStage(NewMyApplicationStage(this, jsii.String("Germany"), &stageProps{
// Env: &Environment{
// Region: jsii.String("eu-central-1"),
// },
// }))
//
type Wave interface {
// Identifier for this Wave.
Id() *string
// Additional steps that are run after all of the stages in the wave.
Post() *[]Step
// Additional steps that are run before any of the stages in the wave.
Pre() *[]Step
// The stages that are deployed in this wave.
Stages() *[]StageDeployment
// Add an additional step to run after all of the stages in this wave.
AddPost(steps ...Step)
// Add an additional step to run before any of the stages in this wave.
AddPre(steps ...Step)
// Add a Stage to this wave.
//
// It will be deployed in parallel with all other stages in this
// wave.
AddStage(stage awscdk.Stage, options *AddStageOpts) StageDeployment
}
// The jsii proxy struct for Wave
type jsiiProxy_Wave struct {
_ byte // padding
}
func (j *jsiiProxy_Wave) Id() *string {
var returns *string
_jsii_.Get(
j,
"id",
&returns,
)
return returns
}
func (j *jsiiProxy_Wave) Post() *[]Step {
var returns *[]Step
_jsii_.Get(
j,
"post",
&returns,
)
return returns
}
func (j *jsiiProxy_Wave) Pre() *[]Step {
var returns *[]Step
_jsii_.Get(
j,
"pre",
&returns,
)
return returns
}
func (j *jsiiProxy_Wave) Stages() *[]StageDeployment {
var returns *[]StageDeployment
_jsii_.Get(
j,
"stages",
&returns,
)
return returns
}
func NewWave(id *string, props *WaveProps) Wave {
_init_.Initialize()
if err := validateNewWaveParameters(id, props); err != nil {
panic(err)
}
j := jsiiProxy_Wave{}
_jsii_.Create(
"aws-cdk-lib.pipelines.Wave",
[]interface{}{id, props},
&j,
)
return &j
}
func NewWave_Override(w Wave, id *string, props *WaveProps) {
_init_.Initialize()
_jsii_.Create(
"aws-cdk-lib.pipelines.Wave",
[]interface{}{id, props},
w,
)
}
func (w *jsiiProxy_Wave) AddPost(steps ...Step) {
args := []interface{}{}
for _, a := range steps {
args = append(args, a)
}
_jsii_.InvokeVoid(
w,
"addPost",
args,
)
}
func (w *jsiiProxy_Wave) AddPre(steps ...Step) {
args := []interface{}{}
for _, a := range steps {
args = append(args, a)
}
_jsii_.InvokeVoid(
w,
"addPre",
args,
)
}
func (w *jsiiProxy_Wave) AddStage(stage awscdk.Stage, options *AddStageOpts) StageDeployment {
if err := w.validateAddStageParameters(stage, options); err != nil {
panic(err)
}
var returns StageDeployment
_jsii_.Invoke(
w,
"addStage",
[]interface{}{stage, options},
&returns,
)
return returns
}