You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: src/pages/guides/terraform/terratest.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,30 +3,30 @@ export const description =
3
3
4
4
# Testing AWS resources with Terratest
5
5
6
-
This guide will walk you through adding Terratest to a Nitric project.
6
+
This guide will walk you through adding [Terratest](https://terratest.gruntwork.io/) to a Nitric project.
7
7
8
8
## How Terratest works
9
9
10
10
Terratest is designed to automate the entire process of testing your Terraform code with the following steps:
11
11
12
-
- Initialize: Terratest will automatically run terraform init to initialize the Terraform working directory.
13
-
- Apply: It will then run terraform apply to deploy the infrastructure as defined in your Terraform code.
14
-
- Assert: The test script will then run assertions to check that the infrastructure was created as expected.
15
-
- Teardown: Finally, it will run terraform destroy to tear down the infrastructure after the test completes.
12
+
-**Initialize**: Terratest will automatically run terraform init to initialize the Terraform working directory.
13
+
-**Apply**: It will then run terraform apply to deploy the infrastructure as defined in your Terraform code.
14
+
-**Assert**: The test script will then run assertions to check that the infrastructure was created as expected.
15
+
-**Teardown**: Finally, it will run terraform destroy to tear down the infrastructure after the test completes.
16
16
17
17
## What we'll be doing
18
18
19
19
1. Create and set up your application.
20
20
2. Deploying to AWS with a Terraform provider.
21
-
3. Add and execute Terratest
21
+
3. Add and execute Terratest.
22
22
23
23
## Create and set up your application.
24
24
25
-
Our sample project creates a real-time communication service using websockets and a key-value store for connections.
25
+
Our sample project creates a real-time communication service using [websockets](/docs/websockets) and a [key-value store](/docs/keyvalue) for connections.
26
26
27
27
We intend to deploy to AWS and will use Terratest to ensure that the following:
28
28
29
-
-**API Gateway WebSocket**: Confirm that the webSocket endpoint is correctly configured for real-time communication.
29
+
-**API Gateway WebSocket**: Confirm that the websocket endpoint is correctly configured for real-time communication.
30
30
-**DynamoDB Table**: Verify that the key-value store for connections is created and operational.
31
31
-**IAM Roles**: Ensure that permissions for interacting with AWS services are correctly set up.
The Nitric Terraform providers are currently in preview, to enable them you'll need to enable beta-providers in your Nitric project. You can do this by adding the following to your project's nitric.yaml file:
145
+
The Nitric Terraform providers are currently in preview, to enable them you'll need to enable beta-providers in your Nitric project. You can do this by adding the following to your project's `nitric.yaml` file:
146
146
147
147
```
148
148
preview:
@@ -155,7 +155,7 @@ Once you've created your Nitric stack, you can generate the Terraform code by ru
155
155
nitric up
156
156
```
157
157
158
-
This will generate the Terraform code for your Nitric application into a folder named cdktf.out by default.
158
+
This will generate the Terraform code for your Nitric application into a folder named `cdktf.out` by default.
0 commit comments