I'm using maven plugin to deploy to AppEngine. I need to be logged in to gloud to be able to deploy services. I need to be logged in to gcloud to be able to use Cloud SQL Auth Proxy also. Now I don't see any way to set deployer account separately to Cloud SQL Auth Proxy account which means I have to use the same account which has broad privileges starting from deployment and ending with 'Cloud SQL Connector/Instance User'. Is it a design flaw? Did I miss something?
Desired state:
- Manually scaled service in AppEngine Flex (basically a singleton, legacy monolith app)
- Cloud SQL PostgreSQL instance
- Separate service account for deployment with .json key
- Separate service account (IAM) for Cloud SQL Auth Proxy with .json key
UPDATE.
Temporarily solved by this config:
spring-context.xml
<beans profile="appengine">
<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
<property name="poolName" value="springHikariCP" />
<property name="connectionTestQuery" value="SELECT 1" />
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="connectionTimeout" value="600000"/>
<property name="jdbcUrl" value="${db.url}" />
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
<property name="dataSourceProperties">
<props>
<prop key="sslmode">disable</prop>
</props>
</property>
</bean>
app.yaml
env_variables:
JAVA_OPTS: >-
-Ddb.username=postgres -Ddb.password=postgres-password
-Ddb.url=jdbc:postgresql://127.0.0.1:3306/dbname?cloudSqlInstance=project:location:instance&socketFactory=com.google.cloud.sql.postgres.SocketFactory
beta_settings:
#tcp sockets:
cloud_sql_instances: project:location:instance=tcp:3306