kind-keyboard-17263
04/29/2022, 4:59 PMconst pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");
// Create a public HTTP endpoint (using AWS APIGateway)
const endpoint = new awsx.apigateway.API("hello", {
routes: [
// Serve a simple REST API on `GET /name` (using AWS Lambda)
{
path: "/source",
method: "GET",
eventHandler: (req: any, ctx: any, cb: any) => {
cb(undefined, {
statusCode: 200,
body: Buffer.from(JSON.stringify({ name: "AWS" }), "utf8").toString("base64"),
isBase64Encoded: true,
headers: { "content-type": "application/json" },
})
}
}
]
});
// Export the public URL for the HTTP service
exports.url = endpoint.url;
but I am having the following error:
Type Name Status Info
pulumi:pulumi:Stack store_event-dev **failed** 1 error; 2 warnings └─ aws:apigateway:x:API hello
~ ├─ aws:apigateway:RestApi hello updated
+ └─ aws:apigateway:Deployment hello **creating failed** 1 error
Diagnostics:
aws:apigateway:Deployment (hello):
error: 1 error occurred:
* Error creating API Gateway Deployment: BadRequestException: The REST API doesn't contain any methods
pulumi:pulumi:Stack (store_event-dev):
warning: resource plugin aws is expected to have version >=5.3.0, but has 5.2.0; the wrong version may be on your path, or this may be a bug in the plugin
warning: resource plugin aws is expected to have version >=5.3.0, but has 5.2.0; the wrong version may be on your path, or this may be a bug in the plugin
error: update failed
Resources:
~ 1 updated
13 unchanged
Duration: 4s
Which I am not able to find much about 😕billowy-army-68599
package.json
and the output of pulumi plugin ls
kind-keyboard-17263
04/29/2022, 5:44 PMNAME KIND VERSION SIZE INSTALLED LAST USED
aws resource 5.3.0 368 MB n/a 1 day ago
aws resource 5.2.0 368 MB n/a 3 days ago
aws resource 4.38.1 350 MB n/a 2 hours ago
aws-apigateway resource 0.0.6 171 MB n/a 2 hours ago
docker resource 3.2.0 40 MB n/a 1 day ago
TOTAL plugin cache size: 1.3 GB
{
"name": "store_event",
"devDependencies": {
"@types/node": "^14"
},
"dependencies": {
"@pulumi/aws": "^5.0.0",
"@pulumi/aws-apigateway": "0.0.6",
"@pulumi/awsx": "^0.40.0",
"@pulumi/cloud": "^0.30.1",
"@pulumi/cloud-aws": "^0.30.1",
"@pulumi/pulumi": "^3.0.0"
}
}
billowy-army-68599
pulumi stack output
show? everything looks okay nowkind-keyboard-17263
04/30/2022, 6:46 AM[nix-shell:~/dev/lvtia/aws/aws_ts]$ pulumi stack output
Please choose a stack: dev
Current stack outputs (0):
No output values currently in this stack
Can it be that during a few tests the AWS env got corrupted (and there I mean in full desync with pulumi stack) ?billowy-army-68599
pulumi plugin rm -a
then start again by reinstalling the your node moduleskind-keyboard-17263
04/30/2022, 7:47 PM