aws / aws/aws-cli

Package command uploads entire directory when using SAM InlineCode

Open
#3,763 3 comments 6 reactions 0 assignees View on GitHub
cloudformation package-deploy customization feature-request p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

SAM recently released support for `InlineCode`, however, when the package command gets run it zips+uploads the entire current directory (even though it doesn't get used). I believe this is the issue https://github.com/aws/aws-cli/blob/d0fd4d2e2856e441156c0ba333eb119c7abd977e/awscli/customizations/cloudformation/artifact_exporter.py#L125.

Repro:

Create a SAM template with the following Resource:

```yaml
MyFunction:
Type: AWS::Serverless::Function
Properties:
InlineCode: |
exports.handler = async (event) => {
return event
}
Handler: index.handler
Runtime: nodejs8.10
```

Run `aws cloudformation package` command.

Result: You can see the entire current directory gets zipped and uploaded to S3.

Expected: It doesn't.

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.