-1

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?

jonua
  • 1,915
  • 3
  • 17
  • 27

1 Answers1

0

I found a solution which responds to my requirements. I am create a separated folder with template.yaml which describes a one resource (AWS::Serverless::LayerVersion) only. When I need release a new version I make a build that resource

jonua
  • 1,915
  • 3
  • 17
  • 27