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
demandé il y a 2 ans307 vues
1 réponse
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).

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions