Lambda 函数调用 Codepipeline 并传递参数。可能吗?

问题描述 投票:0回答:1

有没有人尝试过或有基于 python 的 Lambda 函数的示例,我在其中调用特定的代码管道,但我想以在 Codebuild 过程中使用这些变量的方式传递变量?

我通常在代码构建过程中放入环境变量,所以我想影响它们。

amazon-web-services lambda aws-lambda aws-codepipeline aws-codebuild
1个回答
0
投票
使用 boto3(或任何其他 AWS 开发工具包)中的 start_pipeline_execution 调用,无法将参数传递给 CodePipeline,因为 [CodePipeline API][2] 不支持它。

更新:现在支持此功能,您可以通过管道执行指定变量列表,例如使用Python boto3。
response = client.start_pipeline_execution(
    name='string',
    variables=[
        {
            'name': 'string',
            'value': 'string'
        },
    ],
    ...
)

请参阅 https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/codepipeline/client/start_pipeline_execution.html#

© www.soinside.com 2019 - 2024. All rights reserved.