我需要一些关于Terraform中的以下工作流程的想法。
我正在尝试构建一个工作流程,其中我将:
1)将数据文件(变量)存储在一个集中位置。
2)将TF计划/模块文件存储在另一个位置(这些文件将使用上述数据文件来替换变量,并最终应用于基础设施)
本质上保持TF计划和可变数据的分离。
任何关于这方面的建议都将非常感谢。提前谢谢。
发布于 2019-11-18 07:30:13
一般情况下,我会这样构造terraform:
variables.tf- this stores variable definitions
- eg. "I require a database hostname and password as strings
- this is committed into version control
- this DOES NOT store the actual database hostname, password or other sensitive variables
- this allows terraform to verify that you pass in the variables during run time
terraform.tfvars- stores sensitive variables
- eg. `database_password=shhhdonttell` (hopefully more secure than this)
- this IS NOT committed to version control because it stores sensitive data
terraform.tfvars
terraform.tfvars.dist terraform.tfvars,并填充database_password=<add database password here>
这就是我所遵循的结构。我将所有敏感变量存储在LastPass中,并将它们共享给团队中的其他人。然后可以将变量从LastPass复制粘贴到terraform.tfvars中。
https://stackoverflow.com/questions/58868546
复制相似问题