cloudtools / cloudtools/troposphere
Lambda Code Property Does Not Support String Value.
- 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
Assessment
This issue has not been assessed yet.