Terraform for AWS:如何(并且我可以安全地)忽略与批量计算环境缩放相关的错误?

Terraform for AWS:如何(并且我可以安全地)忽略与批量计算环境缩放相关的错误?,terraform,terraform-provider-aws,aws-batch,Terraform,Terraform Provider Aws,Aws Batch,在使用terraform apply更新配置时,我经常看到这样的错误: Error: error updating Batch Compute Environment (dev-james-data-ingest): Manually scaling down compute environment is not supported. Disconnecting job queues from compute environment will cause it to scale-down to

在使用
terraform apply
更新配置时,我经常看到这样的错误:

Error: error updating Batch Compute Environment (dev-james-data-ingest): Manually scaling down compute environment is not supported.  Disconnecting job queues from compute environment will cause it to scale-down to minvCpus.
    status code: 400, request id: ed1a562b-dfc8-4e3f-af9b-e3efba4dbfe7
我的经验是,这似乎是一个可以安全忽略的无害错误。(但事实确实如此吗?)

我正在编写一个包装Terraform命令的Python脚本,通过模块调用
Terraform
可执行文件。在上述关于此错误无害的假设下,我捕获调用
sh.terraform
引发的异常,如果
stderr
包含与此错误相关的已知错误消息,则我将其吞掉,否则,我引发异常:

    try:
        sh.terraform("apply", "-auto-approve", plan_file)
    except sh.ErrorReturnCode as err_code:
        if (
            "Manually scaling down compute environment is not supported.  "
            "Disconnecting job queues from compute environment will cause it to scale-down to minvCpus."
            not in str(err_code.stderr)
        ):
            raise

我是否正确地检测到了这个错误,或者是否有方法从Terraform中捕获更具体的信息,并使用这些信息来确定问题是否是计算环境的缩小问题?或者这个计算环境的缩小问题真的是一个真正的错误,并且应该将
terraform apply
命令视为整体错误吗?

您得到了anser吗?您得到了anser吗?