https://serverless-stack.com/ logo
#sst
Title
# sst
s

Sam Hulick

08/12/2021, 4:01 AM
quick bug in the docs:
environment
is missing in the Properties on the right sidebar. https://docs.serverless-stack.com/constructs/Function
f

Frank

08/12/2021, 4:10 AM
Hey Sam,
sst.Function
extends the
lambda.Function
, so all the extended props are not listed.
(@Jay @thdxr something for us to think about for the docs. Do we want to document our constructs in a way where ppl don’t have to flip back and forth between SST doc and CDK doc?)
a

Ashishkumar Pandey

08/12/2021, 4:20 AM
We could use a pattern like a separate options object as an optional argument. I think that could be helpful.
s

Sam Hulick

08/12/2021, 4:23 AM
ahh of course! right
man, the CDK docs are sooo bad in some places.
f

Frank

08/12/2021, 4:24 AM
@Ashishkumar Pandey, can you share a brief example? something like this?
Copy code
new sst.Function(this, "MyFunction", {
  handler: "...",
  cdkOptions: {
    // all the inherited options go here
  },
});
a

Ashishkumar Pandey

08/12/2021, 4:24 AM
I’ve survived PHP, Wordpress and Android, CDK is no problem.
s

Sam Hulick

08/12/2021, 4:25 AM
like this: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.LayerVersion.html#addwbrpermissionid-permission what is “id”? just a string 😄 no clue as to what it should be, or what it does.
a

Ashishkumar Pandey

08/12/2021, 4:25 AM
@Frank yep, that looks perfect. It would simply be a union of all the other cdk options.
@Sam Hulick, yep it’s just a string, looks like an identifier so that you could maybe refer it and manipulate it later.
s

Sam Hulick

08/12/2021, 4:28 AM
well, according to AWS support, you put the layer ARN there 😳
a

Ashishkumar Pandey

08/12/2021, 4:29 AM
wait, let me check the code.
I think it’s the id to be used in the other account (at best) or just a simple identifier. It won’t be the arn of the source layer because you already have an instance of it.