Open your CDK project and create a new stack named ProductsServiceStack. Have ProductsServiceStack inherit from the Stack class from the amazon.awscdk library.

To create the ProductsServiceStack, we need to include several dependencies such as VPC, Cluster, NetworkLoadBalancer, ApplicationLoadBalancer, and Repository that were created earlier. Therefore, we need to define a record class named ProductsServiceProps to pass into the ProductsServiceStack. Add the following code snippet outside the ClusterStack class:
record ProductsServiceProps(
Vpc vpc,
Cluster cluster,
NetworkLoadBalancer networkLoadBalancer,
ApplicationLoadBalancer applicationLoadBalancer,
Repository repository
){}

public ProductsServiceStack(final Construct scope, final String id,
final StackProps props, ProductsServiceProps productsServiceProps) {
super(scope, id, props);
}
