Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-alb-lambda: Does not allow ApplicationLoadBalancerProps #30951

Closed
darrenflannerypoppulo opened this issue Jul 25, 2024 · 2 comments
Closed
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. p2

Comments

@darrenflannerypoppulo
Copy link

Describe the bug

On the aws-alb-lambda it says you can specify ApplicationLoadBalancerProps, but says the following This cannot specify a VPC, it will use the VPC in existingVpc or the VPC created by the construct. .

I tried to all ApplicationLoadBalancerProps without a vpc so I can specify what subnets I want the ALB to be created in, but I get an error, saying 'vpc' is a required field.

When I add a vpc, the same as the existing_vpc property. I also get an error: Specify any existing VPC at the construct level, not within loadBalancerProps.

My Code:

alb_to_lambda = AlbToLambda(
            self,
            f"{STACK_PREFIX}{self.stack_config.function_name}AlbToLambda",
            lambda_function_props=FunctionProps(
                runtime=Runtime.PYTHON_3_9,
                handler=self.stack_config.function_handler,
                code=get_lambda_code(self.stack_config.lambda_code_path),
                function_name=f"{STACK_PREFIX}{self.stack_config.function_name}",
                description=f"{STACK_PREFIX}{self.stack_config.function_description}",
                log_retention=RetentionDays.FIVE_DAYS,
                timeout=Duration.seconds(30),
                environment=self.stack_config.environment,
                dead_letter_queue=dlq,
                memory_size=self.stack_config.memory_size,
            ),
            target_props=elbv2.ApplicationTargetGroupProps(
                target_group_name=f"{STACK_PREFIX}{self.stack_config.function_name}TG",
                health_check=elbv2.HealthCheck(
                    path="/healthcheck", interval=Duration.minutes(5), enabled=True
                ),
            ),
            existing_vpc=vpc,
            listener_props=elbv2.BaseApplicationListenerProps(
                certificates=[certificate],
            ),
            load_balancer_props=elbv2.ApplicationLoadBalancerProps(
                vpc_subnets=subnets,
            ),
            public_api=False,
        )

Expected Behavior

I can add ApplicationLoadBalancerProps to AlbToLambda construct

Current Behavior

I cannot add ApplicationLoadBalancerProps to AlbToLambda construct without getting an error

Reproduction Steps

Try to deploy an AlbToLambda construct using ApplicationLoadBalancerProps as a property

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.143

Framework Version

No response

Node.js Version

n/a

OS

Linux

Language

Python

Language Version

No response

Other information

No response

@darrenflannerypoppulo darrenflannerypoppulo added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jul 25, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Jul 25, 2024

Hi @darrenflannerypoppulo,

Thanks for opening the issue. The package aws-alb-lambda is part of https://github.com/awslabs/aws-solutions-constructs repository. This issue should be opened in that repository. Looks like we cannot transfer this issue to that repository. Please open a new issue in that repository so that you get updates as issue is being worked upon.

Thanks,
Ashish

@ashishdhingra ashishdhingra added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2024
@ashishdhingra ashishdhingra self-assigned this Jul 25, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. p2
Projects
None yet
Development

No branches or pull requests

2 participants