Probably something which i don’t understand for quiet some time.
Executed plan and then apply. Created few resources and failed since the snapshot was not found.
aws_lambda_function.LambdaShipRdsLog: Creation complete
aws_rds_cluster_parameter_group.default: Creation complete
aws_db_parameter_group.default: Creation complete
aws_s3_bucket.RdsLogShipment: Creation complete
Error applying plan:
1 error(s) occurred:
* aws_rds_cluster.default: Error creating RDS Cluster: DBClusterSnapshotNotFoundFault: DBClusterSnapshot not found: xy
status code: 404, request id: 123
So, i fixed the issue and trigger the plan and apply once again , but end up getting the resource exists error.
3 error(s) occurred:
* aws_db_parameter_group.default: Error creating DB Parameter Group: DBParameterGroupAlreadyExists: Parameter group xyz already exists
status code: 400, request id: 123
* aws_lambda_function.LambdaShipRdsLog: Error creating Lambda function: ResourceConflictException: Function already exist: xyz
status code: 409, request id: 123
* aws_rds_cluster_parameter_group.default: Error creating DB Cluster Parameter Group: DBParameterGroupAlreadyExists: Parameter group xyz already exists
status code: 400, request id: 123
As per my understanding, any resource that are being created will be updated in the state file and the next time when i execute terraform plan for the config, it knows that the resource already exists and it will skip it, but that doesn’t looks like the case. Can someone explain what I am missing? Thanks.
terraform destroyand thenterraform plan.