@@ -34,15 +34,16 @@ type CloudSqlPostgresqlProviderModel struct {
3434}
3535
3636type ConnectionConfig struct {
37- ConnectionName types.String `tfsdk:"connection_name"`
38- Database types.String `tfsdk:"database"`
39- Username types.String `tfsdk:"username"`
40- Password types.String `tfsdk:"password"`
41- Proxy types.String `tfsdk:"proxy"`
42- PrivateIP types.Bool `tfsdk:"private_ip"`
43- PSC types.Bool `tfsdk:"psc"`
44- SslMode types.String `tfsdk:"ssl_mode"`
45- // IAMAuthentication types.Bool `tfsdk:"iam_authentication"` # Not supporting IAM authentication for now.
37+ ConnectionName types.String `tfsdk:"connection_name"`
38+ Database types.String `tfsdk:"database"`
39+ Username types.String `tfsdk:"username"`
40+ Password types.String `tfsdk:"password"`
41+ Proxy types.String `tfsdk:"proxy"`
42+ PrivateIP types.Bool `tfsdk:"private_ip"`
43+ PSC types.Bool `tfsdk:"psc"`
44+ SslMode types.String `tfsdk:"ssl_mode"`
45+ GoogleApiAccessToken types.String `tfsdk:"google_api_access_token"`
46+ // IAMAuthentication types.Bool `tfsdk:"iam_authentication"` # Not supporting IAM authentication on the database for now.
4647}
4748
4849func (p * CloudSqlPostgresqlProvider ) Metadata (ctx context.Context , req provider.MetadataRequest , resp * provider.MetadataResponse ) {
@@ -177,6 +178,12 @@ func (p *CloudSqlPostgresqlProvider) Configure(ctx context.Context, req provider
177178 "The provider cannot create the Cloud SQL Postgresql client as there is an unknown configuration value for the `ssl_mode`" )
178179 }
179180
181+ if connectionConfig .GoogleApiAccessToken .IsUnknown () {
182+ resp .Diagnostics .AddAttributeError (connectionConfigsPath .AtName ("google_api_access_token" ),
183+ "Unknown Cloud SQL Postgresql google api access token value" ,
184+ "The provider cannot create the Cloud SQL Postgresql client as there is an unknown configuration value for `google_api_access_token`" )
185+ }
186+
180187 if resp .Diagnostics .HasError () {
181188 return
182189 }
0 commit comments