Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 18518d8

Browse files
docs(awstf): update import docs for secret imports in awstf (#740)
Co-authored-by: Ryan Cartwright <[email protected]>
1 parent ed98a97 commit 18518d8

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

docs/providers/pulumi/aws.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ The Nitric team is working to expand the list of resources that can be imported.
9696
- [Buckets](/storage)
9797

9898
<Note>
99-
Currently, only resources in the same AWS account and region as the Nitric project
100-
are supported.
99+
Currently, only resources in the same AWS account and region as the Nitric
100+
project are supported.
101101
</Note>
102102

103103
### Buckets
@@ -142,8 +142,8 @@ import:
142142
```
143143

144144
<Note>
145-
Unlike some other imported resources, secret imports require the ARN to be used.
146-
Providing only the secret's name will be invalid.
145+
Unlike some other imported resources, secret imports require the ARN to be
146+
used. Providing only the secret's name will be invalid.
147147
</Note>
148148

149149
Need to import another resource type or have another question? Chat with us on [Discord](https://nitric.io/chat) or [open an issue](https://github.com/nitrictech/nitric/issues) on GitHub.
@@ -167,7 +167,6 @@ region: my-aws-stack-region
167167
schedule-timezone: Australia/Sydney # Available since v0.27.0
168168
169169
# Import existing AWS Resources
170-
# Currently only secrets are supported
171170
# Available since v0.28.0
172171
import:
173172
# A name ARN map of buckets, where the name matches the nitric name of the bucket you would like to import

docs/providers/terraform/aws.mdx

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,43 @@ In this example the project name is `api-testing` and the stack name is `aws`.
7979

8080
![resource group list image](/docs/images/docs/aws-rg-screen.png)
8181

82+
83+
## Importing Existing Resources
84+
85+
The Nitric team is working to expand the list of resources that can be imported. Currently, only the following resources are supported:
86+
87+
- [Secrets](/secrets)
88+
89+
<Note>
90+
Currently, only resources in the same AWS account and region as the Nitric project
91+
are supported.
92+
</Note>
93+
94+
### Secrets
95+
96+
To import a secret, you will need to know the secret's ARN. You can find the ARN of a secret in the AWS console or by using the AWS CLI.
97+
98+
First, add the secret to your project as you usually would if it wasn't imported. Then add the secret to the `import` section of your stack file. Here's an example of how to import a secret:
99+
100+
```javascript
101+
import { secret } from "@nitric/sdk
102+
103+
const mySecret = secret("credentials").allow("access");
104+
```
105+
106+
```yaml
107+
import:
108+
secrets:
109+
credentials: arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret
110+
```
111+
112+
<Note>
113+
Unlike some other imported resources, secret imports require the ARN to be used.
114+
Providing only the secret's name will be invalid.
115+
</Note>
116+
117+
Need to import another resource type or have another question? Chat with us on [Discord](https://nitric.io/chat) or [open an issue](https://github.com/nitrictech/nitric/issues) on GitHub.
118+
82119
## Stack Configuration
83120

84121
```yaml title:nitric.[stack ID].yaml
@@ -95,8 +132,14 @@ region: my-aws-stack-region
95132
# Optional outdir
96133
# outdir: ./tf-output
97134
98-
# config:
99-
# Config (same as base AWS provider except for VPC/Secret imports)
135+
# Import existing AWS Resources
136+
# Currently only secrets are supported
137+
import:
138+
# A name ARN map of secrets, where the name matches the nitric name of the secret you would like to import
139+
secrets:
140+
# In typescript this would import the provided secret reference for a secret declared as
141+
# const mySecret = secret('my-secret');
142+
my-secret: arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret
100143
101144
# The timezone that deployed schedules will run with
102145
# Format is in tz identifiers:

0 commit comments

Comments
 (0)