Hello! it's been a while since I used pulumi and I...
# aws
p
Hello! it's been a while since I used pulumi and I'm just starting a new project. Is
pulumi logs
expected to work with Crosswalk (awsx) out of the box?
This post is from 2019 when I last tried it out https://www.pulumi.com/blog/unified-logs-with-pulumi-logs/
This is what I see when I try running it locally
Copy code
$ pulumi -v 10 logs
Please choose a stack: dev
Collecting logs for stack dev since 2022-06-27T15:03:47.000-04:00.

error: failed to get logs: 28 errors occurred:
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
	* no AWS region found
I'm logged in to pulumi and running this locally
this is all that's in the stack (and i've successfully run
pulumi up
Copy code
const api = new awsx.apigateway.API('myapi', {
  routes: [
    {
      path: '/api/v1',
      method: 'GET',
      eventHandler: async () => {
        return {
          statusCode: 200,
          body: '<h1>Hello world!</h1>',
        };
      },
      authorizers: [
        awsx.apigateway.getRequestLambdaAuthorizer({
          queryParameters: ['auth'],
          handler: async (event: awsx.apigateway.AuthorizerEvent) => {
            // Add your own custom authorization logic here.
            // Access the headers using event.headers, the query parameters using
            // event.queryStringParameters or path parameters using event.pathParameters
            return awsx.apigateway.authorizerResponse(
              'user',
              'Allow',
              event.methodArn,
            );
          },
        }),
      ],
    },
  ],
});
b
have you set an aws region in your aws profile?
p
i'll double check but i at least exported AWS_REGION=us-east-1
in that shell
no difference if i set region = us-east-1 in my aws credentials file
I verified i can see the cloudwatch log groups etc. in the aws console
Copy code
$ pulumi version
v3.35.1
on mac os catalina
l
What is the provider set up to use? If you're using a profile in the provider, then the env var won't be used. If you're using the default provider, then it will.
p
you mean in my Pulumi.yml?
l
No, in the provider object you're passing into the various resource constructors.
p
the code is above, i'm pretty sure I'm using the defaults
it was deployed via github actions which passed the aws region into the github action
ok i had to
pulumi config set aws:region us-east-1
l
Good. That is the preferred way to set the region on the default AWS provider.
p
That's what i get for running it on github before locally haha. Thanks!
👍 1