diff --git a/senza/components/stups_auto_configuration.py b/senza/components/stups_auto_configuration.py
index 5969330..415e380 100644
--- a/senza/components/stups_auto_configuration.py
+++ b/senza/components/stups_auto_configuration.py
@@ -28,12 +28,13 @@ def find_taupage_image(region: str):
 def component_stups_auto_configuration(definition, configuration, args, info, force, account_info):
     ec2 = boto3.resource('ec2', args.region)
 
+    vpc_id = configuration.get('VpcId', account_info.VpcID)
     availability_zones = configuration.get('AvailabilityZones')
 
     server_subnets = []
     lb_subnets = []
     lb_internal_subnets = []
-    for subnet in ec2.subnets.filter(Filters=[{'Name': 'vpc-id', 'Values': [account_info.VpcID]}]):
+    for subnet in ec2.subnets.filter(Filters=[{'Name': 'vpc-id', 'Values': [vpc_id]}]):
         name = get_tag(subnet.tags, 'Name', '')
         if availability_zones and subnet.availability_zone not in availability_zones:
             # skip subnet as it's not in one of the given AZs

Support multiple VPCs
Senza's STUPS components currently assume a single VPC per region (Seven Seconds only configures a single VPC). There might be valid reasons to have multiple VPCs (e.g. a special VPC with VPN tunnel to some 3rd party location), so Senza needs to support that, too.
diff --git a/tests/test_components.py b/tests/test_components.py
index 1191bae..eceb9da 100644
--- a/tests/test_components.py
+++ b/tests/test_components.py
@@ -220,6 +220,42 @@ def test_component_stups_auto_configuration(monkeypatch):
     assert {'myregion': {'Subnets': ['sn-3']}} == result['Mappings']['ServerSubnets']
 
 
+def test_component_stups_auto_configuration_vpc_id(monkeypatch):
+    args = MagicMock()
+    args.region = 'myregion'
+
+    configuration = {
+        'Name': 'Config',
+        'VpcId': 'vpc-123'
+    }
+
+    sn1 = MagicMock()
+    sn1.id = 'sn-1'
+    sn1.tags = [{'Key': 'Name', 'Value': 'dmz-1'}]
+    sn1.availability_zone = 'az-1'
+    sn2 = MagicMock()
+    sn2.id = 'sn-2'
+    sn2.tags = [{'Key': 'Name', 'Value': 'dmz-2'}]
+    sn2.availability_zone = 'az-2'
+    sn3 = MagicMock()
+    sn3.id = 'sn-3'
+    sn3.tags = [{'Key': 'Name', 'Value': 'internal-3'}]
+    sn3.availability_zone = 'az-1'
+    ec2 = MagicMock()
+    def get_subnets(Filters):
+        assert Filters == [{'Name': 'vpc-id', 'Values': ['vpc-123']}]
+        return [sn1, sn2, sn3]
+    ec2.subnets.filter = get_subnets
+    image = MagicMock()
+    ec2.images.filter.return_value = [image]
+    monkeypatch.setattr('boto3.resource', lambda x, y: ec2)
+
+    result = component_stups_auto_configuration({}, configuration, args, MagicMock(), False, MagicMock())
+
+    assert {'myregion': {'Subnets': ['sn-1', 'sn-2']}} == result['Mappings']['LoadBalancerSubnets']
+    assert {'myregion': {'Subnets': ['sn-3']}} == result['Mappings']['ServerSubnets']
+
+
 def test_component_redis_node(monkeypatch):
     mock_string = "foo"
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
boto3==1.37.23
botocore==1.37.23
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
clickclick==20.10.2
dnspython==1.15.0
dnspython3==1.15.0
exceptiongroup==1.2.2
idna==3.10
importlib_metadata==8.6.1
iniconfig==2.1.0
jmespath==1.0.1
packaging==24.2
pluggy==1.5.0
pystache==0.6.8
pytest==8.3.5
python-dateutil==2.9.0.post0
PyYAML==6.0.2
requests==2.32.3
s3transfer==0.11.4
six==1.17.0
stups-cli-support==1.1.22
stups-pierone==1.1.56
-e git+https://github.com/zalando-stups/senza.git@cdd45d357b6767742393d4b2aa9af68715e6dd5e#egg=stups_senza
stups-tokens==1.1.19
stups-zign==1.2
tomli==2.2.1
typing==3.7.4.3
urllib3==1.26.20
zipp==3.21.0

name: senza
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - boto3==1.37.23
      - botocore==1.37.23
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - click==8.1.8
      - clickclick==20.10.2
      - dnspython==1.15.0
      - dnspython3==1.15.0
      - exceptiongroup==1.2.2
      - idna==3.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jmespath==1.0.1
      - packaging==24.2
      - pluggy==1.5.0
      - pystache==0.6.8
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.2
      - requests==2.32.3
      - s3transfer==0.11.4
      - six==1.17.0
      - stups-cli-support==1.1.22
      - stups-pierone==1.1.56
      - stups-tokens==1.1.19
      - stups-zign==1.2
      - tomli==2.2.1
      - typing==3.7.4.3
      - urllib3==1.26.20
      - zipp==3.21.0
prefix: /opt/conda/envs/senza

tests/test_components.py::test_component_stups_auto_configuration_vpc_id
tests/test_components.py::test_weighted_dns_load_balancer tests/test_components.py::test_weighted_dns_load_balancer_with_different_domains tests/test_components.py::test_check_docker_image_exists
tests/test_components.py::test_invalid_component tests/test_components.py::test_component_iam_role tests/test_components.py::test_get_merged_policies tests/test_components.py::test_component_load_balancer_healthcheck tests/test_components.py::test_component_load_balancer_idletimeout tests/test_components.py::test_component_load_balancer_http_only tests/test_components.py::test_component_load_balancer_namelength tests/test_components.py::test_component_stups_auto_configuration tests/test_components.py::test_component_redis_node tests/test_components.py::test_component_redis_cluster tests/test_components.py::test_component_taupage_auto_scaling_group_user_data_without_ref tests/test_components.py::test_component_taupage_auto_scaling_group_user_data_with_ref tests/test_components.py::test_component_taupage_auto_scaling_group_user_data_with_lists_and_empty_dict tests/test_components.py::test_component_auto_scaling_group_configurable_properties tests/test_components.py::test_component_auto_scaling_group_metric_type tests/test_components.py::test_component_auto_scaling_group_optional_metric_type tests/test_components.py::test_to_iso8601_duration tests/test_components.py::test_normalize_asg_success tests/test_components.py::test_normalize_network_threshold tests/test_components.py::test_check_application_id tests/test_components.py::test_check_application_version tests/test_components.py::test_get_load_balancer_name
senza/components/stups_auto_configuration.py
senza/components/stups_auto_configuration.py