CodePipeline policy with LambdaInvokeAction wrongly assumes that ImportValue of a Lambda is the ARN but it is the logical ID
See original GitHub issue🐛 Bug Report
What is the problem?
A CodePipeline with a LambdaInvokeAction wrongly assumes that ImportValue of a Lambda is the ARN but it is the logical ID. The pipeline policy also wrongly assumes the import value.
Reproduction Steps
Clone https://github.com/khornberg/cdk-bugs
Install pip packages (assuming one has the npm package already)
Run cdk synth --path-metadata false --version-reporting false --app "python3 pipeline-lambda-invoke-action-bug.py"
Verbose Log
https://github.com/khornberg/cdk-bugs/blob/master/output.yaml
Pipeline action Lines 78-82 are wrong and will fail
Fn::Select:
- 6
- Fn::Split:
- ":"
- Fn::ImportValue: SomeFunction
Policy Lines 135-138
- Action: lambda:InvokeFunction
Effect: Allow
Resource:
Fn::ImportValue: SomeFunction
The action is created thus
LambdaInvokeAction(
action_name="LambdaInvokeAction",
run_order=1,
lambda_=Function.from_function_arn(
self, "function", core.Fn.import_value("SomeFunction")
),
)
Environment
- CDK CLI Version: 1.5.0 (build c020efa)
- Module Version: 1.6.1
- OS: OSX Mojave
- Language: Python
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Invoke an AWS Lambda function in a pipeline in CodePipeline
This topic assumes you are familiar with AWS CodePipeline and AWS Lambda and know how to create pipelines, functions, and the IAM policies...
Read more >@aws-cdk/aws-codepipeline-actions | Yarn - Package Manager
This package contains Actions that can be used in a CodePipeline. import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as ...
Read more >codepipeline.putJobSuccessResult() Hanging when Invoking ...
The hanging behavior implies it is a networking issue, but if CodePipeline has an endpoint to the VPC and successfully is able to...
Read more >@aws-cdk/aws-codepipeline: Versions | Openbase
Full version history for @aws-cdk/aws-codepipeline including change logs. ... lambda-python: handler path is incorrectly generated when using PythonFunction ...
Read more >Cloudformation ImportValue within ParameterOverride ...
AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: SAM Template for Deploy Python code to Lambda Parameters ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No I’ve since moved on
@khornberg is there anything else we can help you with this issue?