Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make discover causes Invalid base64 error [FIX OFFERED] #231

Open
danstreeter opened this issue Dec 19, 2021 · 0 comments
Open

make discover causes Invalid base64 error [FIX OFFERED] #231

danstreeter opened this issue Dec 19, 2021 · 0 comments

Comments

@danstreeter
Copy link

When using make discover to test from a local system, an Invalid base64 error is returned from AWS.

This is also true when running the make command manually and is due to the inbound payload being raw JSON.

Not being an expert on either Makefile's or the invocation parameters of Lambda from the AWS CLI tool - I didnt want to raise a PR to fix this in the makefile, but offer up the solution here as I do not know the effect this change might have on other opereating systems or environments.

The link below states 'If you are on windows' - but I am working on OSX, but it still worked.

Basically the 'fix' was to add the following line into the discover task in the makefile:

        --cli-binary-format=raw-in-base64-out \

The whole task then looks like:

discover:
	@aws lambda invoke \
		--function-name $(FUNCTION_NAME) \
		--cli-binary-format=raw-in-base64-out \
		--payload ${DISCOVERY_PAYLOAD} \
		/dev/fd/3 3>&1 >/dev/null | jq '.'

Origin / Reference: https://bobbyhadz.com/blog/aws-cli-invalid-base64-lambda-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant