holy-lambda

Karol Wójcik 2021-07-07T09:11:54.134500Z

Does anyone here have mac with m1 excluding @steveb8n. I would like to know whether stack:sync fails on your machine.

steveb8n 2021-07-07T05:45:57.087Z

@karol.wojcik I’m starting to play with this. I’ve hit my first hurdle in that I use aws-vault i.e. I don’t have a default aws profile

steveb8n 2021-07-07T08:13:00.099100Z

ok I’m back and playing with it again

steveb8n 2021-07-07T08:13:34.099300Z

trying to be methodically, here’s my plan…

steveb8n 2021-07-07T08:13:35.099500Z

## Env

- M1 mac
- docker desktop
- bb 
- aws-vault (not required until deploy. not using HL for deploy)

## Goals

1. sample using :babashka running locally (invoke and api)
2. sample using :native compile locally
3. sample using :native running locally (invoke and api)
4. sample using :native deployed to AWS

5. mylambda running locally (api) - discover best runtime for REPL connection / interactive changes?
6. mylambda compiled locally
7. mylambda deployed to AWS
   
8. mylambda compiled in CI deployed to AWS. Winning!

steveb8n 2021-07-07T08:13:57.099700Z

does any of this look difficult to you?

steveb8n 2021-07-07T08:15:41.099900Z

I suspect using my M1 mac is causing problems….

steveb8n 2021-07-07T08:16:13.100600Z

➜  holy-lambda-example bb stack:sync
[holy-lambda] Command <stack:sync>
[holy-lambda] Syncing project and holy-lambda deps.edn
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[holy-lambda] Babashka pods found! Syncing babashka pods. Pods should be distributed via a layer which points to .holy-lambda/pods
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Could not find /project/.holy-lambda/clojure-tools-1.10.3.849.jar
Attempting download from 
Cloning: 

steveb8n 2021-07-07T08:18:51.100800Z

this hangs at the last step. in Docker desktop I see a warning about the image used in the container “image may have poor performance or fail if running via emulation”. the process in the container pegs 2 cores at 100% and never completes so I have to kill it

steveb8n 2021-07-07T08:19:05.101Z

I wonder if this will only work on an Intel Mac?

steveb8n 2021-07-07T08:19:55.101200Z

before all of that: when is the best time to reach out to you for help? I’m aware that you probably have a job 🙂

Karol Wójcik 2021-07-07T08:50:42.111800Z

@steveb8n you can write to me anytime, however if you would like to setup a call, then 4pm Warsaw time is most optimal for me. I will answer all the questions starting from the bottom: 1. warning you see should not stop you from using HL as far as I can tell. You’re probably the only user of HL with M1, but still it should not be a problem (at least I hope so). 2. The last step is cloning in which it hangs? How long did you wait? What I can see is that you’re trying babashka runtime which requires a special layer to work. During stack:sync HL tries to deploy the layer for you, but it’s not possibile since you have fake credentials. My sugestiom are: • set :self-manage-layers? option in bb.edn to true • manually deploy the layer: https://serverlessrepo.aws.amazon.com/#!/applications/eu-central-1/443526418261/holy-lambda-babashka-runtime and reference it’s ARN. • Remove all the :pods for now, since you probably not using any Regarding invoke/api do you mean bb stack:invoke and bb stack:api?

steveb8n 2021-07-07T08:52:25.113800Z

ok. you are right that I don’t really want layers. I’m just using :babashka to prove the minimal case.

steveb8n 2021-07-07T08:52:41.114300Z

what I really want is :native i.e. no layers

Karol Wójcik 2021-07-07T08:52:43.114500Z

Regarding goals, they seem rather typical I would say. I would probably have some hints regarding 5) which we can discuss further on call.

steveb8n 2021-07-07T08:53:04.114900Z

should I skip the minimal :babashka goals in that case?

Karol Wójcik 2021-07-07T08:53:08.115200Z

Yep

Karol Wójcik 2021-07-07T08:53:12.115500Z

I would do that

Karol Wójcik 2021-07-07T08:53:29.116100Z

I would try :java runtime at first

steveb8n 2021-07-07T08:53:39.116400Z

ok. I’ll start with :native right away

steveb8n 2021-07-07T08:54:09.116800Z

4pm your time is midnight my time. the earth is working against our collaboration

steveb8n 2021-07-07T08:54:51.117600Z

