Hello! I'm trying to run a flow in an AWS Push Wor...
# prefect-cloud
r
Hello! I'm trying to run a flow in an AWS Push Work Pool. The code is running correctly but I need it to run on a specific subnet in AWS. When I try to run it, it sometimes uses the subnet that I need but some other times it randomly uses any of the other available subnets in the VPC. I tried making changes in the Base Job Template by adding network_configuration with the specific subnet to use but still it's not working. My configuration looks like this:
Copy code
"network_configuration": {
        "type": "object",
        "title": "Network Configuration",
        "default": {
          "subnets": [
            "subnet-XX"
          ],
          "assignPublicIp": "DISABLED",
          "securityGroups": [
            "sg-XX"
          ]
        },
        "description": "Apply a custom network configuration. See the [AWS documentation](<https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html>) for available options."
      }
Also I've explicitly declared the VPC ID which seems to be required for this to run, but I'm still getting the same error. Does anyone know how to fix this?
k
hi, this is a bug we've identified and have a work in progress fix for
there's a field missing on the base job template on the push work pool. You can fix it right now by adding
Copy code
},
      "launchType": "{{ launch_type }}",
      "taskDefinition": "{{ task_definition_arn }}"
    },
    "network_configuration": "{{ network_configuration }}",  <----- this line
    "cloudwatch_logs_options": "{{ cloudwatch_logs_options }}",
    "configure_cloudwatch_logs": "{{ configure_cloudwatch_logs }}",
    "task_start_timeout_seconds": "{{ task_start_timeout_seconds }}",
    "auto_deregister_task_definition": "{{ auto_deregister_task_definition }}"
  }
}
to the json on the advanced tab of the Edit page of your work pool. we'll get this fixed asap so newly created push work pools have it on there
o
@Rogelio after adding the line @Kevin Grismore suggested the following format for network_configuration works for us:
Copy code
{
  "awsvpcConfiguration": {
    "subnets": [
      "subnet-XXXXX",
      "subnet-XXXX"
    ],
    "assignPublicIp": "DISABLED"
  }
}
Also waiting to get this fixed
k
this is fixed now, but it'll only apply when you create a new ECS Push work pool
👍 1