cdk-app-cli 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,29 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The operator CLI for CDK apps. Experimental.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
cdk-app [construct] [subcommand]
|
|
5
|
+
`cdk-app` lets you associate commands with CDK constructs so that you can quickly invoke functions, redrive queues, visit resources in the AWS console, and more by just referencing the construct name.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Positionals:
|
|
11
|
-
construct [string] [required]
|
|
12
|
-
subcommand [string]
|
|
7
|
+
### Examples:
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Extra configuration options available via environment variables:
|
|
19
|
-
|
|
20
|
-
- CDK_APP_DIR - Path to cdk.out.
|
|
21
|
-
- AWS_REGION - AWS region to run commands in.
|
|
22
|
-
```
|
|
9
|
+
* `cdk-app MyLambda tail-logs` - stream logs in real time from the Lambda's log group
|
|
10
|
+
* `cdk-app TransactionTable visit-console` - open the AWS console page for your table
|
|
11
|
+
* `cdk-app OrderQueue redrive-queue` - retry messages that failed to get processed
|
|
23
12
|
|
|
24
13
|
## 🚀 Getting Started
|
|
25
14
|
|
|
26
15
|
Create a [CDK app](https://www.npmjs.com/package/aws-cdk) with a Lambda
|
|
27
|
-
function, and deploy it to your account.
|
|
16
|
+
function, and deploy it to your AWS account.
|
|
28
17
|
|
|
29
18
|
```ts
|
|
30
19
|
const fn = new lambda.Function(this, 'MyLambda', {
|
|
@@ -45,7 +34,7 @@ Commands:
|
|
|
45
34
|
audit-console
|
|
46
35
|
```
|
|
47
36
|
|
|
48
|
-
Run a command to instantly access the
|
|
37
|
+
Run a command to instantly access the construct in the AWS console:
|
|
49
38
|
|
|
50
39
|
```
|
|
51
40
|
$ cdk-app MyLambda visit-console
|
|
@@ -62,9 +51,12 @@ $ cdk-app MyLambda describe
|
|
|
62
51
|
...
|
|
63
52
|
```
|
|
64
53
|
|
|
65
|
-
Any extra arguments you pass will get automatically passed through to the
|
|
54
|
+
Any extra arguments you pass will get automatically passed through to the
|
|
55
|
+
underlying command.
|
|
66
56
|
|
|
67
|
-
You can
|
|
57
|
+
You can add your own commands by defining a JSON or YAML file in your CDK app
|
|
58
|
+
named `construct-commmands`. For example, here we define some commands that use
|
|
59
|
+
the [awslogs](https://github.com/jorgebastida/awslogs) CLI:
|
|
68
60
|
|
|
69
61
|
```yaml
|
|
70
62
|
# construct-commands.yml
|
|
@@ -102,14 +94,37 @@ done
|
|
|
102
94
|
|
|
103
95
|
## 📖 Documentation
|
|
104
96
|
|
|
105
|
-
### Command
|
|
97
|
+
### Command line options
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
cdk-app [construct] [subcommand]
|
|
101
|
+
|
|
102
|
+
Run an operator command on your CDK app's constructs.
|
|
103
|
+
|
|
104
|
+
Positionals:
|
|
105
|
+
construct [string] [required]
|
|
106
|
+
subcommand [string]
|
|
107
|
+
|
|
108
|
+
Options:
|
|
109
|
+
--version Show version number [boolean]
|
|
110
|
+
--help Show help [boolean]
|
|
111
|
+
|
|
112
|
+
Extra configuration options available via environment variables:
|
|
113
|
+
|
|
114
|
+
- CDK_APP_DIR - Path to cdk.out.
|
|
115
|
+
- AWS_REGION - AWS region to run commands in.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### construct-commands.json
|
|
119
|
+
|
|
120
|
+
#### Command types
|
|
106
121
|
|
|
107
122
|
| Type | Description |
|
|
108
123
|
| ----------- | ----------- |
|
|
109
124
|
| open | Specify a URL or file to open. |
|
|
110
125
|
| exec | Specify a command to run in your shell. |
|
|
111
126
|
|
|
112
|
-
|
|
127
|
+
#### Command substitutions
|
|
113
128
|
|
|
114
129
|
| Syntax | Description |
|
|
115
130
|
| ----------- | ----------- |
|