@taimos/projen 0.1.78 → 0.1.80

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/API.md CHANGED
@@ -2,6 +2,322 @@
2
2
 
3
3
  ## Constructs <a name="Constructs" id="Constructs"></a>
4
4
 
5
+ ### GitHubAmplifyDeploy <a name="GitHubAmplifyDeploy" id="@taimos/projen.GitHubAmplifyDeploy"></a>
6
+
7
+ Adds one path-scoped deploy workflow per Amplify Hosting app.
8
+
9
+ Amplify's own auto-build fires on every push to a tracked branch. In a
10
+ monorepo that means every frontend rebuilds whenever anything changes — the
11
+ marketing site rebuilding for a backend-only commit and vice versa, once per
12
+ tracked branch. Amplify bills build minutes, so most of those are waste.
13
+
14
+ Amplify's native answer, `AMPLIFY_DIFF_DEPLOY`, diffs exactly one directory
15
+ (`AMPLIFY_MONOREPO_APP_ROOT`, overridable via `AMPLIFY_DIFF_DEPLOY_ROOT` —
16
+ still a single path). That is enough for a self-contained app but not for one
17
+ that also depends on a shared workspace package: a one-directory diff would
18
+ ship a stale frontend whenever the shared types changed. GitHub's `paths:`
19
+ filters accept multiple globs, so builds move to CI.
20
+
21
+ Each generated workflow resolves the pushed branch to its stage and account,
22
+ chains OIDC -> deployment role -> build-trigger role, reads the app id from
23
+ SSM, starts a `RELEASE` job and polls until it reaches a terminal state — so
24
+ a failed Amplify build fails the workflow instead of passing silently.
25
+
26
+ This component generates the CI half only. The infrastructure half belongs in
27
+ the project's own CDK app, which must:
28
+
29
+ 1. set `autoBuild: false` on every branch these workflows build,
30
+ 2. publish each app's id to `<parameterPrefix>/<key>/app-id`, and
31
+ 3. create a role named `buildTriggerRoleName` in each stage account,
32
+ trusted by `deploymentRoleArn` and granting `amplify:StartJob` +
33
+ `amplify:GetJob` on the tracked branch ARNs only.
34
+
35
+ Use `buildTriggerRoleName` and `appIdParameterName()` from the projenrc to
36
+ keep those names in step; a mismatch fails the workflow loudly at the
37
+ assume-role or parameter-read step rather than skipping a deploy.
38
+
39
+ #### Initializers <a name="Initializers" id="@taimos/projen.GitHubAmplifyDeploy.Initializer"></a>
40
+
41
+ ```typescript
42
+ import { GitHubAmplifyDeploy } from '@taimos/projen'
43
+
44
+ new GitHubAmplifyDeploy(scope: GitHubProject, options: GitHubAmplifyDeployOptions)
45
+ ```
46
+
47
+ | **Name** | **Type** | **Description** |
48
+ | --- | --- | --- |
49
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.Initializer.parameter.scope">scope</a></code> | <code>projen.github.GitHubProject</code> | *No description.* |
50
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.Initializer.parameter.options">options</a></code> | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions">GitHubAmplifyDeployOptions</a></code> | *No description.* |
51
+
52
+ ---
53
+
54
+ ##### `scope`<sup>Required</sup> <a name="scope" id="@taimos/projen.GitHubAmplifyDeploy.Initializer.parameter.scope"></a>
55
+
56
+ - *Type:* projen.github.GitHubProject
57
+
58
+ ---
59
+
60
+ ##### `options`<sup>Required</sup> <a name="options" id="@taimos/projen.GitHubAmplifyDeploy.Initializer.parameter.options"></a>
61
+
62
+ - *Type:* <a href="#@taimos/projen.GitHubAmplifyDeployOptions">GitHubAmplifyDeployOptions</a>
63
+
64
+ ---
65
+
66
+ #### Methods <a name="Methods" id="Methods"></a>
67
+
68
+ | **Name** | **Description** |
69
+ | --- | --- |
70
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.toString">toString</a></code> | Returns a string representation of this construct. |
71
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.with">with</a></code> | Applies one or more mixins to this construct. |
72
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.postProjectCreation">postProjectCreation</a></code> | Called once, right after `postSynthesize()`, only when the project is created for the first time. |
73
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.postSynthesize">postSynthesize</a></code> | Called after synthesis. |
74
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.preSynthesize">preSynthesize</a></code> | Called before synthesis. |
75
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.projectCreation">projectCreation</a></code> | Called once, right after `synthesize()`, only when the project is created for the first time. |
76
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.synthesize">synthesize</a></code> | Synthesizes files to the project output directory. |
77
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.appIdParameterName">appIdParameterName</a></code> | The SSM parameter path holding an app's Amplify app id. |
78
+
79
+ ---
80
+
81
+ ##### `toString` <a name="toString" id="@taimos/projen.GitHubAmplifyDeploy.toString"></a>
82
+
83
+ ```typescript
84
+ public toString(): string
85
+ ```
86
+
87
+ Returns a string representation of this construct.
88
+
89
+ ##### `with` <a name="with" id="@taimos/projen.GitHubAmplifyDeploy.with"></a>
90
+
91
+ ```typescript
92
+ public with(mixins: ...IMixin[]): IConstruct
93
+ ```
94
+
95
+ Applies one or more mixins to this construct.
96
+
97
+ Mixins are applied in order. The list of constructs is captured at the
98
+ start of the call, so constructs added by a mixin will not be visited.
99
+ Use multiple `with()` calls if subsequent mixins should apply to added
100
+ constructs.
101
+
102
+ ###### `mixins`<sup>Required</sup> <a name="mixins" id="@taimos/projen.GitHubAmplifyDeploy.with.parameter.mixins"></a>
103
+
104
+ - *Type:* ...constructs.IMixin[]
105
+
106
+ The mixins to apply.
107
+
108
+ ---
109
+
110
+ ##### `postProjectCreation` <a name="postProjectCreation" id="@taimos/projen.GitHubAmplifyDeploy.postProjectCreation"></a>
111
+
112
+ ```typescript
113
+ public postProjectCreation(initProject: InitProject): void
114
+ ```
115
+
116
+ Called once, right after `postSynthesize()`, only when the project is created for the first time.
117
+
118
+ It does not run on later `projen` invocations. It only fires for `projen new` (or `Projects.createProject`).
119
+ It is also skipped when post-synthesis steps are disabled, e.g. `--no-post` or `PROJEN_DISABLE_POST`.
120
+ Use it for one-off setup that can be turned off by the user, like running a task to give the user immediate
121
+ feedback on their new project. Order across components is not guaranteed.
122
+
123
+ ###### `initProject`<sup>Required</sup> <a name="initProject" id="@taimos/projen.GitHubAmplifyDeploy.postProjectCreation.parameter.initProject"></a>
124
+
125
+ - *Type:* projen.InitProject
126
+
127
+ Details about how the project was created, e.g. its type and the original CLI args.
128
+
129
+ ---
130
+
131
+ ##### `postSynthesize` <a name="postSynthesize" id="@taimos/projen.GitHubAmplifyDeploy.postSynthesize"></a>
132
+
133
+ ```typescript
134
+ public postSynthesize(): void
135
+ ```
136
+
137
+ Called after synthesis.
138
+
139
+ Order is *not* guaranteed.
140
+
141
+ ##### `preSynthesize` <a name="preSynthesize" id="@taimos/projen.GitHubAmplifyDeploy.preSynthesize"></a>
142
+
143
+ ```typescript
144
+ public preSynthesize(): void
145
+ ```
146
+
147
+ Called before synthesis.
148
+
149
+ ##### `projectCreation` <a name="projectCreation" id="@taimos/projen.GitHubAmplifyDeploy.projectCreation"></a>
150
+
151
+ ```typescript
152
+ public projectCreation(initProject: InitProject): void
153
+ ```
154
+
155
+ Called once, right after `synthesize()`, only when the project is created for the first time.
156
+
157
+ It does not run on later `projen` invocations. It only fires for `projen new` (or `Projects.createProject`).
158
+ Use it for deterministic, one-off file generation. Order across components is not guaranteed.
159
+
160
+ ###### `initProject`<sup>Required</sup> <a name="initProject" id="@taimos/projen.GitHubAmplifyDeploy.projectCreation.parameter.initProject"></a>
161
+
162
+ - *Type:* projen.InitProject
163
+
164
+ Details about how the project was created, e.g. its type and the original CLI args.
165
+
166
+ ---
167
+
168
+ ##### `synthesize` <a name="synthesize" id="@taimos/projen.GitHubAmplifyDeploy.synthesize"></a>
169
+
170
+ ```typescript
171
+ public synthesize(): void
172
+ ```
173
+
174
+ Synthesizes files to the project output directory.
175
+
176
+ ##### `appIdParameterName` <a name="appIdParameterName" id="@taimos/projen.GitHubAmplifyDeploy.appIdParameterName"></a>
177
+
178
+ ```typescript
179
+ public appIdParameterName(key: string): string
180
+ ```
181
+
182
+ The SSM parameter path holding an app's Amplify app id.
183
+
184
+ The CDK side must
185
+ publish the id under exactly this name.
186
+
187
+ ###### `key`<sup>Required</sup> <a name="key" id="@taimos/projen.GitHubAmplifyDeploy.appIdParameterName.parameter.key"></a>
188
+
189
+ - *Type:* string
190
+
191
+ ---
192
+
193
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
194
+
195
+ | **Name** | **Description** |
196
+ | --- | --- |
197
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
198
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.isComponent">isComponent</a></code> | Test whether the given construct is a component. |
199
+
200
+ ---
201
+
202
+ ##### `isConstruct` <a name="isConstruct" id="@taimos/projen.GitHubAmplifyDeploy.isConstruct"></a>
203
+
204
+ ```typescript
205
+ import { GitHubAmplifyDeploy } from '@taimos/projen'
206
+
207
+ GitHubAmplifyDeploy.isConstruct(x: any)
208
+ ```
209
+
210
+ Checks if `x` is a construct.
211
+
212
+ Use this method instead of `instanceof` to properly detect `Construct`
213
+ instances, even when the construct library is symlinked.
214
+
215
+ Explanation: in JavaScript, multiple copies of the `constructs` library on
216
+ disk are seen as independent, completely different libraries. As a
217
+ consequence, the class `Construct` in each copy of the `constructs` library
218
+ is seen as a different class, and an instance of one class will not test as
219
+ `instanceof` the other class. `npm install` will not create installations
220
+ like this, but users may manually symlink construct libraries together or
221
+ use a monorepo tool: in those cases, multiple copies of the `constructs`
222
+ library can be accidentally installed, and `instanceof` will behave
223
+ unpredictably. It is safest to avoid using `instanceof`, and using
224
+ this type-testing method instead.
225
+
226
+ ###### `x`<sup>Required</sup> <a name="x" id="@taimos/projen.GitHubAmplifyDeploy.isConstruct.parameter.x"></a>
227
+
228
+ - *Type:* any
229
+
230
+ Any object.
231
+
232
+ ---
233
+
234
+ ##### `isComponent` <a name="isComponent" id="@taimos/projen.GitHubAmplifyDeploy.isComponent"></a>
235
+
236
+ ```typescript
237
+ import { GitHubAmplifyDeploy } from '@taimos/projen'
238
+
239
+ GitHubAmplifyDeploy.isComponent(x: any)
240
+ ```
241
+
242
+ Test whether the given construct is a component.
243
+
244
+ ###### `x`<sup>Required</sup> <a name="x" id="@taimos/projen.GitHubAmplifyDeploy.isComponent.parameter.x"></a>
245
+
246
+ - *Type:* any
247
+
248
+ ---
249
+
250
+ #### Properties <a name="Properties" id="Properties"></a>
251
+
252
+ | **Name** | **Type** | **Description** |
253
+ | --- | --- | --- |
254
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
255
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.property.project">project</a></code> | <code>projen.Project</code> | *No description.* |
256
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.property.buildTriggerRoleName">buildTriggerRoleName</a></code> | <code>string</code> | Name of the IAM role CI chains into, in every stage account. |
257
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.property.parameterPrefix">parameterPrefix</a></code> | <code>string</code> | Prefix of the SSM parameter path holding each app's Amplify app id. |
258
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeploy.property.workflows">workflows</a></code> | <code>projen.github.GithubWorkflow[]</code> | The generated deploy workflows, one per app. |
259
+
260
+ ---
261
+
262
+ ##### `node`<sup>Required</sup> <a name="node" id="@taimos/projen.GitHubAmplifyDeploy.property.node"></a>
263
+
264
+ ```typescript
265
+ public readonly node: Node;
266
+ ```
267
+
268
+ - *Type:* constructs.Node
269
+
270
+ The tree node.
271
+
272
+ ---
273
+
274
+ ##### `project`<sup>Required</sup> <a name="project" id="@taimos/projen.GitHubAmplifyDeploy.property.project"></a>
275
+
276
+ ```typescript
277
+ public readonly project: Project;
278
+ ```
279
+
280
+ - *Type:* projen.Project
281
+
282
+ ---
283
+
284
+ ##### `buildTriggerRoleName`<sup>Required</sup> <a name="buildTriggerRoleName" id="@taimos/projen.GitHubAmplifyDeploy.property.buildTriggerRoleName"></a>
285
+
286
+ ```typescript
287
+ public readonly buildTriggerRoleName: string;
288
+ ```
289
+
290
+ - *Type:* string
291
+
292
+ Name of the IAM role CI chains into, in every stage account.
293
+
294
+ ---
295
+
296
+ ##### `parameterPrefix`<sup>Required</sup> <a name="parameterPrefix" id="@taimos/projen.GitHubAmplifyDeploy.property.parameterPrefix"></a>
297
+
298
+ ```typescript
299
+ public readonly parameterPrefix: string;
300
+ ```
301
+
302
+ - *Type:* string
303
+
304
+ Prefix of the SSM parameter path holding each app's Amplify app id.
305
+
306
+ ---
307
+
308
+ ##### `workflows`<sup>Required</sup> <a name="workflows" id="@taimos/projen.GitHubAmplifyDeploy.property.workflows"></a>
309
+
310
+ ```typescript
311
+ public readonly workflows: GithubWorkflow[];
312
+ ```
313
+
314
+ - *Type:* projen.github.GithubWorkflow[]
315
+
316
+ The generated deploy workflows, one per app.
317
+
318
+ ---
319
+
320
+
5
321
  ### GitHubProductionRelease <a name="GitHubProductionRelease" id="@taimos/projen.GitHubProductionRelease"></a>
