-
Notifications
You must be signed in to change notification settings - Fork 17
/
IRepository.go
271 lines (229 loc) · 6.75 KB
/
IRepository.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
package awsecr
import (
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
"github.com/aws/aws-cdk-go/awscdk/v2"
"github.com/aws/aws-cdk-go/awscdk/v2/awsecr/internal"
"github.com/aws/aws-cdk-go/awscdk/v2/awsevents"
"github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
)
// Represents an ECR repository.
type IRepository interface {
awscdk.IResource
// Add a policy statement to the repository's resource policy.
AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult
// Grant the given principal identity permissions to perform the actions on this repository.
Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
// Grant the given identity permissions to pull images in this repository.
GrantPull(grantee awsiam.IGrantable) awsiam.Grant
// Grant the given identity permissions to pull and push images to this repository.
GrantPullPush(grantee awsiam.IGrantable) awsiam.Grant
// Define a CloudWatch event that triggers when something happens to this repository.
//
// Requires that there exists at least one CloudTrail Trail in your account
// that captures the event. This method will not create the Trail.
OnCloudTrailEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule
// Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository.
//
// Requires that there exists at least one CloudTrail Trail in your account
// that captures the event. This method will not create the Trail.
OnCloudTrailImagePushed(id *string, options *OnCloudTrailImagePushedOptions) awsevents.Rule
// Defines a CloudWatch event rule which triggers for repository events.
//
// Use
// `rule.addEventPattern(pattern)` to specify a filter.
OnEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule
// Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
OnImageScanCompleted(id *string, options *OnImageScanCompletedOptions) awsevents.Rule
// Returns the URI of the repository for a certain digest. Can be used in `docker push/pull`.
//
// ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
RepositoryUriForDigest(digest *string) *string
// Returns the URI of the repository for a certain tag. Can be used in `docker push/pull`.
//
// ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
RepositoryUriForTag(tag *string) *string
// Returns the URI of the repository for a certain tag or digest, inferring based on the syntax of the tag.
//
// Can be used in `docker push/pull`.
//
// ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
// ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
RepositoryUriForTagOrDigest(tagOrDigest *string) *string
// The ARN of the repository.
RepositoryArn() *string
// The name of the repository.
RepositoryName() *string
// The URI of this repository (represents the latest image):.
//
// ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
RepositoryUri() *string
}
// The jsii proxy for IRepository
type jsiiProxy_IRepository struct {
internal.Type__awscdkIResource
}
func (i *jsiiProxy_IRepository) AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult {
if err := i.validateAddToResourcePolicyParameters(statement); err != nil {
panic(err)
}
var returns *awsiam.AddToResourcePolicyResult
_jsii_.Invoke(
i,
"addToResourcePolicy",
[]interface{}{statement},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant {
if err := i.validateGrantParameters(grantee); err != nil {
panic(err)
}
args := []interface{}{grantee}
for _, a := range actions {
args = append(args, a)
}
var returns awsiam.Grant
_jsii_.Invoke(
i,
"grant",
args,
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) GrantPull(grantee awsiam.IGrantable) awsiam.Grant {
if err := i.validateGrantPullParameters(grantee); err != nil {
panic(err)
}
var returns awsiam.Grant
_jsii_.Invoke(
i,
"grantPull",
[]interface{}{grantee},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) GrantPullPush(grantee awsiam.IGrantable) awsiam.Grant {
if err := i.validateGrantPullPushParameters(grantee); err != nil {
panic(err)
}
var returns awsiam.Grant
_jsii_.Invoke(
i,
"grantPullPush",
[]interface{}{grantee},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) OnCloudTrailEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule {
if err := i.validateOnCloudTrailEventParameters(id, options); err != nil {
panic(err)
}
var returns awsevents.Rule
_jsii_.Invoke(
i,
"onCloudTrailEvent",
[]interface{}{id, options},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) OnCloudTrailImagePushed(id *string, options *OnCloudTrailImagePushedOptions) awsevents.Rule {
if err := i.validateOnCloudTrailImagePushedParameters(id, options); err != nil {
panic(err)
}
var returns awsevents.Rule
_jsii_.Invoke(
i,
"onCloudTrailImagePushed",
[]interface{}{id, options},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) OnEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule {
if err := i.validateOnEventParameters(id, options); err != nil {
panic(err)
}
var returns awsevents.Rule
_jsii_.Invoke(
i,
"onEvent",
[]interface{}{id, options},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) OnImageScanCompleted(id *string, options *OnImageScanCompletedOptions) awsevents.Rule {
if err := i.validateOnImageScanCompletedParameters(id, options); err != nil {
panic(err)
}
var returns awsevents.Rule
_jsii_.Invoke(
i,
"onImageScanCompleted",
[]interface{}{id, options},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) RepositoryUriForDigest(digest *string) *string {
var returns *string
_jsii_.Invoke(
i,
"repositoryUriForDigest",
[]interface{}{digest},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) RepositoryUriForTag(tag *string) *string {
var returns *string
_jsii_.Invoke(
i,
"repositoryUriForTag",
[]interface{}{tag},
&returns,
)
return returns
}
func (i *jsiiProxy_IRepository) RepositoryUriForTagOrDigest(tagOrDigest *string) *string {
var returns *string
_jsii_.Invoke(
i,
"repositoryUriForTagOrDigest",
[]interface{}{tagOrDigest},
&returns,
)
return returns
}
func (j *jsiiProxy_IRepository) RepositoryArn() *string {
var returns *string
_jsii_.Get(
j,
"repositoryArn",
&returns,
)
return returns
}
func (j *jsiiProxy_IRepository) RepositoryName() *string {
var returns *string
_jsii_.Get(
j,
"repositoryName",
&returns,
)
return returns
}
func (j *jsiiProxy_IRepository) RepositoryUri() *string {
var returns *string
_jsii_.Get(
j,
"repositoryUri",
&returns,
)
return returns
}