by Semir H.
If you find this tutorial useful, please consider making a donation to support future work like this:
Preparation:
Decide in which Region you will create this.
Decide on the DB Engine (MySQL or Oracle).
For this tutorial I will use the following:
Multi AZ Deployment = Yes
Allocated Storage = 5 GB (minimum - good enough for this tutorial)
DB Instance Identifier = TestDB-Inst
Master Username = dbadmin
Password = whatever you want
Procedure:
Log into your Amazon Web Services (AWS) Management Console. Go to the Amazon RDS tab. Pick your Region. Click on “Launch DB Instance”.
In the “Engine Selection” pick MySQL and click on “Select”.
Fill in the “DB Instance Details” as per your needs. I’ll use the details I put down above. Click on “Continue”
Example:
On the “Additional Configuration” part leave everything at defaults (no need to put a DB name now). Click on “Continue”.
On the “Management Options” pick your Backup Retention Period (e.g. 1 day), Backup Window and Maintenance Window. Click on “Continue”.
Review your settings and if you are happy, launch the DB Instance.
DB Security Groups (connecting EC2 to RDS):
To make sure a particular EC2 Instance (in my case an Ubuntu Linux one) can connect to the Amazon RDS MySQL Instance we just created we need to create or modify an existing DB Security Group. I’ll just modify the default one.
Go to Amazon RDS tab and click on the “DB Security Groups” link.
Click on the “default” DB Security Group.
Under “Connection Type” pick “EC2 Security Group”.
Put in your Security Group name (in my case it was “linux sec grp”) and the AWS Account ID of the AWS account where this EC2 Security Group is. The number is a 12 digit number without any dashes.
Click on “Add”. If all goes well you should see that the connection you just defined will be authorised. Here’s an example (with my personal details blacked out):
This will essentially let any EC2 Instance (my Linux Instances) that are controlled by my “Linux Sec Grp” Security Group be able to communicate with my new MySQL RDS Instance.
To connect to the new MySQL Amazon RDS Instance (TestDB-Inst) we’ll need to find the Endpoint address. We do that by clicking on the DB Instance and looking under its Description. In my case it is “testdb-inst.cheuhkpk9v6o.ap-southeast-1.rds.amazonaws.com”.
Testing connecting:
# mysql -h testdb-inst.cheuhkpk9v6o.ap-southeast-1.rds.amazonaws.com -u dbadmin -p
Enter the password and there you go, you are now connected to your MySQL Instance.
You may now create databases for your projects.
Information Technology HOWTOs, Technical Solutions, Best Practices and general cool stuff.
Showing posts with label security groups. Show all posts
Showing posts with label security groups. Show all posts
Wednesday, August 10, 2011
Deploying an Amazon MySQL RDS Instance
Thursday, August 4, 2011
How to change AWS EC2 Security Group of an existing Instance
By Semir H.
If you find this tutorial useful, please consider making a donation to support future work like this:
Scenario:
You have a few pre-made Security Groups and one of your Instances needs to change from one to another.
Solution:
AWS EC2 does not have a way to easily switch these. You basically have to clone the Instance into an AMI and then deploy a new Instance out of that AMI, taking care to associate the new Instance with the desired Security Group at the time of creation.
You can delete the AMI and the associated Snapshot, if you desire so.
Process:
Create a Security Group with your desired port settings.
Clone your Instance by right clicking on it and choosing to create an Image (EBS AMI). It is best if the original Instance is turned off so that no data is lost.
After a bit of time your new AMI should be visible in the AMIs section. Please make sure you’re in the correct Region.
Right-click on your new AMI and pick “Launch Instance”.
Use the “Request Instance Wizard” to select settings you wish but please make sure you select the correct Security Group during this process.
You may also take this opportunity to change your Key Pair.
Finish the wizard and launch the Instance.
You should now see that the new Instance has the new Security Group associated with it.
Log into your new Instance and confirm that no data is missing.
Cleanup:
Once you are sure no data is missing and that you will not need your original Instance or the resulting AMI then you can delete both.
Also delete the Snapshot that was made during the cloning process.
If you find this tutorial useful, please consider making a donation to support future work like this:
Scenario:
You have a few pre-made Security Groups and one of your Instances needs to change from one to another.
Solution:
AWS EC2 does not have a way to easily switch these. You basically have to clone the Instance into an AMI and then deploy a new Instance out of that AMI, taking care to associate the new Instance with the desired Security Group at the time of creation.
You can delete the AMI and the associated Snapshot, if you desire so.
Process:
Create a Security Group with your desired port settings.
Clone your Instance by right clicking on it and choosing to create an Image (EBS AMI). It is best if the original Instance is turned off so that no data is lost.
After a bit of time your new AMI should be visible in the AMIs section. Please make sure you’re in the correct Region.
Right-click on your new AMI and pick “Launch Instance”.
Use the “Request Instance Wizard” to select settings you wish but please make sure you select the correct Security Group during this process.
You may also take this opportunity to change your Key Pair.
Finish the wizard and launch the Instance.
You should now see that the new Instance has the new Security Group associated with it.
Log into your new Instance and confirm that no data is missing.
Cleanup:
Once you are sure no data is missing and that you will not need your original Instance or the resulting AMI then you can delete both.
Also delete the Snapshot that was made during the cloning process.
Subscribe to:
Posts (Atom)




