public AwsTeamCityTemplateRds()

in src/main/java/jetbrains/teamcity/aws/template/services/rds/AwsTeamCityTemplateRds.java [41:63]


    public AwsTeamCityTemplateRds(@NotNull final Construct scope,
                                  @NotNull final Vpc vpc,
                                  @NotNull final ApplicationLoadBalancedFargateService loadBalancedFargateService) {
        myDatabaseInstance = DatabaseInstance.Builder.create(scope, "TeamCityDatabase")
                .engine(DatabaseInstanceEngine.postgres(PostgresInstanceEngineProps.builder().version(PostgresEngineVersion.VER_16_2).build()))
                .instanceIdentifier(DATABASE_INSTANCE_IDENTIFIER)
                .databaseName(AwsTeamCityTemplateRds.DATABASE_NAME)
                .allocatedStorage(30)
                .maxAllocatedStorage(100)
                .autoMinorVersionUpgrade(false)
                .backupRetention(Duration.days(0))
                .multiAz(false)
                .vpc(vpc)
                .vpcSubnets(SubnetSelection.builder()
                        .subnetType(SubnetType.PRIVATE_WITH_EGRESS)
                        .build())
                .credentials(Credentials.fromPassword(AwsTeamCityTemplateRds.DATABASE_USERNAME, new SecretValue(DATABASE_MASTER_PASSWORD)))
                .removalPolicy(RemovalPolicy.DESTROY)
                .build();

        // Allow connections from the ECS service with setup task
        myDatabaseInstance.getConnections().allowDefaultPortFrom(loadBalancedFargateService.getService().getConnections());
    }