diff --git a/senza/components/elastigroup.py b/senza/components/elastigroup.py
index 42e9e6d..391ee91 100644
--- a/senza/components/elastigroup.py
+++ b/senza/components/elastigroup.py
@@ -138,7 +138,7 @@ def component_elastigroup(definition, configuration, args, info, force, account_
     extract_user_data(configuration, elastigroup_config, info, force, account_info)
     extract_load_balancer_name(configuration, elastigroup_config)
     extract_public_ips(configuration, elastigroup_config)
-    extract_image_id(elastigroup_config)
+    extract_image_id(configuration, elastigroup_config)
     extract_security_group_ids(configuration, elastigroup_config, args)
     extract_instance_types(configuration, elastigroup_config)
     extract_autoscaling_capacity(configuration, elastigroup_config)
@@ -497,7 +497,7 @@ def extract_public_ips(configuration, elastigroup_config):
             ]
 
 
-def extract_image_id(elastigroup_config: dict):
+def extract_image_id(configuration, elastigroup_config: dict):
     """
     This function identifies whether a senza formatted AMI mapping is configured,
     if so it transforms it into a Spotinst Elastigroup AMI API configuration
@@ -506,7 +506,8 @@ def extract_image_id(elastigroup_config: dict):
     launch_spec_config = elastigroup_config["compute"]["launchSpecification"]
 
     if "imageId" not in launch_spec_config.keys():
-        launch_spec_config["imageId"] = {"Fn::FindInMap": ["Images", {"Ref": "AWS::Region"}, "LatestTaupageImage"]}
+        image_key = configuration.get("Image", "LatestTaupageImage")
+        launch_spec_config["imageId"] = {"Fn::FindInMap": ["Images", {"Ref": "AWS::Region"}, image_key]}
 
 
 def extract_security_group_ids(configuration, elastigroup_config: dict, args):

Allow Elastigroup component to use custom Taupage AMI
Currently, Elastigroup components [always use the latest production Taupage AMI](https://github.com/zalando-stups/senza/blob/235c2a4b25bdd9dffdc36e0a2bbe16704788a407/senza/components/elastigroup.py#L509).

When the attribute `Image` is specified that setting should be honored, allowing users to easily specify one of the other [existing options](https://stups.readthedocs.io/en/latest/components/senza.html#senza-stupsautoconfiguration) - `LatestTaupageStagingImage` or `LatestTaupageDevImage`

The current workaround is to customize use the `Elastigroup` attribute:
```yaml
Elastigroup:
  compute:
    launchSpecification:
      imageId: <ami-id>
```

Which requires users to know in advance the AMI ID and hardcode it.  
diff --git a/tests/test_elastigroup.py b/tests/test_elastigroup.py
index 78725db..7213a8b 100644
--- a/tests/test_elastigroup.py
+++ b/tests/test_elastigroup.py
@@ -62,7 +62,8 @@ def test_component_elastigroup_defaults(monkeypatch):
     assert {'tagKey': 'StackName', 'tagValue': 'foobar'} in tags
     assert {'tagKey': 'StackVersion', 'tagValue': '0.1'} in tags
     assert properties["group"]["compute"]["product"] == ELASTIGROUP_DEFAULT_PRODUCT
-    assert properties["group"]["compute"]["subnetIds"] == {"Fn::FindInMap": ["ServerSubnets", {"Ref": "AWS::Region"}, "Subnets"]}
+    assert properties["group"]["compute"]["subnetIds"] == {
+        "Fn::FindInMap": ["ServerSubnets", {"Ref": "AWS::Region"}, "Subnets"]}
     assert properties["group"]["region"] == "reg1"
     assert properties["group"]["strategy"] == ELASTIGROUP_DEFAULT_STRATEGY
 
@@ -666,19 +667,28 @@ def test_public_ips():
 def test_extract_image_id():
     test_cases = [
         {  # default behavior - set latest taupage image
+            "input": {},
             "given_config": {},
             "expected_config": {"compute": {"launchSpecification": {
                 "imageId": {"Fn::FindInMap": ["Images", {"Ref": "AWS::Region"}, "LatestTaupageImage"]}
             }}},
         },
         {  # leave imageId untouched
+            "input": {},
             "given_config": {"compute": {"launchSpecification": {"imageId": "fake-id"}}},
             "expected_config": {"compute": {"launchSpecification": {"imageId": "fake-id"}}},
         },
+        {  # use specified image from the Senza mapping
+            "input": {"Image": "Foo"},
+            "given_config": {},
+            "expected_config": {"compute": {"launchSpecification": {
+                "imageId": {"Fn::FindInMap": ["Images", {"Ref": "AWS::Region"}, "Foo"]}
+            }}},
+        }
     ]
     for test_case in test_cases:
         got = test_case["given_config"]
-        extract_image_id(got)
+        extract_image_id(test_case["input"], got)
         assert test_case["expected_config"] == got
 
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-mock responses mock
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
arrow==1.3.0
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
coverage==7.8.0
dnspython==2.7.0
exceptiongroup==1.2.2
idna==3.10
importlib_metadata==8.6.1
iniconfig==2.1.0
jmespath==1.0.1
mock==5.2.0
packaging==24.2
pluggy==1.5.0
pystache==0.6.8
pytest==8.3.5
pytest-cov==6.0.0
pytest-mock==3.14.0
python-dateutil==2.9.0.post0
PyYAML==6.0.2
raven==6.10.0
requests==2.32.3
responses==0.25.7
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@235c2a4b25bdd9dffdc36e0a2bbe16704788a407#egg=stups_senza
stups-tokens==1.1.19
stups-zign==1.2
tomli==2.2.1
types-python-dateutil==2.9.0.20241206
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:
      - arrow==1.3.0
      - 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
      - coverage==7.8.0
      - dnspython==2.7.0
      - exceptiongroup==1.2.2
      - idna==3.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jmespath==1.0.1
      - mock==5.2.0
      - packaging==24.2
      - pluggy==1.5.0
      - pystache==0.6.8
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytest-mock==3.14.0
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.2
      - raven==6.10.0
      - requests==2.32.3
      - responses==0.25.7
      - 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
      - types-python-dateutil==2.9.0.20241206
      - typing==3.7.4.3
      - urllib3==1.26.20
      - zipp==3.21.0
prefix: /opt/conda/envs/senza

tests/test_elastigroup.py::test_extract_image_id
tests/test_elastigroup.py::test_component_elastigroup_defaults tests/test_elastigroup.py::test_raw_user_data_and_base64_encoding_cf_function_used tests/test_elastigroup.py::test_missing_access_token tests/test_elastigroup.py::test_spotinst_account_resolution tests/test_elastigroup.py::test_spotinst_account_resolution_failure tests/test_elastigroup.py::test_block_mappings tests/test_elastigroup.py::test_auto_scaling_rules tests/test_elastigroup.py::test_detailed_monitoring tests/test_elastigroup.py::test_prediction_strategy tests/test_elastigroup.py::test_autoscaling_capacity tests/test_elastigroup.py::test_product tests/test_elastigroup.py::test_standard_tags tests/test_elastigroup.py::test_extract_subnets tests/test_elastigroup.py::test_load_balancers tests/test_elastigroup.py::test_multiple_target_groups tests/test_elastigroup.py::test_public_ips tests/test_elastigroup.py::test_extract_security_group_ids tests/test_elastigroup.py::test_missing_instance_type tests/test_elastigroup.py::test_extract_instance_types tests/test_elastigroup.py::test_extract_instance_profile tests/test_elastigroup.py::test_patch_cross_stack_policy tests/test_elastigroup.py::test_patch_cross_stack_policy_errors
senza/components/elastigroup.py
senza/components/elastigroup.py