If I get really stuck then I’ll gladly stay up late for it but, for now, I’ll try iterating via slack like this

steveb8n 2021-07-07T08:55:05.118200Z

I’ll try :java now

Karol Wójcik 2021-07-07T08:56:18.119800Z

Tomorrow I am available the whole day, so we can arrange a call anytime you want

Karol Wójcik 2021-07-07T08:57:03.120600Z

Btw how do you test your lambas locally with cdk?

steveb8n 2021-07-07T08:57:54.120800Z

my current lambdas are cljs. I run them inside a node local server and I wrote a layer to mock api-gw requests into thek

steveb8n 2021-07-07T08:57:56.121Z

them

steveb8n 2021-07-07T08:58:05.121200Z

I like the idea of using SAM instead

Karol Wójcik 2021-07-07T08:59:26.122700Z

You would have to make sure that lambdas are declared in template.yml if you would like to use bb stack:api, bb stack:invoke

steveb8n 2021-07-07T08:59:29.122900Z

my deeper goal is to fix slow cold-starts because I have a chain of 3 lambdas in my prod system. an authorizer, a dispatcher and a runner. 3 cljs cold starts is way too long so I’m gonna replace 2 of the 3 (not the runner) with a native version

steveb8n 2021-07-07T09:00:34.123100Z

hmm, looks like a similar hang for stack:sync using :java. I’ll wait a while and see if it gets any further

steveb8n 2021-07-07T09:00:55.123300Z

I waited > 10 mins last time

steveb8n 2021-07-07T09:02:16.123500Z

re testing: I’ll do most of it using mocked requests and aws api call with .cljc sources/tests

steveb8n 2021-07-07T09:02:49.123700Z

but having a local runtime is also needed for running the full stack on a dev machine

Karol Wójcik 2021-07-07T09:04:59.124700Z

I’m worried about hanging stack:sync.

Karol Wójcik 2021-07-07T09:05:47.126100Z

Please try bb stack:prune, bb stack:sync. Show me please the output of bb stack:doctor.

steveb8n 2021-07-07T09:05:48.126300Z

me too. it possible that it’s a docker problem. the docker desktop for M1 is still beta

steveb8n 2021-07-07T09:06:31.126600Z

it completed once when I first tried it. I might restart the docker daemon and see if that helps

steveb8n 2021-07-07T09:07:20.127700Z

same hang now. > 5 mins in. no network traffic, 2 cores at 100%. I’ll kill it and try a restart

Karol Wójcik 2021-07-07T09:08:17.128600Z

Do you use VPN?

Karol Wójcik 2021-07-07T09:08:49.129600Z

Try to but :network ”host” in your :docker option.

Karol Wójcik 2021-07-07T09:09:03.130200Z

It seems like it hangs on downloading the dependencies.

steveb8n 2021-07-07T09:09:22.130900Z

no VPN

Karol Wójcik 2021-07-07T09:10:06.132100Z

Use bb stack:prune, show me the output of doctor and run sync again.

Karol Wójcik 2021-07-07T09:10:31.132900Z

Btw what memory limit did you specify in GUI?

steveb8n 2021-07-07T09:12:50.134600Z

my ISP had an outage this afternoon, so I could have a messed up DNS cache on this machine. I think I’ll try a full reboot to rule that out

steveb8n 2021-07-07T09:13:14.135Z

using “host” didn’t change behaviour

Karol Wójcik 2021-07-07T09:13:18.135300Z

The clojure -P hangs there

Karol Wójcik 2021-07-07T09:13:29.135800Z

This is what I’m using in docker

Karol Wójcik 2021-07-07T09:13:55.136300Z

Try to run it locally

steveb8n 2021-07-07T09:14:35.137Z

➜  holy-lambda-example bb stack:prune
----- Error --------------------------------------------------------------------
Type:     java.lang.Exception
Message:  File does not exist: stack:prune

Karol Wójcik 2021-07-07T09:15:38.137600Z

It should be stack:purge then.

steveb8n 2021-07-07T09:16:09.138Z

➜  holy-lambda-example bb stack:doctor
[holy-lambda] Command <stack:doctor>

