Error Active stages pointing to this deployment must be moved or deleted

I have an api gateway deployement that requires connection to console to create a new deployement .I try to force the deployement automatically so i add stage_description = “Deployed at: ${timestamp()}” in the aws_api_gateway_deployment resource , when i test the first time is passed and the next time i get the error Active stages pointing to this deployment must be moved or deleted

– Deployment ------------------------------------

resource “aws_api_gateway_deployment” “dev_api_front_deployment” {
depends_on = [
aws_api_gateway_method.dev_api_front_auth_register_post,
aws_api_gateway_integration.dev_api_front_auth_register_post-integration,
aws_api_gateway_method.dev_api_front_auth_register_confirm_post,
aws_api_gateway_integration.dev_api_front_auth_register_confirm_post-integration,
aws_api_gateway_method.dev_api_front_auth_register_confirm_resend_post,
aws_api_gateway_integration.dev_api_front_auth_register_confirm_resend_post-integration

]
rest_api_id = aws_api_gateway_rest_api.dev_api_front.id
stage_name = var.environment
stage_description = “Deployed at: ${timestamp()}”

}

i try to change my code like this but still get the error :frowning: i use Terraform v0.12.31 with the provider 3.70.0
resource “aws_api_gateway_deployment” “dev_api_front_deployment” {

triggers = {
redeployment = sha1(jsonencode([
aws_api_gateway_method.dev_api_front_auth_register_post,
aws_api_gateway_integration.dev_api_front_auth_register_post-integration,
aws_api_gateway_method.dev_api_front_auth_register_confirm_post,
aws_api_gateway_integration.dev_api_front_auth_register_confirm_post-integration,
aws_api_gateway_method.dev_api_front_auth_register_confirm_resend_post,
aws_api_gateway_integration.dev_api_front_auth_register_confirm_resend_post-integration

]))

}
rest_api_id = aws_api_gateway_rest_api.dev_api_front.id
}

resource “aws_api_gateway_stage” “dev_api_front_stage” {
deployment_id = aws_api_gateway_deployment.dev_api_front_deployment.id
rest_api_id = aws_api_gateway_rest_api.dev_api_front.id
stage_name = var.environment
}|