6
322
 
7
323
  Adds a manual "Production Release" workflow that promotes a branch into a production branch.
@@ -921,6 +1237,7 @@ When given a project, this it the project itself.
921
1237
  | <code><a href="#@taimos/projen.MonorepoProject.property.defaultReleaseBranch">defaultReleaseBranch</a></code> | <code>string</code> | The default release branch (promoted by the production release workflow). |
922
1238
  | <code><a href="#@taimos/projen.MonorepoProject.property.prBuildWorkflow">prBuildWorkflow</a></code> | <code>projen.github.GithubWorkflow</code> | The unified PR build workflow. |
923
1239
  | <code><a href="#@taimos/projen.MonorepoProject.property.workspaceFile">workspaceFile</a></code> | <code>projen.YamlFile</code> | The generated `pnpm-workspace.yaml`. |
1240
+ | <code><a href="#@taimos/projen.MonorepoProject.property.amplifyDeploy">amplifyDeploy</a></code> | <code><a href="#@taimos/projen.GitHubAmplifyDeploy">GitHubAmplifyDeploy</a></code> | The Amplify deploy workflows, when `amplifyDeployOptions` is set. |
924
1241
  | <code><a href="#@taimos/projen.MonorepoProject.property.amplifyFile">amplifyFile</a></code> | <code>projen.YamlFile</code> | The generated `amplify.yml`, if any Amplify apps were configured. |
