在使用块时必须先声明其对应的类型,样例中 resource 和 network 均为块类型,其中 resource 为顶层块类型,network 为嵌套块类型。 Terraform 支持的顶层块类型包括: provider,resource,data,variable,output,module,locals 等关键字。 块标签在块类型之后定义,且数量由块类型决定,样例中 resource 块类型包含两个标签:hu...
{"Action":"alikafka:*","Resource":"*","Effect":"Allow"},{"Action":"ram:CreateServiceLinkedRole","Resource":"*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":["connector.alikafka.aliyuncs.com","instanceencryption.alikafka.aliyuncs.com","alikafka.aliyuncs.com","etl....
variable"name"{ default ="tf-accdbinstance"}provider"alicloud"{ region ="cn-hangzhou"}data"alicloud_db_zones""example"{ engine ="PostgreSQL"engine_version ="14.0"instance_charge_type ="Serverless"category ="serverless_basic"db_instance_storage_type ="cloud_essd"}data"alicloud_db_instance_clas...
variable"resource_group_location"{ type = string default ="eastus"description ="Location of the resource group."}variable"resource_group_name_prefix"{ type = string description ="Prefix of the resource group name that's combined with a random ID so name is unique in your Azure s...
{ internal = 8300 external = 8300 protocol = "tcp" }] } 自定义验证规则 我们可以使用 validation嵌套块为输入变量指定自定义验证规则,该特性在 Terraform 0.13.0之后的版本支持,例如: variable "iam_user_password" { type = string description = "The password for iam user to log in." validation {...
{ sns = { sid = "SNSPublish" actions = ["sqs:SendMessage"] principals = [ { type = "Service" identifiers = ["sns.amazonaws.com"] } ] conditions = [{ test = "ArnEquals" variable = "aws:SourceArn" values = [module.sns.topic_arn] }] } } tags = { Environment = "dev" } ...
{test="StringEquals"variable="${replace(module.eks.cluster_oidc_issuer_url, "https://", "")}:aud"values=["sts.amazonaws.com"]}principals{identifiers=[module.eks.oidc_provider_arn]type="Federated"}}}## KastenK10IAMrole resource"aws_iam_role""kasten_...
{test="StringEquals"variable="aws:SourceAccount"values=[data.aws_caller_identity.current.account_id]}condition{test="ArnEquals"variable="aws:SourceArn"values=["arn:${data.aws_partition.current.partition}:bedrock:${data.aws_region.current.name}:...
variable "iscreate" { type = bool default = true } # Creating the test-server instance if `iscreate` equals true resource "aws_instance" "test-server" { ami = "ami-05cafdf7c9f772ad2" instance_type = "t2.micro" count = var.iscreate == true ? 1:0 # conditional expression } # ...
variable "desired_count" { type = number description = "The desired number of tasks to start with. Set this to 0 if using DAEMON Service type. (FARGATE does not suppoert DAEMON Service type)" default = 1 } variable "launch_type" { type = string description = "The ECS launc...