gentle-analyst-70055
02/26/2024, 3:26 AMforeach.
Since the foreach will take place in the Step Function, I believe DynamoDB is required to manage the state of the foreach.
Suppose if the pipeline and the Step Function is running on AWS region us-west-2, is it possible to have the DynamoDB running on other region, i.e. us-east-1?
METAFLOW_SFN_DYNAMO_DB_TABLE seems to accept only Table Name instead of the full ARN.
Is it possible for Metaflow to support Step Function and DynamoDB residing in two separate AWS regions?
Thank you for your help!flaky-plumber-70709
02/26/2024, 9:06 PMDeny IAM policy like the one below. IIRC you do not need to go through all of the hoops that you do in the cross-account case
https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws_deny-requested-region.htmlflaky-plumber-70709
02/26/2024, 9:09 PMflaky-plumber-70709
02/26/2024, 9:11 PMflaky-plumber-70709
02/26/2024, 9:13 PMflaky-plumber-70709
02/26/2024, 9:17 PMgentle-analyst-70055
02/26/2024, 9:17 PMflaky-plumber-70709
02/26/2024, 9:18 PMgentle-analyst-70055
02/26/2024, 9:19 PMgentle-analyst-70055
02/26/2024, 9:20 PMflaky-plumber-70709
02/26/2024, 9:22 PMflaky-plumber-70709
02/26/2024, 9:22 PMflaky-plumber-70709
02/26/2024, 9:29 PMflaky-plumber-70709
02/26/2024, 9:30 PMflaky-plumber-70709
02/26/2024, 9:37 PMgentle-analyst-70055
02/26/2024, 10:19 PMMETAFLOW_SFN_DYNAMO_DB_TABLE to the full ARN of the dynamo and ping back here.
We do have IAM policy which grants permission for the cross region access, so access is allowed in terms of IAM permission.flaky-plumber-70709
02/27/2024, 12:18 AMMETAFLOW_SFN_DYNAMO_DB_TABLE won't accept an ARN as input so that won't work. Looking at the code a bit more it is kind of inconsistent where only the ddb table and auth key don't accept arns. Looks like it wouldn't require that big of a change to support ARNs for ddb so I can create an issue to start that conversation and should have time tomorrow to work on the PRflaky-plumber-70709
02/27/2024, 12:21 AMgentle-analyst-70055
02/27/2024, 12:27 AMMETAFLOW_SFN_DYNAMO_DB_TABLE to the full ARN, and unfortunately it failed with the following error (I scrubbed the account id in the message below)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the PutItem operation: 1 validation error detected: Value 'arn:aws:dynamodb:us-east-1:<aws account id>:table/ml-training-pipelines-metaflow-internal-tools' at 'tableName' failed to satisfy constraint: Valid ARN format is 'arn:<awsPartition>:<vendor>:<region>:<subscriber>:resourceType/resourceName', where Resource name must have length less than or equal to 255, Resource name must have length greater than or equal to 3, Resource name must satisfy regular expression pattern: [a-zA-Z0-9_.-]+gentle-analyst-70055
02/27/2024, 12:28 AMgentle-analyst-70055
02/27/2024, 12:29 AMMETAFLOW_SFN_DYNAMO_DB_AWS_REGION.
If METAFLOW_SFN_DYNAMO_DB_AWS_REGION environment variable is specified, we can supply additional client_params={'region_name': <value from METAFLOW_SFN_DYNAMO_DB_AWS_REGION>}
https://github.com/Netflix/metaflow/blob/2588f1d3030ebbd5ca3ab47a2fffb1eb9926855a/metaflow/plugins/aws/step_functions/dynamo_db_client.py#L13
https://github.com/Netflix/metaflow/blob/2588f1d3030ebbd5ca3ab47a2fffb1eb9926855a/metaflow/plugins/aws/aws_client.py#L10gentle-analyst-70055
02/27/2024, 12:30 AMgentle-analyst-70055
02/27/2024, 12:31 AMflaky-plumber-70709
02/27/2024, 1:20 AMCurrently, cross-Region AWS SDK integration and cross-Region AWS resource access aren't available in Step Functions.flaky-plumber-70709
02/27/2024, 1:22 AMflaky-plumber-70709
02/27/2024, 1:25 AMMETAFLOW_SFN_DYNAMO_DB_TABLE accepted the ddb ARN it would be a no go, I thought for some reason that metaflow wouldn't use that internally because the sfn direct integration is fairly recentflaky-plumber-70709
02/27/2024, 1:26 AMflaky-plumber-70709
02/27/2024, 1:29 AMdamp-lizard-48279
02/28/2024, 4:46 AMsquare-wire-39606
02/28/2024, 4:16 PMdamp-lizard-48279
02/28/2024, 7:14 PMgentle-analyst-70055
02/29/2024, 2:43 AM