0

Currently deploying to AWS using SAM. When referencing a Layer SAM doesnt seem to update the variable correctly?

template.yaml

Parameters:
  HelperFunctionsLayer:
    Type: String
    Default: layer-helper-functions:69

...

Outputs:
  HelperFunctionsLayer:
    Value: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:${HelperFunctionsLayer}'

Output from sam deploy:

-------------------------------------------------------------------------------------------------
Outputs                                                                                         
-------------------------------------------------------------------------------------------------
Key                 HelperFunctionsLayer                                                        
Description         -                                                                           
Value               arn:aws:lambda:us-east-1:000000000000:layer:layer-helper-functions:22       
-------------------------------------------------------------------------------------------------

Notice the version has not updated. We are deploying via GitLab runner could a version of the config be kept and not updated somewhere?

EDIT: Have now also reproduced locally without GitLab...

EDIT1: In the deployment the function does get updated but the version does not change.

The only current way we can this to work is to name the layer explicitly however this is referenced quite a few times in the template.yaml GitLab Snippet

ck3mp
  • 391
  • 5
  • 18

2 Answers2

0

consider using the --force-upload flag of sam deploy

user990492
  • 41
  • 3
0

Changing the parameter name is what finally did it for me. Kind of annoying but careful search and replace did it. So HelperFunctionsLayer could be renamed to something like HelperFunctionsLayerNew.