Trying to delete Object from State File - Getting 404 Error

Found way to resolve this issue. Ran TF Plan again after setting up TF_LOG & TF_LOG_PATH environment variables. The Following error is displayed in Log out put :slight_smile:

2019/07/26 05:35:02 [ERROR] module.elasticache_redis: eval: *terraform.EvalRefresh, err: CacheParameterGroupNotFound: CacheParameterGroup http-apicluster not found.
status code: 404, request id: 1d7638cb-af67-11e9-9c0b-8bdab75dab1a

Ran the following rm state command to remove the object from state file :sunny:

terraform state rm module.elasticache_redis.aws_elasticache_parameter_group.default

Re-Ran the Plan & Apply - It worked fine and proivsioed re-factored infrastructure sucessfully.

Though of sharing this in group, It will be useful in those circumstances, who wants to remove objects from state file , either they have been deleted through other means like aws console or aws cli which will not let re-build terraform plan until you references to them in config file.

1 Like