[holy-lambda] ---------------------------------------
[holy-lambda]  Checking health of holy-lambda stack
[holy-lambda]  Home directory is:        /Users/steve
[holy-lambda]  Project directory is:     /Users/steve/Documents/oss/holy-lambda-example
[holy-lambda]  AWS SAM version:          SAM CLI, version 1.26.0
[holy-lambda]  AWS CLI version:          aws-cli/2.2.17 Python/3.9.6 Darwin/20.4.0 source/arm64 prompt/off
[holy-lambda]  AWS directory is:         /Users/steve/.aws
[holy-lambda]  AWS directory exists?:    true
[holy-lambda]  Docker version:           Docker version 20.10.7, build f0df350
[holy-lambda]  Babashka tasks sha:       f0fb9a181445a8b153f11895475ad76cf8a5da5e
[holy-lambda]  Babashka tasks version:   0.2.2
[holy-lambda]  Babashka version:         babashka v0.4.6
[holy-lambda]  Runtime:                  :java
[holy-lambda]  Runtime version:          0.1.2
[holy-lambda]  TTY:                      true
[holy-lambda]  Runtime entrypoint:       com.company.example-lambda.core
[holy-lambda]  Stack name:               example-lambda-52640d-stack
[holy-lambda]  S3 Bucket name:           example-lambda-52640d
[holy-lambda]  S3 Bucket prefix:         holy-lambda
[holy-lambda]  S3 Bucket exists?:        false
[holy-lambda] ---------------------------------------

[holy-lambda] :runtime looks good
[holy-lambda] :runtime:entrypoint looks good
[holy-lambda] :stack:capabilities looks good
[holy-lambda] :runtime:bootstrap-file is supported only for :native runtime
[holy-lambda] :runtime:native-deps is supported only for :native runtime
[holy-lambda] :runtime:version is supported only for :babashka runtime
[holy-lambda] :runtime:pods are supported only for :babashka runtime
[holy-lambda] :runtime:native-image-args are supported only for :native runtime
[holy-lambda] :stack:name looks good
[holy-lambda] property :mvn/local-repo in file deps.edn is correct
[holy-lambda] property :mvn/local-repo in file bb.edn is correct
[holy-lambda] Syncing stack is not required
[holy-lambda] :infra:region definition looks good
[holy-lambda] :infra:bucket-prefix looks good
[holy-lambda] :stack:template looks good
[holy-lambda] :infra:bucket-name looks good, but example-lambda-52640d does not exists (use bb :bucket:create)
[holy-lambda] Required commands ["aws" "sam" "bb" "docker" "clojure" "zip" "id" "clj-kondo" "bash"] installed!

