@aws/nx-plugin-mcp 0.120.0 → 1.0.0-rc.0

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.
Files changed (92) hide show
  1. package/bin/aws-nx-mcp.js +74 -41
  2. package/docs/guides/astro-docs.mdx +144 -0
  3. package/docs/guides/connection/py-agent-a2a.mdx +105 -0
  4. package/docs/guides/connection/py-agent-mcp.mdx +147 -0
  5. package/docs/guides/connection/react-agui.mdx +240 -0
  6. package/docs/guides/connection/react-fastapi.mdx +1476 -0
  7. package/docs/guides/connection/react-py-agent.mdx +198 -0
  8. package/docs/guides/connection/react-smithy.mdx +1355 -0
  9. package/docs/guides/connection/react-trpc.mdx +447 -0
  10. package/docs/guides/connection/react-ts-agent.mdx +198 -0
  11. package/docs/guides/connection/smithy-rdb.mdx +161 -0
  12. package/docs/guides/connection/trpc-rdb.mdx +127 -0
  13. package/docs/guides/connection/ts-agent-a2a.mdx +106 -0
  14. package/docs/guides/connection/ts-agent-mcp.mdx +144 -0
  15. package/docs/guides/connection/ts-agent-rdb.mdx +141 -0
  16. package/docs/guides/connection/ts-mcp-server-rdb.mdx +135 -0
  17. package/docs/guides/connection.mdx +126 -0
  18. package/docs/guides/docker-bundling.mdx +403 -0
  19. package/docs/guides/docs.mdx +21 -0
  20. package/docs/guides/fastapi.mdx +511 -0
  21. package/docs/guides/license.mdx +293 -0
  22. package/docs/guides/nx-generator.mdx +588 -0
  23. package/docs/guides/py-agent.mdx +483 -0
  24. package/docs/guides/py-api.mdx +22 -0
  25. package/docs/guides/py-mcp-server.mdx +161 -0
  26. package/docs/guides/python-lambda-function.mdx +207 -0
  27. package/docs/guides/python-project.mdx +228 -0
  28. package/docs/guides/react-website-auth.mdx +216 -0
  29. package/docs/guides/react-website.mdx +424 -0
  30. package/docs/guides/runtime-config.mdx +312 -0
  31. package/docs/guides/terraform-project.mdx +317 -0
  32. package/docs/guides/trpc.mdx +818 -0
  33. package/docs/guides/ts-agent.mdx +436 -0
  34. package/docs/guides/ts-api.mdx +28 -0
  35. package/docs/guides/ts-lambda-function.mdx +218 -0
  36. package/docs/guides/ts-mcp-server.mdx +169 -0
  37. package/docs/guides/ts-nx-plugin.mdx +159 -0
  38. package/docs/guides/ts-rdb.mdx +759 -0
  39. package/docs/guides/ts-smithy-api.mdx +663 -0
  40. package/docs/guides/typescript-infrastructure.mdx +408 -0
  41. package/docs/guides/typescript-project.mdx +312 -0
  42. package/docs/guides/website.mdx +21 -0
  43. package/docs/guides/workspace.mdx +181 -0
  44. package/docs/snippets/agent/architecture.mdx +72 -0
  45. package/docs/snippets/agent/bedrock-deployment.mdx +172 -0
  46. package/docs/snippets/agent/runtime-arn.mdx +64 -0
  47. package/docs/snippets/api/api-architecture.mdx +93 -0
  48. package/docs/snippets/api/api-choice-note.mdx +6 -0
  49. package/docs/snippets/api/cors-configuration-cdk-note.mdx +25 -0
  50. package/docs/snippets/api/cors-configuration-terraform-note.mdx +28 -0
  51. package/docs/snippets/api/shared-constructs.mdx +38 -0
  52. package/docs/snippets/api/type-safe-api-integrations.mdx +643 -0
  53. package/docs/snippets/api/waf-configuration.mdx +37 -0
  54. package/docs/snippets/connection/a2a-infrastructure.mdx +63 -0
  55. package/docs/snippets/connection/lambda-rdb-ssl-requirements.mdx +40 -0
  56. package/docs/snippets/connection/mcp-server-rdb-ssl-requirements.mdx +35 -0
  57. package/docs/snippets/connection/rdb-api-infrastructure.mdx +72 -0
  58. package/docs/snippets/connection/react-agent-infrastructure.mdx +61 -0
  59. package/docs/snippets/connection/strands-agent-rdb-ssl-requirements.mdx +35 -0
  60. package/docs/snippets/lambda-function/architecture.mdx +36 -0
  61. package/docs/snippets/lambda-function/deploying-your-function.mdx +118 -0
  62. package/docs/snippets/mcp/architecture.mdx +58 -0
  63. package/docs/snippets/mcp/assistant-docs.mdx +10 -0
  64. package/docs/snippets/mcp/bedrock-deployment.mdx +167 -0
  65. package/docs/snippets/mcp/config.mdx +13 -0
  66. package/docs/snippets/mcp/configuration-py.mdx +42 -0
  67. package/docs/snippets/mcp/configuration-ts.mdx +53 -0
  68. package/docs/snippets/mcp/observability.mdx +8 -0
  69. package/docs/snippets/mcp/shared-constructs.mdx +32 -0
  70. package/docs/snippets/pdk-migration/example/01-migrate-api.mdx +602 -0
  71. package/docs/snippets/pdk-migration/example/02-migrate-website.mdx +915 -0
  72. package/docs/snippets/pdk-migration/example/03-migrate-infra.mdx +161 -0
  73. package/docs/snippets/pdk-migration/example/04-deploy.mdx +229 -0
  74. package/docs/snippets/pdk-migration/faq/aws-arch.mdx +17 -0
  75. package/docs/snippets/pdk-migration/faq/cdk-graph.mdx +29 -0
  76. package/docs/snippets/pdk-migration/faq/infrastructure-python-java.mdx +19 -0
  77. package/docs/snippets/pdk-migration/faq/pdk-nag.mdx +15 -0
  78. package/docs/snippets/pdk-migration/faq/pipeline.mdx +15 -0
  79. package/docs/snippets/pdk-migration/faq/type-safe-api.mdx +310 -0
  80. package/docs/snippets/pdk-migration/faq/use-of-projen.mdx +15 -0
  81. package/docs/snippets/prerequisites.mdx +20 -0
  82. package/docs/snippets/required-prerequisites.mdx +12 -0
  83. package/docs/snippets/shared-constructs.mdx +40 -0
  84. package/docs/snippets/tools/acurl.mdx +73 -0
  85. package/docs/snippets/ts-bundle.mdx +14 -0
  86. package/generators.json +47 -6
  87. package/package.json +1 -1
  88. package/src/py/api/schema.json +100 -0
  89. package/src/ts/api/schema.json +105 -0
  90. package/src/ts/docs/schema.json +70 -0
  91. package/src/ts/website/app/schema.json +97 -0
  92. package/src/ts/website/auth/schema.json +46 -0
