feat: give the trigger a default name if none is specified
This commit is contained in:
1 file changed
+4
-2
@@ -585,7 +585,7 @@ func getAutoscaling(input GetAutoscalingInput) (ProcessAutoscaling, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
triggers := []ProcessAutoscalingTrigger{}
|
triggers := []ProcessAutoscalingTrigger{}
|
||||||
for _, trigger := range config.Triggers {
|
for idx, trigger := range config.Triggers {
|
||||||
if trigger.Type == "" {
|
if trigger.Type == "" {
|
||||||
return ProcessAutoscaling{}, fmt.Errorf("Autoscaling trigger type is required for trigger: index %d", idx)
|
return ProcessAutoscaling{}, fmt.Errorf("Autoscaling trigger type is required for trigger: index %d", idx)
|
||||||
}
|
}
|
||||||
@@ -603,7 +603,9 @@ func getAutoscaling(input GetAutoscalingInput) (ProcessAutoscaling, error) {
|
|||||||
metadata[key] = output.String()
|
metadata[key] = output.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger := ProcessAutoscalingTrigger{
|
if trigger.Name == "" {
|
||||||
|
trigger.Name = fmt.Sprintf("trigger-%s-%d", trigger.Type, idx+1)
|
||||||
|
}
|
||||||
Name: trigger.Name,
|
Name: trigger.Name,
|
||||||
Type: trigger.Type,
|
Type: trigger.Type,
|
||||||
Metadata: metadata,
|
Metadata: metadata,
|
||||||
|
|||||||
Reference in new issue
Block a user