diff --git a/docs/providers/pulumi/aws.mdx b/docs/providers/pulumi/aws.mdx index 606a027df..62c0e1358 100644 --- a/docs/providers/pulumi/aws.mdx +++ b/docs/providers/pulumi/aws.mdx @@ -96,8 +96,8 @@ The Nitric team is working to expand the list of resources that can be imported. - [Buckets](/storage) - Currently, only resources in the same AWS account and region as the Nitric project - are supported. + Currently, only resources in the same AWS account and region as the Nitric + project are supported. ### Buckets @@ -142,8 +142,8 @@ import: ``` - Unlike some other imported resources, secret imports require the ARN to be used. - Providing only the secret's name will be invalid. + Unlike some other imported resources, secret imports require the ARN to be + used. Providing only the secret's name will be invalid. 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 schedule-timezone: Australia/Sydney # Available since v0.27.0 # Import existing AWS Resources -# Currently only secrets are supported # Available since v0.28.0 import: # A name ARN map of buckets, where the name matches the nitric name of the bucket you would like to import diff --git a/docs/providers/terraform/aws.mdx b/docs/providers/terraform/aws.mdx index 57299a86a..3d35d5c6e 100644 --- a/docs/providers/terraform/aws.mdx +++ b/docs/providers/terraform/aws.mdx @@ -79,6 +79,43 @@ In this example the project name is `api-testing` and the stack name is `aws`. ![resource group list image](/docs/images/docs/aws-rg-screen.png) + +## Importing Existing Resources + +The Nitric team is working to expand the list of resources that can be imported. Currently, only the following resources are supported: + +- [Secrets](/secrets) + + + Currently, only resources in the same AWS account and region as the Nitric project + are supported. + + +### Secrets + +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. + +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: + +```javascript +import { secret } from "@nitric/sdk + +const mySecret = secret("credentials").allow("access"); +``` + +```yaml +import: + secrets: + credentials: arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret +``` + + + Unlike some other imported resources, secret imports require the ARN to be used. + Providing only the secret's name will be invalid. + + +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. + ## Stack Configuration ```yaml title:nitric.[stack ID].yaml @@ -95,8 +132,14 @@ region: my-aws-stack-region # Optional outdir # outdir: ./tf-output -# config: -# Config (same as base AWS provider except for VPC/Secret imports) +# Import existing AWS Resources +# Currently only secrets are supported +import: + # A name ARN map of secrets, where the name matches the nitric name of the secret you would like to import + secrets: + # In typescript this would import the provided secret reference for a secret declared as + # const mySecret = secret('my-secret'); + my-secret: arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret # The timezone that deployed schedules will run with # Format is in tz identifiers: