Terraform provisioning state issue

Hello Team
I tested to store terraform state file in DB of morpheus with “backend - internal”
and see correct

terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "5.50.0"
    }
  }
}

image
But if I want to use remote terraform state backend ( select local backend ) I cant see status of provisioned resources

terraform {
   backend "s3" {
     bucket     = "terraformstate"
     key        = "project/terraform.state"
     region     = "ap-southeast-1"
     access_key = "var.key"
     secret_key = "var.secret"
   }

Why its not visible correctly ?
and How morpheus works with remote state? for example team changed count of ec2 instances - morpheus will reflect it in resources?

Morpheus technically supports using a remote state, however there are some limitations.

  • Morpheus will not be able to read the state file from the remote state. In this case Terraform itself can auth to the S3 bucket however Morpheus is not. So, it does not currently have a mechanism to read this it and display it.
  • The resources will never show the status you are showing in your screenshot.

Currently Morpheus does not dev/QA against remote state. It will function but there are some limitations like listed above. The typical recommended approach is to use the internal backend or local storage of the state where it is stored in the Morpheus DB.

1 Like