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년 전307회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