2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Amazon AuroraをterraformでLaunchするアレ

Last updated at Posted at 2016-03-27

俺です。

terraform v0.6.11で書いたやつです。
subnetは自分で作ってねという。
任意のwriter nodeとparameter groupを指定できないのが痛い。
ただwriter nodeのfailoverは40秒ぐらいで終わるので作った後ターゲットのAZでなければ手動failしてしまえばよいかなと。

resource "aws_rds_cluster_instance" "aurorasaikou" {
  cluster_identifier = "${aws_rds_cluster.aurorasaikou.id}"
  identifier         = "${aws_rds_cluster.aurorasaikou.cluster_identifier}-${count.index}"
  instance_class     = "db.r3.large"
  db_subnet_group_name = "${aws_db_subnet_group.backend.name}"
  publicly_accessible = false
  count = 3
  depends_on = ["aws_db_subnet_group.backend"]
}

resource "aws_rds_cluster" "aurorasaikou" {
  cluster_identifier = "aurorasaikou"
  availability_zones = ["ap-northeast-1a", "ap-northeast-1c"]
  database_name = "aurorasaikou"
  master_username = "aurorasaikouuser"
  master_password = "Aurorasa1ko%"
  final_snapshot_identifier = true
  port = 3306
  apply_immediately = true
  vpc_security_group_ids = [""${aws_security_group.default.id}"]
  db_subnet_group_name = "backend"
}

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?