-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
The example provided in VpcIngressConnection does not work as the service method accepts software.amazon.awscdk.services.apprunner.alpha.IService. the service created in line 7 is of type software.amazon.awscdk.services.apprunner.alpha.Service which does not inherit from IService leading to a compilation error in the second last line when using VpcIngressConnection#service(IService)
InterfaceVpcEndpoint interfaceVpcEndpoint = InterfaceVpcEndpoint.Builder.create(this, "MyVpcEndpoint")
.vpc(vpc)
.service(InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS)
.privateDnsEnabled(false)
.build();
Service service = Service.Builder.create(this, "Service")
.source(Source.fromEcrPublic(EcrPublicProps.builder()
.imageConfiguration(ImageConfiguration.builder()
.port(8000)
.build())
.imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
.build()))
.isPubliclyAccessible(false)
.build();
VpcIngressConnection.Builder.create(this, "VpcIngressConnection")
.vpc(vpc)
.interfaceVpcEndpoint(interfaceVpcEndpoint)
.service(service). // incompatible types
.build();
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
VpcIngressConnection#service(Service) should not throw a compilation error when passing a service.
Current Behavior
A compilation error in the second last line when using VpcIngressConnection#service(IService) with the service created by Service.Builder#create()
Reproduction Steps
Just use the provided example in the documentation
Possible Solution
Either
- Make
ServiceinheritIServiceor - Change
VpcIngressConnection#service(IService)toVpcIngressConnection#service(Service)
Additional Information/Context
No response
CDK CLI Version
2.174.0
Framework Version
No response
Node.js Version
v23.5.0
OS
Mac
Language
Java
Language Version
21
Other information
No response