fix(add owner to service): set self.current_account as VPC Service Endpoint Owner
Regarding https://github.com/spulec/moto/issues/5605 since the owner in VPC Service Endpoints are always empty, set self.current_account as VPC Service Endpoint Owner.
Codecov Report
Merging #5606 (de4f043) into master (dc368fb) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## master #5606 +/- ##
=======================================
Coverage 96.20% 96.20%
=======================================
Files 742 742
Lines 72631 72631
=======================================
Hits 69872 69872
Misses 2759 2759
| Flag | Coverage Δ | |
|---|---|---|
| servertests | 36.91% <0.00%> (+<0.01%) |
:arrow_up: |
| unittests | 96.13% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| moto/ec2/responses/vpcs.py | 98.71% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
The default services will always have owner=amazon, so this solution is not correct.
To verify this, see the output for the cassandra service:
aws ec2 describe-vpc-endpoint-services --filters '[{"Name":"service-name","Values":["com.amazonaws.us-east-1.cassandra"]}]'
From the issue you opened:
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.
As far as I can tell, our describe--endpoint doesn't yet return user-created (non-default) services? From the docs:
[X] describe_vpc_endpoint_services
Return info on services to which you can create a VPC endpoint.
Currently only the default endpoing services are returned.
http://docs.getmoto.org/en/latest/docs/services/ec2.html
So we would have to implement that first, to actually return user-created configurations, and then we can change the Owner-field to be either amazon or the account ID.