Be able to disable globals for a resource
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Describe your idea/feature/enhancement
I have layers setup in my globals, because I'm too lazy to add them to each function (I have ~50):
```
Globals:
Function:
Layers:
- !Ref Layer1
- !Ref Layer2
- !Ref Layer3
```
But they conflict once the changeset is generated:
`ERROR: Runtime, Handler, Layers cannot be present when PackageType is of type Image`
This is because some of my lambdas are images and some aren't.
```
thisLambdaIsAZipFile:
Type: AWS::Serverless::Function
thisLambdaIsADockerImage:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
```
### Proposal
I have a handful of ways to fix this:
1. I could unset layers by putting a falsey value `Layers: null`, but it crashes (#1951)
2. I could unset layers by putting an empty array `Layers: []`, but it gives me the same error as above
3. Maybe layers could be ignored during the creation of the changeset when its an image type being pushed
4. There could be an option to disable specific globals for that function, or maybe some way to define these functions outside of the context of globals
Contributor guide
Assessment
This issue has not been assessed yet.