Difference between revisions of "Terraform resource: aws db instance"
Jump to navigation
Jump to search
↑ https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#backup_retention_period
Line 1: | Line 1: | ||
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance | * https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance | ||
− | == Official | + | == Official example == |
resource "aws_db_instance" "default" { | 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_mysql_instance" { | ||
allocated_storage = 10 | allocated_storage = 10 | ||
engine = "mysql" | engine = "mysql" |
Revision as of 20:22, 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_mysql_instance" { 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 }
Arguments
instance_class
(required)multi_az
engine
:aurora, aurora-mysql, aurora-postgresql
backup_retention_period
: (0-35)[1]allocated_storage
password
Related terms
See also
- Terraform AWS resources: IAM, Net, EC2, ECS, ECR, S3, Route53, ACM, CloudWatch, CloudFront SES, RDS, DLM
Advertising: