aws_db_parameter_group试图在第二次“申请”中销毁

时间:2017-09-19 07:16:05

标签: amazon-web-services jenkins-pipeline terraform amazon-rds-aurora

我的Jenkin管道有4个terraform阶段和1个Ansible阶段。在terraform阶段,我正在创建一个带有自定义db-parameter-groups的Aurora RDS集群。在第一轮比赛中,直到Ansible都没有问题。在我修复了Ansible问题后,我试图再次执行管道,现在它在Terraform RDS阶段失败,因为它试图破坏aws_db_parameter_group。这是terraform输出:

[0m[1maws_security_group.main_security_group: Refreshing state... (ID: sg-91cdd8f8)[0m
[0m[1maws_rds_cluster.main_rds_cluster: Refreshing state... (ID: rds-cluster-acceptance)[0m
[0m[1maws_rds_cluster_instance.main_cluster_instance: Refreshing state... (ID: rds-cluster-acceptance-instance0)[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Destroying... (ID: db-accep-oscar5-6)[0m[0m
[0m[1mmodule.aurora-1.aws_rds_cluster.main_rds_cluster: Modifying... (ID: rds-cluster-acceptance)[0m
final_snapshot_identifier: "rds-snapshot-acceptance-2017-09-19T05-46-02Z" => "rds-snapshot-acceptance-2017-09-19T06-13-53Z"[0m
[0m[1mmodule.aurora-1.aws_rds_cluster.main_rds_cluster: Modifications complete (ID: rds-cluster-acceptance)[0m[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Still destroying... (ID: db-accep-oscar5-6, 10s elapsed)[0m[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Still destroying... (ID: db-accep-oscar5-6, 20s elapsed)[0m[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Still destroying... (ID: db-accep-oscar5-6, 30s elapsed)[0m[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Still destroying... (ID: db-accep-oscar5-6, 40s elapsed)[0m[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Still destroying... (ID: db-accep-oscar5-6, 50s elapsed)[0m[0m
[0m[1mmodule.aurora-1.aws_db_parameter_group.rds_pg: Still destroying... (ID: db-accep-oscar5-6, 1m0s elapsed)[0m[0m

1 个答案:

答案 0 :(得分:0)

terraform apply上的资源销毁主要发生在以下情况:

  • 资源已在配置中更改,更改强制重新创建资源(例如,资源名称)
  • 您的terraform状态文件(terraform.tfstate)未被保留,因此Terraform不知道状态并试图销毁现有基础设施