This is a Terraform based Infrastructure deployment project - It can be deployed on AWS to build a full Code pipeline in order automate the continuous delivery pipeline for fast and reliable updates. AWS Code pipeline can be triggered using bitbucket repository in this case configured with a connection using Code Star, can be updated as well with Code Commit.
Here we can make use of terraform workspaces to create two similar pipelines one for "development" stage and one for "production" stage
Create and use Terraform Dev workspace
$ terraform workspace new dev main
$ terraform workspace use dev
Initialize and deploy to development envrionment
$ terraform init main
$ terraform plan -out=terraform.pipeline.dev.plan main
$ terraform apply terraform.pipeline.dev.plan main
Create and use Terraform Prod workspace
$ terraform workspace new prod main
$ terraform workspace use prod
Initialize and deploy to production envrionment
$ terraform init main
$ terraform plan -out=terraform.pipeline.prod.plan main
$ terraform apply terraform.pipeline.prod.plan main