Repository: getmoto/moto
Pull request #7746 (2024-06-03 22:08:09)

Bump ruby/setup-ruby from 1.177.1 to 1.179.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.177.1 to 1.179.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/ruby/setup-ruby/commit/d5fb7a202fc07872cb44f00ba8e6197b70cb0c55"><code>d5fb7a2</code></a> Update CRuby releases on Windows</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/0cde4689ba33c09f1b890c1725572ad96751a3fc"><code>0cde468</code></a> Clearer</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/a56d16ef336872fc5c5412580aa7a1a0460d8f73"><code>a56d16e</code></a> Refine errors text</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/12dfa2bb470be612a06b153aaf7bd8d7c56deb1f"><code>12dfa2b</code></a> Better error for 404</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/68b705993a229bc26951e27288e9374376f2ee44"><code>68b7059</code></a> Fix condition</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/d046db60e330fabc5f3aa2535500c8cc3fb26b07"><code>d046db6</code></a> Fail clearly for CRuby &lt; 2.6 on macos-arm64</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/d4138ebc479e2e18496c7f267b266fb2ad0ed142"><code>d4138eb</code></a> Do not validate the version for self-hosted</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/049eae045072f3ce40fa17ae13a84a436158c50e"><code>049eae0</code></a> Remove trailing space</li>
<li><a href="https://github.com/ruby/setup-ruby/commit/ff22bbb25feefdbda5d7d4e2a36b8e4713a8269b"><code>ff22bbb</code></a> Add ruby-3.1.6,ruby-3.3.2</li>
<li>See full diff in <a href="https://github.com/ruby/setup-ruby/compare/943103cae7d3f1bb1e4951d5fcc7928b40e4b742...d5fb7a202fc07872cb44f00ba8e6197b70cb0c55">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ruby/setup-ruby&package-manager=github_actions&previous-version=1.177.1&new-version=1.179.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/moto/ec2/models/route_tables.py b/moto/ec2/models/route_tables.py
index c557b5a70..0932e2103 100644
--- a/moto/ec2/models/route_tables.py
+++ b/moto/ec2/models/route_tables.py
@@ -122,6 +122,12 @@ class RouteTable(TaggedEC2Resource, CloudFormationModel):
                 for route in self.routes.values()
                 if route.nat_gateway is not None
             ]
+        elif filter_name == "route.transit-gateway-id":
+            return [
+                route.transit_gateway.id
+                for route in self.routes.values()
+                if route.transit_gateway is not None
+            ]
         else:
             return super().get_filter_value(filter_name, "DescribeRouteTables")
 


Test patch:
diff --git a/.github/workflows/tests_sdk_ruby.yml b/.github/workflows/tests_sdk_ruby.yml
index 4997aa25c..1ec511e42 100644
--- a/.github/workflows/tests_sdk_ruby.yml
+++ b/.github/workflows/tests_sdk_ruby.yml
@@ -13,7 +13,7 @@ jobs:
     steps:
       - uses: actions/checkout@v4
       - name: Set up Ruby ${{ matrix.ruby-version }}
-        uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742
+        uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55
         with:
           ruby-version: ${{ matrix.ruby-version }}
       - name: Set up Python 3.8
diff --git a/tests/test_ec2/test_route_tables.py b/tests/test_ec2/test_route_tables.py
index 4187103c4..9db133ef2 100644
--- a/tests/test_ec2/test_route_tables.py
+++ b/tests/test_ec2/test_route_tables.py
@@ -269,6 +269,35 @@ def test_route_tables_filters_vpc_peering_connection():
     all(vpc_pcx_id == vpc_pcx.id for vpc_pcx_id in vpc_pcx_ids)
 
 
+@mock_aws
+def test_route_tables_filters_transit_gateway():
+    client = boto3.client("ec2", region_name="us-east-1")
+    ec2 = boto3.resource("ec2", region_name="us-east-1")
+    vpc = ec2.create_vpc(CidrBlock="10.0.0.0/16")
+    main_route_table_id = client.describe_route_tables(
+        Filters=[{"Name": "vpc-id", "Values": [vpc.id]}]
+    )["RouteTables"][0]["RouteTableId"]
+    main_route_table = ec2.RouteTable(main_route_table_id)
+
+    response = client.create_transit_gateway()
+
+    gateway = response["TransitGateway"]
+    main_route_table.create_route(TransitGatewayId=gateway["TransitGatewayId"])
+
+    route_tables = client.describe_route_tables(
+        Filters=[
+            {
+                "Name": "route.transit-gateway-id",
+                "Values": [gateway["TransitGatewayId"]],
+            }
+        ]
+    )["RouteTables"]
+
+    assert len(route_tables) == 1
+    route_table = route_tables[0]
+    assert route_table["RouteTableId"] == main_route_table_id
+
+
 @mock_aws
 def test_route_table_associations():
     client = boto3.client("ec2", region_name="us-east-1")