terraformを使ってcloudsqlでレプリケーションをしたい。

実現したいこと

cloudsqlでレプリケーションをしたい。

発生している問題・分からないこと

マスターは作成できるがread_replicaが作成されない。

エラーメッセージ

│ Error: Provider produced inconsistent result after apply

│ When applying changes to google_sql_user.users, provider "provider["registry.terraform.io/hashicorp/google"]" produced an unexpected new value: Root object was present, but now absent.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Error creating Database: googleapi: Error 403: The client is not authorized to make this request., notAuthorized

│ with google_sql_database.database,
│ on main.tf line 18, in resource "google_sql_database" "database":
│ 18: resource "google_sql_database" "database" {



│ Error: Error, failed to create instance app1-db: googleapi: Error 400: The requested operation is not allowed with an instance that does not have binary log enabled., errorBinLogNotEnabled

│ with google_sql_database_instance.read_replica,
│ on main.tf line 34, in resource "google_sql_database_instance" "read_replica":
│ 34: resource "google_sql_database_instance" "read_replica" {

### 該当のソースコード ```terraform resource "google_sql_database_instance" "master" { name = "app1-db-1" database_version = "MYSQL_8_0" region = "asia-northeast1" project = "<project-id>" settings { tier = "db-f1-micro" } } resource "google_sql_database" "database" { name = "users-db" instance = "app1-db-1" project = "<project-id>" charset = "utf8mb4" collation = "utf8mb4_bin" } resource "google_sql_user" "users" { name = "root" instance = "app1-db-1" project = "<project-id>" host = "%" password = "Curry000" } resource "google_sql_database_instance" "read_replica" { name = "app1-db" master_instance_name = "app1-db-1" region = "asia-northeast2" database_version = "MYSQL_8_0" project = "<project-id>" settings { tier = "db-f1-micro" availability_type = "REGIONAL" ip_configuration { ipv4_enabled = true } } }

試したこと・調べたこと

上記の詳細・結果

エラーコードをぐぐりましたが、でてきませんでした。

補足

特になし

コメントを投稿

0 コメント