(aws-sam): cannot generate string policies for CfnFunction
See original GitHub issueThe property CfnFunctionProps.policies
accepts a list of both objects and strings. However, when I try to generate a list with a string, an empty object is generated instead.
Reproduction Steps
Running cdk synth
with the following construct:
new CfnFunction(scope, 'MyFunction', {
policies: ['AWSLambdaExecute']
});
What did you expect to happen?
MyFunction:
Type: AWS::Serverless::Function
Properties:
Policies:
- AWSLambdaExecute
What actually happened?
MyFunction:
Type: AWS::Serverless::Function
Properties:
Policies:
- {}
Environment
- CDK CLI Version : 1.80.0
- Framework Version:
- Node.js Version: 12.18.3
- OS : Ubuntu 19.10
- Language (Version):
Other
Note that if I use a string, instead of a list of strings, the output is correct.
new CfnFunction(scope, 'MyFunction', {
policies: 'AWSLambdaExecute'
});
MyFunction:
Type: AWS::Serverless::Function
Properties:
Policies: 'AWSLambdaExecute'
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
class CfnFunction (construct) · AWS CDK - AWS Documentation
Create a new AWS::Serverless::Function . Construct Props. Name, Type, Description. architectures? string[], AWS ...
Read more >Reference local code in SAM using CfnFunction in the CDK ...
Where hello_world has the code for my function. Running sam build and sam deploy does the work of packaging and uploading the code...
Read more >Top 5 @aws-cdk/aws-sam Code Examples - Snyk
To help you get started, we've selected a few @aws-cdk/aws-sam examples, based on popular ways it is used in public projects.
Read more >awssam - Go Packages
Construct, id *string, props *CfnFunctionProps) CfnFunction ... The Removal Policy controls what happens to this resource when it stops // being managed by ......
Read more >Mastering the AWS Serverless Application Model (AWS SAM)
When building serverless applications, you have a wide range of options for building your infrastructure and developing your code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Which means we need to make sure that a string is not a valid object in our validation logic.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.