Logo

dev-resources.site

for different kinds of informations.

Port Forwarding to Amazon MQ

Published at
2/26/2024
Categories
ssm
aws
rabbitmq
portforwarding
Author
bianca
Categories
4 categories in total
ssm
open
aws
open
rabbitmq
open
portforwarding
open
Author
6 person written this
bianca
open
Port Forwarding to Amazon MQ

Image description
Overview
RabbitMQ is a powerful message broker widely used in modern applications for handling message queues. However, ensuring the security of your RabbitMQ instance is crucial, especially in a production environment. One way to enhance security is by deploying RabbitMQ in a private subnet. In this article, we'll explore how to set up a private RabbitMQ instance on AWS and enable access to it securely using port forwarding through AWS Systems Manager (SSM) Agent.

Prerequisites

  • An AWS account
  • Amazon MQ.

Install and Configure SSM Agent

Depending on your OS, download ssm agent here

Configure awscli using either of the following:
a) aws configure
Image description

b) export sso credentials
Image description

Start port forwarding session:
Linux & MacOS

aws ssm start-session \
    --target instance-id \
    --document-name AWS-StartPortForwardingSessionToRemoteHost \
    --parameters '{"host":["my.example.mq.eu-west-1.amazonaws.com"],"portNumber":["443"], "localPortNumber":["4000"]}'
Enter fullscreen mode Exit fullscreen mode

Windows

aws ssm start-session ^
    --target instance-id ^
    --document-name AWS-StartPortForwardingSessionToRemoteHost ^
    --parameters host="my.example.us-east-2.rds.amazonaws.com",portNumber="443",localPortNumber="4000"
Enter fullscreen mode Exit fullscreen mode

You can use a different port other than 4000

In a separate tab open /etc/hosts with vim or nano and the following line.

127.0.0.1          my.example.mq.eu-west-1.amazonaws.com
Enter fullscreen mode Exit fullscreen mode

Note: Please change my.example.mq.eu-west-1.amazonaws.com. You can get it as shown:
Image description

Navigate to your browser:
Image description

Conclusion
You are now able to access your broker outside the VPC from your local browser.

ssm Article's
30 articles in total
Favicon
The re-re-rebirth of AWS Systems Manager
Favicon
How can I enforce MFA before switching roles and using SSM login in AWS?
Favicon
EC2 instance deployment unification across AWS Organizations
Favicon
ECS Exec Usage Guide
Favicon
Gerenciamento de alta latΓͺncia com AWS CloudWatch e AWS Systems Manager
Favicon
How to β€” AWS Auto Stop/Start of EC2 Instances using Tags
Favicon
Use AWS StepFunctions for SSM Patching Alerts
Favicon
Port Forwarding to Amazon MQ
Favicon
NestJS Configuration Secrets Made Easy with configify
Favicon
No-ssh deployment to EC2 using ansible and AWS Systems Manager
Favicon
Automating patching with AWS Systems Manager
Favicon
[AWS] How To Install Cloud Watch Agent To EC2 Linux With SSM
Favicon
Create a Secure VPC with SSM-Managed Private EC2 Instances Using the AWS CLI
Favicon
Stop/Start RDS Instances Automatically Using System Manager for Cost Optimization
Favicon
How to debug running CodeBuild builds in AWS Session Manager
Favicon
AWS SSM Automation for Encrypting RDS Instances
Favicon
AWS Config Auto Remediation for Configuring S3 Lifecycle Rule
Favicon
A practical method for managing environment variables in microservices running on AWS ECS
Favicon
More Automation for Your AWS Resources, More Coffee Time for You!
Favicon
How to connect to an EC2 Private Instance via SSM Port Forwarding !
Favicon
Storing related secrets in Parameter Store for more efficient access
Favicon
Securely Connect to EC2 Instances Using Systems Manager (SSM)
Favicon
EC2 Spot instances : Comment simuler une fin d'instance et lancer une commande avant la terminaison
Favicon
AWS Systems Manager (SSM) Cross Region Replication
Favicon
3 Ways to Read SSM Parameters
Favicon
Connect to a Private Subnet AWS EC2 without Ingress
Favicon
Utilizando o Session Manager - AWS System Manager
Favicon
Amazon SSM Agent - Risk Of Security
Favicon
AWS SSM Agent - Connection Error
Favicon
Fetch Application Inventory using Systems Manager

Featured ones: