You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Would be very helpful to be able define only the region name via AwsCredentials config, preserving the rest of the authentication data.
Traceback / Example
We run in the issue when ECS worker is not being able to deploy an ESC task into private subnet only.
Scenario:
ESC Wroker is running within a docker instance in ECS cluster with and IAM executor role will all permissions set.
No special authentication data was defined since we relay on the IAM role
ECS worker has the authentication with prefect cloud correct and working
We have pull based work pool setup.
We define a custom networks with explicit definition of private subnets for ESC taks for server-less flow execution
AWS has no default VPCs
If we do not specify any subnets for ECS task, all is going correctly, the task is placed on any available subnet from the VPC, and completes successfully. The problem comes when we define a custom network configuration and explicitly request to place the task in a private subnet. And we get the following error:
Subnets ['subnet-XXX', 'subnet-YYY'] not found within VPC with ID vpc-IDIDID.Please check that VPC is associated with supplied subnets
Seems like the ECS Worker tries to validate custom network configuration against the VPC subnets, and fails.
I suspect the problem might come from the fact that the VPC is not a default one and we need to specify the aws-region. If I request the subnets via aws-cli and query in the same way prefect does, without specifying the region the list is empty. Providing the region the list is correct. Would be nice to to have a way to "force"/"configure" prefect to use a particular region only.
I tried it via aws-credentials defining only the region and I get:
Client error '422 Unprocessable Entity' for url
'https://api.prefect.cloud/api/accounts/ACCOUT_ID/workspaces/WORKSPACE/work_pools/
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'loc': ['body', 'base_job_template'], 'msg': "Validation failed for field 'aws_credentials.aws_access_key_id'. Failure reason: None is not of type 'string'", 'type': 'value_error'}]
Expectation / Proposal
Would be very helpful to be able define only the region name via AwsCredentials config, preserving the rest of the authentication data.
Traceback / Example
We run in the issue when ECS worker is not being able to deploy an ESC task into private subnet only.
Scenario:
If we do not specify any subnets for ECS task, all is going correctly, the task is placed on any available subnet from the VPC, and completes successfully. The problem comes when we define a custom network configuration and explicitly request to place the task in a private subnet. And we get the following error:
The subnets/VPC are correct, subnets are associated with the VPC. The error message comes from github.dev/PrefectHQ/prefect-aws/blob/6865af76b7f0a0555eefc63fce41721fcf827407/prefect_aws/workers/ecs_worker.py#L1382.
Seems like the ECS Worker tries to validate custom network configuration against the VPC subnets, and fails.
I suspect the problem might come from the fact that the VPC is not a default one and we need to specify the aws-region. If I request the subnets via aws-cli and query in the same way prefect does, without specifying the region the list is empty. Providing the region the list is correct. Would be nice to to have a way to "force"/"configure" prefect to use a particular region only.
I tried it via aws-credentials defining only the region and I get:
Creating an env var
AWS_DEFAULT_REGION
in the container seems to not have any effect.I'm unable to confirm if it is really being used. As far as I can see https://github.com/PrefectHQ/prefect-aws/blob/main/prefect_aws/credentials.py#L99 boto3 session is instantiated and it takes precedence over env vars or ~/.aws/config as per boto3 docs https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials
The text was updated successfully, but these errors were encountered: