Skip to content

Latest commit

 

History

History
101 lines (80 loc) · 3.31 KB

README-CN.md

File metadata and controls

101 lines (80 loc) · 3.31 KB

terraform-alicloud-rds

本 Module 用于在阿里云的 VPC 下创建一个rds云数据库.

本 Module 支持创建以下资源:

Terraform 版本

本模板要求使用版本 Terraform 0.12。

用法

module "mysql" {
  source  = "terraform-alicloud-modules/rds/alicloud"
  profile = "Your-Profile-Name"
  region  = "cn-beijing"
  
  engine            = "MySQL"
  engine_version    = "8.0"
  connection_prefix = "developmentabc"
  vswitch_id        = "vsw-bp1tili2u5kpgdk84osjk"
  instance_storage  = 20
  period            = 1
  instance_type     = "rds.mysql.s2.large"
  instance_name     = "myDBInstance"
  instance_charge_type       = "Postpaid"
  security_ips = [
    "11.193.54.0/24",
    "121.43.18.0/24"
    ]
    
  tags = {
    Created      = "Terraform"
    Environment = "dev"
  }
  
  ###############
  #backup_policy#
  ###############
  preferred_backup_period     = ["Monday", "Wednesday"]
  preferred_backup_time       = "00:00Z-01:00Z"
  backup_retention_period     = 7
  log_backup_retention_period = 7
  enable_backup_log           = true
  
  ###########
  #databases#
  ###########
  account_name = "account_name1"
  password     = "1234abc"
  type         = "Normal"
  privilege    = "ReadWrite"
  databases = [
    {
      name          = "dbuserv1"
      character_set = "utf8"
      description   = "db1"
    },
    {
      name          = "dbuserv2"
      character_set = "utf8"
      description   = "db2"
    },
  ]
}

示例

注意事项

  • 本 Module 使用的 AccessKey 和 SecretKey 可以直接从 profileshared_credentials_file 中获取。如果未设置,可通过下载安装 aliyun-cli 后进行配置.

作者

Created and maintained by He Guimin(@xiaozhu36, [email protected])

许可

Apache 2 Licensed. See LICENSE for full details.

参考