Warm tip: This article is reproduced from serverfault.com, please click

amazon web services-Terraform应用不在后端保存数据

(amazon web services - Terraform apply not saving data in the backend)

发布于 2020-11-30 16:09:52

我在部署代码时正在运行terraform apply。但是出现此错误`无法保存状态:领事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`

当我第二次运行地形时,我看到以下错误

 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
Questioner
user2436956
Viewed
0
user2436956 2020-12-03 21:53:30

我找到了解决我问题的方法。我们的后端内存不足。我们必须清理后端的空间。之后,我必须运行“ terraform import”以将资源手动添加到后端文件。由于问题也在生产中,因此我们无法进行“地形破坏”。那解决了我的问题。

谢谢大家!!