0

I do a SAM deployment from my local console. With sam package ... --s3-bucket xy I specify the existing s3-bucket where deployment relevant objects are stored. I want that bucket to appear in the Output section in Cloudformation but I don't know how to reference it. If I look under Template in the web console I see the path:

Resources:
  MyLambda:
    Properties:
      CodeUri: s3://xy/1b26f7841...

So I tried to add

Outputs:
  SourceBucket:
    Value: !GetAtt MyLambda.Properties.CodeUri

to my template.yaml, but the deployment fails with Requested attribute Properties.CodeUri does not exist in schema for AWS::Lambda::Function

peer
  • 4,171
  • 8
  • 42
  • 73

1 Answers1

0

Sadly you can't do this. AWS::Serverless::Function does not return such information. You would have to use custom resource to get it.

Alternatively, if you pass the bucket uri as input parameter to your template, you can output the parameter's value directly.

Marcin
  • 215,873
  • 14
  • 235
  • 294