Optimize VPC Endpoints costs for development environment

0

Hello,

I recently set up 5 VPC Endpoints to avoid using NAT Gateway with my ECS tasks (2 for ECR, 1 for S3, 1 for Cloudwatch Logs and 1 for Secret Manager), each endpoint is linked to only one AZ. At the end, the VPC Endpoint Hours cost the same as the NAT Gateway.

As the documentation says "Pricing per VPC endpoint per AZ ($/hour)", could I detach my VPC Endpoint from all my subnets outside the working hours to avoid VPC Endpoint Hours costs ? Will the costs of endpoints be 0 or just decreased ?

2 Antworten
1
Akzeptierte Antwort

Hello.

How about using Lambda and EventBridge to create a script that deletes a VPC endpoint after business hours?
There is no function to detach VPC endpoints, so I think you can reduce costs by deleting them outside of business hours.
Also, since there is no charge for the S3 gateway VPC endpoint, I think you only need to delete the interface endpoint.
You can create a Lambda function to delete VPC endpoints by using the "delete_vpc_endpoints" API.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/delete_vpc_endpoints.html

You can also create a VPC endpoint using the "create_vpc_endpoint" API.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/create_vpc_endpoint.html

profile picture
EXPERTE
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor 25 Tagen
profile picture
EXPERTE
überprüft vor einem Monat
1

Hi There

Another option would be to run your own NAT Instance on an EC2 instance and stop it when you are not using it.

https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html

profile pictureAWS
EXPERTE
Matt-B
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor 25 Tagen
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen