Resource Policy is not being created for Lambda when using Lambda version but is being created when using new Lambda.
Example shows creating new resource policy for api gateway to invoke weatherFunction lambda version 13
_lambda.Version.from_version_attributes(self, id='stageVersion',lambda_=weatherFunction,version='13').add_permission(id='invokeweatherfnversion13',principal=iam.ServicePrincipal(service='apigateway.amazonaws.com'),
action='lambda:InvokeFunction',source_arn=api.arn_for_execute_api(stage='dev', method='GET',path='/')
)
Resource Policy is not being created for Lambda when using Lambda version but is being created when using new Lambda.
Reproduction Steps:
Create a new lambda function and publish a new version for it.
Create a new resource policy for the created lambda version.
Example shows creating new resource policy for api gateway to invoke weatherFunction lambda version 13
Error Log
No error message
Environment
Other
This is 🐛 Bug Report