Stan
Stan

Reputation: 21

Specifying CloudSQL Postgres instance name in Springboot configuration

I'm working on connecting a CloudSQL Postgres instance to a Springboot application. The connection currently is on JDBC and is specified in the application.properties

app.datasource.url=jdbc:mysql://localhost/test
app.datasource.username=dbuser
app.datasource.password=dbpass
app.datasource.pool-size=30

@ConfigurationProperties("app.datasource")
public HikariDataSource dataSource()
{
    return DataSourceBuilder.create().type(HikariDataSource.class).build(); 
}

With CloudSQL, I've changed the url, username and password. I'm told I also need to specify the Postgres instance name, without which the connection seems to be failing.

I tried adding in app.datasource.instance="instance-name", but that doesn't give me any resolution.

Any advice here?

Upvotes: 0

Views: 36

Answers (0)

Related Questions