Fix WarmPool with --target direct

This commit is contained in:
Peter Rifel 2023-07-30 10:19:06 -05:00
parent 12b6991ad3
commit 9f497fb731
No known key found for this signature in database
GPG Key ID: BC6469E5B16DB2B6
1 changed files with 25 additions and 0 deletions

View File

@ -110,6 +110,31 @@ func (e *AutoscalingGroup) CompareWithID() *string {
return e.Name
}
// Track dependencies here to explicitly ignore WarmPool
// because the WarmPool should be created after the ASG, not the other way around.
// The WarmPool struct field is only used for RenderTerraform.
func (e *AutoscalingGroup) GetDependencies(tasks map[string]fi.CloudupTask) []fi.CloudupTask {
var deps []fi.CloudupTask
for _, lb := range e.LoadBalancers {
deps = append(deps, lb)
}
for _, tg := range e.TargetGroups {
deps = append(deps, tg)
}
for _, subnet := range e.Subnets {
deps = append(deps, subnet)
}
if e.LaunchTemplate != nil {
deps = append(deps, e.LaunchTemplate)
}
return deps
}
// Find is used to discover the ASG in the cloud provider
func (e *AutoscalingGroup) Find(c *fi.CloudupContext) (*AutoscalingGroup, error) {
cloud := c.T.Cloud.(awsup.AWSCloud)