Sets up a replication configuration for an AWS Elastic Container Registry to replicate to the first available region.

Terraform Template

data "aws_caller_identity" "current" {
}

data "aws_regions" "example" {
}

resource "aws_ecr_replication_configuration" "example" {

  replication_configuration {

    rule {

      destination {
        region = data.aws_regions.example.names[0]
        registry_id = data.aws_caller_identity.current.account_id
      }
    }
  }
}