Bryan
05/31/2024, 8:24 PMFlow run could not be submitted to infrastructure: An error occurred (InvalidParameterException) when calling the RunTask operation: At least one security group must be supplied when specifying subnets that are owned by a different account.
Based on the error, I assumed that I needed to create a VPC Security group which I did. I also added information to the "Network Configuration section in the Work Pool which looks like this:
{
"Subnets": [
"subnet-xxxx",
"subnet-yyyy"
],
"SecurityGroups": [
"sg-xxxyyy"
]
}
I am still getting the same error. I am at a loss for what is actually needed. Does anyone have thoughts on possible fixes?Kevin Grismore
05/31/2024, 9:40 PMKevin Grismore
05/31/2024, 10:06 PM{
"awsvpcConfiguration": {
"subnets": ["string", ...],
"securityGroups": ["string", ...],
"assignPublicIp": "ENABLED"|"DISABLED"
}
}
Bryan
05/31/2024, 10:08 PM{
"networkConfiguration": {
"awsvpcConfiguration": {
"subnets": [
"subnet-XXXX",
"subnet-YYYY"
],
"securityGroups": [
"sg-XXXYYY"
]
}
}
}
I will give your example a try.Bryan
05/31/2024, 10:10 PMKevin Grismore
05/31/2024, 10:11 PMKevin Grismore
05/31/2024, 10:11 PMBryan
05/31/2024, 10:13 PMKevin Grismore
05/31/2024, 10:16 PMKevin Grismore
05/31/2024, 10:29 PMKevin Grismore
05/31/2024, 10:30 PMFlow run could not be submitted to infrastructure:
is a string in the push worker that wraps the error we get back from submitting the ECS task run via this methodKevin Grismore
05/31/2024, 10:31 PMKevin Grismore
05/31/2024, 10:31 PMBryan
05/31/2024, 10:32 PM{
"awsvpcConfiguration": {
"subnets": [
"subnet-XXX",
"subnet-YYY"
],
"assignPublicIp": "DISABLED",
"securityGroups": [
"sg-XXXYYY"
]
}
}
Kevin Grismore
05/31/2024, 10:34 PMnetworkConfiguration={
'awsvpcConfiguration': {
'subnets': [
'string',
],
'securityGroups': [
'string',
],
'assignPublicIp': 'ENABLED'|'DISABLED'
}
},
and the fact that our code does this:
{"awsvpcConfiguration": network_configuration}
your network config should look like this:
{
"subnets": [
"subnet-XXX",
"subnet-YYY"
],
"assignPublicIp": "DISABLED",
"securityGroups": [
"sg-XXXYYY"
]
}
Bryan
05/31/2024, 10:36 PMKevin Grismore
05/31/2024, 10:36 PMKevin Grismore
05/31/2024, 10:37 PMKevin Grismore
05/31/2024, 10:37 PM"task_definition": {
"cpu": "{{ cpu }}",
"family": "{{ family }}",
"memory": "{{ memory }}",
"executionRoleArn": "{{ execution_role_arn }}",
"containerDefinitions": [
{
"name": "{{ container_name }}",
"image": "{{ image }}"
}
]
},
"task_run_request": {
"tags": "{{ labels }}",
"cluster": "{{ cluster }}",
"overrides": {
"cpu": "{{ cpu }}",
"memory": "{{ memory }}",
"taskRoleArn": "{{ task_role_arn }}",
"containerOverrides": [
{
"cpu": "{{ cpu }}",
"name": "{{ container_name }}",
"memory": "{{ memory }}",
"command": "{{ command }}",
"environment": "{{ env }}"
}
]
},
"launchType": "{{ launch_type }}",
"taskDefinition": "{{ task_definition_arn }}"
},
Bryan
05/31/2024, 10:38 PMKevin Grismore
05/31/2024, 10:38 PMBryan
05/31/2024, 10:40 PM{
"subnets": [
"subnet-XXX",
"subnet-YYY"
],
"assignPublicIp": "DISABLED",
"securityGroups": [
"sg-XXXYYY"
]
}
I get the same error.Kevin Grismore
05/31/2024, 10:41 PMKevin Grismore
05/31/2024, 10:41 PMBryan
05/31/2024, 10:47 PMKevin Grismore
05/31/2024, 10:48 PMKevin Grismore
05/31/2024, 10:48 PMBryan
05/31/2024, 10:48 PMBryan
05/31/2024, 11:25 PMBryan
05/31/2024, 11:25 PMKevin Grismore
05/31/2024, 11:27 PMBryan
05/31/2024, 11:30 PM{
"eventVersion": "1.09",
"userIdentity": {
"type": "IAMUser",
"principalId": "XXX",
"arn": "arn:aws:iam::XXX:user/XXX",
"accountId": "XXX",
"accessKeyId": "XXX",
"userName": "XXX"
},
"eventTime": "2024-05-31T22:38:22Z",
"eventSource": "<http://ecs.amazonaws.com|ecs.amazonaws.com>",
"eventName": "RunTask",
"awsRegion": "us-west-2",
"sourceIPAddress": "<http://35.227.XXX.XXX|35.227.XXX.XXX>",
"userAgent": "Boto3/1.28.2 md/Botocore#1.31.2 ua/2.0 os/linux#6.1.75+ md/arch#x86_64 lang/python#3.11.7 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.31.2",
"errorCode": "InvalidParameterException",
"errorMessage": "At least one security group must be supplied when specifying subnets that are owned by a different account.",
"requestParameters": {
"cluster": "arn:aws:ecs:us-west-2:XXX:cluster/prefect-ecs-cluster",
"enableECSManagedTags": false,
"enableExecuteCommand": false,
"launchType": "FARGATE",
"networkConfiguration": {
"awsvpcConfiguration": {
"assignPublicIp": "ENABLED",
"securityGroups": [],
"subnets": [
"subnet-XXX",
"subnet-XXXX",
"subnet-XXXXX",
"subnet-XXXXXX"
]
}
},
"overrides": {
"containerOverrides": [
{
"name": "prefect",
"command": [
"python",
"-m",
"prefect.engine"
],
"environment": "HIDDEN_DUE_TO_SECURITY_REASONS"
}
],
"taskRoleArn": "arn:aws:iam::XXX:role/prefect_task_role"
},
"tags": [
{
"key": "<http://prefect.io/flow-run-id|prefect.io/flow-run-id>",
"value": "976fa3af-249a-4f3e-9312-c2928b6daXXX"
},
{
"key": "<http://prefect.io/flow-run-name|prefect.io/flow-run-name>",
"value": "hungry-kittiwake"
},
{
"key": "<http://prefect.io/deployment-id|prefect.io/deployment-id>",
"value": "3b2a0441-5d3a-4127-afe2-d46cbc59XXXX"
},
{
"key": "<http://prefect.io/deployment-name|prefect.io/deployment-name>",
"value": "dev-prefect_testing-someflow"
},
{
"key": "<http://prefect.io/deployment-updated|prefect.io/deployment-updated>",
"value": "2024-05-30T20:29:25.791701Z"
},
{
"key": "<http://prefect.io/flow-id|prefect.io/flow-id>",
"value": "58f7206e-ed29-4f75-8187-662f6ee8XXXX"
},
{
"key": "<http://prefect.io/flow-name|prefect.io/flow-name>",
"value": "someflow"
}
],
"taskDefinition": "arn:aws:ecs:us-west-2:XXX:task-definition/prefect__3b2a0441-5d3a-4127-afe2-d46cbc59c5ce__41dd128a-1674-4611-b95b-a9a39f4aXXXX:3"
},
"responseElements": null,
"requestID": "dc521906-6ccc-4e6c-b52d-97ae0cb2XXXX",
"eventID": "16c4075a-0038-4185-83e7-3ddef8bbXXXX",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"recipientAccountId": "XXXX",
"eventCategory": "Management",
"tlsDetails": {
"tlsVersion": "TLSv1.3",
"cipherSuite": "TLS_AES_128_GCM_SHA256",
"clientProvidedHostHeader": "<http://ecs.us-west-2.amazonaws.com|ecs.us-west-2.amazonaws.com>"
}
}
Bryan
05/31/2024, 11:31 PMKevin Grismore
05/31/2024, 11:34 PMBryan
05/31/2024, 11:34 PMKevin Grismore
05/31/2024, 11:34 PMBryan
05/31/2024, 11:35 PMKevin Grismore
05/31/2024, 11:36 PMBryan
05/31/2024, 11:41 PMKevin Grismore
05/31/2024, 11:42 PMBryan
05/31/2024, 11:42 PMKevin Grismore
05/31/2024, 11:42 PMKevin Grismore
05/31/2024, 11:43 PMKevin Grismore
05/31/2024, 11:47 PMKevin Grismore
05/31/2024, 11:47 PMBryan
05/31/2024, 11:49 PMBryan
06/05/2024, 11:45 PMKevin Grismore
06/05/2024, 11:48 PMBryan
06/05/2024, 11:49 PMKevin Grismore
06/05/2024, 11:55 PMKevin Grismore
06/10/2024, 3:33 PMKevin Grismore
06/10/2024, 3:35 PM},
"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. we'll get this fixed asap so newly created push work pools have it on thereBryan
06/10/2024, 3:59 PMBryan
06/10/2024, 5:48 PMBryan
06/10/2024, 5:51 PMBryan
06/10/2024, 5:54 PMKevin Grismore
06/10/2024, 5:55 PMBryan
06/10/2024, 5:55 PM