随笔分类 - Teffaform
摘要:变量 (var) 为了使代码更DRY化和可配置化,terraform允许用户定义输入变量。 输入变量、输出变量 变量语法 varible "NAME" { [CONFIG ...] } 变量声明包含3个参数: description 描述参数用来说明如何使用这个变量 default 有多种方法可以为
阅读全文
摘要:代码如下: provider "aws" { profile = "default" region = "ap-east-1" } resource "aws_instance" "example" { ami = "ami-0e5c29e6c87a9644f" instance_type = "t
阅读全文
摘要:Error: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for suppor
阅读全文
摘要:main.tf terraform { required_providers { docker = { source = "kreuzwerker/docker" } } } provider "docker" {} resource "docker_image" "nginx" { name =
阅读全文
摘要:使用terraform的第一步是配置要使用的提供商创建一个空文件夹,并在其中创建名为main.tf的文件,文件内容如下 provider "aws" { profile = "default" region = "ap-northeast-1" } 表示: 1、此配置告诉terraform 将使用A
阅读全文
摘要:根据provider选择相应的插件进行下载 https://releases.hashicorp.com/ AWS 初始化 ➜ aws pwd /opt/terraform/plugins/aws ➜ aws ls terraform-provider-aws_2.70.0_darwin_amd64
阅读全文
摘要:##官方下载页面 https://www.terraform.io/downloads.html Windows安装步骤 在Windows上,它至少包含C:\Windows和C:\Windows\system32目录 右击我的电脑-属性-高级系统设置-环境变量-系统变量-Path-编辑-新建 lin
阅读全文