|
1 | | -import { Callout } from 'nextra/components'; |
| 1 | +import { Callout, Tab, Tabs } from 'nextra/components'; |
2 | 2 | import { NextSeo } from 'next-seo'; |
3 | 3 |
|
4 | 4 | <NextSeo description="Define environment variables for your Bref application." /> |
@@ -42,25 +42,42 @@ Instead, you can use the [SSM parameter store](https://docs.aws.amazon.com/syste |
42 | 42 |
|
43 | 43 | ### Creating secrets |
44 | 44 |
|
45 | | -To create a parameter, you can do it via the [AWS SSM console](https://console.aws.amazon.com/systems-manager/parameters) or the [Bref Dashboard](https://dashboard.bref.sh/): |
| 45 | +<Tabs items={['Bref Cloud', 'Serverless CLI']}> |
| 46 | + <Tab> |
| 47 | + Create secrets via [Bref Cloud](https://bref.cloud). |
46 | 48 |
|
47 | | - |
| 49 | + If you have **not** deployed the application yet, go to the root "Secrets" section in Bref Cloud and create a new secret there ([bref.cloud/secrets/create](https://bref.cloud/secrets/create)). Provide the target application and environment name when creating the secret. |
48 | 50 |
|
49 | | -You can also do it in the CLI via the following command: |
| 51 | + If you have already deployed the application, open the application in Bref Cloud, go to a specific environment, and create a new secret under the "Secrets" tab: |
50 | 52 |
|
51 | | -```bash |
52 | | -aws ssm put-parameter --region us-east-1 --name '/my-app/my-parameter' --type String --value 'mysecretvalue' |
53 | | -``` |
| 53 | +  |
54 | 54 |
|
55 | | -On Windows, the first part of the path needs to be double slashes and all subsequent forward slashes changed to backslashes: |
| 55 | + You can also run the `bref secret:create` command in your terminal: |
56 | 56 |
|
57 | | -```bash |
58 | | -aws ssm put-parameter --region us-east-1 --name '//my-app\my-parameter' --type String --value 'mysecretvalue' |
59 | | -``` |
| 57 | + ```bash |
| 58 | + bref secret:create |
| 59 | + ``` |
| 60 | + |
| 61 | + You can also run the command outside of a project: `bref secret:create --app=app-name --env=env-name --team=team-slug`. |
| 62 | + </Tab> |
| 63 | + <Tab> |
| 64 | + Create a parameter via the [AWS SSM console](https://console.aws.amazon.com/systems-manager/parameters) or the `aws` CLI: |
| 65 | + |
| 66 | + ```bash |
| 67 | + aws ssm put-parameter --region us-east-1 --name '/my-app/my-parameter' --type String --value 'mysecretvalue' |
| 68 | + ``` |
| 69 | + |
| 70 | + On Windows, the first part of the path needs to be double slashes and all subsequent forward slashes changed to backslashes: |
| 71 | + |
| 72 | + ```bash |
| 73 | + aws ssm put-parameter --region us-east-1 --name '//my-app\my-parameter' --type String --value 'mysecretvalue' |
| 74 | + ``` |
60 | 75 |
|
61 | | -It is recommended to prefix the parameter name with your application name, for example: `/my-app/my-parameter`. |
| 76 | + It is recommended to prefix the parameter name with your application name, for example: `/my-app/my-parameter`. |
62 | 77 |
|
63 | | -SSM also allows to store a SecureString parameter, which is encrypted with AWS KMS. To use a SecureString, simply change the `--type` argument to `--type SecureString`. Bref takes care of decrypting the value. |
| 78 | + SSM also allows to store a SecureString parameter, which is encrypted with AWS KMS. To use a SecureString, simply change the `--type` argument to `--type SecureString`. Bref takes care of decrypting the value. |
| 79 | + </Tab> |
| 80 | +</Tabs> |
64 | 81 |
|
65 | 82 | ### Retrieving secrets |
66 | 83 |
|
|
0 commit comments