question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
khornbergcommented, Sep 9, 2020

No I’ve since moved on

0reactions
skinny85commented, Sep 5, 2020

@khornberg is there anything else we can help you with this issue?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found