0

If I pass more than one subnet Id to EmrServerlessCreateApplicationOperator via the networkConfiguration attribute, I receive an error.

If I use a single subnet Id the operator works fine. This is the network configuration and also shown is an extract of the operator:

network_config = {
    'subnetIds': [
        subnet_ids
    ],
    'securityGroupIds': [
        security_group_ids
    ]
}

EmrServerlessCreateApplicationOperator(
    task_id=task_identifier,
    job_type="SPARK",
    release_label="emr-6.6.0",
    config={"name":config_name, "networkConfiguration": network_config}
)

If I try passing more than one subnet Id (via the subnet_ids string value), whether comma separated either with or without quotes, I receive the following error from Airflow:

(An error occurred (ValidationException) when calling the CreateApplication operation: 1 validation error detected: Value at 'networkConfiguration.subnetIds' failed to satisfy constraint: Member must satisfy constraint: [Member must have length less than or equal to 32, Member must have length greater than or equal to 1, Member must satisfy regular expression pattern: [-0-9a-zA-Z]+.*]; 2522)

Does anyone have an example of how to correctly format multiple subnet Ids for the network configuration?

1
  • 1
    Can you add the full traceback to your question? Have you tried adding the second subnet to the array? 'subnnetIds': [subnet_id1, subnet_id2] Commented Jul 13, 2023 at 7:56

1 Answer 1

0

As mentioned by @0x26res, if added as an additional item in the array rather than the string, this works as expected.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.