Repository: getmoto/moto

Issue:
create_vpc_endpoint_service_configuration does not include `Owner` key in resource
When using `create_vpc_endpoint_service_configuration` function, the created service does not have the `owner` key that AWS automatically associates with your account_id.
So, when I use the `describe_vpc_endpoint_services` function, the created service does not show any owner and I expect to be the mocked account id.

This is an example of an expected service:

> {'ServiceName': 'com.amazonaws.vpce.eu-west-1.vpce-svc-0e8175b5', 'ServiceId': 'vpce-svc-00e8175b5', 'ServiceType': [{'ServiceType': 'Interface'}], 'AvailabilityZones': ['eu-west-1a'], **_'Owner': '123456789012'_**, 'BaseEndpointDnsNames': ['vpce-svc-00e8175b5.eu-west-1.vpce.amazonaws.com'], 'VpcEndpointPolicySupported': False, 'AcceptanceRequired': True, 'ManagesVpcEndpoints': False, 'Tags': [], 'SupportedIpAddressTypes': ['ipv4']}

More info:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_vpc_endpoint_services


Discussion:

Patch:
diff --git a/moto/ec2/models/vpc_service_configuration.py b/moto/ec2/models/vpc_service_configuration.py
--- a/moto/ec2/models/vpc_service_configuration.py
+++ b/moto/ec2/models/vpc_service_configuration.py
@@ -41,6 +41,21 @@ def __init__(
         self.principals: List[str] = []
         self.ec2_backend = ec2_backend
 
+    def to_dict(self) -> Dict[str, Any]:
+        return {
+            "AcceptanceRequired": self.acceptance_required,
+            "AvailabilityZones": self.availability_zones,
+            "BaseEndpointDnsNames": [self.endpoint_dns_name],
+            "ManagesVpcEndpoints": self.manages_vpc_endpoints,
+            "Owner": self.ec2_backend.account_id,
+            "PrivateDnsName": self.private_dns_name,
+            "PrivateDnsNames": [{"PrivateDnsName": self.private_dns_name}],
+            "ServiceId": self.id,
+            "ServiceName": self.service_name,
+            "ServiceType": [{"ServiceType": self.service_type}],
+            "VpcEndpointPolicySupported": True,
+        }
+
 
 class VPCServiceConfigurationBackend:
     def __init__(self) -> None:
diff --git a/moto/ec2/models/vpcs.py b/moto/ec2/models/vpcs.py
--- a/moto/ec2/models/vpcs.py
+++ b/moto/ec2/models/vpcs.py
@@ -845,13 +845,16 @@ def describe_vpc_endpoint_services(
         default_services = self._collect_default_endpoint_services(
             self.account_id, region  # type: ignore[attr-defined]
         )
+        custom_services = [x.to_dict() for x in self.configurations.values()]  # type: ignore
+        all_services = default_services + custom_services
+
         for service_name in service_names:
-            if service_name not in [x["ServiceName"] for x in default_services]:
+            if service_name not in [x["ServiceName"] for x in all_services]:
                 raise InvalidServiceName(service_name)
 
         # Apply filters specified in the service_names and filters arguments.
         filtered_services = sorted(
-            self._filter_endpoint_services(service_names, filters, default_services),
+            self._filter_endpoint_services(service_names, filters, all_services),
             key=itemgetter("ServiceName"),
         )
 


Test patch:
diff --git a/tests/test_ec2/test_vpc_service_configuration.py b/tests/test_ec2/test_vpc_service_configuration.py
--- a/tests/test_ec2/test_vpc_service_configuration.py
+++ b/tests/test_ec2/test_vpc_service_configuration.py
@@ -3,6 +3,7 @@
 
 from botocore.exceptions import ClientError
 from moto import mock_ec2, mock_elbv2
+from moto.core import DEFAULT_ACCOUNT_ID
 from moto.moto_api._internal import mock_random
 
 # See our Development Tips on writing tests for hints on how to write good tests:
@@ -101,13 +102,11 @@ def test_create_vpc_endpoint_service_configuration_with_options():
         region_name="us-east-2", lb_type="gateway", zone="us-east-1c"
     )
 
-    resp = client.create_vpc_endpoint_service_configuration(
+    config = client.create_vpc_endpoint_service_configuration(
         GatewayLoadBalancerArns=[lb_arn],
         AcceptanceRequired=False,
         PrivateDnsName="example.com",
-    )
-    assert "ServiceConfiguration" in resp
-    config = resp["ServiceConfiguration"]
+    )["ServiceConfiguration"]
 
     assert config["AcceptanceRequired"] is False
     assert config["PrivateDnsName"] == "example.com"
@@ -118,6 +117,13 @@ def test_create_vpc_endpoint_service_configuration_with_options():
         "Value": "val",
     }
 
+    service_name = config["ServiceName"]
+    detail = client.describe_vpc_endpoint_services(ServiceNames=[service_name])[
+        "ServiceDetails"
+    ][0]
+    assert detail["ServiceName"] == service_name
+    assert detail["Owner"] == DEFAULT_ACCOUNT_ID
+
 
 @mock_ec2
 @mock_elbv2