type = string default = "ap-shanghai" } variable "secret_id" {} variable "secret_key" {} data and output块 data块用于从外部数据源获取信息。 output块用于定义输出值,这些值可以在Terraform执行完毕后显示出来 代码语言:txt AI代码解释 data "tencentcloud_availability_zones" "availability_zones" {} ...
} variable "resource_group_name_prefix" { type = string default = "rg" description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." } variable "username" { type = string description = "The username for the local accou...
复制 variable "example_list" { type = list(string) default = ["item1", "item2", "item3"] } 引用列表变量:在配置文件中,可以通过${var.example_list}来引用整个列表变量,或者通过${var.example_list[index]}来引用列表中的特定元素。例如:...
其中alicloud_instance为资源类型(Resource Type),定义这个资源的类型,告诉Terraform这个Resource是阿里云的ECS实例还是阿里云的VPC。 default为资源名称(Resource Name),资源名称在同一个模块中必须唯一,主要用于供其他资源引用该资源。 大括号里面的block块为配置参数(Configuration Arguments),定义资源的属性,比如ECS 实例的...
variable "job_name" { description = "A name for the job." type = string default = "My Job" } variable "task_key" { description = "A name for the task." type = string default = "my_task" } resource "databricks_job" "this" { name = var.job_name task { task_key = var.task...
variable "access_key" {}variable "secret_key" {}variable "region" { default = "us-east-1"}variable "f5user" { type = string default = "admin"}variable "f5pass" { type = string default = "admin"} 1. 上面定义了变量。前两个变量是空的,第三个给了一个默认值(默认参数)。此时运行terr...
{ description ="Namespace Name"type = string default ="admin"}# 定义命名空间ID变量,默认值为 "cn-hangzhou:admin"variable"namespace_id"{ description ="Namespace ID"type = string default ="cn-hangzhou:admin"}resource"alicloud_sae_namespace""default"{ namespace_description = var.namespace_...
type = string default = "" } variable "region" { description = "OCI region where resources will be created for Requestor Tenancy" type = string default = "us-ashburn-1" # example value # check this document, if you want to use different region - https://docs.oracle.com/en-us/iaas/...
type = list(string) default = ["vpc_demo1", "vpc_demo2"] } variable "cidr_list" { type = list(string) default = ["192.168.0.0/16", "172.16.0.0/16"] } resource "volcengine_vpc" "vpcs" { count = 2 name = var.name_list[count.index] cidr = var.cidr_list[count.index] } f...
type = string description = "ami id" default = "ami-0ff1cd0b5d98708d1" } variable "ec2-instnce-type" { type = string description = "ec2 instance type" default = "t3.micro" } variable "vpc_security_group" { type = list(string) description = "ec2 security group" default = [ "s...