@@ -0,0 +1,424 @@
1
+ ---
2
+ title: React Website
3
+ description: Reference documentation for a React Website
4
+ generator: ts#react-website
5
+ when:
6
+ framework:
7
+ - react
8
+ ---
9
+ import { FileTree, Steps } from '@astrojs/starlight/components';
10
+ import Link from '@components/link.astro';
11
+ import RunGenerator from '@components/run-generator.astro';
12
+ import GeneratorParameters from '@components/generator-parameters.astro';
13
+ import NxCommands from '@components/nx-commands.astro';
14
+ import PackageManagerShortCommand from '@components/package-manager-short-command.astro';
15
+ import Infrastructure from '@components/infrastructure.astro';
16
+ import Snippet from '@components/snippet.astro';
17
+ import OptionFilter from '@components/option-filter.astro';
18
+
19
+ This generator creates a new [React](https://react.dev/) website with [Cloudscape](http://cloudscape.design/) configured by default, along with the AWS CDK or Terraform infrastructure to deploy your website to the cloud as a static website hosted in [S3](https://aws.amazon.com/s3/), served by [CloudFront](https://aws.amazon.com/cloudfront/) and protected by [WAF](https://aws.amazon.com/waf/).
20
+
21
+ The generated application uses [Vite](https://vite.dev/) as the build tool and bundler. It uses [TanStack Router](https://tanstack.com/router/v1) for type-safe routing.
22
+
23
+ :::note[UX Provider]
24
+ The default `uxProvider` is [Cloudscape](http://cloudscape.design/). You can also select [shadcn/ui](https://ui.shadcn.com/) or `None` (bring your own component library).
25
+ :::
26
+
27
+ ## Usage
28
+
29
+ ### Generate a React Website
30
+
31
+ You can generate a new React Website in two ways:
32
+
33
+ <RunGenerator generator="ts#website" />
34
+
35
+ ### Options
36
+
37
+ <GeneratorParameters generator="ts#website" />
38
+
39
+ ## Generator Output
40
+
41
+ The generator will create the following project structure in the `<directory>/<name>` directory:
42
+
43
+ <FileTree>
44
+ - index.html HTML entry point
45
+ - public Static assets
46
+ - src
47
+ - main.tsx Application entry point with React setup
48
+ - config.ts Application configuration (eg. logo)
49
+ - components
50
+ - AppLayout Components for the overall layout and navigation bar
51
+ - hooks
52
+ - useAppLayout.tsx Hook for adjusting the AppLayout from nested components (Cloudscape only)
53
+ - routes
54
+ - index.tsx Example route (or page) for TanStack Router
55
+ - styles.css Global styles
56
+ - vite.config.mts Vite and Vitest configuration
57
+ - tsconfig.json Base TypeScript configuration for source and tests
58
+ - tsconfig.app.json TypeScript configuration for source code
59
+ - tsconfig.spec.json TypeScript configuration for tests
60
+ </FileTree>
61
+
62
+ :::note[Without TanStack Router]
63
+ If you opted not to use [TanStack Router](https://tanstack.com/router/v1), you will be vended a simple `src/app.tsx` file as your application entry point instead of the `routes` directory.
64
+ :::
65
+
66
+ ### Infrastructure
67
+
68
+ <Snippet name="shared-constructs" />
69
+
70
+ The generator creates infrastructure as code for deploying your website based on your selected `iacProvider`:
71
+
72
+ <Infrastructure>
73
+ <Fragment slot="cdk">
74
+ <FileTree>
75
+ - packages/common/constructs/src
76
+ - app
77
+ - static-websites
78
+ - \<name>.ts Infrastructure specific to your website
79
+ - core
80
+ - static-website.ts Generic StaticWebsite construct
81
+ </FileTree>
82
+ </Fragment>
83
+ <Fragment slot="terraform">
84
+ <FileTree>
85
+ - packages/common/terraform/src
86
+ - app
87
+ - static-websites
88
+ - \<name>
89
+ - \<name>.tf Module specific to your website
90
+ - core
91
+ - static-website
92
+ - static-website.tf Generic static website module
93
+ </FileTree>
94
+ </Fragment>
95
+ </Infrastructure>
96
+
97
+ #### Architecture
98
+
99
+ The deployed website has the following architecture:
100
+
101
+ ```d2 inline=true
102
+ direction: right
103
+
104
+ browser: Web Browser {
105
+ shape: image
106
+ icon: /nx-plugin-for-aws/icons/aws/client.svg
107
+ }
108
+
109
+ waf: WAF {
110
+ shape: image
111
+ icon: /nx-plugin-for-aws/icons/aws/waf.svg
112
+ }
113
+
114
+ cloudfront: CloudFront {
115
+ shape: image
116
+ icon: /nx-plugin-for-aws/icons/aws/cloudfront.svg
117
+ }
118
+
119
+ s3: Static Assets\n(S3) {
120
+ shape: image
121
+ icon: /nx-plugin-for-aws/icons/aws/s3.svg
122
+ }
123
+
124
+ browser -> waf
125
+ waf -> cloudfront
126
+ cloudfront -> s3
127
+ ```
128
+
129
+ ## Implementing your React Website
130
+
131
+ The [React documentation](https://react.dev/learn) is a good place to start to learn the basics of building with React.
132
+
133
+ <OptionFilter when={{ uxProvider: 'Cloudscape' }} description="Cloudscape component docs pointer">
134
+ You can refer to the [Cloudscape documentation](https://cloudscape.design/components/) for details about the available components and how to use them.
135
+ </OptionFilter>
136
+
137
+ <OptionFilter when={{ uxProvider: 'Shadcn' }} description="Shadcn component docs pointer">
138
+ You can refer to the [shadcn/ui documentation](https://ui.shadcn.com/docs) for details about the available components and how to use them.
139
+ </OptionFilter>
140
+
141
+ ### Routes
142
+
143
+ #### Creating a Route/Page
144
+
145
+ Your website comes with [TanStack Router](https://tanstack.com/router/v1) configured by default. This makes it easy to add new routes:
146
+
147
+ <Steps>
148
+ 1. [Run the Local Development Server](#local-development-server)
149
+ 2. Create a new `<page-name>.tsx` file in `src/routes`, with its position in the file tree representing the path
150
+ 3. Notice a `Route` and `RouteComponent` are automatically generated for you. You can start building your page here!
151
+ </Steps>
152
+
153
+ #### Navigating Between Pages
154
+
155
+ You can use the `Link` component or `useNavigate` hook to navigate between pages:
156
+
157
+ ```tsx {1, 4, 8-9, 14}
158
+ import { Link, useNavigate } from '@tanstack/react-router';
159
+
160
+ export const MyComponent = () => {
161
+ const navigate = useNavigate();
162
+
163
+ const submit = async () => {
164
+ const id = await ...
165
+ // Use `navigate` for redirecting after some asynchronous action
166
+ navigate({ to: '/products/$id', { params: { id }} });
167
+ };
168
+
169
+ return (
170
+ <>
171
+ <Link to="/products">Cancel</Link>
172
+ <Button onClick={submit}>Submit</Button>
173
+ </>
174
+ )
175
+ };
176
+ ```
177
+
178
+ For more details, check out the [TanStack Router](https://tanstack.com/router/latest/docs/framework/react/overview) documentation.
179
+
180
+ ## Runtime Configuration
181
+
182
+ Configuration from your infrastructure is provided to your website via <Link href="guides/runtime-config">Runtime Configuration</Link>. This allows your website to access details such as API URLs which are not known until your application is deployed.
183
+
184
+ ### Infrastructure
185
+
186
+ <Infrastructure>
187
+ <Fragment slot="cdk">
188
+ The `RuntimeConfig` CDK construct can be used to add and retrieve configuration in your CDK infrastructure. The CDK constructs generated by `@aws/nx-plugin` generators (such as <Link path="guides/trpc">`ts#trpc-api`</Link> and <Link path="guides/fastapi">`py#fast-api`</Link>) will automatically add appropriate values to the `RuntimeConfig`.
189
+
190
+ Your website CDK construct will deploy the `connection` namespace of the runtime configuration as a `runtime-config.json` file to the root of your S3 bucket.
191
+
192
+ ```ts title="packages/infra/src/stacks/application-stack.ts"
193
+ import { Stack } from 'aws-cdk-lib';
194
+ import { Construct } from 'constructs';
195
+ import { MyWebsite, MyApi } from ':my-scope/common-constructs';
196
+
197
+ export class ApplicationStack extends Stack {
198
+ constructor(scope: Construct, id: string) {
199
+ super(scope, id);
200
+
201
+ // Website can be declared at any point — runtime config is resolved lazily
202
+ new MyWebsite(this, 'MyWebsite');
203
+
204
+ // Automatically adds values to the RuntimeConfig
205
+ new MyApi(this, 'MyApi', {
206
+ integrations: MyApi.defaultIntegrations(this).build(),
207
+ });
208
+ }
209
+ }
210
+ ```
211
+
212
+ :::note[CDK Website Construct]
213
+ With CDK, the website construct can be declared at any point in your stack. Runtime configuration is resolved lazily at synth time, so all values will be included regardless of declaration order.
214
+ :::
215
+ </Fragment>
216
+ <Fragment slot="terraform">
217
+ With Terraform, runtime configuration is managed through the runtime-config modules. The Terraform modules generated by `@aws/nx-plugin` generators (such as <Link path="guides/trpc">`ts#trpc-api`</Link> and <Link path="guides/fastapi">`py#fast-api`</Link>) will automatically add appropriate values to the runtime configuration.
218
+
219
+ Your website Terraform module will deploy the `connection` namespace of the runtime configuration as a `runtime-config.json` file to the root of your S3 bucket.
220
+
221
+ ```hcl title="packages/infra/src/main.tf" {18-19}
222
+ module "asset_bucket" {
223
+ source = "../../common/terraform/src/core/asset-bucket"
224
+ }
225
+
226
+ # Automatically adds values to runtime config
227
+ module "my_api" {
228
+ source = "../../common/terraform/src/app/apis/my-api"
229
+
230
+ asset_bucket_name = module.asset_bucket.bucket_name
231
+ }
232
+
233
+ # Automatically deploys the runtime config to runtime-config.json
234
+ module "my_website" {
235
+ source = "../../common/terraform/src/app/static-websites/my-website"
236
+
237
+ providers = {
238
+ aws.us_east_1 = aws.us_east_1
239
+ }
240
+
241
+ # Ensure API is deployed first to add to runtime config
242
+ depends_on = [module.my_api]
243
+ }
244
+ ```
245
+
246
+ :::caution[Module Ordering]
247
+ You must ensure that you declare your website module _after_ any modules which add to the runtime configuration and configure the appropriate `depends_on` to ensure ordering, otherwise they will be missing in your `runtime-config.json` file.
248
+ :::
249
+ </Fragment>
250
+ </Infrastructure>
251
+
252
+ ### Website Code
253
+
254
+ In your website, you can use the `useRuntimeConfig` hook to retrieve values from the runtime configuration:
255
+
256
+ ```tsx {1,4}
257
+ import { useRuntimeConfig } from '../hooks/useRuntimeConfig';
258
+
259
+ const MyComponent = () => {
260
+ const runtimeConfig = useRuntimeConfig();
261
+
262
+ // Access values in the runtime config here
263
+ const apiUrl = runtimeConfig.apis.MyApi;
264
+ };
265
+ ```
266
+
267
+ :::note[Runtime Configuration]
268
+ For details on how runtime configuration is stored in AWS AppConfig and how server-side consumers (Lambda functions, agents) can retrieve it, see the <Link path="guides/runtime-config">Runtime Configuration</Link> guide.
269
+ :::
270
+
271
+ ### Local Runtime Config
272
+
273
+ When running the [local development server](#local-development-server), you will need a `runtime-config.json` file in your `public` directory in order for your local website to know the backend URLs, identity configuration, etc.
274
+
275
+ Your website project is configured with a `load:runtime-config` target which you can use to pull down the `runtime-config.json` file from a deployed application:
276
+
277
+ <NxCommands commands={['run <my-website>:"load:runtime-config"']} />
278
+
279
+ :::note[Custom Stage Names]
280
+ <Infrastructure>
281
+ <Fragment slot="cdk">
282
+ If you change the prefix for your stage names in your infrastructure project's `src/main.ts`, you will need to update the `load:runtime-config` target in your website's `project.json` file accordingly.
283
+
284
+ Additionally it's worth noting that the `load:runtime-config` target assumes a single stage of your application is deployed to the environment you have AWS credentials for. You will need to adjust the command if you deploy multiple stages to the same account and region.
285
+ </Fragment>
286
+ <Fragment slot="terraform">
287
+ For Terraform projects, the `load:runtime-config` target copies the `runtime-config.json` file that was created after your most recent local `terraform apply`.
288
+ </Fragment>
289
+ </Infrastructure>
290
+ :::
291
+
292
+ ## Local Development Server
293
+
294
+ You can run a local development server using either the `serve` or `serve-local` target.
295
+
296
+ ### Serve Target
297
+
298
+ The `serve` target starts a local development server for your website. This target requires you to have deployed any supporting infrastructure that the website interacts with, and have [loaded local runtime configuration](#local-runtime-config).
299
+
300
+ You can run this target with the following command:
301
+
302
+ <NxCommands commands={['serve <my-website>']} />
303
+
304
+ This target is useful for working on website changes while pointing to "real" deployed APIs and other infrastructure.
305
+
306
+ ### Serve Local Target
307
+
308
+ The `serve-local` target starts a local development server for your website (with [Vite `MODE`](https://vite.dev/guide/env-and-mode) set to `serve-local`), as well as starting any local servers for APIs you have connected your website to via the <Link path="/guides/connection">Connection generator</Link>.
309
+
310
+ When your local website server is run via this target, `runtime-config.json` is automatically overridden to point to your locally running API urls.
311
+
312
+ You can run this target with the following command:
313
+
314
+ <NxCommands commands={['serve-local <my-website>']} />
315
+
316
+ This target is useful when you are working across your website and API and wish to quickly iterate without deploying your infrastructure.
317
+
318
+ :::note[`dev` script]
319
+ If no `dev` script exists in your root `package.json` when this generator runs, a `dev` script is added that invokes `serve-local` for the generated website, meaning you can also start the local development server with:
320
+
321
+ <PackageManagerShortCommand commands={["dev"]} />
322
+
323
+ This makes the first React website you generate the default `dev` target for the workspace. Subsequent websites do not overwrite the existing `dev` script — you can invoke their `serve-local` targets directly, or update the script manually.
324
+ :::
325
+
326
+ :::warning[Mock Authentication]
327
+ When run in this mode and no `runtime-config.json` is present, if you have configured Cognito Authentication (via the <Link path="/guides/react-website-auth">`ts#website#auth` generator</Link>), login will be skipped and requests to your local servers will not include authentication headers.
328
+
329
+ To enable login and authentication for `serve-local`, deploy your infrastructure and load runtime config.
330
+ :::
331
+
332
+ :::tip[Serve-Local Behavior]
333
+ When running with `serve-local`, you can specify any environment variables required by your APIs to point to other deployed AWS resources, for example:
334
+
335
+ <NxCommands env={{DYNAMODB_TABLE_NAME: 'xxxxx'}} commands={['serve-local <my-website>']} />
336
+
337
+ Note that your local API servers will run with the AWS credentials you have configured locally.
338
+ :::
339
+
340
+ ## Building
341
+
342
+ You can build your website using the `build` target. This use Vite to create a production bundle in the root `dist/packages/<my-website>/bundle` directory, as well as type-checking, compiling and linting your website.
343
+
344
+ <NxCommands commands={['build <my-website>']} />
345
+
346
+ ## Testing
347
+
348
+ Testing your website is much like writing tests in a standard TypeScript project, so please refer to the <Link path="guides/typescript-project#testing">TypeScript project guide</Link> for more details.
349
+
350
+ For React specific testing, React Testing Library is already installed and available for you to use to write tests. For more details on its usage, please refer to the [React Testing Library documentation](https://testing-library.com/docs/react-testing-library/example-intro).
351
+
352
+ You can run your tests using the `test` target:
353
+
354
+ <NxCommands commands={['test <my-website>']} />
355
+
356
+ ## Deploying Your Website
357
+
358
+ The React website generator creates CDK or Terraform infrastructure as code based on your selected `iacProvider`. You can use this to deploy your website.
359
+
360
+ <Infrastructure>
361
+ <Fragment slot="cdk">
362
+ To deploy your website, we recommend using the <Link path="guides/typescript-infrastructure">`ts#infra` generator</Link> to create a CDK application.
363
+
364
+ You can use the CDK construct generated for you in `packages/common/constructs` to deploy your website.
365
+
366
+ ```ts title="packages/infra/src/stacks/application-stack.ts" {3, 9}
367
+ import { Stack } from 'aws-cdk-lib';
368
+ import { Construct } from 'constructs';
369
+ import { MyWebsite } from ':my-scope/common-constructs';
370
+
371
+ export class ApplicationStack extends Stack {
372
+ constructor(scope: Construct, id: string) {
373
+ super(scope, id);
374
+
375
+ new MyWebsite(this, 'MyWebsite');
376
+ }
377
+ }
378
+ ```
379
+
380
+ This sets up:
381
+
382
+ 1. An S3 bucket for hosting your static website files
383
+ 2. CloudFront distribution for global content delivery
384
+ 3. WAF Web ACL for security protection
385
+ 4. Origin Access Control for secure S3 access
386
+ 5. Automatic deployment of website files and runtime configuration
387
+ </Fragment>
388
+ <Fragment slot="terraform">
389
+ To deploy your website, we recommend using the <Link path="guides/terraform-infrastructure">`terraform#project` generator</Link> to create a Terraform project.
390
+
391
+ You can use the Terraform module generated for you in `packages/common/terraform` to deploy your website.
392
+
393
+ ```hcl title="packages/infra/src/main.tf" {3}
394
+ # Deploy website
395
+ module "my_website" {
396
+ source = "../../common/terraform/src/app/static-websites/my-website"
397
+
398
+ providers = {
399
+ aws.us_east_1 = aws.us_east_1
400
+ }
401
+ }
402
+ ```
403
+
404
+ This sets up:
405
+
406
+ 1. An S3 bucket for hosting your static website files
407
+ 2. CloudFront distribution for global content delivery
408
+ 3. WAF Web ACL for security protection (deployed in us-east-1)
409
+ 4. Origin Access Control for secure S3 access
410
+ 5. Automatic deployment of website files and runtime configuration
411
+
412
+ :::note[WAF Provider Region]
413
+ The `aws.us_east_1` provider is required for CloudFront and WAF resources, which must be deployed in the us-east-1 region. Make sure your Terraform configuration includes this provider:
414
+
415
+ ```hcl title="packages/infra/src/providers.tf"
416
+ provider "aws" {
417
+ alias = "us_east_1"
418
+ region = "us-east-1"
419
+ }
420
+ ```
421
+ :::
422
+ </Fragment>
423
+ </Infrastructure>
424
+