AWS API gateway configure vpc endpoint id from different region - amazon-web-services

Current Scenario
Currently, we are having our AWS API gateway of type PRIVATE in EU-central-1. if we try to configure VPC endpoint from region in ap-southeast-1
we are getting error like
is not valid vpc endpoint id
but when we try to configure it from same region it works well.
not sure how to resolve this error

To connect to one service from VPC A to another in VPC B you can use followin Amazon VPC-to-Amazon VPC Connectivity Options - https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/amazon-vpc-to-amazon-vpc-connectivity-options.html
Each one has its own advantages and limitations.
AWS private linkis one of these options. Attaching one image from offical doc here https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/aws-privatelink.html
Here is the link for VPC endpoint and supported service - https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html

Related

Unable to Access IAM AWS Service Endpoint in a private subnet using a Private Link of VPC Endpoint

We're trying to access AWS Services from a private subnet in a VPC using a VPC endpoint or Private Link. We're trying to avoid adding a NAT gateway on the private subnet.
We created/added a VPC Endpoints (i.e. AWS Service for EC2 and S3)
com.amazonaws.us-east-2.ec2
com.amazonaws.us-east-2.s3
But we're not able to access something like com.amazonaws.us-east-2.iam; is there an iam endpoint or is this supported or is there any workaround
for us to use iam via VPC Endpoint on us-east-2?
Here's the error we're getting when we use the latest version of Java AWS SDK to get ec2 instance attached iam role programatically
org.apache.http.conn.ConnectTimeoutException: Connect to
iam.amazonaws.com:443 [iam.amazonaws.com/
Thanks for any information you can provide.
As of May 2022, VPC endpoint for IAM is not supported. You'd have to connect to IAM via internet. Or as a workaround, you can do IAM actions in CloudFormation.

Timeout calling PRIVATE API Gateway from another AWS account

I am trying to call my private API gateway from a lambda function in another AWS account. But i am getting timeout while making the call (Actually the http call is just stuck and hits my client side timeout).
In the AWS account which hosts the private AWS account i did the following
* Created my private API gateway and lambda behind the API
Create resource policy and provided access to the VPC endpoint of the other AWS caller (caller)
create VPC endpoint with private DNS enabled.
Attached policy to VPC endpoint with full access, security group with access to all traffic.
In the second AWS account (caller) i did the following
* Create VPC and VPC endpoint for API gateway with full access.
created lambda in the VPC with security group with access to all traffic (inbound and outbound)
In lambda I am using the public DNS of the VPC endpoint(Account 1) and used header 'x-apigw-api-id'
I already tried the debugging steps mentioned in this page https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-private-endpoint-connection/.
Also tried whitelisting based on the VPC ID instead of VPC endpoint ID.
Any suggestions for resolving this issue.
Just found the isssue. I was using the VPC endpoint of the other aws account while making a call. When i used the VPC endpoint of the same account it worked.

AWS How to associate a VPC interface endpoint to a specific NLB in another VPC

I have an existing VPC interface endpoint for elastic load balancer in a VPC A and a NLB in VPC B with a VPC endpoint service associated.
How I can create the association between the VPC interface endpoint and NLB as in the AWS diagram?
According to I can't connect to an endpoint service from my Amazon Virtual Private Cloud (Amazon VPC) interface endpoint using AWS PrivateLink., it looks a request needs to be created.
.
Request that the endpoint service provider accepts the endpoint connection request to activate the connection.
However, I do not see any option to create a request in the VPC endpoint side.
According to Create A VPC Endpoint Service, the request can be created when creating a VPC interface endpoint, but I have already created one.
Please advise how to, or correct me if I misunderstand something.
Go to your VPC Dashboard > Endpoint Service and check under the Endpoint Connections tab. If your VPC endpoint is in the list and the state is Available, then the association you are looking for is established.
One possible reason why you did not have a Pending acceptance status in your VPC endpoint could be that you did not check the Acceptance required box when creating the VPC endpoint service.
Check out AWS New York Summit 2018 - AWS PrivateLink: Fundamentals (SRV211) at 28:08 and 33:33 for the full demo.

Using Lambda inside VPC with SNS+RDS

I'd like to have a lambda expression that every hour makes a query on RDS database, pull some ARN (device tokens) and then sends these devices a notification via SNS. My desire is to remain inside the VPC and I'd like to avoid using NAT due to its cost. Should i create a VPC endpoint (is this called AWS PrivateLink?) that can reach out SNS+RDS? Is NAT and Endpoint similar in billing? Globally is this the right way to achieve a "cron sending notifications" on AWS?
RDS is reachable inside the VPC without the endpoint isn't it?
This is totally possibly
Your lambda can run in a private subnet in the VPC that communicates with your RDS database over the network on port 3306. Make sure your security group and NACL rules allow this.
You then need to create a VPC endpoint to your SNS service. Be sure your route table includes this route.
The main difference between VPC endpoints and AWS Privatelink is the following:
A VPC endpoint enables you to privately connect your VPC to supported AWS services. SNS, Kinesis, SQS, S3,....
While AWS Privatelink is more about creating your own application in your VPC and configuring it as an AWS PrivateLink-powered service (referred to as an endpoint service). Other AWS principals can create a connection from their VPC to your endpoint service using an interface VPC endpoint.
VPC endpoints are free. Nat Gateways cost per hour per GB.

How to setup access to ElasticDomain from different AWS account?

I created an ElasticDomain in private subnet which has a VPC endpoint and a security group which allows access from port 443. We want to access this ElasticDomain from another AWS account's EC2 instance. But we are not able to do that.
We tried creating ElasticDomain with a public endpoint which is accessible from anywhere but is not the right option for us.
We are considering to use apache as a reverse proxy and then set up a VPC private-link on a consumer account. Is that a right approach?
AWS PrivateLink via VPC and Network Load Balancer doesn't support ElasticDomain for now.
Check out the following two links:
1) https://aws.amazon.com/blogs/security/how-to-control-access-to-your-amazon-elasticsearch-service-domain/
2) AWS ElasticSearch write to account "A" from lambda in account "B"