terraform

Solid

Terraform 基础设施即代码

DevOps & Infrastructure 1 stars 0 forks Updated yesterday Apache-2.0

Install

View on GitHub

Quality Score: 79/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Terraform 基础设施即代码 ## 概述 HCL 编写、状态管理、模块开发等技能。 ## 基础命令 ```bash # 初始化 terraform init terraform init -upgrade # 升级 provider # 格式化 terraform fmt terraform fmt -recursive # 验证 terraform validate # 计划 terraform plan terraform plan -out=plan.tfplan # 应用 terraform apply terraform apply plan.tfplan terraform apply -auto-approve # 销毁 terraform destroy terraform destroy -auto-approve # 查看状态 terraform show terraform state list terraform state show resource_type.name # 输出 terraform output terraform output -json ``` ## HCL 语法 ### Provider 配置 ```hcl # providers.tf terraform { required_version = ">= 1.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } backend "s3" { bucket = "my-terraform-state" key = "prod/terraform.tfstate" region = "us-east-1" } } provider "aws" { region = var.aws_region default_tags { tags = { Environment = var.environment ManagedBy = "Terraform" } } } ``` ### 变量定义 ```hcl # variables.tf variable "aws_region" { description = "AWS region" type = string default = "us-east-1" } variable "instance_type" { description = "EC2 instance type" type = string default = "t3.micro" } variable "environment" { description = "Environment name" type = string validation { condition = contains(["dev", "staging", "prod"], var.environment) error_message = "Environment must be dev, staging, or ...

Details

Author
ryukyagamilight
Repository
ryukyagamilight/terminal-skills
Created
5 months ago
Last Updated
yesterday
Language
N/A
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category