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

From wikieduonline
Jump to navigation Jump to search
Line 32: Line 32:
 
== Selected arguments ==
 
== Selected arguments ==
 
* <code>[[instance_class]]</code> (required)
 
* <code>[[instance_class]]</code> (required)
 +
* <code>[[multi_az]]</code> (optional)
 
* <code>[[AWS RDS engines|engine]]</code>: <code>[[aurora]], aurora-mysql, aurora-postgresql, mysql, mariadb, postgres</code>
 
* <code>[[AWS RDS engines|engine]]</code>: <code>[[aurora]], aurora-mysql, aurora-postgresql, mysql, mariadb, postgres</code>
 
* <code>[[allocated_storage]]</code> <ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#allocated_storage</ref> (required)
 
* <code>[[allocated_storage]]</code> <ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#allocated_storage</ref> (required)
Line 37: Line 38:
 
* <code>[[db_name]]</code> (optional)
 
* <code>[[db_name]]</code> (optional)
 
* <code>[[password]]</code>
 
* <code>[[password]]</code>
* <code>[[multi_az]]</code> (optional)
 
 
* <code>[[backup_retention_period]]</code>: [0-35]<ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#backup_retention_period</ref>
 
* <code>[[backup_retention_period]]</code>: [0-35]<ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#backup_retention_period</ref>
 
* <code>[[vpc_security_group_ids]]</code>
 
* <code>[[vpc_security_group_ids]]</code>

Revision as of 11:41, 19 April 2023

Terraform resource: aws_db_instance

Official example

resource "aws_db_instance" "default" {
  allocated_storage    = 10
  engine               = "mysql"
  engine_version       = "5.7"
  instance_class       = "db.t3.micro"
  db_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
  engine               = "mariadb"
  instance_class       = "db.t3.micro"
  db_name              = "mydb"
  username             = "foo"
  password             = "foobarbaz"
  publicly_accessible  = false
  skip_final_snapshot  = true
}

Selected arguments

Related terms

See also

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