I have a Resource in my template.yml:
MyLayer:
Type: AWS::Serverless::LayerVersion
Properties:
ContentUri: layers/my-layer
CompatibleRuntimes:
- python3.8
Metadata:
BuildMethod: makefile
This is my Makefile:
build-MyLayer:
mkdir -p "$(ARTIFACTS_DIR)/python"
cp *.py "$(ARTIFACTS_DIR)/python"
python -m pip install -r requirements.txt -t "$(ARTIFACTS_DIR)/python"
Every time while I doing sam build
and then sam deploy
the layer MyLayer deploys to the AWS and new version creating. Even if I do not change the code of the MyLayer module.
How can I disable a layer new version creating in every deploy?