Terraform updating existing s3 bucket

Hi, i want to create a new s3 bucket every time i run terraform apply with a bucket name. i tried with the following terraform configuration. It’s creating s3 bucket for the first time. Any subsequent terraform apply with a new bucket name changing the previous one. Can anyone help?

main.tf

`provider “aws” {
region = var.aws_region
}

resource “aws_s3_bucket” “aqua-robotics-bucket” {
bucket = “${var.env}-${var.company_name}-${var.bucket_name}”
}

resource “aws_s3_bucket_acl” “aqua-robotics-bucket-acl” {
bucket = aws_s3_bucket.aqua-robotics-bucket.id
acl = var.acl
}

resource “aws_s3_bucket_versioning” “aqua-robotics-bucket-versioning” {
bucket = aws_s3_bucket.aqua-robotics-bucket.id
versioning_configuration {
status = var.versioning
}
}`

variables.tf

`variable “aws_region” {
description = “The AWS region to use to create resources.”
default = “eu-north-1”
}

variable “env” {
description = “Deployment Environment”
type = string
default = “dev”
}

variable “company_name” {
description = “Company Name”
type = string
default = “aquarobotics”
}

variable “bucket_name” {
description = “The name of the bucket”
type = string
}

variable “acl” {
type = string
description = " Defaults to private"
default = “private”
}

variable “tags” {
type = map(string)
description = “(Optional) A mapping of tags to assign to the bucket.”
default = {
environment = “DEV”
}
}

variable “versioning” {
type = string
description = “(Optional) A state of versioning.”
default = “Disabled”
}`

Hello,
This is not possible to make the terraform stack create new resource with the same resource name.
every time you apply it will get to the same bucket and edit on it.

Terraform will update the same resource, that’s the default behavior.
Workaround: You can use the concept of modules to achieve this. Create a new directory which will be your root module. Then add a module block for a single resource. Remember you still have to add a new module resource block for new resources as you cannot use the same block to create new ones. It will be easier than copying the whole code.
Note: Minor changes to the current config may be needed to use it as a module.