diff --git a/CHANGELOG.md b/CHANGELOG.md index 7967e69f..78fc162e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed `push_to_s3` deployment step function to write paths `as_posix()` to allow support for deploying from windows [#314](https://github.com/PrefectHQ/prefect-aws/pull/314) +### Fixed + +- Resolved an issue where defining subnets in network configuration would erroneously report them as missing in the VPC. [#321](https://github.com/PrefectHQ/prefect-aws/pull/321) + ### Deprecated ### Removed diff --git a/prefect_aws/workers/ecs_worker.py b/prefect_aws/workers/ecs_worker.py index 1b1c8073..a3822a3f 100644 --- a/prefect_aws/workers/ecs_worker.py +++ b/prefect_aws/workers/ecs_worker.py @@ -1349,10 +1349,10 @@ def _custom_network_configuration( + "Network configuration cannot be inferred." ) + subnet_ids = [subnet["SubnetId"] for subnet in subnets] + config_subnets = network_configuration.get("subnets", []) - if not all( - [conf_sn in sn.values() for conf_sn in config_subnets for sn in subnets] - ): + if not all(conf_sn in subnet_ids for conf_sn in config_subnets): raise ValueError( f"Subnets {config_subnets} not found within {vpc_message}." + "Please check that VPC is associated with supplied subnets."