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

From wikieduonline
Jump to navigation Jump to search
 
(66 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
[[Terraform resource]]: <code>aws_db_instance</code>
 +
 
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance
 
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance
  
  
 +
* [[engine_version]]
 +
* [[auto_minor_version_upgrade]]
 +
* <code>[[publicly_accessible]]</code>
 +
 +
== 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 ===
 +
 +
[[Terraform: resource|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 ==
 
* <code>[[instance_class]]</code> (required)
 
* <code>[[instance_class]]</code> (required)
* <code>[[multi_az]]</code>
+
* <code>[[multi_az]]</code> (optional)
* <code>[[engine]]</code>: <code>[[aurora]], aurora-mysql, aurora-postgresql</code>
+
* <code>[[AWS RDS engines|engine]]</code>: <code>[[aurora]], aurora-mysql, aurora-postgresql, mysql, mariadb, postgres</code>
* <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>[[allocated_storage]]</code> <ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#allocated_storage</ref> (required)
* <code>[[allocated_storage]]</code>
+
* <code>[[max_allocated_storage]]</code> (optional) <ref>https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#max_allocated_storage</ref>
 +
* <code>[[db_name]]</code> (optional)
 +
* <code>[[password]]</code>
 +
* <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>[[iam_database_authentication_enabled]]</code>
 +
* <code>[[db_subnet_group_name]]</code> (optional)
 +
* <code>[[enabled_cloudwatch_logs_exports]]</code>
 +
* <code>[[monitoring_role_arn]]</code>
 +
* [[Enhanced monitoring]]: <code>[[monitoring_interval]]</code> (default 0)
 +
* <code>[[ca_cert_identifier]]</code> (Optional) The identifier of the [[CA certificate]] for the DB instance.
  
 +
== Errors ==
 +
* <code>[[will be created]]</code>
 +
* <code>[[InvalidParameterCombination]]</code>
 +
* <code>[[InstanceType]]</code>
 +
* <code>[[Warning: Redundant ignore changes element]]</code>
  
 
== Related terms ==
 
== Related terms ==
 
* <code>[[aws rds create-db-instance]]</code>
 
* <code>[[aws rds create-db-instance]]</code>
 
* [[CloudFormation]] <code>[[AWS::RDS::DBInstance]]</code>
 
* [[CloudFormation]] <code>[[AWS::RDS::DBInstance]]</code>
 +
* <code>[[aws rds describe-db-instances]]</code>
 +
* [[Terraform resource: aws_db_security_group]]
 +
* [[Terraform module: rds]]
 +
* <code>[[Error: Error creating DB Instance]]</code>
 +
* <code>[[enable_dns_hostnames]] = true</code>
 +
* <code>[[enable_dns_support]]  = true</code>
 +
* <code>[[google_sql_user]]</code>
 +
* [[tf show]] | grep .rds.amazonaws.com
 +
* [[Master password]]
 +
* [[google_sql_database_instance]]
  
 
== See also ==
 
== See also ==
 +
* {{aws_db_instance}}
 +
* {{tf rds}}
 
* {{terraform aws resources}}
 
* {{terraform aws resources}}
 +
* {{terraform aws modules}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]
 
[[Category:AWS]]
 
[[Category:AWS]]

Latest revision as of 11:49, 7 November 2024

Terraform resource: aws_db_instance


Official example[edit]

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[edit]

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[edit]

Errors[edit]

Related terms[edit]

See also[edit]

  • 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: