我希望能够使用Terraform在Google Cloud Platform中精细地创建/修改PostgreSQL CloudSQL实例。目前有一个设置tier = "<instance_type>"
取自Terraform文档
name = "master-instance"
database_version = "POSTGRES_11"
region = "us-central1"
settings {
# Second-generation instance tiers are based on the machine
# type. See argument reference below.
tier = "db-f1-micro"
}
}
我如何修改它以匹配我现在拥有的?我可以创建自定义图片以在GCP中使用吗?
我看到有一个方法,使自定义图像在这里,但我怎么会在Terraform使用它?
实例层是计算机类型,对于自定义计算机类型,您可以像下面这样在该变量中设置值:db-custom-<CPUs>-<Memory_in_MB>
因此,例如:
name = "master-instance"
database_version = "POSTGRES_11"
region = "us-central1"
settings {
# Second-generation instance tiers are based on the machine
# type. See argument reference below.
tier = "db-custom-12-61440"
}
}
我将其复制到项目中,并使用此值创建了具有12个CPU和60 GB内存的实例
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句