925
1242
  | <code><a href="#@taimos/projen.MonorepoProject.property.assignApprover">assignApprover</a></code> | <code>projen-pipelines.GitHubAssignApprover</code> | The PR approver assignment, if enabled. |
926
1243
  | <code><a href="#@taimos/projen.MonorepoProject.property.productionRelease">productionRelease</a></code> | <code><a href="#@taimos/projen.GitHubProductionRelease">GitHubProductionRelease</a></code> | The production release workflow, if enabled. |
@@ -1660,6 +1977,18 @@ The generated `pnpm-workspace.yaml`.
1660
1977
 
1661
1978
  ---
1662
1979
 
1980
+ ##### `amplifyDeploy`<sup>Optional</sup> <a name="amplifyDeploy" id="@taimos/projen.MonorepoProject.property.amplifyDeploy"></a>
1981
+
1982
+ ```typescript
1983
+ public readonly amplifyDeploy: GitHubAmplifyDeploy;
1984
+ ```
1985
+
1986
+ - *Type:* <a href="#@taimos/projen.GitHubAmplifyDeploy">GitHubAmplifyDeploy</a>
1987
+
1988
+ The Amplify deploy workflows, when `amplifyDeployOptions` is set.
1989
+
1990
+ ---
1991
+
1663
1992
  ##### `amplifyFile`<sup>Optional</sup> <a name="amplifyFile" id="@taimos/projen.MonorepoProject.property.amplifyFile"></a>
