@pipeline-builder/pipeline-manager 6.5.4 → 6.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agent/post-steps.d.ts +1 -1
- package/dist/agent/post-steps.d.ts.map +1 -1
- package/dist/agent/post-steps.js +27 -31
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +8 -9
- package/dist/commands/audit-stacks.d.ts +2 -1
- package/dist/commands/audit-stacks.d.ts.map +1 -1
- package/dist/commands/audit-stacks.js +12 -2
- package/dist/commands/deploy-job.js +4 -4
- package/dist/commands/provision-steps.d.ts +1 -1
- package/dist/commands/provision-steps.js +2 -2
- package/dist/commands/provision.js +2 -2
- package/dist/commands/redrive-events.d.ts +4 -3
- package/dist/commands/redrive-events.d.ts.map +1 -1
- package/dist/commands/redrive-events.js +51 -18
- package/dist/commands/runner-signing-key.js +2 -2
- package/dist/commands/{setup-runner.d.ts → setup-account.d.ts} +119 -71
- package/dist/commands/setup-account.d.ts.map +1 -0
- package/dist/commands/setup-account.js +1345 -0
- package/dist/commands/store-token.d.ts +6 -28
- package/dist/commands/store-token.d.ts.map +1 -1
- package/dist/commands/store-token.js +12 -139
- package/dist/config/cli.constants.d.ts +0 -8
- package/dist/config/cli.constants.d.ts.map +1 -1
- package/dist/config/cli.constants.js +1 -9
- package/dist/lambda/events-handler.js +1529 -0
- package/dist/lambda/runner-handler.d.ts +25 -1
- package/dist/lambda/runner-handler.d.ts.map +1 -1
- package/dist/lambda/runner-handler.js +403 -50
- package/dist/lambda/runner-inspect-connection.d.ts +32 -0
- package/dist/lambda/runner-inspect-connection.d.ts.map +1 -0
- package/dist/lambda/runner-inspect-connection.js +144 -0
- package/dist/lambda/runner-inspect.d.ts +6 -1
- package/dist/lambda/runner-inspect.d.ts.map +1 -1
- package/dist/lambda/runner-inspect.js +15 -5
- package/dist/lambda/runner-jws.d.ts.map +1 -1
- package/dist/lambda/runner-jws.js +59 -6
- package/dist/lambda/runner-sources.d.ts +12 -0
- package/dist/lambda/runner-sources.d.ts.map +1 -1
- package/dist/lambda/runner-sources.js +28 -22
- package/dist/lambda/token-renew-handler.d.ts +3 -2
- package/dist/lambda/token-renew-handler.d.ts.map +1 -1
- package/dist/lambda/token-renew-handler.js +17 -5
- package/dist/templates/account-stack.json +2049 -0
- package/dist/templates/forwarder-stack.json +133 -0
- package/dist/utils/{runner-template.d.ts → account-template.d.ts} +69 -18
- package/dist/utils/account-template.d.ts.map +1 -0
- package/dist/utils/account-template.js +316 -0
- package/dist/utils/inspect-buildspec.d.ts +9 -0
- package/dist/utils/inspect-buildspec.d.ts.map +1 -0
- package/dist/utils/inspect-buildspec.js +209 -0
- package/package.json +5 -4
- package/dist/commands/setup-events.d.ts +0 -15
- package/dist/commands/setup-events.d.ts.map +0 -1
- package/dist/commands/setup-events.js +0 -182
- package/dist/commands/setup-runner.d.ts.map +0 -1
- package/dist/commands/setup-runner.js +0 -1132
- package/dist/templates/events-stack.json +0 -192
- package/dist/templates/runner-stack.json +0 -948
- package/dist/templates/token-renew-stack.json +0 -115
- package/dist/utils/cron.d.ts +0 -28
- package/dist/utils/cron.d.ts.map +0 -1
- package/dist/utils/cron.js +0 -119
- package/dist/utils/runner-template.d.ts.map +0 -1
- package/dist/utils/runner-template.js +0 -229
|
@@ -1,948 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"AWSTemplateFormatVersion": "2010-09-09",
|
|
3
|
-
"Description": "Pipeline Builder cross-account PIPELINE RUNNER — a Lambda that starts/stops this account's pipelines with its own role, on platform-signed requests POSTed to its Function URL (or an IP-allowlisted, WAF rate-limited API Gateway). The platform holds no AWS access to this account and the runner holds no platform credential. Deployed by pipeline-manager infra setup-runner, which also fills PipelineActions with one ARN per allowlisted region x prefix and keys the API deployment to the IP allowlist (utils/runner-template.ts). With EnableDeploy=true (setup-runner --enable-deploy) it also holds a deploy CodeBuild project the runner starts on a signed deploy request: it runs the pipeline's own managed cdk-synth image (pinned by digest) with a role that can only assume this account's CDK bootstrap roles, and the job's single-use platform grant travels KMS-encrypted, bound to its request (only the runner role encrypts, only the deploy role decrypts). Lambda code is uploaded separately.",
|
|
4
|
-
"Parameters": {
|
|
5
|
-
"RunnerId": {
|
|
6
|
-
"Type": "String",
|
|
7
|
-
"Description": "The runner's platform id (the aud every signed request must carry). Required: setup-runner registers the runner first and deploys with its id; there is no unbound runner.",
|
|
8
|
-
"MinLength": 1
|
|
9
|
-
},
|
|
10
|
-
"PlatformBaseUrl": {
|
|
11
|
-
"Type": "String",
|
|
12
|
-
"Description": "The platform's base URL (https). Signatures are verified against this runner's own key set, <PlatformBaseUrl>/api/pipelines/runner/runners/<RunnerId>/jwks.json (its owning organization's keys only)."
|
|
13
|
-
},
|
|
14
|
-
"EntryPoint": {
|
|
15
|
-
"Type": "String",
|
|
16
|
-
"Default": "function-url",
|
|
17
|
-
"AllowedValues": [
|
|
18
|
-
"function-url",
|
|
19
|
-
"api-gateway"
|
|
20
|
-
],
|
|
21
|
-
"Description": "A Lambda Function URL, or a REST API whose resource policy admits only AllowedIps."
|
|
22
|
-
},
|
|
23
|
-
"AllowedIps": {
|
|
24
|
-
"Type": "CommaDelimitedList",
|
|
25
|
-
"Default": "255.255.255.255/32",
|
|
26
|
-
"Description": "api-gateway entry point only: source CIDRs (the platform's egress IPs) the API admits."
|
|
27
|
-
},
|
|
28
|
-
"EnableWaf": {
|
|
29
|
-
"Type": "String",
|
|
30
|
-
"Default": "true",
|
|
31
|
-
"AllowedValues": [
|
|
32
|
-
"true",
|
|
33
|
-
"false"
|
|
34
|
-
],
|
|
35
|
-
"Description": "api-gateway entry point only: attach a WAFv2 web ACL with a per-IP rate-based rule to the API stage ('false' = setup-runner --no-waf). Ignored for the Function URL entry point."
|
|
36
|
-
},
|
|
37
|
-
"WafRateLimit": {
|
|
38
|
-
"Type": "Number",
|
|
39
|
-
"Default": 1000,
|
|
40
|
-
"MinValue": 10,
|
|
41
|
-
"MaxValue": 2000000000,
|
|
42
|
-
"Description": "api-gateway entry point with EnableWaf: requests one source IP may send in any 5-minute window before WAF blocks it (WAFv2 rate-based rule; setup-runner --waf-rate-limit)."
|
|
43
|
-
},
|
|
44
|
-
"AllowedRegions": {
|
|
45
|
-
"Type": "String",
|
|
46
|
-
"Description": "Comma-separated regions the runner may act in (customer-set; the platform cannot change it)."
|
|
47
|
-
},
|
|
48
|
-
"AllowedPipelinePrefixes": {
|
|
49
|
-
"Type": "String",
|
|
50
|
-
"Description": "Comma-separated CodePipeline name prefixes the runner may act on ('*' = every pipeline)."
|
|
51
|
-
},
|
|
52
|
-
"PipelinePrefix": {
|
|
53
|
-
"Type": "String",
|
|
54
|
-
"Default": "pipeline-builder-",
|
|
55
|
-
"Description": "Single-prefix fallback used only when this template is deployed as-is; setup-runner replaces the PipelineActions resources with every region x prefix."
|
|
56
|
-
},
|
|
57
|
-
"NameSuffix": {
|
|
58
|
-
"Type": "String",
|
|
59
|
-
"Default": "",
|
|
60
|
-
"Description": "Suffix on the role/function/API names: setup-runner passes '-<RunnerId>', so runners of different organizations never collide in one account (an organization has at most one runner per account)."
|
|
61
|
-
},
|
|
62
|
-
"PipelineManagerVersion": {
|
|
63
|
-
"Type": "String",
|
|
64
|
-
"Default": "0.0.0",
|
|
65
|
-
"Description": "The @pipeline-builder/pipeline-manager version whose runner bundle this stack runs (semver; reported as runnerVersion in every response and checked against the platform's MIN_RUNNER_VERSION). setup-runner always passes its own package version; 0.0.0 marks a hand-deployed stack as outdated."
|
|
66
|
-
},
|
|
67
|
-
"EnableDeploy": {
|
|
68
|
-
"Type": "String",
|
|
69
|
-
"Default": "false",
|
|
70
|
-
"AllowedValues": [
|
|
71
|
-
"true",
|
|
72
|
-
"false"
|
|
73
|
-
],
|
|
74
|
-
"Description": "Deploys through this runner (setup-runner --enable-deploy): the deploy CodeBuild project, its role, log group and grant key. The runner answers DEPLOY_NOT_ENABLED to a deploy request without it and reports the deploy:1 capability only with it."
|
|
75
|
-
},
|
|
76
|
-
"RegistryPullHost": {
|
|
77
|
-
"Type": "String",
|
|
78
|
-
"Default": "",
|
|
79
|
-
"AllowedPattern": "^$|^[A-Za-z0-9.-]+(:[0-9]{1,5})?$",
|
|
80
|
-
"Description": "EnableDeploy only: the platform registry host (and :port) the deploy build pulls the pipeline's system/cdk-synth image from, pinned by digest. Never taken from a request."
|
|
81
|
-
},
|
|
82
|
-
"RegistryCredentialSecretName": {
|
|
83
|
-
"Type": "String",
|
|
84
|
-
"Default": "",
|
|
85
|
-
"Description": "EnableDeploy only: the Secrets Manager secret (in the stack region) holding the registry:push key CodeBuild pulls the image with — pipeline-builder/<orgId>/registry-push (pipeline-manager infra store-token --scope registry:push)."
|
|
86
|
-
},
|
|
87
|
-
"CdkQualifier": {
|
|
88
|
-
"Type": "String",
|
|
89
|
-
"Default": "hnb659fds",
|
|
90
|
-
"AllowedPattern": "^[A-Za-z0-9]{1,10}$",
|
|
91
|
-
"Description": "EnableDeploy only: the CDK bootstrap qualifier of the regions deployed into (cdk-<qualifier>-*-role-<account>-<region> are the only roles the deploy job may assume)."
|
|
92
|
-
},
|
|
93
|
-
"DeployTimeoutMinutes": {
|
|
94
|
-
"Type": "Number",
|
|
95
|
-
"Default": 60,
|
|
96
|
-
"MinValue": 10,
|
|
97
|
-
"MaxValue": 120,
|
|
98
|
-
"Description": "EnableDeploy only: the deploy build's timeout (CodeBuild TimeoutInMinutes). At most 120: the platform's deploy deadline (RUNNER_DEPLOY_DEADLINE_MINUTES, default 120) cancels a longer deploy first, failing DEPLOY_TIMED_OUT."
|
|
99
|
-
},
|
|
100
|
-
"DeployConcurrency": {
|
|
101
|
-
"Type": "Number",
|
|
102
|
-
"Default": 2,
|
|
103
|
-
"MinValue": 1,
|
|
104
|
-
"MaxValue": 20,
|
|
105
|
-
"Description": "EnableDeploy only: deploy builds that may run at once (CodeBuild ConcurrentBuildLimit; the platform's MAX_ACTIVE_DEPLOYS_PER_RUNNER is the first limit)."
|
|
106
|
-
},
|
|
107
|
-
"DeployPermissionsBoundaryArn": {
|
|
108
|
-
"Type": "String",
|
|
109
|
-
"Default": "",
|
|
110
|
-
"Description": "EnableDeploy only: an IAM permissions boundary for the deploy role ('' = none)."
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"Conditions": {
|
|
114
|
-
"UseFunctionUrl": {
|
|
115
|
-
"Fn::Equals": [
|
|
116
|
-
{
|
|
117
|
-
"Ref": "EntryPoint"
|
|
118
|
-
},
|
|
119
|
-
"function-url"
|
|
120
|
-
]
|
|
121
|
-
},
|
|
122
|
-
"UseApiGateway": {
|
|
123
|
-
"Fn::Equals": [
|
|
124
|
-
{
|
|
125
|
-
"Ref": "EntryPoint"
|
|
126
|
-
},
|
|
127
|
-
"api-gateway"
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
"UseWaf": {
|
|
131
|
-
"Fn::And": [
|
|
132
|
-
{
|
|
133
|
-
"Condition": "UseApiGateway"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"Fn::Equals": [
|
|
137
|
-
{
|
|
138
|
-
"Ref": "EnableWaf"
|
|
139
|
-
},
|
|
140
|
-
"true"
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
"UseDeploy": {
|
|
146
|
-
"Fn::Equals": [
|
|
147
|
-
{
|
|
148
|
-
"Ref": "EnableDeploy"
|
|
149
|
-
},
|
|
150
|
-
"true"
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
"HasDeployPermissionsBoundary": {
|
|
154
|
-
"Fn::And": [
|
|
155
|
-
{
|
|
156
|
-
"Condition": "UseDeploy"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"Fn::Not": [
|
|
160
|
-
{
|
|
161
|
-
"Fn::Equals": [
|
|
162
|
-
{
|
|
163
|
-
"Ref": "DeployPermissionsBoundaryArn"
|
|
164
|
-
},
|
|
165
|
-
""
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"Resources": {
|
|
174
|
-
"RunnerRole": {
|
|
175
|
-
"Type": "AWS::IAM::Role",
|
|
176
|
-
"Properties": {
|
|
177
|
-
"RoleName": {
|
|
178
|
-
"Fn::Sub": "pipeline-builder-runner${NameSuffix}"
|
|
179
|
-
},
|
|
180
|
-
"AssumeRolePolicyDocument": {
|
|
181
|
-
"Version": "2012-10-17",
|
|
182
|
-
"Statement": [
|
|
183
|
-
{
|
|
184
|
-
"Effect": "Allow",
|
|
185
|
-
"Principal": {
|
|
186
|
-
"Service": "lambda.amazonaws.com"
|
|
187
|
-
},
|
|
188
|
-
"Action": "sts:AssumeRole"
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
"ManagedPolicyArns": [
|
|
193
|
-
{
|
|
194
|
-
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
"Policies": [
|
|
198
|
-
{
|
|
199
|
-
"PolicyName": "pipeline-runner",
|
|
200
|
-
"PolicyDocument": {
|
|
201
|
-
"Version": "2012-10-17",
|
|
202
|
-
"Statement": [
|
|
203
|
-
{
|
|
204
|
-
"Sid": "FindPipelineByTag",
|
|
205
|
-
"Effect": "Allow",
|
|
206
|
-
"Action": [
|
|
207
|
-
"tag:GetResources"
|
|
208
|
-
],
|
|
209
|
-
"Resource": "*"
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
"Sid": "PipelineActions",
|
|
213
|
-
"Effect": "Allow",
|
|
214
|
-
"Action": [
|
|
215
|
-
"codepipeline:StartPipelineExecution",
|
|
216
|
-
"codepipeline:StopPipelineExecution",
|
|
217
|
-
"codepipeline:GetPipelineExecution",
|
|
218
|
-
"codepipeline:ListTagsForResource"
|
|
219
|
-
],
|
|
220
|
-
"Resource": [
|
|
221
|
-
{
|
|
222
|
-
"Fn::Sub": "arn:${AWS::Partition}:codepipeline:${AWS::Region}:${AWS::AccountId}:${PipelinePrefix}*"
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"Sid": "ListSourceConnections",
|
|
228
|
-
"Effect": "Allow",
|
|
229
|
-
"Action": [
|
|
230
|
-
"codeconnections:ListConnections",
|
|
231
|
-
"codeconnections:ListHosts",
|
|
232
|
-
"codestar-connections:ListConnections",
|
|
233
|
-
"codestar-connections:ListHosts"
|
|
234
|
-
],
|
|
235
|
-
"Resource": "*"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
"Sid": "ReadSourceConnections",
|
|
239
|
-
"Effect": "Allow",
|
|
240
|
-
"Action": [
|
|
241
|
-
"codeconnections:GetConnection",
|
|
242
|
-
"codeconnections:GetHost",
|
|
243
|
-
"codestar-connections:GetConnection",
|
|
244
|
-
"codestar-connections:GetHost"
|
|
245
|
-
],
|
|
246
|
-
"Resource": [
|
|
247
|
-
{
|
|
248
|
-
"Fn::Sub": "arn:${AWS::Partition}:codeconnections:${AWS::Region}:${AWS::AccountId}:connection/*"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"Fn::Sub": "arn:${AWS::Partition}:codeconnections:${AWS::Region}:${AWS::AccountId}:host/*"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
"Fn::Sub": "arn:${AWS::Partition}:codestar-connections:${AWS::Region}:${AWS::AccountId}:connection/*"
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"Fn::Sub": "arn:${AWS::Partition}:codestar-connections:${AWS::Region}:${AWS::AccountId}:host/*"
|
|
258
|
-
}
|
|
259
|
-
]
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"Sid": "DescribeGitHubTokenSecrets",
|
|
263
|
-
"Effect": "Allow",
|
|
264
|
-
"Action": [
|
|
265
|
-
"secretsmanager:DescribeSecret"
|
|
266
|
-
],
|
|
267
|
-
"Resource": [
|
|
268
|
-
{
|
|
269
|
-
"Fn::Sub": "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:pipeline-builder/*/github-token*"
|
|
270
|
-
}
|
|
271
|
-
]
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"Sid": "ReadGitHubTokenSecrets",
|
|
275
|
-
"Effect": "Allow",
|
|
276
|
-
"Action": [
|
|
277
|
-
"secretsmanager:GetSecretValue"
|
|
278
|
-
],
|
|
279
|
-
"Resource": [
|
|
280
|
-
{
|
|
281
|
-
"Fn::Sub": "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:pipeline-builder/*/github-token*"
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"Fn::If": [
|
|
287
|
-
"UseDeploy",
|
|
288
|
-
{
|
|
289
|
-
"Sid": "DeployBuild",
|
|
290
|
-
"Effect": "Allow",
|
|
291
|
-
"Action": [
|
|
292
|
-
"codebuild:StartBuild",
|
|
293
|
-
"codebuild:BatchGetBuilds",
|
|
294
|
-
"codebuild:StopBuild",
|
|
295
|
-
"codebuild:ListBuildsForProject"
|
|
296
|
-
],
|
|
297
|
-
"Resource": [
|
|
298
|
-
{
|
|
299
|
-
"Fn::Sub": "arn:${AWS::Partition}:codebuild:${AWS::Region}:${AWS::AccountId}:project/pipeline-builder-runner-deploy-${RunnerId}"
|
|
300
|
-
}
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"Ref": "AWS::NoValue"
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
|
-
}
|
|
308
|
-
]
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
]
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
"RunnerFunction": {
|
|
315
|
-
"Type": "AWS::Lambda::Function",
|
|
316
|
-
"Properties": {
|
|
317
|
-
"FunctionName": {
|
|
318
|
-
"Fn::Sub": "pipeline-builder-runner${NameSuffix}"
|
|
319
|
-
},
|
|
320
|
-
"Runtime": "nodejs26.x",
|
|
321
|
-
"Handler": "index.handler",
|
|
322
|
-
"Code": {
|
|
323
|
-
"ZipFile": "exports.handler=async()=>({statusCode:500,body:JSON.stringify({errorCode:'RUNNER_ERROR'})})"
|
|
324
|
-
},
|
|
325
|
-
"Role": {
|
|
326
|
-
"Fn::GetAtt": [
|
|
327
|
-
"RunnerRole",
|
|
328
|
-
"Arn"
|
|
329
|
-
]
|
|
330
|
-
},
|
|
331
|
-
"Timeout": 30,
|
|
332
|
-
"MemorySize": 256,
|
|
333
|
-
"ReservedConcurrentExecutions": 2,
|
|
334
|
-
"Environment": {
|
|
335
|
-
"Variables": {
|
|
336
|
-
"RUNNER_ID": {
|
|
337
|
-
"Ref": "RunnerId"
|
|
338
|
-
},
|
|
339
|
-
"PLATFORM_BASE_URL": {
|
|
340
|
-
"Ref": "PlatformBaseUrl"
|
|
341
|
-
},
|
|
342
|
-
"ALLOWED_REGIONS": {
|
|
343
|
-
"Ref": "AllowedRegions"
|
|
344
|
-
},
|
|
345
|
-
"ALLOWED_PIPELINE_PREFIXES": {
|
|
346
|
-
"Ref": "AllowedPipelinePrefixes"
|
|
347
|
-
},
|
|
348
|
-
"RUNNER_VERSION": {
|
|
349
|
-
"Ref": "PipelineManagerVersion"
|
|
350
|
-
},
|
|
351
|
-
"DEPLOY_ENABLED": {
|
|
352
|
-
"Ref": "EnableDeploy"
|
|
353
|
-
},
|
|
354
|
-
"DEPLOY_PROJECT_NAME": {
|
|
355
|
-
"Fn::If": [
|
|
356
|
-
"UseDeploy",
|
|
357
|
-
{
|
|
358
|
-
"Fn::Sub": "pipeline-builder-runner-deploy-${RunnerId}"
|
|
359
|
-
},
|
|
360
|
-
""
|
|
361
|
-
]
|
|
362
|
-
},
|
|
363
|
-
"REGISTRY_PULL_HOST": {
|
|
364
|
-
"Ref": "RegistryPullHost"
|
|
365
|
-
},
|
|
366
|
-
"REGISTRY_CREDENTIAL_SECRET": {
|
|
367
|
-
"Ref": "RegistryCredentialSecretName"
|
|
368
|
-
},
|
|
369
|
-
"DEPLOY_GRANT_KEY_ARN": {
|
|
370
|
-
"Fn::If": [
|
|
371
|
-
"UseDeploy",
|
|
372
|
-
{
|
|
373
|
-
"Fn::GetAtt": [
|
|
374
|
-
"DeployGrantKey",
|
|
375
|
-
"Arn"
|
|
376
|
-
]
|
|
377
|
-
},
|
|
378
|
-
""
|
|
379
|
-
]
|
|
380
|
-
},
|
|
381
|
-
"NODE_ENV": "production"
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
"RunnerLogGroup": {
|
|
387
|
-
"Type": "AWS::Logs::LogGroup",
|
|
388
|
-
"Properties": {
|
|
389
|
-
"LogGroupName": {
|
|
390
|
-
"Fn::Sub": "/aws/lambda/pipeline-builder-runner${NameSuffix}"
|
|
391
|
-
},
|
|
392
|
-
"RetentionInDays": 90
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
"DeployLogGroup": {
|
|
396
|
-
"Type": "AWS::Logs::LogGroup",
|
|
397
|
-
"Condition": "UseDeploy",
|
|
398
|
-
"Properties": {
|
|
399
|
-
"LogGroupName": {
|
|
400
|
-
"Fn::Sub": "/aws/codebuild/pipeline-builder-runner-deploy-${RunnerId}"
|
|
401
|
-
},
|
|
402
|
-
"RetentionInDays": 90
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
"DeployRole": {
|
|
406
|
-
"Type": "AWS::IAM::Role",
|
|
407
|
-
"Condition": "UseDeploy",
|
|
408
|
-
"Properties": {
|
|
409
|
-
"RoleName": {
|
|
410
|
-
"Fn::Sub": "pb-runner-deploy${NameSuffix}"
|
|
411
|
-
},
|
|
412
|
-
"Description": "Pipeline Builder runner deploy job: assumes only this account's CDK bootstrap roles in the allowlisted regions (cdk deploy), never IAM or CloudFormation directly.",
|
|
413
|
-
"AssumeRolePolicyDocument": {
|
|
414
|
-
"Version": "2012-10-17",
|
|
415
|
-
"Statement": [
|
|
416
|
-
{
|
|
417
|
-
"Effect": "Allow",
|
|
418
|
-
"Principal": {
|
|
419
|
-
"Service": "codebuild.amazonaws.com"
|
|
420
|
-
},
|
|
421
|
-
"Action": "sts:AssumeRole",
|
|
422
|
-
"Condition": {
|
|
423
|
-
"StringEquals": {
|
|
424
|
-
"aws:SourceAccount": {
|
|
425
|
-
"Ref": "AWS::AccountId"
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
"ArnLike": {
|
|
429
|
-
"aws:SourceArn": {
|
|
430
|
-
"Fn::Sub": "arn:${AWS::Partition}:codebuild:${AWS::Region}:${AWS::AccountId}:project/pipeline-builder-runner-deploy-${RunnerId}"
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
]
|
|
436
|
-
},
|
|
437
|
-
"PermissionsBoundary": {
|
|
438
|
-
"Fn::If": [
|
|
439
|
-
"HasDeployPermissionsBoundary",
|
|
440
|
-
{
|
|
441
|
-
"Ref": "DeployPermissionsBoundaryArn"
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
"Ref": "AWS::NoValue"
|
|
445
|
-
}
|
|
446
|
-
]
|
|
447
|
-
},
|
|
448
|
-
"Policies": [
|
|
449
|
-
{
|
|
450
|
-
"PolicyName": "pipeline-runner-deploy",
|
|
451
|
-
"PolicyDocument": {
|
|
452
|
-
"Version": "2012-10-17",
|
|
453
|
-
"Statement": [
|
|
454
|
-
{
|
|
455
|
-
"Sid": "AssumeCdkBootstrapRoles",
|
|
456
|
-
"Effect": "Allow",
|
|
457
|
-
"Action": [
|
|
458
|
-
"sts:AssumeRole"
|
|
459
|
-
],
|
|
460
|
-
"Resource": [
|
|
461
|
-
{
|
|
462
|
-
"Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${CdkQualifier}-deploy-role-${AWS::AccountId}-${AWS::Region}"
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
"Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${CdkQualifier}-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
"Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${CdkQualifier}-image-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${CdkQualifier}-lookup-role-${AWS::AccountId}-${AWS::Region}"
|
|
472
|
-
}
|
|
473
|
-
]
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
"Sid": "ReadCdkBootstrapVersion",
|
|
477
|
-
"Effect": "Allow",
|
|
478
|
-
"Action": [
|
|
479
|
-
"ssm:GetParameter"
|
|
480
|
-
],
|
|
481
|
-
"Resource": [
|
|
482
|
-
{
|
|
483
|
-
"Fn::Sub": "arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/cdk-bootstrap/${CdkQualifier}/version"
|
|
484
|
-
}
|
|
485
|
-
]
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
"Sid": "DescribeAccountSecrets",
|
|
489
|
-
"Effect": "Allow",
|
|
490
|
-
"Action": [
|
|
491
|
-
"secretsmanager:DescribeSecret"
|
|
492
|
-
],
|
|
493
|
-
"Resource": [
|
|
494
|
-
{
|
|
495
|
-
"Fn::Sub": "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:pipeline-builder/*"
|
|
496
|
-
}
|
|
497
|
-
]
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
"Sid": "ReadRegistryPullCredential",
|
|
501
|
-
"Effect": "Allow",
|
|
502
|
-
"Action": [
|
|
503
|
-
"secretsmanager:GetSecretValue"
|
|
504
|
-
],
|
|
505
|
-
"Resource": [
|
|
506
|
-
{
|
|
507
|
-
"Fn::Sub": "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:${RegistryCredentialSecretName}-??????"
|
|
508
|
-
}
|
|
509
|
-
]
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
"Sid": "WriteDeployLogs",
|
|
513
|
-
"Effect": "Allow",
|
|
514
|
-
"Action": [
|
|
515
|
-
"logs:CreateLogStream",
|
|
516
|
-
"logs:PutLogEvents"
|
|
517
|
-
],
|
|
518
|
-
"Resource": [
|
|
519
|
-
{
|
|
520
|
-
"Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/pipeline-builder-runner-deploy-${RunnerId}:*"
|
|
521
|
-
}
|
|
522
|
-
]
|
|
523
|
-
}
|
|
524
|
-
]
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
]
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
"DeployGrantKey": {
|
|
531
|
-
"Type": "AWS::KMS::Key",
|
|
532
|
-
"Condition": "UseDeploy",
|
|
533
|
-
"Properties": {
|
|
534
|
-
"Description": {
|
|
535
|
-
"Fn::Sub": "Pipeline Builder runner ${RunnerId}: wraps each deploy job's single-use platform grant under {runnerId, purpose, requestId} (the runner role encrypts, the deploy role decrypts; a ciphertext decrypts for its own request only)."
|
|
536
|
-
},
|
|
537
|
-
"EnableKeyRotation": true,
|
|
538
|
-
"PendingWindowInDays": 7,
|
|
539
|
-
"KeyPolicy": {
|
|
540
|
-
"Version": "2012-10-17",
|
|
541
|
-
"Statement": [
|
|
542
|
-
{
|
|
543
|
-
"Sid": "KeyAdministration",
|
|
544
|
-
"Effect": "Allow",
|
|
545
|
-
"Principal": {
|
|
546
|
-
"AWS": {
|
|
547
|
-
"Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:root"
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
"Action": [
|
|
551
|
-
"kms:DescribeKey",
|
|
552
|
-
"kms:GetKeyPolicy",
|
|
553
|
-
"kms:GetKeyRotationStatus",
|
|
554
|
-
"kms:ListResourceTags",
|
|
555
|
-
"kms:PutKeyPolicy",
|
|
556
|
-
"kms:EnableKeyRotation",
|
|
557
|
-
"kms:DisableKeyRotation",
|
|
558
|
-
"kms:EnableKey",
|
|
559
|
-
"kms:DisableKey",
|
|
560
|
-
"kms:TagResource",
|
|
561
|
-
"kms:UntagResource",
|
|
562
|
-
"kms:UpdateKeyDescription",
|
|
563
|
-
"kms:ScheduleKeyDeletion",
|
|
564
|
-
"kms:CancelKeyDeletion"
|
|
565
|
-
],
|
|
566
|
-
"Resource": "*"
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
"Sid": "RunnerEncryptsGrants",
|
|
570
|
-
"Effect": "Allow",
|
|
571
|
-
"Principal": {
|
|
572
|
-
"AWS": {
|
|
573
|
-
"Fn::GetAtt": [
|
|
574
|
-
"RunnerRole",
|
|
575
|
-
"Arn"
|
|
576
|
-
]
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
"Action": "kms:Encrypt",
|
|
580
|
-
"Resource": "*",
|
|
581
|
-
"Condition": {
|
|
582
|
-
"StringEquals": {
|
|
583
|
-
"kms:EncryptionContext:runnerId": {
|
|
584
|
-
"Ref": "RunnerId"
|
|
585
|
-
},
|
|
586
|
-
"kms:EncryptionContext:purpose": "deploy-grant"
|
|
587
|
-
},
|
|
588
|
-
"Null": {
|
|
589
|
-
"kms:EncryptionContext:requestId": "false"
|
|
590
|
-
},
|
|
591
|
-
"ForAllValues:StringEquals": {
|
|
592
|
-
"kms:EncryptionContextKeys": [
|
|
593
|
-
"runnerId",
|
|
594
|
-
"purpose",
|
|
595
|
-
"requestId"
|
|
596
|
-
]
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
"Sid": "DeployJobDecryptsGrants",
|
|
602
|
-
"Effect": "Allow",
|
|
603
|
-
"Principal": {
|
|
604
|
-
"AWS": {
|
|
605
|
-
"Fn::GetAtt": [
|
|
606
|
-
"DeployRole",
|
|
607
|
-
"Arn"
|
|
608
|
-
]
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
"Action": "kms:Decrypt",
|
|
612
|
-
"Resource": "*",
|
|
613
|
-
"Condition": {
|
|
614
|
-
"StringEquals": {
|
|
615
|
-
"kms:EncryptionContext:runnerId": {
|
|
616
|
-
"Ref": "RunnerId"
|
|
617
|
-
},
|
|
618
|
-
"kms:EncryptionContext:purpose": "deploy-grant"
|
|
619
|
-
},
|
|
620
|
-
"Null": {
|
|
621
|
-
"kms:EncryptionContext:requestId": "false"
|
|
622
|
-
},
|
|
623
|
-
"ForAllValues:StringEquals": {
|
|
624
|
-
"kms:EncryptionContextKeys": [
|
|
625
|
-
"runnerId",
|
|
626
|
-
"purpose",
|
|
627
|
-
"requestId"
|
|
628
|
-
]
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
]
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
},
|
|
636
|
-
"DeployProject": {
|
|
637
|
-
"Type": "AWS::CodeBuild::Project",
|
|
638
|
-
"Condition": "UseDeploy",
|
|
639
|
-
"DependsOn": "DeployLogGroup",
|
|
640
|
-
"Properties": {
|
|
641
|
-
"Name": {
|
|
642
|
-
"Fn::Sub": "pipeline-builder-runner-deploy-${RunnerId}"
|
|
643
|
-
},
|
|
644
|
-
"Description": "Pipeline Builder runner deploy job: pipeline-manager pipeline deploy-job on the pipeline's managed cdk-synth image (StartBuild overrides only the image digest and the request's PB_* values).",
|
|
645
|
-
"ServiceRole": {
|
|
646
|
-
"Fn::GetAtt": [
|
|
647
|
-
"DeployRole",
|
|
648
|
-
"Arn"
|
|
649
|
-
]
|
|
650
|
-
},
|
|
651
|
-
"Source": {
|
|
652
|
-
"Type": "NO_SOURCE",
|
|
653
|
-
"BuildSpec": "version: 0.2\nenv:\n shell: bash\n exported-variables:\n - PB_DEPLOY_RESULT\n - PB_DEPLOY_STAGE\nphases:\n build:\n commands:\n - pipeline-manager pipeline deploy-job --result-file /tmp/pb-deploy-result.env\n post_build:\n commands:\n - 'export PB_DEPLOY_RESULT=\"$(grep -E ''^PB_DEPLOY_RESULT=[A-Z_]{1,64}$'' /tmp/pb-deploy-result.env 2>/dev/null | cut -d= -f2)\"'\n - 'export PB_DEPLOY_STAGE=\"$(grep -E ''^PB_DEPLOY_STAGE=[a-z_]{1,32}$'' /tmp/pb-deploy-result.env 2>/dev/null | cut -d= -f2)\"'\n"
|
|
654
|
-
},
|
|
655
|
-
"Artifacts": {
|
|
656
|
-
"Type": "NO_ARTIFACTS"
|
|
657
|
-
},
|
|
658
|
-
"Environment": {
|
|
659
|
-
"Type": "LINUX_CONTAINER",
|
|
660
|
-
"ComputeType": "BUILD_GENERAL1_MEDIUM",
|
|
661
|
-
"Image": {
|
|
662
|
-
"Fn::Sub": "${RegistryPullHost}/system/cdk-synth:set-per-build"
|
|
663
|
-
},
|
|
664
|
-
"ImagePullCredentialsType": "SERVICE_ROLE",
|
|
665
|
-
"RegistryCredential": {
|
|
666
|
-
"Credential": {
|
|
667
|
-
"Ref": "RegistryCredentialSecretName"
|
|
668
|
-
},
|
|
669
|
-
"CredentialProvider": "SECRETS_MANAGER"
|
|
670
|
-
},
|
|
671
|
-
"PrivilegedMode": false,
|
|
672
|
-
"EnvironmentVariables": [
|
|
673
|
-
{
|
|
674
|
-
"Name": "PLATFORM_BASE_URL",
|
|
675
|
-
"Type": "PLAINTEXT",
|
|
676
|
-
"Value": {
|
|
677
|
-
"Ref": "PlatformBaseUrl"
|
|
678
|
-
}
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
"Name": "PB_RUNNER_ID",
|
|
682
|
-
"Type": "PLAINTEXT",
|
|
683
|
-
"Value": {
|
|
684
|
-
"Ref": "RunnerId"
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
"Name": "PB_CDK_QUALIFIER",
|
|
689
|
-
"Type": "PLAINTEXT",
|
|
690
|
-
"Value": {
|
|
691
|
-
"Ref": "CdkQualifier"
|
|
692
|
-
}
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
"Name": "NODE_ENV",
|
|
696
|
-
"Type": "PLAINTEXT",
|
|
697
|
-
"Value": "production"
|
|
698
|
-
}
|
|
699
|
-
]
|
|
700
|
-
},
|
|
701
|
-
"TimeoutInMinutes": {
|
|
702
|
-
"Ref": "DeployTimeoutMinutes"
|
|
703
|
-
},
|
|
704
|
-
"QueuedTimeoutInMinutes": 30,
|
|
705
|
-
"ConcurrentBuildLimit": {
|
|
706
|
-
"Ref": "DeployConcurrency"
|
|
707
|
-
},
|
|
708
|
-
"LogsConfig": {
|
|
709
|
-
"CloudWatchLogs": {
|
|
710
|
-
"Status": "ENABLED",
|
|
711
|
-
"GroupName": {
|
|
712
|
-
"Fn::Sub": "/aws/codebuild/pipeline-builder-runner-deploy-${RunnerId}"
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
},
|
|
718
|
-
"FunctionUrl": {
|
|
719
|
-
"Type": "AWS::Lambda::Url",
|
|
720
|
-
"Condition": "UseFunctionUrl",
|
|
721
|
-
"Properties": {
|
|
722
|
-
"AuthType": "NONE",
|
|
723
|
-
"TargetFunctionArn": {
|
|
724
|
-
"Fn::GetAtt": [
|
|
725
|
-
"RunnerFunction",
|
|
726
|
-
"Arn"
|
|
727
|
-
]
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
},
|
|
731
|
-
"FunctionUrlPermission": {
|
|
732
|
-
"Type": "AWS::Lambda::Permission",
|
|
733
|
-
"Condition": "UseFunctionUrl",
|
|
734
|
-
"Properties": {
|
|
735
|
-
"FunctionName": {
|
|
736
|
-
"Ref": "RunnerFunction"
|
|
737
|
-
},
|
|
738
|
-
"Action": "lambda:InvokeFunctionUrl",
|
|
739
|
-
"Principal": "*",
|
|
740
|
-
"FunctionUrlAuthType": "NONE"
|
|
741
|
-
}
|
|
742
|
-
},
|
|
743
|
-
"FunctionUrlInvokePermission": {
|
|
744
|
-
"Type": "AWS::Lambda::Permission",
|
|
745
|
-
"Condition": "UseFunctionUrl",
|
|
746
|
-
"Properties": {
|
|
747
|
-
"FunctionName": {
|
|
748
|
-
"Ref": "RunnerFunction"
|
|
749
|
-
},
|
|
750
|
-
"Action": "lambda:InvokeFunction",
|
|
751
|
-
"Principal": "*",
|
|
752
|
-
"InvokedViaFunctionUrl": true
|
|
753
|
-
}
|
|
754
|
-
},
|
|
755
|
-
"RunnerApi": {
|
|
756
|
-
"Type": "AWS::ApiGateway::RestApi",
|
|
757
|
-
"Condition": "UseApiGateway",
|
|
758
|
-
"Properties": {
|
|
759
|
-
"Name": {
|
|
760
|
-
"Fn::Sub": "pipeline-builder-runner${NameSuffix}"
|
|
761
|
-
},
|
|
762
|
-
"Description": "Pipeline Builder runner entry point, admitting only the platform's egress IPs",
|
|
763
|
-
"EndpointConfiguration": {
|
|
764
|
-
"Types": [
|
|
765
|
-
"REGIONAL"
|
|
766
|
-
]
|
|
767
|
-
},
|
|
768
|
-
"Policy": {
|
|
769
|
-
"Version": "2012-10-17",
|
|
770
|
-
"Statement": [
|
|
771
|
-
{
|
|
772
|
-
"Effect": "Allow",
|
|
773
|
-
"Principal": "*",
|
|
774
|
-
"Action": "execute-api:Invoke",
|
|
775
|
-
"Resource": "execute-api:/*",
|
|
776
|
-
"Condition": {
|
|
777
|
-
"IpAddress": {
|
|
778
|
-
"aws:SourceIp": {
|
|
779
|
-
"Ref": "AllowedIps"
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
]
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
},
|
|
788
|
-
"RunnerApiMethod": {
|
|
789
|
-
"Type": "AWS::ApiGateway::Method",
|
|
790
|
-
"Condition": "UseApiGateway",
|
|
791
|
-
"Properties": {
|
|
792
|
-
"RestApiId": {
|
|
793
|
-
"Ref": "RunnerApi"
|
|
794
|
-
},
|
|
795
|
-
"ResourceId": {
|
|
796
|
-
"Fn::GetAtt": [
|
|
797
|
-
"RunnerApi",
|
|
798
|
-
"RootResourceId"
|
|
799
|
-
]
|
|
800
|
-
},
|
|
801
|
-
"HttpMethod": "POST",
|
|
802
|
-
"AuthorizationType": "NONE",
|
|
803
|
-
"Integration": {
|
|
804
|
-
"Type": "AWS_PROXY",
|
|
805
|
-
"IntegrationHttpMethod": "POST",
|
|
806
|
-
"Uri": {
|
|
807
|
-
"Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${RunnerFunction.Arn}/invocations"
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
},
|
|
812
|
-
"RunnerApiDeployment": {
|
|
813
|
-
"Type": "AWS::ApiGateway::Deployment",
|
|
814
|
-
"Condition": "UseApiGateway",
|
|
815
|
-
"DependsOn": "RunnerApiMethod",
|
|
816
|
-
"Properties": {
|
|
817
|
-
"RestApiId": {
|
|
818
|
-
"Ref": "RunnerApi"
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
},
|
|
822
|
-
"RunnerApiStage": {
|
|
823
|
-
"Type": "AWS::ApiGateway::Stage",
|
|
824
|
-
"Condition": "UseApiGateway",
|
|
825
|
-
"Properties": {
|
|
826
|
-
"RestApiId": {
|
|
827
|
-
"Ref": "RunnerApi"
|
|
828
|
-
},
|
|
829
|
-
"DeploymentId": {
|
|
830
|
-
"Ref": "RunnerApiDeployment"
|
|
831
|
-
},
|
|
832
|
-
"StageName": "runner",
|
|
833
|
-
"MethodSettings": [
|
|
834
|
-
{
|
|
835
|
-
"ResourcePath": "/*",
|
|
836
|
-
"HttpMethod": "*",
|
|
837
|
-
"ThrottlingRateLimit": 5,
|
|
838
|
-
"ThrottlingBurstLimit": 10
|
|
839
|
-
}
|
|
840
|
-
]
|
|
841
|
-
}
|
|
842
|
-
},
|
|
843
|
-
"RunnerApiPermission": {
|
|
844
|
-
"Type": "AWS::Lambda::Permission",
|
|
845
|
-
"Condition": "UseApiGateway",
|
|
846
|
-
"Properties": {
|
|
847
|
-
"FunctionName": {
|
|
848
|
-
"Ref": "RunnerFunction"
|
|
849
|
-
},
|
|
850
|
-
"Action": "lambda:InvokeFunction",
|
|
851
|
-
"Principal": "apigateway.amazonaws.com",
|
|
852
|
-
"SourceArn": {
|
|
853
|
-
"Fn::Sub": "arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${RunnerApi}/*/POST/"
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
|
-
"RunnerWebAcl": {
|
|
858
|
-
"Type": "AWS::WAFv2::WebACL",
|
|
859
|
-
"Condition": "UseWaf",
|
|
860
|
-
"Properties": {
|
|
861
|
-
"Name": {
|
|
862
|
-
"Fn::Sub": "pipeline-builder-runner${NameSuffix}"
|
|
863
|
-
},
|
|
864
|
-
"Description": "Pipeline Builder runner API: per-source-IP rate limit (in front of the resource-policy IP allowlist and the stage throttle)",
|
|
865
|
-
"Scope": "REGIONAL",
|
|
866
|
-
"DefaultAction": {
|
|
867
|
-
"Allow": {}
|
|
868
|
-
},
|
|
869
|
-
"Rules": [
|
|
870
|
-
{
|
|
871
|
-
"Name": "per-ip-rate-limit",
|
|
872
|
-
"Priority": 0,
|
|
873
|
-
"Action": {
|
|
874
|
-
"Block": {}
|
|
875
|
-
},
|
|
876
|
-
"Statement": {
|
|
877
|
-
"RateBasedStatement": {
|
|
878
|
-
"Limit": {
|
|
879
|
-
"Ref": "WafRateLimit"
|
|
880
|
-
},
|
|
881
|
-
"AggregateKeyType": "IP",
|
|
882
|
-
"EvaluationWindowSec": 300
|
|
883
|
-
}
|
|
884
|
-
},
|
|
885
|
-
"VisibilityConfig": {
|
|
886
|
-
"SampledRequestsEnabled": true,
|
|
887
|
-
"CloudWatchMetricsEnabled": true,
|
|
888
|
-
"MetricName": {
|
|
889
|
-
"Fn::Sub": "pipeline-builder-runner${NameSuffix}-rate-limit"
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
],
|
|
894
|
-
"VisibilityConfig": {
|
|
895
|
-
"SampledRequestsEnabled": true,
|
|
896
|
-
"CloudWatchMetricsEnabled": true,
|
|
897
|
-
"MetricName": {
|
|
898
|
-
"Fn::Sub": "pipeline-builder-runner${NameSuffix}"
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
},
|
|
903
|
-
"RunnerWebAclAssociation": {
|
|
904
|
-
"Type": "AWS::WAFv2::WebACLAssociation",
|
|
905
|
-
"Condition": "UseWaf",
|
|
906
|
-
"Properties": {
|
|
907
|
-
"ResourceArn": {
|
|
908
|
-
"Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}::/restapis/${RunnerApi}/stages/${RunnerApiStage}"
|
|
909
|
-
},
|
|
910
|
-
"WebACLArn": {
|
|
911
|
-
"Fn::GetAtt": [
|
|
912
|
-
"RunnerWebAcl",
|
|
913
|
-
"Arn"
|
|
914
|
-
]
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
},
|
|
919
|
-
"Outputs": {
|
|
920
|
-
"FunctionName": {
|
|
921
|
-
"Value": {
|
|
922
|
-
"Ref": "RunnerFunction"
|
|
923
|
-
}
|
|
924
|
-
},
|
|
925
|
-
"RunnerId": {
|
|
926
|
-
"Value": {
|
|
927
|
-
"Ref": "RunnerId"
|
|
928
|
-
}
|
|
929
|
-
},
|
|
930
|
-
"EndpointUrl": {
|
|
931
|
-
"Description": "Where the platform delivers run requests. Treat as a secret: never log it.",
|
|
932
|
-
"Value": {
|
|
933
|
-
"Fn::If": [
|
|
934
|
-
"UseFunctionUrl",
|
|
935
|
-
{
|
|
936
|
-
"Fn::GetAtt": [
|
|
937
|
-
"FunctionUrl",
|
|
938
|
-
"FunctionUrl"
|
|
939
|
-
]
|
|
940
|
-
},
|
|
941
|
-
{
|
|
942
|
-
"Fn::Sub": "https://${RunnerApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/runner/"
|
|
943
|
-
}
|
|
944
|
-
]
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}
|