aws-lambda-layer-cli 1.4.1
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/LICENSE +21 -0
- package/README.md +393 -0
- package/bin/aws-lambda-layer.js +89 -0
- package/completion/aws-lambda-layer-completion.bash +101 -0
- package/completion/aws-lambda-layer-completion.zsh +110 -0
- package/package.json +31 -0
- package/scripts/aws-lambda-layer +821 -0
- package/scripts/build_pypi.sh +37 -0
- package/scripts/create_nodejs_layer.sh +459 -0
- package/scripts/create_python_layer.sh +465 -0
- package/scripts/install.js +34 -0
- package/scripts/install.ps1 +663 -0
- package/scripts/install.sh +107 -0
- package/scripts/pypi_resources/__init__.py +9 -0
- package/scripts/pypi_resources/cli.py +83 -0
- package/scripts/sync_version.js +24 -0
- package/scripts/uninstall.ps1 +180 -0
- package/scripts/uninstall.sh +58 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#compdef aws-lambda-layer
|
|
2
|
+
|
|
3
|
+
_aws-lambda-layer() {
|
|
4
|
+
local -a commands runtime_opts common_opts node_opts python_opts
|
|
5
|
+
|
|
6
|
+
commands=(
|
|
7
|
+
'zip:Create and package a Lambda layer as zip file'
|
|
8
|
+
'publish:Create and publish a Lambda layer to AWS (uses IAM credentials)'
|
|
9
|
+
'help:Show help message'
|
|
10
|
+
'--help:Show help message'
|
|
11
|
+
'--version:Show version information'
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
runtime_opts=(
|
|
15
|
+
'--nodejs:Node.js runtime'
|
|
16
|
+
'--node:Node.js runtime'
|
|
17
|
+
'-n:Node.js runtime'
|
|
18
|
+
'--python:Python runtime'
|
|
19
|
+
'--py:Python runtime'
|
|
20
|
+
'-p:Python runtime'
|
|
21
|
+
'--runtime:runtime:(nodejs python)'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
common_opts=(
|
|
25
|
+
'--name:name:'
|
|
26
|
+
'--help'
|
|
27
|
+
'-h'
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
publish_opts=(
|
|
31
|
+
'--description:description:'
|
|
32
|
+
'--layer-name:layer-name:'
|
|
33
|
+
'--profile:profile:'
|
|
34
|
+
'--region:region:'
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
node_opts=(
|
|
38
|
+
'--node-version:version:'
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
python_opts=(
|
|
42
|
+
'--python-version:version:'
|
|
43
|
+
'--no-uv'
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
_arguments -C \
|
|
47
|
+
'1: :->command' \
|
|
48
|
+
'2: :->runtime_or_option' \
|
|
49
|
+
'3: :->packages' \
|
|
50
|
+
'*: :->options'
|
|
51
|
+
|
|
52
|
+
case $state in
|
|
53
|
+
command)
|
|
54
|
+
_describe 'command' commands
|
|
55
|
+
;;
|
|
56
|
+
runtime_or_option)
|
|
57
|
+
if [[ $words[2] == "zip" ]] || [[ $words[2] == "publish" ]]; then
|
|
58
|
+
_describe 'runtime' runtime_opts
|
|
59
|
+
fi
|
|
60
|
+
;;
|
|
61
|
+
packages)
|
|
62
|
+
# After runtime, expect packages as positional argument
|
|
63
|
+
_message 'comma-separated packages (e.g., express@4.18.2,lodash)'
|
|
64
|
+
;;
|
|
65
|
+
options)
|
|
66
|
+
# Check if runtime is already specified
|
|
67
|
+
local runtime=""
|
|
68
|
+
for word in ${words[@]}; do
|
|
69
|
+
case $word in
|
|
70
|
+
--nodejs|--node|-n|--runtime=nodejs)
|
|
71
|
+
runtime="nodejs"
|
|
72
|
+
break
|
|
73
|
+
;;
|
|
74
|
+
--python|--py|-p|--runtime=python)
|
|
75
|
+
runtime="python"
|
|
76
|
+
break
|
|
77
|
+
;;
|
|
78
|
+
esac
|
|
79
|
+
done
|
|
80
|
+
|
|
81
|
+
if [[ -n $runtime ]]; then
|
|
82
|
+
# Check if this is publish command for extra options
|
|
83
|
+
local cmd_opts=()
|
|
84
|
+
if [[ $words[2] == "publish" ]]; then
|
|
85
|
+
cmd_opts=($common_opts $publish_opts)
|
|
86
|
+
else
|
|
87
|
+
cmd_opts=($common_opts)
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
case $runtime in
|
|
91
|
+
nodejs)
|
|
92
|
+
_arguments -s \
|
|
93
|
+
$cmd_opts \
|
|
94
|
+
$node_opts
|
|
95
|
+
;;
|
|
96
|
+
python)
|
|
97
|
+
_arguments -s \
|
|
98
|
+
$cmd_opts \
|
|
99
|
+
$python_opts
|
|
100
|
+
;;
|
|
101
|
+
esac
|
|
102
|
+
else
|
|
103
|
+
# Still need runtime
|
|
104
|
+
_describe 'runtime' runtime_opts
|
|
105
|
+
fi
|
|
106
|
+
;;
|
|
107
|
+
esac
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_aws-lambda-layer "$@"
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aws-lambda-layer-cli",
|
|
3
|
+
"version": "1.4.1",
|
|
4
|
+
"description": "CLI tool for creating and publishing AWS Lambda layers for Node.js and Python.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/yukcw/aws-lambda-layer-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/yukcw/aws-lambda-layer-cli/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/yukcw/aws-lambda-layer-cli#readme",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"sync-version": "node scripts/sync_version.js",
|
|
16
|
+
"prepublishOnly": "npm run sync-version"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"aws-lambda-layer": "bin/aws-lambda-layer.js"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin/",
|
|
26
|
+
"completion/",
|
|
27
|
+
"scripts/",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
]
|
|
31
|
+
}
|