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
Splits out a "How to authenticate to AWS accounts" section in the
README, which includes more detailed instructions on how to authenticate
using AWS SSO, including a newly created Bitwarden item with a sample
`~/.aws/config`.
Also adds a couple NPM commands for deploying to a particular account
when using AWS SSO to authenticate.
Copy file name to clipboardExpand all lines: README.md
+21-16Lines changed: 21 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,23 +54,28 @@ The code can be deployed to either the dev account (`Innov-Platform-Dev`) or to
54
54
55
55
> :warning: Please be careful to deploy to the prod account only with extreme caution and after thoroughly testing changes in dev. **Make sure to test that API requests work in the browser before deploying to prod** (see [Test API Requests in the browser](#test-api-requests-in-the-browser) for instructions). This ensures that CORS is enabled properly.
56
56
57
-
### Steps to test dev/prod environments:
57
+
### How to authenticate to AWS accounts
58
+
59
+
#### Option A: Use AWS SSO (Recommended)
58
60
1.[Ensure AWS CLI is installed/up to date](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
59
-
2.[Configure](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html) your `~/.aws/credentials` and `~/.aws/config` files with `dev` and `prod` profile names.
60
-
3. Start an active AWS SSO session (run the `aws sso login` script).
61
-
-**Note:** You need to be logged in before running synth or deploy.
62
-
4. Run **synth scripts** to verify CloudFormation templates.
63
-
64
-
### Steps to deploy to the dev/prod AWS account:
65
-
1. Make code changes locally.
66
-
2. Test code changes locally.
67
-
3. Log into AWS console, and open "Command line and programmatic access" option under the appropriate account.
68
-
4. Save the account credentials to your `~/.aws/credentials` file.
69
-
5. Run `export AWS_PROFILE=[PROFILE ID]` from your command line.
70
-
6. Run **deploy scripts** to deploy this AWS CDK project to AWS.
71
-
-**Note:**
72
-
- If you don't run the scripts, you'll have to navigate to the `/infra` directory before deploying.
73
-
- Running `npx cdk deploy` deploys this entire AWS CDK project to AWS. See individual scripts for stack-specific deploys.
61
+
2.[Configure](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html) your `~/.aws/config` files with `dev` and `prod` profiles. A sample `~/.aws/config` can be found in the ResX Bitwarden under the `
62
+
Feedback API ~/.aws/config` item.
63
+
3. Run `sso:login:dev` or `sso:login:prod` to start an active AWS SSO session with the desired account.
64
+
65
+
#### Option B: Set AWS environment variables
66
+
1. Go to the AWS access portal.
67
+
2. Click the desired account, and then click "Access keys"
68
+
3. Export the environment variables under "Option 1: Set AWS environment variables" to your terminal.
69
+
- These environment variables will expire after the session duration, so you will have to periodically re-export new variables following the instructions.
70
+
71
+
### Steps to deploy to the dev/prod AWS account
72
+
To deploy this AWS CDK project to AWS
73
+
- If you authenticated using AWS SSO (Option A):
74
+
- Run `deploy:api:dev` or `deploy:api:prod` based on which account you want to deploy to.
75
+
- If you authenticated by setting env vars (Option B):
76
+
- Run `deploy:api`. The CDK project will be deployed to the account whose env vars you last exported.
77
+
78
+
**Note:** If you don't run the scripts, you'll have to navigate to the `/infra` directory before deploying. Running `npx cdk deploy` deploys this entire AWS CDK project to AWS. See individual scripts for stack-specific deploys.
0 commit comments