问题描述
@H_404_0@我正在python中使用CDK部署Lambda函数
from aws_cdk import (
core,aws_lambda as _lambda
)
class MyLambdaStack(core.Stack):
def __init__(self,id,scope: core.Construct,**kwargs) -> None:
super().__init__(id,scope,**kwargs)
my_function = _lambda.Function(self,"MyLambda",runtime=_lambda.Runtime.PYTHON_3_8,handler="MyLambda.handler",code=_lambda.Code.from_asset(
'./lambda',bundling=core.BundlingOptions(
image=_lambda.Runtime.PYTHON_3_8.bundling_docker_image,command=[
'bash','-c','pip install -r requirements.txt -t /asset-output && cp -au . /asset-output'
],)
)
)
@H_404_0@捆绑正常工作,但是每次,我每次运行cdk
命令时,docker镜像都会旋转,并且pip install
命令运行。
@H_404_0@即使cdk ls
也会导致分发包运行。
@H_404_0@如何防止在每个cdk
命令中运行该命令?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)