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개 답변
1
수락된 답변

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
전문가
답변함 한 달 전
profile picture
전문가
검토됨 25일 전
profile picture
전문가
검토됨 한 달 전
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
전문가
Matt-B
답변함 한 달 전
profile picture
전문가
검토됨 25일 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