Implement PostgreSQL Flex database resource and data source (#453)

* Implement db resource

* Implement db data source

* Extend acc test

* Improve logs in other resources

* Add examples

* Generate docs

* Fix linter
This commit is contained in:
João Palet 2024-07-09 14:05:58 +01:00 committed by GitHub
parent 3fb28d1248
commit 34388eb361
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 923 additions and 29 deletions

View file

@ -84,13 +84,13 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
}
r.client = apiClient
tflog.Info(ctx, "PostgresFlex user client configured")
tflog.Info(ctx, "Postgres Flex user client configured")
}
// Schema defines the schema for the data source.
func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgresFlex user data source schema. Must have a `region` specified in the provider configuration.",
"main": "Postgres Flex user data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`,`user_id`\".",
"user_id": "User ID.",
"instance_id": "ID of the PostgresFlex instance.",
@ -182,7 +182,7 @@ func (r *userDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
if resp.Diagnostics.HasError() {
return
}
tflog.Info(ctx, "PostgresFlex user read")
tflog.Info(ctx, "Postgres Flex user read")
}
func mapDataSourceFields(userResp *postgresflex.GetUserResponse, model *DataSourceModel) error {