Terraform community has shared common modules on terraform registry which we can directly use in our code. We can find it here suitable module Module Registry
I have used this module S3 bucket creation which creates s3 bucket for us.
- Just copy paste the module code from terraform registry
- Add input variable according to your demand
- terraform init (This will import module code from terraform registry)
- terraform plan -out=mytfplan (Here you will see the resource creation count)
- terraform apply mytfplan