@adobe/helix-deploy 9.3.6 → 9.3.7
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/AWS.md +109 -0
- package/CHANGELOG.md +7 -0
- package/docs/images/acc_id.png +0 -0
- package/docs/images/apigateway.png +0 -0
- package/docs/images/bucket.png +0 -0
- package/docs/images/perm.png +0 -0
- package/docs/images/role.png +0 -0
- package/docs/images/secret.png +0 -0
- package/package.json +15 -15
package/AWS.md
CHANGED
|
@@ -78,3 +78,112 @@ The is no automatic installation of the proxy functions (yet).
|
|
|
78
78
|
|
|
79
79
|
[invoke]: https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html
|
|
80
80
|
|
|
81
|
+
## Getting started with `hedy` on AWS
|
|
82
|
+
|
|
83
|
+
### 1. Create a Starter Project
|
|
84
|
+
Create a simple JavaScript starter project.
|
|
85
|
+
|
|
86
|
+
src/index.js:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
const { Response } = require('@adobe/fetch');
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* This is the main function
|
|
93
|
+
* @param {Request} req Universal API Request
|
|
94
|
+
* @param {HEDYContext} context Universal API Context
|
|
95
|
+
* @returns {Response} a status response
|
|
96
|
+
*/
|
|
97
|
+
module.exports.main = async function main(req, context) {
|
|
98
|
+
const result = '{"result": "it works!"}';
|
|
99
|
+
return new Response(result, {
|
|
100
|
+
status: 200,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
package.json:
|
|
106
|
+
```
|
|
107
|
+
{
|
|
108
|
+
"name": "my-project",
|
|
109
|
+
"version": "1.0",
|
|
110
|
+
"private": true,
|
|
111
|
+
"main": "src/index.js",
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"@adobe/fetch": "4.1.0"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Build the project with `npm i`
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### 2. Configure your AWS account
|
|
122
|
+
|
|
123
|
+
Its useful to install the AWS Command Line Interface. See [Install or update the latest version of the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
|
|
124
|
+
If you're on MacOS you can just use `brew install awscli`.
|
|
125
|
+
|
|
126
|
+
* Go to the [AWS UI](https://aws.amazon.com/) and in Secrets Manager create a secret called `/helix-deploy/default/all` you can enter a dummy key and value
|
|
127
|
+
for the secret and use the default values with everything else.
|
|
128
|
+
<img width="1094" alt="secret" src="docs/images/secret.png">
|
|
129
|
+
|
|
130
|
+
* Copy your account number from the top right of the console
|
|
131
|
+
<img width="237" alt="acc_id" src="docs/images/acc_id.png">
|
|
132
|
+
|
|
133
|
+
* ... and create an associated S3 bucket named `helix-deploy-bucket-<userid>`
|
|
134
|
+
<img width="823" alt="bucket" src="docs/images/bucket.png">
|
|
135
|
+
|
|
136
|
+
* Create an API Gateway of type 'HTTP API' with name 'API Managed by Helix Deploy'
|
|
137
|
+
<img width="1132" alt="apigateway" src="docs/images/apigateway.png">
|
|
138
|
+
|
|
139
|
+
* Create a role for invoking the Lambda. Start by giving it the `AWSLambdaBasicExecutionRole`.
|
|
140
|
+
<img width="1293" alt="role" src="docs/images/role.png">
|
|
141
|
+
|
|
142
|
+
* Edit the role and add the Secrets Manager -> Read -> GetSecretValue permission.
|
|
143
|
+
<img width="1184" alt="perm" src="docs/images/perm.png">
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
Finally, to get access from the command line to your AWS account you need to configure the AWS environment.
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
$ aws sts get-session-token
|
|
150
|
+
{
|
|
151
|
+
"Credentials": {
|
|
152
|
+
"AccessKeyId": "XXXYYY",
|
|
153
|
+
"SecretAccessKey": "abcdef",
|
|
154
|
+
"SessionToken": "... lots of chars ...",
|
|
155
|
+
"Expiration": "2023-10-03T17:28:34+00:00"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
Set the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` environment variables to the values from the above JSON result. Note that the session has a maximum timespan of 1 hour, so you need to refresh this regularly.
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
At this point you should be ready to deploy your function.
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
$ npx hedy \
|
|
166
|
+
--build --verbose --directory ~/proj/hedy/temp \
|
|
167
|
+
--entryFile ~/proj/hedy/myproj/src/index.js --deploy \
|
|
168
|
+
--target aws --aws-region eu-west-1 \
|
|
169
|
+
--aws-role 'arn:aws:iam::148835428639:role/HedyInvocationRole' \
|
|
170
|
+
--aws-api 99q7f1czdf -l minor --name "myfunc@1"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
if all goes well, the the output will end with something like this:
|
|
174
|
+
```
|
|
175
|
+
{
|
|
176
|
+
"aws": {
|
|
177
|
+
"name": "amazonwebservices;host=https://99q7f1czdf.execute-api.eu-west-1.amazonaws.com",
|
|
178
|
+
"url": "https://99q7f1czdf.execute-api.eu-west-1.amazonaws.com/default/myfunc/0.0.0"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Now you can invoke your function as follows (note the URL is as reported by the `hedy` command with a slight change to the version number):
|
|
184
|
+
```
|
|
185
|
+
$ curl https://99q7f1czdf.execute-api.eu-west-1.amazonaws.com/default/myfunc/v0.0
|
|
186
|
+
{"result": "it works!"}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [9.3.7](https://github.com/adobe/helix-deploy/compare/v9.3.6...v9.3.7) (2023-10-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([c5f6f5b](https://github.com/adobe/helix-deploy/commit/c5f6f5b33a52c12839c1ac96cff46fddf2d499d0))
|
|
7
|
+
|
|
1
8
|
## [9.3.6](https://github.com/adobe/helix-deploy/compare/v9.3.5...v9.3.6) (2023-09-30)
|
|
2
9
|
|
|
3
10
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-deploy",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.7",
|
|
4
4
|
"description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/adobe/helix-deploy#readme",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@adobe/fastly-native-promises": "3.0.5",
|
|
40
40
|
"@adobe/fetch": "4.1.0",
|
|
41
|
-
"@aws-sdk/client-apigatewayv2": "3.
|
|
42
|
-
"@aws-sdk/client-lambda": "3.
|
|
43
|
-
"@aws-sdk/client-s3": "3.
|
|
44
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
45
|
-
"@aws-sdk/client-ssm": "3.
|
|
46
|
-
"@aws-sdk/client-sts": "3.
|
|
47
|
-
"@fastly/js-compute": "3.6.
|
|
41
|
+
"@aws-sdk/client-apigatewayv2": "3.427.0",
|
|
42
|
+
"@aws-sdk/client-lambda": "3.427.0",
|
|
43
|
+
"@aws-sdk/client-s3": "3.427.0",
|
|
44
|
+
"@aws-sdk/client-secrets-manager": "3.427.0",
|
|
45
|
+
"@aws-sdk/client-ssm": "3.427.0",
|
|
46
|
+
"@aws-sdk/client-sts": "3.427.0",
|
|
47
|
+
"@fastly/js-compute": "3.6.2",
|
|
48
48
|
"@google-cloud/functions": "3.0.1",
|
|
49
49
|
"@google-cloud/secret-manager": "5.0.1",
|
|
50
|
-
"@google-cloud/storage": "7.
|
|
51
|
-
"@rollup/plugin-alias": "5.0.
|
|
52
|
-
"@rollup/plugin-commonjs": "25.0.
|
|
53
|
-
"@rollup/plugin-json": "6.0.
|
|
54
|
-
"@rollup/plugin-node-resolve": "15.2.
|
|
55
|
-
"@rollup/plugin-terser": "0.4.
|
|
50
|
+
"@google-cloud/storage": "7.2.0",
|
|
51
|
+
"@rollup/plugin-alias": "5.0.1",
|
|
52
|
+
"@rollup/plugin-commonjs": "25.0.5",
|
|
53
|
+
"@rollup/plugin-json": "6.0.1",
|
|
54
|
+
"@rollup/plugin-node-resolve": "15.2.2",
|
|
55
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
56
56
|
"archiver": "6.0.1",
|
|
57
57
|
"chalk-template": "1.1.0",
|
|
58
58
|
"constants-browserify": "1.0.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@semantic-release/changelog": "6.0.3",
|
|
76
76
|
"@semantic-release/git": "10.0.1",
|
|
77
77
|
"c8": "8.0.1",
|
|
78
|
-
"eslint": "8.
|
|
78
|
+
"eslint": "8.51.0",
|
|
79
79
|
"husky": "8.0.3",
|
|
80
80
|
"lint-staged": "14.0.1",
|
|
81
81
|
"mocha": "10.2.0",
|