Argus/Postgresflex Credentials import documentation and fix (#22)

* Add documentation

* Remove password from datasource

* Fix bug§

* add warning

* Create logAndWarning function
This commit is contained in:
Vicente Pinto 2023-09-25 10:47:28 +01:00 committed by GitHub
parent 9b5ca058ef
commit d3cdbf0e2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 87 additions and 8 deletions

View file

@ -326,6 +326,10 @@ func (r *userResource) ImportState(ctx context.Context, req resource.ImportState
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("project_id"), idParts[0])...)
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("instance_id"), idParts[1])...)
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("user_id"), idParts[2])...)
core.LogAndAddWarning(ctx, &resp.Diagnostics,
"Postgresflex user imported with empty password",
"The user password is not imported as it is only available upon creation of a new user. The password field will be empty.",
)
tflog.Info(ctx, "Postgresflex user state imported")
}