Terraform Google Vault 项目教程
terraform-google-vaultA Terraform Module for how to run Vault on Google Cloud using Terraform and Packer项目地址:https://gitcode.com/gh_mirrors/ter/terraform-google-vault
1. 项目的目录结构及介绍
terraform-google-vault/
├── examples/
│ ├── basic/
│ └── full/
├── modules/
│ ├── cluster/
│ └── network/
├── test/
├── .gitignore
├── .kitchen.yml
├── CHANGELOG.md
├── CODEOWNERS
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── main.tf
├── network.tf
├── outputs.tf
├── storage.tf
├── variables.tf
└── versions.tf
examples/: 包含基本和完整配置的示例。modules/: 包含集群和网络的模块。test/: 包含测试文件。.gitignore: Git 忽略文件。.kitchen.yml: KitchenCI 配置文件。CHANGELOG.md: 变更日志。CODEOWNERS: 代码所有者。CONTRIBUTING.md: 贡献指南。LICENSE: 许可证。Makefile: Makefile 文件。README.md: 项目说明文档。main.tf: 主 Terraform 配置文件。network.tf: 网络配置文件。outputs.tf: 输出配置文件。storage.tf: 存储配置文件。variables.tf: 变量定义文件。versions.tf: 版本配置文件。
2. 项目的启动文件介绍
main.tf: 这是项目的主配置文件,包含了 Terraform 的主要资源定义和模块调用。
module "vault" {
source = "terraform-google-modules/vault/google"
version = "~> 2.0"
project_id = var.project_id
region = var.region
kms_keyring = var.kms_keyring
kms_crypto_key = var.kms_crypto_key
}
3. 项目的配置文件介绍
variables.tf: 定义了项目中使用的变量。
variable "project_id" {
description = "The ID of the Google Cloud project"
}
variable "region" {
description = "The region to deploy resources in"
}
variable "kms_keyring" {
description = "The name of the KMS keyring"
}
variable "kms_crypto_key" {
description = "The name of the KMS crypto key"
}
outputs.tf: 定义了项目输出的变量。
output "vault_addr" {
value = module.vault.vault_addr
}
output "vault_cacert" {
value = module.vault.vault_cacert
}
versions.tf: 定义了 Terraform 和提供者的版本。
terraform {
required_version = ">= 0.12"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.0"
}
}
}
以上是 Terraform Google Vault 项目的基本教程,包含了项目的目录结构、启动文件和配置文件的介绍。希望对你有所帮助!
terraform-google-vaultA Terraform Module for how to run Vault on Google Cloud using Terraform and Packer项目地址:https://gitcode.com/gh_mirrors/ter/terraform-google-vault