Hi, I am trying to set up a cache policy for Cloud...
# help
t
Hi, I am trying to set up a cache policy for CloudFront. The cache policy requires having a unique name, so I need to “decorate” it with a stage name. So I try to use:
Copy code
cachePolicyName: scope.stageName + 'CFrontCachePolicy'
where scope is
<http://sst.App|sst.App>
. The problem is that
stageName
is empty. What is the reason for that?
f
Try
scope.stage
Alternatively, you can do:
Copy code
cachePolicyName: scope.logicalPrefixedName("CFrontCachePolicy")
t
ok, let me check
works, thanks
f
btw, where did you see
scope.stageName
?
I’m asking b/c we should update the doc if it was mis-documented somewhere.
t
My IDE uses autocomplete so this is my first choice. Maybe some documentation in the code should be required.
f
Ah I see. Are you using VSCode?