I want to build an s3 bucket only when we are using our prod account. We are using terraform 11.7 which I don't think supports the 'null' choice for if statement
Does anyone know if something like this can be done in terraform 11:
resource "aws_s3_bucket" "feedback_service_bucket" {
bucket = "${var.account_name == "prod" ? "ces-${var.environment}-QA-compendex" : null}"
acl = "private"
}
I will upgrade soon to terraform 13, but as this is required in this sprint I don't have time. We have a prod.tfvars file which is used when the applied environment is set to prod (obviously), so if the above is not possible, is there a way to put an entire resource into a tfvars file. I know you can use variables, but I'm not sure about resource. Any help would be great, thanks