Hi folks ! I am starting now with Pulumi on AWS, a...
# aws
k
Hi folks ! I am starting now with Pulumi on AWS, and I am trying to execute this, straight from https://www.pulumi.com/docs/guides/crosswalk/aws/lambda/:
Copy code
const 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:
Copy code
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 😕
b
can you share your
package.json
and the output of
pulumi plugin ls
k
plugins:
Copy code
NAME            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
Package.json:
Copy code
{
  "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"
  }
}
thanks for helping me out
b
what does
pulumi stack output
show? everything looks okay now
k
Copy code
[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) ?
No standard pulumi example gets installed, actually. Everything fails for the same error ...
🤷‍♂️
b
I would clear out your plugin cache
pulumi plugin rm -a
then start again by reinstalling the your node modules
k
Ty dude, will try asap
This didn't work 😞