-1

运行 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
4

1 回答 1

2

我建议您查看您导入的模块的源代码,以确定需要传递哪些变量。按照惯例,将它们放在一个variables.tf文件中,该文件将描述它们的使用。

于 2020-10-15T22:06:09.023 回答