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. Inference currently supports AWS resources.

Inferred dependencies:

  • connect the exact data source to the resource it reads;
  • use the safe manual trigger policy;
  • take part in the dependency graph and cycle checks.

A declaration for the same resource, one of its parent modules, or the whole dependency stack can set a different trigger policy.

Stack output reads are not inferred. Add an explicit declaration when using gantrycd_state_outputs.

Use resource identity overrides when GantryCD should use another ID or realm, or leave a resource out of inference.