cloudtools / cloudtools/troposphere

Lambda Code Property Does Not Support String Value.

Open
#1,069 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
4.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

In the below "AWS::Lambda::Function" definition, for the "Code" property, I can just add a String value that is path to my lambda code. A common pattern is to use the [aws package](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html) command before deployment. This command zips the code in the directory given (e.g. /src/lib), pushes the zip file to S3, and then modifies your cloudformation file for you to update the bucket name and location.

Troposphere does not currently support the ability to provide a string value for the Code property on the AWS::Lambda::Function type.

```
Resources:
ServicePromotionsConsumer:
Type: AWS::Lambda::Function
Properties:
FunctionName: my-function
Description: "Does stuff"
Handler: "File.lambda_handler"
Role: my-role
Code: /src/lib
Runtime: python3.6
Timeout: 60
MemorySize: 128
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.