[holy-lambda] Validating template.yml
2021-07-07 19:14:57 Loading policies from IAM...
Traceback (most recent call last):
  File "/opt/homebrew/bin/sam", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py", line 153, in wrapped
    raise exception  # pylint: disable=raising-bad-type
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py", line 122, in wrapped
    return_value = func(*args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/utils/version_checker.py", line 42, in wrapped
    actual_result = func(*args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/cli/main.py", line 90, in wrapper
    return func(*args, **kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/commands/validate/validate.py", line 37, in cli
    do_cli(ctx, template_file)  # pragma: no cover
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/commands/validate/validate.py", line 59, in do_cli
    validator.is_valid()
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/commands/validate/lib/sam_template_validator.py", line 56, in is_valid
    managed_policy_map = self.managed_policy_loader.load()
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samtranslator/translator/managed_policy_translator.py", line 25, in load
    for page in page_iterator:
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/botocore/paginate.py", line 255, in __iter__
    response = self._make_request(current_kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/botocore/paginate.py", line 332, in _make_request
    return self._method(**current_kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/botocore/client.py", line 386, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/homebrew/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/botocore/client.py", line 705, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the ListPolicies operation: The security token included in the request is invalid.

steveb8n 2021-07-07T09:16:25.138300Z

does this mean that it’s still trying to reach aws?

steveb8n 2021-07-07T09:16:58.138500Z

purge was much better

steveb8n 2021-07-07T09:17:33.138700Z

same result from doctor. failing when trying to get IAM policies

steveb8n 2021-07-07T09:17:44.139100Z

would that explain the hang?

Karol Wójcik 2021-07-07T09:17:50.139400Z

Nope

steveb8n 2021-07-07T09:18:25.140500Z

I won’t bother rebooting as this seems like the culprit right?

Karol Wójcik 2021-07-07T09:18:32.140900Z

I’m trying to validate the template via sam which requires aws credentials. Ignore it

Karol Wójcik 2021-07-07T09:18:52.141400Z

It’s not connected at all

Karol Wójcik 2021-07-07T09:19:23.142100Z

Can you use clojure -P? Does it hang?

steveb8n 2021-07-07T09:20:39.142500Z

yes clojure -P runs ok. not sure what to expect from it

steveb8n 2021-07-07T09:21:00.142900Z

stack sync is now moving (after purge) i.e. downloading deps

steveb8n 2021-07-07T09:21:10.143100Z

and sync complete!

Karol Wójcik 2021-07-07T09:21:15.143500Z

Ok good.

steveb8n 2021-07-07T09:21:34.144100Z

next try stack:invoke?

Karol Wójcik 2021-07-07T09:21:40.144500Z

Yep

Karol Wójcik 2021-07-07T09:21:56.145100Z

Or bb stack:api ;)

Karol Wójcik 2021-07-07T09:22:03.145500Z

Whatever you would like.

steveb8n 2021-07-07T09:22:13.146Z

missing a jar. I suspect I need a build first

Karol Wójcik 2021-07-07T09:22:21.146400Z

Yep

Karol Wójcik 2021-07-07T09:22:48.147200Z

It’s good that tasks are informative

steveb8n 2021-07-07T09:23:05.147400Z

running stack:compile now

Karol Wójcik 2021-07-07T09:23:16.147700Z

Great!

Karol Wójcik 2021-07-07T09:24:04.148800Z

Btw i will add an entry to troubleshooting guide. It seems that docker process somewhat hanged last time.

steveb8n 2021-07-07T09:24:39.149100Z

4 cores working very hard

steveb8n 2021-07-07T09:25:01.149300Z

➜  holy-lambda-example bb stack:compile
[holy-lambda] Command <stack:compile>
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[main] INFO hf.depstar.uberjar - Compiling com.company.example-lambda.core ...
[main] INFO hf.depstar.uberjar - Building uber jar: .holy-lambda/build/output.jar
➜  holy-lambda-example 

steveb8n 2021-07-07T09:25:30.149500Z

yeah the purge trick is good for troubleshooting

Karol Wójcik 2021-07-07T09:26:02.149900Z

It hangs on compile?

steveb8n 2021-07-07T09:26:22.150500Z

no compile completed fine

steveb8n 2021-07-07T09:26:27.150700Z

[holy-lambda] Command <stack:invoke>ke 
[holy-lambda] ----------------------------- Runtime Output: ----------------------------
[holy-lambda] Invoking com.company.example-lambda.core.ExampleLambda (java8)
Decompressing /Users/steve/Documents/oss/holy-lambda-example/.holy-lambda/build/output.jar
Skip pulling image and use local one: amazon/aws-sam-cli-emulation-image-java8:rapid-1.26.0.

Mounting /private/var/folders/x3/v5swftpj3gx3bt3wvlzkzwy80000gn/T/tmpkofppcl6 as /var/task:ro,delegated inside runtime container
START RequestId: ed161c24-e703-4a62-83b9-543d6e3b412b Version: $LATEST
Function 'ExampleLambdaFunction' timed out after 40 seconds
No response from invoke container for ExampleLambdaFunction

[holy-lambda] -------------------------------------------------------------------------

[holy-lambda] ----------------------------- Function Output: --------------------------
[holy-lambda] 
[holy-lambda] -------------------------------------------------------------------------
➜  holy-lambda-example 

steveb8n 2021-07-07T09:27:01.151Z

I’m out of my depth trying to understand that last log

Karol Wójcik 2021-07-07T09:27:30.151400Z

Function times out

steveb8n 2021-07-07T09:27:39.151700Z

is it that the jvm took too long to start?

Karol Wójcik 2021-07-07T09:27:49.152100Z

How much memory did you set on docker?

steveb8n 2021-07-07T09:27:50.152300Z

I wonder if M1 docker emulation is just really slow?

steveb8n 2021-07-07T09:28:22.152700Z

Karol Wójcik 2021-07-07T09:28:43.153500Z

It should be at least 8 GB

steveb8n 2021-07-07T09:28:55.153900Z

ok. did I not RTFM?

Karol Wójcik 2021-07-07T09:28:55.154100Z

That’s first thing

Karol Wójcik 2021-07-07T09:29:20.154500Z

kinda :D

steveb8n 2021-07-07T09:29:49.155300Z

sorry 🙂

Karol Wójcik 2021-07-07T09:29:52.155600Z

Did you change anything in the implementation of lambda?

steveb8n 2021-07-07T09:30:47.156600Z

no changes to code from clj-new

Karol Wójcik 2021-07-07T09:31:20.157500Z

Use 80 seconds instead of 40 in template.yml.

steveb8n 2021-07-07T09:31:54.158400Z

ok. trying 80

Karol Wójcik 2021-07-07T09:31:58.158700Z

Btw it looks like docker support on M1 is quite bad now

steveb8n 2021-07-07T09:33:01.159Z

I have an intel OSX laptop also. I can try this there

steveb8n 2021-07-07T09:33:17.159200Z

it’s just half as fast

steveb8n 2021-07-07T09:33:30.159400Z

80 secs worked!

steveb8n 2021-07-07T09:33:45.159600Z

[holy-lambda] ----------------------------- Function Output: --------------------------
[holy-lambda] {"statusCode":200,"headers":{"content-type":"text/plain; charset=utf-8","Custom-Header":"Some Value"},"body":"Hello world"}
[holy-lambda] -------------------------------------------------------------------------

Karol Wójcik 2021-07-07T09:34:03.159900Z

XD

steveb8n 2021-07-07T09:34:10.160300Z

hi five

Karol Wójcik 2021-07-07T09:34:20.160700Z

That’s make me laugh

steveb8n 2021-07-07T09:34:31.161Z

trying api now

Karol Wójcik 2021-07-07T09:34:41.161400Z

👋🙌

Karol Wójcik 2021-07-07T09:34:57.162Z

Remember that you have to visit the site to invoke lambda

steveb8n 2021-07-07T09:35:42.163300Z

the irony of doing this to get faster cold starts on aws

Karol Wójcik 2021-07-07T09:35:50.163800Z

On my machine :java runtime takes like 9s to respond. This is the response time I see on AWS as well.

steveb8n 2021-07-07T09:35:54.164Z

api working now too

steveb8n 2021-07-07T09:36:20.164400Z

once loaded, api response is instant

steveb8n 2021-07-07T09:36:34.164800Z

I can check off a couple of goals now

steveb8n 2021-07-07T09:36:47.165400Z

thanks. I gotta go eat my dinner now too

Karol Wójcik 2021-07-07T09:36:50.165600Z

You can use native:executable to produce native artifact

steveb8n 2021-07-07T09:37:29.166Z

ok, trying that before dinner

Karol Wójcik 2021-07-07T09:38:06.166600Z

Make sure to use it with :runtime :native

steveb8n 2021-07-07T09:38:31.167400Z

the cli told me to do that. good error handling

Karol Wójcik 2021-07-07T09:38:32.167600Z

Like: bb native:executable :runtime :native

steveb8n 2021-07-07T09:38:47.168Z

waiting on big graal command now…

steveb8n 2021-07-07T09:40:21.168200Z

maybe no surprise that graal is slow in a slow docker container

Karol Wójcik 2021-07-07T09:41:57.169Z

Let me know when it finishes. You can add some cores to docker as well. Maybe it could help a least a little bit.

steveb8n 2021-07-07T09:43:11.169400Z

yeah this is gonna take a while. still going strong

steveb8n 2021-07-07T09:43:36.169600Z

I can always try the native build on the intel laptop. just do local dev on the M1

steveb8n 2021-07-07T09:44:33.170Z

I see what I can learn about the docker emulation/perf on M1 as well. maybe something I can do about that

steveb8n 2021-07-07T09:45:02.170600Z

but, for now I have enough to progress so I’ll carry on with it tomorrow first thing

steveb8n 2021-07-07T09:46:00.171100Z

I’ll touch base with you again tomorrow to discuss getting a good combo of SAM/REPL/local going

steveb8n 2021-07-07T09:46:19.171500Z

thanks for the help! I will pay this forward with my own OSS project soon

Karol Wójcik 2021-07-07T09:46:25.171900Z

Sure! We can settle a call for this! ;)

steveb8n 2021-07-07T09:47:01.172100Z

great. have a good day

Karol Wójcik 2021-07-07T09:54:54.172400Z

U2

steveb8n 2021-07-07T05:46:41.087100Z

do I have no choice but to create a default profile? I don’t want this because it’s much less secure than using aws-vault

steveb8n 2021-07-07T06:05:24.087300Z

I looked up the check done for aws access and tried that…

steveb8n 2021-07-07T06:05:25.087500Z

➜ holy-lambda-example aws configure get region --profile default ap-southeast-2 ➜ holy-lambda-example echo $? 0 ➜ holy-lambda-example

steveb8n 2021-07-07T06:05:58.087700Z

zero exit code in zsh but for some reason the bb task still rejects it

steveb8n 2021-07-07T06:06:49.087900Z

my goal is to run local (native) and compile. I don’t need aws access for this right?

Karol Wójcik 2021-07-07T06:10:21.088400Z

You don’t need AWS access for this

steveb8n 2021-07-07T06:11:05.088700Z

great. that’s what I thought

steveb8n 2021-07-07T06:11:13.089Z

but bb tasks returns….

steveb8n 2021-07-07T06:11:37.089600Z

➜ holy-lambda-example bb tasks The following tasks are available: [holy-lambda] AWS configuration check failed. Unable to get value from the profile: default Did you run command: aws configure? ➜ holy-lambda-example

Karol Wójcik 2021-07-07T06:11:38.089800Z

What bb task are you trying?

steveb8n 2021-07-07T06:12:01.090500Z

no task yet. just “bb tasks”

Karol Wójcik 2021-07-07T06:12:28.091400Z

Hmm.. i will put this check in bb stack:doctor. I did not realize that some people don’t use profiles

Karol Wójcik 2021-07-07T06:12:43.092Z

How AWS vault works with AWS sam?

steveb8n 2021-07-07T06:13:06.092300Z

not sure, I haven’t used SAM before. just installed it now

steveb8n 2021-07-07T06:13:25.092500Z

but I use CDK for deploys so no SAM until HL

Karol Wójcik 2021-07-07T06:13:33.092900Z

Ok got it

Karol Wójcik 2021-07-07T06:14:15.093300Z

Give me 2 minutes please

steveb8n 2021-07-07T06:14:22.093500Z

no probs

steveb8n 2021-07-07T06:14:45.094100Z

in fact, I’m going out for an hour. will check back later

Karol Wójcik 2021-07-07T06:14:55.094500Z

Question: cannot you just put anything in profile?

steveb8n 2021-07-07T06:15:44.094700Z

not gone yet 🙂 not sure but I use ~/.aws/config and yes, I can put anything I want in there

Karol Wójcik 2021-07-07T06:16:18.095300Z

.aws/crendentials

[default]
aws_access_key_id = hello
aws_secret_access_key = world

Karol Wójcik 2021-07-07T06:16:20.095500Z

Put it there

Karol Wójcik 2021-07-07T06:16:26.095800Z

It should work that way I think

steveb8n 2021-07-07T06:17:11.096300Z

ok I’ll see if that works and doesn’t break aws-vault

Karol Wójcik 2021-07-07T06:17:39.096500Z

Just checked AWS vault

Karol Wójcik 2021-07-07T06:18:01.096700Z

It seems that I should check whether environment variables are set

steveb8n 2021-07-07T06:18:03.096900Z

cool. bb tasks now works

steveb8n 2021-07-07T06:20:04.097100Z

stack:sync is running ok too

Karol Wójcik 2021-07-07T06:20:17.097300Z

Cool. You can progress now 🙂

steveb8n 2021-07-07T06:20:29.097500Z

it did warn me that I’m on an M1 mac but I’ll play with it now and see what I can learn

Karol Wójcik 2021-07-07T06:20:47.097700Z

What did warn you?

Karol Wójcik 2021-07-07T06:20:57.097900Z

It's not my warning 😄

steveb8n 2021-07-07T06:22:08.098100Z

I think it’s from docker but I’ll keep digging

steveb8n 2021-07-07T06:22:22.098300Z

aws-vault not broken with your workaround so that’s good too

steveb8n 2021-07-07T06:22:36.098500Z

ok. I’m heading out now. will let you know how I get on later

Karol Wójcik 2021-07-07T06:24:55.098700Z

As long as you don't touch any tasks like bb bucket:create, bb stack:deploy, bb stack:destroy, bb bucket:remove, bb bucket:pack it will work 🙂

Karol Wójcik 2021-07-07T06:25:31.098900Z

In meantime I will work to take secret, access keys from environment variables if possible