Difference between revisions of "Terraform resource: aws db instance"

From wikieduonline
Jump to navigation Jump to search
Line 17: Line 17:
 
=== Basic example ===
 
=== Basic example ===
  
  resource "aws_db_instance" "my_mysql_instance" {
+
  resource "aws_db_instance" "my_mariadb_instance" {
 
   allocated_storage    = 10
 
   allocated_storage    = 10
  engine              = "[[mariadb]]"
 
  engine_version      = "5.7"
 
 
   instance_class      = "[[db.t3.micro]]"
 
   instance_class      = "[[db.t3.micro]]"
 
   name                = "mydb"
 
   name                = "mydb"
 
   username            = "foo"
 
   username            = "foo"
 
   password            = "foobarbaz"
 
   password            = "foobarbaz"
  parameter_group_name = "default.mysql5.7"
 
 
   skip_final_snapshot  = true
 
   skip_final_snapshot  = true
 
  }
 
  }

Revision as of 20:34, 1 June 2022

Official example

resource "aws_db_instance" "default" {
  allocated_storage    = 10
  engine               = "mysql"
  engine_version       = "5.7"
  instance_class       = "db.t3.micro"
  name                 = "mydb"
  username             = "foo"
  password             = "foobarbaz"
  parameter_group_name = "default.mysql5.7"
  skip_final_snapshot  = true
}

Basic example

resource "aws_db_instance" "my_mariadb_instance" {
  allocated_storage    = 10
  instance_class       = "db.t3.micro"
  name                 = "mydb"
  username             = "foo"
  password             = "foobarbaz"
  skip_final_snapshot  = true
}

Arguments

Related terms

See also

  • https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#backup_retention_period
  • Advertising: