public ECRBasedAppRunnerService(Construct scope, String id, Role role) { super(scope, id); CfnService.HealthCheckConfigurationProperty healthCheckConfigurationProperty = new CfnService.HealthCheckConfigurationProperty.Builder() .path("/actuator/health") .protocol("HTTP") .interval(10) .timeout(5) .healthyThreshold(5) .unhealthyThreshold(1) .build(); CfnService.AuthenticationConfigurationProperty authenticationConfigurationProperty = CfnService.AuthenticationConfigurationProperty.builder().accessRoleArn(role.getRoleArn()).build(); CfnService.ImageRepositoryProperty imageRepositoryProperty = CfnService.ImageRepositoryProperty.builder() .imageIdentifier("1234567890.dkr.ecr.eu-west-1.amazonaws.com/demo-quotes-service:latest") .imageConfiguration(CfnService.ImageConfigurationProperty.builder() .port("8080") .build()) .imageRepositoryType("ECR") .build(); CfnService.SourceConfigurationProperty sourceConfigurationProperty = CfnService.SourceConfigurationProperty.builder() .imageRepository(imageRepositoryProperty) .authenticationConfiguration(authenticationConfigurationProperty) .autoDeploymentsEnabled(true) .build(); CfnService cfnService = CfnService.Builder.create(this, "AppRunnerService") .serviceName("demo-quotes-service") .instanceConfiguration(CfnService.InstanceConfigurationProperty.builder() .cpu("1 vCPU") .memory("2 GB") .build()) .sourceConfiguration(sourceConfigurationProperty) .healthCheckConfiguration(healthCheckConfigurationProperty) .build(); }