Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/epomatti/aws-vpc-endpoints
AWS VPC Endpoints integrated with SQS and KMS
https://github.com/epomatti/aws-vpc-endpoints
aws aws-privatelink aws-security kms sqs terraform vpc vpc-endpoints vpce
Last synced: about 1 month ago
JSON representation
AWS VPC Endpoints integrated with SQS and KMS
- Host: GitHub
- URL: https://github.com/epomatti/aws-vpc-endpoints
- Owner: epomatti
- License: mit
- Created: 2022-08-13T19:34:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T03:15:51.000Z (over 1 year ago)
- Last Synced: 2023-09-11T04:26:47.260Z (over 1 year ago)
- Topics: aws, aws-privatelink, aws-security, kms, sqs, terraform, vpc, vpc-endpoints, vpce
- Language: HCL
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS VPC Endpoints
This sandbox implements a VPC Interface Endpoint to send messages to a SQS queue from an EC2 instance that runs in a private subnet.
In addition to provisioning the core resources, policies will be configured to use proper conditions.
The SQS queue will only accept `sqs:SendMessage` operations coming from the configured VPC Endpoint:
```json
"Condition": {
"StringNotEquals": {
"aws:sourceVpce": "vpce-1a2b3c4d"
}
}
```## Setup
Create the EC2 instance key pair material:
```sh
ssh-keygen -f modules/instance/ec2_id_rsa
```To create the environment simply run:
```sh
terraform init
terraform apply -auto-approve
```Connect to the EC2 instance:
```sh
aws ssm start-session --target i-00000000000000000 --region sa-east-1
```Once the environment is created, connect to the EC2 instance using SSM. Confirm that the name is resolving to a private IP:
```sh
$ dig +short sqs.sa-east-1.amazonaws.com
10.0.50.54
```Confirm that you're authenticated from within the EC2 instance:
```sh
aws sts get-caller-identity
```Now send a message to the endpoint to the see the results:
```sh
aws sqs send-message --queue-url https://sqs.sa-east-1.amazonaws.com/000000000000/my-private-queue --message-body Hello
```## Clean-up
```sh
terraform destroy
```