Skip to content
GantryCD

Dependency inference

GantryCD can infer a dependency when a data source in one stack reads a cloud resource managed by another stack.

┌──────────────────────────────────────┐
│ DEPENDENCY: certificates stack       │
│ aws_acm_certificate.main             │
│ manages the cloud object             │
└──────────────────────────────────────┘
                   ▲
                   │ depends on
                   │ same AWS resource identity
┌──────────────────────────────────────┐
│ DEPENDENT: application stack         │
│ data.aws_acm_certificate.main        │
│ reads the cloud object               │
└──────────────────────────────────────┘
# Managed in stack "certificates"
resource "aws_acm_certificate" "main" {
  domain_name = "example.com"
}

# Read from another stack
data "aws_acm_certificate" "main" {
  domain = "example.com"
}

GantryCD compares the resource type, cloud account or endpoint, and resource ID recorded in state.

Inferred dependencies:

  • connect the exact data source to the resource it reads;
  • offer a Deploy button, but never start or block an automatic deployment;
  • take part in the dependency graph and cycle checks.

A declaration that covers both the data source and the resource it reads replaces the inferred dependency. See Trigger policies.

Use resource identity overrides to set another ID or realm on a resource, or to leave one out of inference. Tags reach a resource only if its schema has them, so name the address in a comment when they do not.