klothoplatform / klotho

Klotho - write AWS applications at lightning speed
https://klo.dev
Apache License 2.0
1.13k stars 38 forks source link

determine how to read in more properties from state file #961

Closed jhsinger-klotho closed 7 months ago

jhsinger-klotho commented 8 months ago

because we cant read in the availability zone from the state files we try to solve subnet -> region which leads to

{"level":"error","ts":1709827856.219598,"logger":"engine","msg":"Engine returned error: failed to evaluate group 4: failed to evaluate aws:availability_zone:region:stackpacks-private-subnet-1-region#Index: could not get default value for aws:availability_zone:region:stackpacks-private-subnet-1-region#Index: strconv.Atoi: parsing \"stackpacks-private-subnet-1-region\": invalid syntax"}

there are 3 major issues here

  1. The properties we label as being of type 'Resource' dont map to iac
  2. the AZ template requires specific naming to be accurate
  3. we have to explicitly add the subnet -> region edge because imports cant create resources and the way region gets created is subnet -> az -> region leading us to path expand

For now we have allowed adding explicit edges if both are imported for contextual purposes