【发布时间】:2021-03-12 13:58:51
【问题描述】:
我在部署代码时正在运行 terraform apply。但是有这个错误 `保存状态失败:consul CAS 失败并出现事务错误:[0xc0008ac480]
Error: Failed to persist state to backend.
The error shown above has prevented Terraform from writing the updated state
to the configured backend. To allow for recovery, the state has been written
to the file "errored.tfstate" in the current working directory.
Running "terraform apply" again at this point will create a forked state,
making it harder to recover.
To retry writing this state, use the following command:
terraform state push errored.tfstate`
当我第二次运行 terraform apply 时,我看到以下错误
Error: Creating CloudWatch Log Group failed: ResourceAlreadyExistsException: The specified log group already exists: The CloudWatch Log Group '/aws/kinesisfirehose/test-cloudfront-wafv2-logs' already exists.
Error: Error creating IAM Role test-pvcapture-cloudfront-wafv2-firehose: EntityAlreadyExists: Role with name test-pvcapture-cloudfront-wafv2-firehose already exists.
status code: 409, request id: 0fd8fda2-88fe-4860-ba22-951573f74268
Error: Error creating WAFv2 IPSet: WAFDuplicateItemException: AWS WAF couldn’t perform the operation because some resource in your request is a duplicate of an existing one.
我正在使用的 Terraform 版本:
terraform --version
Terraform v0.13.5
+ provider registry.terraform.io/hashicorp/aws v3.16.0
【问题讨论】:
-
请问您可以用您正在使用的 Terraform 版本更新问题吗?
-
我已经更新了上述问题中的版本信息。感谢您的回复!
-
第二次运行的错误一点也不奇怪。这是第一次运行的警告消息所警告的内容。
-
您的
backend配置是什么(注意不要提及凭据)?
标签: amazon-web-services terraform