Closed therougeb closed 8 months ago
@therougeb I believe your
FunctionArn: !GetAtt
- AuthenticateCookie-dev
- Arn
is incorrect. CloudFormation intrinsic functions take a LogicalId no the Function Name. If you look at the error carefully, you can see SAM CLI is reporting it did not find AuthenticateCookie-dev
but did find AuthenticateCookie
. This is because SAM CLI looks at the LogicalIds (just like CloudFormation).
Update that and give it another try.
As a side note, naming is usually an anti-pattern in CloudFormation. There are cases you have to but general, you should let CloudFormation decide the name for you. This will be a combination of LogicalId + StackName + hash. This simplifies your template and makes it easier to deploy. You won't run into naming conflicts this way at all, since StackNames need to be unique within the account. If you have a good reason to name, go for it. I have seen this hurt to many customers over time, so wanted to bring it up in case you weren't aware you can omit.
Hi @therougeb, does @jfuss's comment above help resolve the issue?
Closing due to inactivity, please create another issue if you still have the same problem, or any other problems.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description:
While testing with sam cli, a local api, i'm unable to link lambda authorizer with api endpoints. Maybe I've missed something or i'm doing it wrong
Steps to reproduce:
Observed result:
with template provided:
if I update template and put
I am able to link authorizer with lambda on sam local start-api but i get this when invoking endpoint:
Expected result:
I expect, even if aws can't guarantee 100% fidelity between deployed / local env at least correct linking on local env between resources / authorizer.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.97.0Add --debug flag to command you are running