运行TF计划时不支持的参数的Terraform错误

时间:2020-10-15 20:59:59

标签: amazon-web-services syntax-error terraform terraform-provider-aws terraform-modules

运行Terraform Plan时出现此错误,并且似乎在重复4-5个参数。

Error: Unsupported argument

  on ec2_asg.tf line 56, in module "ec2_asg":
  56:   addtional_ssm_bootstrap_step_count     = var.addtional_ssm_bootstrap_step_count

An argument named "addtional_ssm_bootstrap_step_count" is not expected here.
Did you mean "additional_ssm_bootstrap_step_count"?


Error: Unsupported argument

  on ec2_asg.tf line 19, in module "ec2_asg":
  19:   encrypt_ebs_volume                     = var.encrypt_ebs_volume

An argument named "encrypt_ebs_volume" is not expected here.

我该如何解决?

这是完整的代码:

module "ec2_asg" {
  source = "github.com/****"

  resource_name       = var.resource_name_bi
  environment         = var.environment
  key_pair            = var.key_pair_internal
  ec2_os              = var.ec2_os_bi
  image_id            = var.image_id_bi
  instance_type       = var.instance_type_bi
  asg_count           = var.asg_count_bi
  scaling_min         = var.scaling_min_bi
  scaling_max         = var.scaling_max_bi
  subnets             = [module.vpc.private_subnets]
  security_group_list = [aws_security_group.bi_asg.id]

  primary_ebs_volume_size                = var.primary_ebs_volume_size_bi
  primary_ebs_volume_type                = var.primary_ebs_volume_type_bi
  primary_ebs_volume_iops                = var.primary_ebs_volume_iops_bi
  encrypt_ebs_volume                     = var.encrypt_ebs_volume_bi
  secondary_ebs_volume_size              = var.secondary_ebs_volume_size_bi
  secondary_ebs_volume_type              = var.secondary_ebs_volume_type_bi
  secondary_ebs_volume_iops              = var.secondary_ebs_volume_iops_bi

1 个答案:

答案 0 :(得分:1)

我建议您查看导入的模块的源代码,以确定需要传递哪些变量。 convention是将它们放在variables.tf文件中的文件,其中将说明它们的用法。