Skip to content

[lambda] Can't use imported lambda with ELBv2 #8597

@stevensu1977

Description

@stevensu1977

❓ General Issue

The Question

I need create ALB with lambda , when I create new Lambda , I use add_permission give lambda resource policy , it's work, but when I use from_function_arn load exits lambda , get:

"No child with id: 'InvokeServicePrincipal(elasticloadbalancing.amazonaws.com)'" error
        # create new lambda , it's work
        # my_lambda = _lambda.Function(
        #     self, 'HelloHandler',
        #     runtime=_lambda.Runtime.PYTHON_3_7,
        #     code=_lambda.Code.asset('lambda'),
        #     handler='hello.handler',
        # )

        #load exits lambda not work
        my_lambda = _lambda.Function.from_function_arn(self,"HelloHandler","arn:aws:lambda:us-east-1:596030579944:function:hello-envoy-lambda")

Environment

  • CDK CLI Version: 1.45.0 (build 0cfab15)
  • Module Version: 1.45.0
  • Node.js Version: 12.4
  • OS: OSX
  • Language (Version): Python (3.7.3)

Other information

jsii.errors.JSIIError: No child with id: 'InvokeServicePrincipal(elasticloadbalancing.amazonaws.com)'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions