Why doesn't cloudformation support ZipFile for golang lambdas?

0

It's really painful that CloudFormation won't let me declare a lambda as a ZipFile:

Resource handler returned message: "Invalid request provided: The ZipFile attribute is not supported for the runtime 'go1.x'"

Why should it care that the content of the .zip is go? It's just an executable.

The problem is there's no clean workaround. I was going down a path of uploading the .zip separately but the problem there is if the filename (s3 key) doesn't change then CloudFormation won't think it needs an update. I can generate a random file name (s3 key) every time but that has to be passed into using --parameter-overrides which also is a little messy. It's sort of compounded by the problem that the aws sdk for go has no support for packaging stacks directly from go.

I guess this is the way it is, but go definitely is a second class citizen here, so my main question is will it always be this way?

profile picture
wz2b
質問済み 2年前308ビュー
1回答
0

The ZipFile attribute in CloudFormation only works with scripted language runtimes nodejs and python, since CloudFormation does not / cannot do the "compile" step for you. The clean way is to use S3Key as you already stated corectly. And then specify new versions with S3ObjectVersion.

AWS SAM automates these steps for you. Another tool worth a look for compiling/handling Lambdas with CloudFormation is the CDK (golang alpha module).

回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