quick bug in the docs: `environment` is missing in...
# sst
s
quick bug in the docs:
environment
is missing in the Properties on the right sidebar. https://docs.serverless-stack.com/constructs/Function
f
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
We could use a pattern like a separate options object as an optional argument. I think that could be helpful.
s
ahh of course! right
man, the CDK docs are sooo bad in some places.
f
@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
I’ve survived PHP, Wordpress and Android, CDK is no problem.
s
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
@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
well, according to AWS support, you put the layer ARN there 😳
a
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.