aws-amplify / aws-amplify/amplify-cli

serverless-export-env functionality

Open
#9,315 0 comments 0 reactions 0 assignees View on GitHub
extensibility feature-request p4
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

auth, storage, function, api, predictions, xr

### Is this related to another service?

_No response_

### Describe the feature you'd like to request

I was hoping to be able to export environment variables in a similar fashion as to how [serverless-export-env](https://www.npmjs.com/package/serverless-export-env) works

### Describe the solution you'd like

I guess it would be a command like `amplify export env` that would export the current environment outputs to a .env file. For example, if I have a custom cdk resource with the following output it woudl create a .env file with `snsTopicArn=someValue`

```
new cdk.CfnOutput(this, 'snsTopicArn', {
value: topic.topicArn,
description: 'The arn of the SNS topic',
});
```

### Describe alternatives you've considered

Not sure how this might tie into the existing aws-exports.js

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start at the CLI entry point for the proposed `amplify export env` command and compare its output model with `aws-exports.js`. Define how current environment outputs, including the custom CDK `CfnOutput` named `snsTopicArn`, should map to a `.env` file; done means the command exports those values consistently without leaving the existing configuration unclear.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.