1664
1993
 
1665
1994
  ```typescript
@@ -10316,6 +10645,321 @@ public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
10316
10645
 
10317
10646
  ## Structs <a name="Structs" id="Structs"></a>
10318
10647
 
10648
+ ### AmplifyDeployApp <a name="AmplifyDeployApp" id="@taimos/projen.AmplifyDeployApp"></a>
10649
+
10650
+ One Amplify Hosting application whose builds CI drives.
10651
+
10652
+ Mirrors a `MonorepoAmplifyApp` entry in the generated `amplify.yml`; the
10653
+ `appRoot` should match so a build is triggered by exactly the directory it is
10654
+ built from.
10655
+
10656
+ #### Initializer <a name="Initializer" id="@taimos/projen.AmplifyDeployApp.Initializer"></a>
10657
+
10658
+ ```typescript
10659
+ import { AmplifyDeployApp } from '@taimos/projen'
10660
+
10661
+ const amplifyDeployApp: AmplifyDeployApp = { ... }
10662
+ ```
10663
+
10664
+ #### Properties <a name="Properties" id="Properties"></a>
10665
+
10666
+ | **Name** | **Type** | **Description** |
10667
+ | --- | --- | --- |
10668
+ | <code><a href="#@taimos/projen.AmplifyDeployApp.property.appRoot">appRoot</a></code> | <code>string</code> | The package path that is the Amplify app root, e.g. `packages/frontend`. `<appRoot>/**` becomes a push trigger path. |
10669
+ | <code><a href="#@taimos/projen.AmplifyDeployApp.property.key">key</a></code> | <code>string</code> | Short key identifying the app. Used in the app-id SSM parameter path and, by default, in the workflow name. |
10670
+ | <code><a href="#@taimos/projen.AmplifyDeployApp.property.dependencyPaths">dependencyPaths</a></code> | <code>string[]</code> | Extra path globs that affect this app's build output. |
10671
+ | <code><a href="#@taimos/projen.AmplifyDeployApp.property.label">label</a></code> | <code>string</code> | Human-readable name used in step names and log lines. |
10672
+ | <code><a href="#@taimos/projen.AmplifyDeployApp.property.workflowName">workflowName</a></code> | <code>string</code> | The generated workflow name, which is also its `.yml` file name. |
10673
+
10674
+ ---
10675
+
10676
+ ##### `appRoot`<sup>Required</sup> <a name="appRoot" id="@taimos/projen.AmplifyDeployApp.property.appRoot"></a>
10677
+
10678
+ ```typescript
10679
+ public readonly appRoot: string;
10680
+ ```
10681
+
10682
+ - *Type:* string
10683
+
10684
+ The package path that is the Amplify app root, e.g. `packages/frontend`. `<appRoot>/**` becomes a push trigger path.
10685
+
10686
+ ---
10687
+
10688
+ ##### `key`<sup>Required</sup> <a name="key" id="@taimos/projen.AmplifyDeployApp.property.key"></a>
10689
+
10690
+ ```typescript
10691
+ public readonly key: string;
10692
+ ```
10693
+
10694
+ - *Type:* string
10695
+
10696
+ Short key identifying the app. Used in the app-id SSM parameter path and, by default, in the workflow name.
10697
+
10698
+ Must match the key the CDK side registers the app under.
10699
+
10700
+ ---
10701
+
10702
+ ##### `dependencyPaths`<sup>Optional</sup> <a name="dependencyPaths" id="@taimos/projen.AmplifyDeployApp.property.dependencyPaths"></a>
10703
+
10704
+ ```typescript
10705
+ public readonly dependencyPaths: string[];
10706
+ ```
10707
+
10708
+ - *Type:* string[]
10709
+ - *Default:* []
10710
+
10711
+ Extra path globs that affect this app's build output.
10712
+
10713
+ Set this for workspace packages the app consumes via `workspace:*` and that
10714
+ the build spec pre-builds — a shared API package, say. Without them a change
10715
+ to shared types would not rebuild the app and it would ship stale.
10716
+
10717
+ ---
10718
+
10719
+ ##### `label`<sup>Optional</sup> <a name="label" id="@taimos/projen.AmplifyDeployApp.property.label"></a>
10720
+
10721
+ ```typescript
10722
+ public readonly label: string;
10723
+ ```
10724
+
10725
+ - *Type:* string
10726
+ - *Default:* the `key`
10727
+
10728
+ Human-readable name used in step names and log lines.
10729
+
10730
+ ---
10731
+
10732
+ ##### `workflowName`<sup>Optional</sup> <a name="workflowName" id="@taimos/projen.AmplifyDeployApp.property.workflowName"></a>
10733
+
10734
+ ```typescript
10735
+ public readonly workflowName: string;
10736
+ ```
10737
+
10738
+ - *Type:* string
10739
+ - *Default:* `<key>-deploy`
10740
+
10741
+ The generated workflow name, which is also its `.yml` file name.
10742
+
10743
+ ---
10744
+
10745
+ ### AmplifyDeployStage <a name="AmplifyDeployStage" id="@taimos/projen.AmplifyDeployStage"></a>
10746
+
10747
+ One deploy stage: a git branch, the logical stage it serves, and the AWS account its Amplify apps live in.
10748
+
10749
+ Both shapes seen in practice are expressible: separate accounts per stage
10750
+ (each entry has its own `account`), or a single account serving several
10751
+ branches (every entry repeats the same `account`, and the branch alone
10752
+ selects which Amplify branch is built).
10753
+
10754
+ #### Initializer <a name="Initializer" id="@taimos/projen.AmplifyDeployStage.Initializer"></a>
10755
+
10756
+ ```typescript
10757
+ import { AmplifyDeployStage } from '@taimos/projen'
10758
+
10759
+ const amplifyDeployStage: AmplifyDeployStage = { ... }
10760
+ ```
10761
+
10762
+ #### Properties <a name="Properties" id="Properties"></a>
10763
+
10764
+ | **Name** | **Type** | **Description** |
10765
+ | --- | --- | --- |
10766
+ | <code><a href="#@taimos/projen.AmplifyDeployStage.property.account">account</a></code> | <code>string</code> | The AWS account hosting this stage's Amplify apps. |
10767
+ | <code><a href="#@taimos/projen.AmplifyDeployStage.property.branch">branch</a></code> | <code>string</code> | The git branch the Amplify apps build from, e.g. `main` or `production`. |
10768
+ | <code><a href="#@taimos/projen.AmplifyDeployStage.property.stageName">stageName</a></code> | <code>string</code> | The logical stage this branch serves, e.g. `dev` or `prod`. Used as the GitHub environment so protection rules apply per stage. |
10769
+
10770
+ ---
10771
+
10772
+ ##### `account`<sup>Required</sup> <a name="account" id="@taimos/projen.AmplifyDeployStage.property.account"></a>
10773
+
10774
+ ```typescript
10775
+ public readonly account: string;
10776
+ ```
10777
+
10778
+ - *Type:* string
10779
+
10780
+ The AWS account hosting this stage's Amplify apps.
10781
+
10782
+ ---
10783
+
10784
+ ##### `branch`<sup>Required</sup> <a name="branch" id="@taimos/projen.AmplifyDeployStage.property.branch"></a>
10785
+
10786
+ ```typescript
10787
+ public readonly branch: string;
10788
+ ```
10789
+
10790
+ - *Type:* string
10791
+
10792
+ The git branch the Amplify apps build from, e.g. `main` or `production`.
10793
+
10794
+ ---
10795
+
10796
+ ##### `stageName`<sup>Required</sup> <a name="stageName" id="@taimos/projen.AmplifyDeployStage.property.stageName"></a>
10797
+
10798
+ ```typescript
10799
+ public readonly stageName: string;
10800
+ ```
10801
+
10802
+ - *Type:* string
10803
+
10804
+ The logical stage this branch serves, e.g. `dev` or `prod`. Used as the GitHub environment so protection rules apply per stage.
10805
+
10806
+ ---
10807
+
10808
+ ### GitHubAmplifyDeployOptions <a name="GitHubAmplifyDeployOptions" id="@taimos/projen.GitHubAmplifyDeployOptions"></a>
10809
+
10810
+ #### Initializer <a name="Initializer" id="@taimos/projen.GitHubAmplifyDeployOptions.Initializer"></a>
10811
+
10812
+ ```typescript
10813
+ import { GitHubAmplifyDeployOptions } from '@taimos/projen'
10814
+
10815
+ const gitHubAmplifyDeployOptions: GitHubAmplifyDeployOptions = { ... }
10816
+ ```
10817
+
10818
+ #### Properties <a name="Properties" id="Properties"></a>
10819
+
10820
+ | **Name** | **Type** | **Description** |
10821
+ | --- | --- | --- |
10822
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.apps">apps</a></code> | <code><a href="#@taimos/projen.AmplifyDeployApp">AmplifyDeployApp</a>[]</code> | The Amplify apps to generate deploy workflows for. |
10823
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.deploymentRoleArn">deploymentRoleArn</a></code> | <code>string</code> | The GitHub OIDC deployment role every workflow assumes first, typically in a management account. |
10824
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.stages">stages</a></code> | <code><a href="#@taimos/projen.AmplifyDeployStage">AmplifyDeployStage</a>[]</code> | The branches that deploy, and the account each one deploys into. |
10825
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.buildTriggerRoleName">buildTriggerRoleName</a></code> | <code>string</code> | Name of the per-account IAM role CI chains into to start builds. |
10826
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.parameterPrefix">parameterPrefix</a></code> | <code>string</code> | Prefix of the SSM parameter path holding each app's Amplify app id. The full path is `<prefix>/<app key>/app-id`. |
10827
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.region">region</a></code> | <code>string</code> | The AWS region the Amplify apps live in. |
10828
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.runnerTags">runnerTags</a></code> | <code>string[]</code> | The runner tags used to select the runner. |
10829
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.sharedBuildPaths">sharedBuildPaths</a></code> | <code>string[]</code> | Paths that change what *every* Amplify build produces, added to each app's own paths. |
10830
+ | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions.property.timeoutMinutes">timeoutMinutes</a></code> | <code>number</code> | Timeout for a deploy job, bounding a hung Amplify build. |
10831
+
10832
+ ---
10833
+
10834
+ ##### `apps`<sup>Required</sup> <a name="apps" id="@taimos/projen.GitHubAmplifyDeployOptions.property.apps"></a>
10835
+
10836
+ ```typescript
10837
+ public readonly apps: AmplifyDeployApp[];
10838
+ ```
10839
+
10840
+ - *Type:* <a href="#@taimos/projen.AmplifyDeployApp">AmplifyDeployApp</a>[]
10841
+
10842
+ The Amplify apps to generate deploy workflows for.
10843
+
10844
+ At least one.
10845
+
10846
+ ---
10847
+
10848
+ ##### `deploymentRoleArn`<sup>Required</sup> <a name="deploymentRoleArn" id="@taimos/projen.GitHubAmplifyDeployOptions.property.deploymentRoleArn"></a>
10849
+
10850
+ ```typescript
10851
+ public readonly deploymentRoleArn: string;
10852
+ ```
10853
+
10854
+ - *Type:* string
10855
+
10856
+ The GitHub OIDC deployment role every workflow assumes first, typically in a management account.
10857
+
10858
+ The per-stage build-trigger role is reached from it
10859
+ by role chaining, so it must be allowed to `sts:AssumeRole` on that role —
10860
+ an IAM grant that lives outside the generated code.
10861
+
10862
+ ---
10863
+
10864
+ ##### `stages`<sup>Required</sup> <a name="stages" id="@taimos/projen.GitHubAmplifyDeployOptions.property.stages"></a>
10865
+
10866
+ ```typescript
10867
+ public readonly stages: AmplifyDeployStage[];
10868
+ ```
10869
+
10870
+ - *Type:* <a href="#@taimos/projen.AmplifyDeployStage">AmplifyDeployStage</a>[]
10871
+
10872
+ The branches that deploy, and the account each one deploys into.
10873
+
10874
+ At least one.
10875
+
10876
+ ---
10877
+
10878
+ ##### `buildTriggerRoleName`<sup>Optional</sup> <a name="buildTriggerRoleName" id="@taimos/projen.GitHubAmplifyDeployOptions.property.buildTriggerRoleName"></a>
10879
+
10880
+ ```typescript
10881
+ public readonly buildTriggerRoleName: string;
10882
+ ```
10883
+
10884
+ - *Type:* string
10885
+ - *Default:* `<project name>-amplify-build-trigger`
10886
+
10887
+ Name of the per-account IAM role CI chains into to start builds.
10888
+
10889
+ The same name is expected in every stage account, so the workflow can build
10890
+ the ARN from the account id alone. The CDK side must create a role with
10891
+ exactly this name.
10892
+
10893
+ ---
10894
+
10895
+ ##### `parameterPrefix`<sup>Optional</sup> <a name="parameterPrefix" id="@taimos/projen.GitHubAmplifyDeployOptions.property.parameterPrefix"></a>
10896
+
10897
+ ```typescript
10898
+ public readonly parameterPrefix: string;
10899
+ ```
10900
+
10901
+ - *Type:* string
10902
+ - *Default:* `/<project name>/amplify`
10903
+
10904
+ Prefix of the SSM parameter path holding each app's Amplify app id. The full path is `<prefix>/<app key>/app-id`.
10905
+
10906
+ Reading the app id at run time means CI never hardcodes an id that changes
10907
+ whenever an app is replaced.
10908
+
10909
+ ---
10910
+
10911
+ ##### `region`<sup>Optional</sup> <a name="region" id="@taimos/projen.GitHubAmplifyDeployOptions.property.region"></a>
10912
+
10913
+ ```typescript
10914
+ public readonly region: string;
10915
+ ```
10916
+
10917
+ - *Type:* string
10918
+ - *Default:* 'eu-central-1'
10919
+
10920
+ The AWS region the Amplify apps live in.
10921
+
10922
+ ---
10923
+
10924
+ ##### `runnerTags`<sup>Optional</sup> <a name="runnerTags" id="@taimos/projen.GitHubAmplifyDeployOptions.property.runnerTags"></a>
10925
+
10926
+ ```typescript
10927
+ public readonly runnerTags: string[];
10928
+ ```
10929
+
10930
+ - *Type:* string[]
10931
+ - *Default:* ['ubuntu-latest']
10932
+
10933
+ The runner tags used to select the runner.
10934
+
10935
+ ---
10936
+
10937
+ ##### `sharedBuildPaths`<sup>Optional</sup> <a name="sharedBuildPaths" id="@taimos/projen.GitHubAmplifyDeployOptions.property.sharedBuildPaths"></a>
10938
+
10939
+ ```typescript
10940
+ public readonly sharedBuildPaths: string[];
10941
+ ```
10942
+
10943
+ - *Type:* string[]
10944
+ - *Default:* the Amplify build spec, the lockfile and the workspace file
10945
+
10946
+ Paths that change what *every* Amplify build produces, added to each app's own paths.
10947
+
10948
+ ---
10949
+
10950
+ ##### `timeoutMinutes`<sup>Optional</sup> <a name="timeoutMinutes" id="@taimos/projen.GitHubAmplifyDeployOptions.property.timeoutMinutes"></a>
10951
+
10952
+ ```typescript
10953
+ public readonly timeoutMinutes: number;
10954
+ ```
10955
+
10956
+ - *Type:* number
10957
+ - *Default:* 45
10958
+
10959
+ Timeout for a deploy job, bounding a hung Amplify build.
10960
+
10961
+ ---
10962
+
10319
10963
  ### GitHubProductionReleaseOptions <a name="GitHubProductionReleaseOptions" id="@taimos/projen.GitHubProductionReleaseOptions"></a>
10320
10964
 
10321
10965
  #### Initializer <a name="Initializer" id="@taimos/projen.GitHubProductionReleaseOptions.Initializer"></a>
@@ -10750,6 +11394,7 @@ const monorepoProjectOptions: MonorepoProjectOptions = { ... }
10750
11394
  | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.tsJestOptions">tsJestOptions</a></code> | <code>projen.typescript.TsJestOptions</code> | Options for ts-jest. |
10751
11395
  | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.typescriptVersion">typescriptVersion</a></code> | <code>string</code> | TypeScript version to use. |
10752
11396
  | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.amplifyApps">amplifyApps</a></code> | <code><a href="#@taimos/projen.MonorepoAmplifyApp">MonorepoAmplifyApp</a>[]</code> | AWS Amplify Hosting applications. |
11397
+ | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.amplifyDeployOptions">amplifyDeployOptions</a></code> | <code><a href="#@taimos/projen.GitHubAmplifyDeployOptions">GitHubAmplifyDeployOptions</a></code> | Drive Amplify Hosting builds from GitHub Actions instead of Amplify's own auto-build, so an app only rebuilds when the packages it is built from actually changed (see `GitHubAmplifyDeploy`). |
10753
11398
  | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.approverMapping">approverMapping</a></code> | <code><a href="#@taimos/projen.MonorepoApproverMapping">MonorepoApproverMapping</a>[]</code> | Author-to-approvers routing for the PR approver assignment. |
10754
11399
  | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.assignApprover">assignApprover</a></code> | <code>boolean</code> | Whether to assign PR approvers via `GitHubAssignApprover`. |
10755
11400
  | <code><a href="#@taimos/projen.MonorepoProjectOptions.property.cdkServerless">cdkServerless</a></code> | <code>boolean</code> | Whether to add `cdk-serverless` as a workspace dev dependency. |
@@ -12963,6 +13608,23 @@ with one entry per app. When omitted, no `amplify.yml` is created.
12963
13608
 
12964
13609
  ---
12965
13610
 
13611
+ ##### `amplifyDeployOptions`<sup>Optional</sup> <a name="amplifyDeployOptions" id="@taimos/projen.MonorepoProjectOptions.property.amplifyDeployOptions"></a>
13612
+
13613
+ ```typescript
13614
+ public readonly amplifyDeployOptions: GitHubAmplifyDeployOptions;
13615
+ ```
13616
+
13617
+ - *Type:* <a href="#@taimos/projen.GitHubAmplifyDeployOptions">GitHubAmplifyDeployOptions</a>
13618
+ - *Default:* Amplify's own auto-build is left in place
13619
+
13620
+ Drive Amplify Hosting builds from GitHub Actions instead of Amplify's own auto-build, so an app only rebuilds when the packages it is built from actually changed (see `GitHubAmplifyDeploy`).
13621
+
13622
+ Setting this generates one deploy workflow per listed app. The project's
13623
+ CDK app must disable `autoBuild` on the tracked branches and provide the
13624
+ app-id parameters and build-trigger role the workflows expect.
13625
+
13626
+ ---
13627
+
12966
13628
  ##### `approverMapping`<sup>Optional</sup> <a name="approverMapping" id="@taimos/projen.MonorepoProjectOptions.property.approverMapping"></a>
12967
13629
 
12968
13630
  ```typescript