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
docs: updating/maintenance of CLI command, runtime and local preferences docs (#765)
* chore: clean up runtime docs, spring cleaning of `init` CLI docs
* chore: spring cleaning of `deploy` CLI docs
* chore: updating destroy, env, logs and sandbox help text based on recent architect 11.2.1 updates to help text
* chore: scrub cli help text and local preference docs
Copy file name to clipboardExpand all lines: src/views/docs/en/reference/cli/deploy.md
+28-22Lines changed: 28 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,34 +8,34 @@ sections:
8
8
- Flags
9
9
---
10
10
11
-
Deploy an Architect project to AWS by creating or updating a [CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html) stack with resources declared in [the project manifest](../../get-started/project-manifest).
11
+
Deploy an Architect project to AWS by creating or updating a [CloudFormation][cfn] Stack with resources declared in [the project manifest][manifest].
12
12
13
-
CloudFormation stack names are created from the name specified in the `@app` pragma and are unique to an AWS region. Changing the project name or region will create a new CF stack.
13
+
[CloudFormation][cfn] Stack names are created from the name specified in [the `@app` pragma][app] and are unique to an AWS region. Changing the project name or region will create a new [CloudFormation][cfn] Stack.
-`[--direct path/to/function]` Overwrite staging Lambda with local source. A faster way to deploy and test small changes to individual functions without redeploying an entire stack.
25
-
-`[--dry-run]` Creates a CloudFormation template but does not deploy it. A dry-run allows you to check the CloudFormation and SAM output before deploying the actual stack.
26
-
-`[--fast, -f]` Deploy the stack, but do not hold the process open to determine whether the deployment succeeded or failed within AWS
27
-
-`[--name, -n]` Deploy a custom named staging stack.
28
-
-`[--no-hydrate]` Do not automatically run `npm`, `bundle`, or `pip`
29
-
-`[--production, -p]` Deploys a CloudFormation stack to a production stack.
30
-
-`[--prune]` Remove assets not present in the local static folder.
31
-
-`[--static, -s]` Deploys only the files in the static folder.
32
-
-`[--tags, -t]` Adds resource tags to the CloudFormation stack.
33
-
- The required tag format is `key=value`, e.g. `--tags key1=value1 key2=value2`
34
-
-`[--verbose, -v]` Displays verbose logging.
23
+
-`--direct path/to/function`: Directly deploy the specified Lambda. A faster way to deploy and test small changes to individual functions without redeploying an entire Stack.
24
+
-`--dry-run`: Generate a [CloudFormation][cfn] template but do not deploy it. A dry run allows you to check the [CloudFormation][cfn] and SAM output before deploying the actual stack.
25
+
-`--eject`: Generate a [CloudFormation][cfn] template but do not deploy it. Instead, print out the `aws cloudformation` CLI invocation to execute the deployment.
26
+
-`--fast`, `-f`: Deploy the stack, but do not block the process until deployment completed.
27
+
-`--name`, `-n`: Deploy a custom named staging Stack. E.g. `--name CI` will deploy a `AppnameStagingCI`[CloudFormation][cfn] Stack.
28
+
-`--no-hydrate`: Do not automatically [`hydrate`](hydrate) functions prior to deployment.
29
+
-`--production`, `-p`: Deploys a [CloudFormation][cfn] Stack to a production Stack. If not specified, will default to deploy to a staging Stack.
30
+
-`--prune`: Remove static assets deployed to S3 bucket not present in the local [`@static`][static] folder.
31
+
-`--static`, `-s`: Deploys only the files in the [`@static`][static] folder.
32
+
-`--tags`, `-t`: Adds resource tags to the CloudFormation stack. The required tag format is `key=value`, e.g. `--tags key1=value1 key2=value2`
When deploying, Architect can automatically scaffold resources (via [`arc init`](./init)) found in the [application's manifest](../../get-started/project-manifest) that do not yet exist. Options are set with [`@create` in local preferences](../configuration/local-preferences#%40create).
38
+
When deploying, Architect can automatically scaffold resources (via [`init`](init)) found in the [application's manifest][manifest] that do not yet exist. Options are set with [`@create` in local preferences](../configuration/local-preferences#%40create).
39
39
40
40
-`autocreate` - Set to `true` to enable automatic creation of boilerplate Lambda handlers and static assets if they do not exist.
41
41
-`templates` - Specify templates for automatic resource scaffolding.
@@ -52,42 +52,48 @@ templates
52
52
53
53
## Examples
54
54
55
-
### Deploy a staging stack
55
+
### Deploy a staging Stack
56
56
57
57
```bash
58
58
arc deploy
59
59
```
60
60
61
-
### Deploy a production stack
61
+
### Deploy a production Stack
62
62
63
63
```bash
64
64
arc deploy --production
65
65
```
66
66
67
-
### Deploy a named environment
67
+
### Deploy a named staging Stack
68
68
69
69
```bash
70
70
arc deploy --name my-stack
71
71
```
72
72
73
-
> 💁 Named stacks use `staging` environment variables [set with `arc env -e staging --add`](./env).
73
+
> 💁 Named stacks use `staging` environment variables [set with the `env` command](env).
74
74
75
75
### Deploy static assets to S3
76
76
77
77
```bash
78
78
arc deploy --static
79
79
```
80
80
81
-
### Deploy code directly to the staging Lambda
81
+
### Deploy the index route directly to staging
82
82
83
83
```bash
84
84
arc deploy --direct src/http/get-index
85
85
```
86
86
87
87
### Run deploy without deploying
88
88
89
-
This is useful for testing `@macros`; it will still generate `sam.json`.
89
+
This is useful for testing [`@plugins`][plugins]; it will still generate `sam.json`.
Copy file name to clipboardExpand all lines: src/views/docs/en/reference/cli/destroy.md
+24-13Lines changed: 24 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,52 +2,63 @@
2
2
title: arc destroy
3
3
category: CLI
4
4
description: CLI destroy command for removing Architect application
5
+
sections:
6
+
- Usage
7
+
- Flags
8
+
- Examples
5
9
---
6
10
7
-
Remove the CloudFormation stack and all related assets (S3 buckets, CloudWatch Log Groups, SSM environment variable parameters) for the current project from AWS completely. By default, removes the staging stack.
11
+
Completely removes your Architect application from AWS. This command deletes all resources associated with your application, including the [CloudFormation][cfn] Stack, SSM environment variables, CloudWatch Logs, deployment S3 bucket, and static S3 bucket (if applicable).
8
12
9
-
Large applications may take several minutes to delete and by default this command times out after 150 seconds. Even if this command times out, deletion may still complete successfully as removal completes asynchronously in the background at AWS. To have this process block until all application resources are removed, use the `--no-timeout` flag (see below for more information).
13
+
By default, this command destroys your staging environment. Use the `--production` flag to target the production environment instead. For custom environments created with [`deploy --name`][deploy], use the `--name` flag to specify the environment to destroy.
14
+
15
+
Large applications may take several minutes to delete and by default this command times out after 150 seconds. Even if this command times out, deletion may still complete successfully as removal completes asynchronously in the background. To have this process block until all application resources are removed, use the `--no-timeout` flag.
-`[--app MyAppName]` Required. Specify the app name, located under `@app` in your Architect manifest, to delete the app from AWS.
20
-
-`[--name NamedEnvironment]` If you ran [`arc deploy`][deploy] with the `--name` flag to specify a custom named environment to deploy your application to, use this flag to destroy that same named application environment.
21
-
-`[--production]` Destroy the production stack of your application. By default, without this flag, the staging stack is removed.
22
-
-`[--force, -f]` Force deletion of the application even if it contains DynamoDB tables ([`@tables`][tables]) or S3 bucket containing static assets ([`@static`][static]).
23
-
-`[--no-timeout]` Do not exit the process until all application resources are deleted.
25
+
-`--app`: App name as specified by your application's [`@app` pragma][app] (required for confirmation).
26
+
-`--force`, `-f`: Destroy an app that has database [`@tables`][tables] and/or [`@static`][static] assets.
27
+
-`--name`: Target a custom named environment created with [`deploy --name`][deploy].
28
+
-`--now`: Skip the 5-second safety delay before destroying resources.
29
+
-`--no-timeout`: Wait indefinitely for all application resources to be removed (by default times out after ~150 seconds).
30
+
-`--production`, `-p`: Destroy the production environment instead of staging.
31
+
-`--verbose`, `-v`: Print more detailed information during the destroy process.
32
+
-`--debug`, `-d`: Print even more detailed information for debugging purposes.
24
33
25
34
## Examples
26
35
27
-
### Destroy the staging stack
36
+
### Destroy the staging Stack
28
37
29
38
```bash
30
39
arc destroy --app my-app
31
40
```
32
41
33
-
### Destroy the production stack
42
+
### Destroy the production Stack
34
43
35
44
```bash
36
45
arc destroy --app my-app --production
37
46
```
38
47
39
-
### Destroy staging stack with S3 bucket and/or Dynamo tables
48
+
### Destroy staging Stack with S3 bucket and/or Dynamo tables
Copy file name to clipboardExpand all lines: src/views/docs/en/reference/cli/env.md
+42-27Lines changed: 42 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,54 @@
2
2
title: arc env
3
3
category: CLI
4
4
description: Read and write environment variables for Lambda functions.
5
+
sections:
6
+
- Usage
7
+
- Flags
8
+
- Security
9
+
- Examples
10
+
- Reserved names
11
+
- Specific function opt-out
5
12
---
6
13
7
-
Read and write environment variables. This allows apps to centrally store sensitive configuration data, such as API keys, outside of the codebase in revision control.
14
+
Manage environment variables for your Architect application across different environments. This command allows you to read, add, and remove environment variables that will be available to your Lambda functions at runtime.
8
15
9
-
> `arc env` will **not** upload variables from a project's [local preferences file](../configuration/local-preferences#%40env); however, it will download variables from AWS and overwrite local preference entries.
16
+
When run without any flags, this command will print out all environment variables and their values, across all environments.
17
+
18
+
Environment variables are stored in AWS SSM Parameter Store for staging and production environments. For local development (testing environment), variables are stored in your project's [`preferences.arc` file][prefs] or `.env` file if one exists.
19
+
20
+
> `arc env` will **not** upload variables from a project's [local preferences file][env-prefs]; however, it will download variables from AWS and overwrite local preference entries.
21
+
22
+
> 💁 `staging` environment variables are also used in named deployments [created with `arc deploy --name <name>`](./deploy).
-`[-e [testing|staging|production]]` Displays all environment variables for the specified environment
21
-
-`<--add, -a> -e <testing|staging|production> NAME value` Assigns a value to the specified variable name in the specified environment
22
-
-`<--remove, -r> -e <testing|staging|production> NAME` Removes the specified variable from the specified environment
23
-
32
+
-`-e`, `--env <environment>`: Specify environment (`testing`, `staging`, or `production`)
33
+
-`-a`, `--add`: Add a new environment variable
34
+
-`-r`, `--remove`: Remove an environment variable
35
+
-`-v`, `--verbose`: Print more detailed output
36
+
-`-d`, `--debug`: Print even more detailed information for debugging
24
37
25
38
## Security
26
39
27
-
It is imperative that the `ARC_APP_SECRET` environment variable be set to
28
-
a strong secret - especially in your production environment! It should have a minimum length of 16 bytes. This secret is
29
-
used to encode HTTP sessions if you use the [`@architect/functions` runtime helpers](../runtime-helpers/node.js#arc.http.session).
40
+
It is imperative that the `ARC_APP_SECRET` environment variable be set to a strong secret - especially in your production environment! **It must have a minimum length of 32 bytes**. This secret is used to encode HTTP sessions if you use the [`@architect/functions` runtime helpers](../runtime-helpers/node.js#arc.http.session).
41
+
42
+
## Reserved names
43
+
44
+
The following environment variable names are reserved for Architect use and cannot be set in an app:
30
45
46
+
-`ARC_ENV`
47
+
-`ARC_APP_NAME`
48
+
-`ARC_SESSION_TABLE_NAME`
49
+
50
+
## Specific function opt-out
51
+
52
+
A function can be [configured with a `config.arc`](../configuration/function-config#%40arc) to not load local environment variables.
31
53
32
54
## Examples
33
55
@@ -37,32 +59,25 @@ used to encode HTTP sessions if you use the [`@architect/functions` runtime help
37
59
arc env
38
60
```
39
61
62
+
### Display variables for a specific environment
63
+
64
+
```bash
65
+
arc env --env staging
66
+
```
40
67
41
68
### Save an environment variable to the staging environment
42
69
43
70
Variable values that contain special characters like email addresses should be wrapped in double quotes
Copy file name to clipboardExpand all lines: src/views/docs/en/reference/cli/hydrate.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: hydrate
2
+
title: arc hydrate
3
3
category: CLI
4
4
description: Install and update dependencies for all functions in a project.
5
5
---
6
6
7
-
Ensure that all functions managed by Architect have their dependencies installed. Functions containing all its required dependencies are considered to be "hydrated" - thus the name!
7
+
Ensure that all functions managed by Architect have their dependencies installed. Functions containing all their required dependencies are considered to be "hydrated" - thus the name!
8
8
9
-
Importantly, `arc hydrate` will also copy shared code from `src/shared` into all functions and `src/views` into `@http` GET functions.
9
+
Importantly, `arc hydrate` will also copy [shared code][sharing] from `src/shared` into all functions and `src/views` into [`@http`][http] GET functions.
10
10
11
-
When developing locally with Sandbox, it is not necessary to manually run `hydrate` since Sandbox handles this automatically. However, it can be helpful to ensure hydration happens prior to a process like `npm test`.
11
+
When [developing locally with Sandbox][local-dev], it is not necessary to manually run `hydrate` since Sandbox handles this automatically. However, it can be helpful to ensure hydration happens prior to a process like `npm test`.
12
12
13
13
## Usage
14
14
@@ -18,9 +18,9 @@ arc hydrate [--shared|--update]
18
18
19
19
## Flags
20
20
21
-
-`[--shared, -s]` Hydrates and copies shared files only
22
-
-`[--update, -u]` Updates each function's dependencies
23
-
-`[--verbose, -v]` Prints additional output to the console
21
+
-`--shared`, `-s`: Hydrates and copies [shared files][sharing] only
22
+
-`--update``-u`: Updates each function's dependencies to latest versions
23
+
-`--verbose`, `-v`: Prints additional output to the console
24
24
25
25
## Notes
26
26
@@ -37,3 +37,7 @@ Hydrate uses the following commands under the hood, depending on project's or fu
Copy file name to clipboardExpand all lines: src/views/docs/en/reference/cli/init.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,23 @@ category: CLI
4
4
description: Scaffold new resources found in the app.arc file
5
5
---
6
6
7
-
Bootstrap new Architect project code. Running `arc init` in an empty directory creates a default `app.arc` manifest file named after that directory with one default function `src/http/get-index`. Edit `app.arc` adding functions and re-run `arc init` to generate further code. This command is intended to be run and re-run; it will only generate files if they do not already exist.
7
+
Bootstrap new Architect project code. Running `arc init` in an empty directory creates a default [`app.arc` manifest file][manifest] named after that directory with one default [`@http` function][http] at `src/http/get-index`. Pass a directory name as a final positional argument to create a project in the specified directory. Edit `app.arc`, expanding the [manifest][manifest], adding functions and re-running `arc init` to generate further code. This command is idempotent: intended to be run and re-run; it will only generate files if they do not already exist.
8
+
9
+
If you run this command with the `--plugin` flag, a scaffolded [Architect plugin][plugins] will be created instead.
8
10
9
11
## Usage
10
12
11
13
```bash
12
-
arc init [--static|--runtime]
14
+
arc init [flags] [path/to/project-directory]
13
15
```
14
16
15
17
## Flags
16
18
17
-
-`[--static, -s]` Create a new project with `@static` folder set to `public`
18
-
-`[--runtime, -r]` Create a new project with a specified runtime, options are node, deno, python, or ruby
19
-
-`[--verbose, -v]` Even more output
19
+
-`-n`, `--name`: Set the [`@app` namespace][app] for the created app
20
+
-`--no-install`: Do not automatically install `@architect/architect` as a dependency in the project
21
+
-`-p`, `--plugin`: Create a new scaffolded [Architect plugin][plugins] instead of a new Architect project
22
+
-`--runtime`, `-r`: Create a new project with the specified runtime. Defaults to `node`. See the [`runtime` configuration documentation][runtimes] for available options.
0 commit comments