Securing IOS Conference Bridges in Cisco Unified Communications Manager
March 21, 2024A Step-by-Step Guide: Importing Cisco ACI Nodes into IaC Using Python
August 7, 2024Learn step by step how to deploy AWS Cloud9 on an Ubuntu 22.04 LTS T3.medium instance, and install popular automation tools.
What is AWS Cloud9?:
AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug code directly from your browser. It comes pre-packaged with essential tools for over 40 programming languages, including JavaScript, Python, and PHP, making it an excellent choice for diverse development needs. With Cloud9, you can seamlessly collaborate with others in real-time, ensuring that everyone has access to the same environment and tools.
Additionally, its ability to provide a consistent development setup across different devices eliminates the usual setup hassles, allowing you to focus on coding and problem-solving.
How To Deploy AWS Cloud9 With Ubuntu 22.04 LTS:
Prerequisites:
- Log Into AWS with an account with permissions to create Cloud9. Example IAM Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:RunInstances",
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"ec2:DescribeImages",
"ec2:DescribeKeyPairs",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeVpcs",
"ec2:CreateSecurityGroup",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:RevokeSecurityGroupIngress",
"ec2:RevokeSecurityGroupEgress",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:AttachVolume",
"ec2:ModifyInstanceAttribute",
"ec2:DescribeVolumes",
"ec2:DescribeVolumeStatus",
"ec2:ModifyVolume",
"cloud9:CreateEnvironmentEC2",
"cloud9:DescribeEnvironments",
"cloud9:DeleteEnvironment",
"cloud9:UpdateEnvironment",
"cloud9:UpdateEnvironmentMembership",
"cloud9:DescribeEnvironmentMemberships",
"cloud9:ListEnvironments"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": [
"arn:aws:iam::your-account-id:role/your-ec2-role"
]
}
]
}
- AWS VPC with Public Subnet — AWS Cloud9 requires a VPC with at least one public subnet. Ensure that your VPC has an internet gateway attached to allow internet access.
- AWS IGW — Attach an internet gateway to your VPC to enable communication with the internet.
- AWS SG — Create a security group that allows inbound SSH (port 22) and HTTP/HTTPS (ports 80/443) traffic from your IP address. Additionally, ensure port 8080 is open for Cloud9 access.
Step 1: Locate the Cloud9 Service
Step 2: Create Environment
Step 3: Instance Details
Step 4: Instance Type
I recommend a t3.medium instance, because it will have enough resources to run some of the IaC tools like CrossPlane on MiniKube, web-servers for IDPs, and other multi-threaded scripts…but usually doesn’t break the bank if you make sure to turn it off when its not in use.
Step 5: Instance Network
Make sure you place the EC2/Virtual Machine into a VPC/Subnet that can be reached from the internet. Select “Create” after this step.
Step 6: Navigate to the EC2 Instance
Step 7: Shutdown/Stop the EC2 Instance
Step 8: Increase the Storage; Select the “Volume ID” on the “Storage” tab of the EC2 Instance
Step 9: From Actions, Modify the AWS EBS Volume
Step 10: Increase the AWS EBS Volume Size from 10 GiB to 100 GiB or more
Step 11: Navigate to Cloud9 Environments, and Launch the Environment
Step 12: Finish AWS EBS Volume Increase
After increasing the size of an EBS volume, you need to extend the partition and file
system to use the new, larger size. Start this process as soon as the volume enters
the optimizing state. On Linux, extend the partition first if your volume has
one. Use the following command to find out if your instance is Nitro-based or
Xen-based:
aws ec2 describe-instance-types --instance-type t3.medium --query "InstanceTypes[].Hypervisor"
Device and partition naming differs between Xen instances and instances built on the Nitro System. “Nitro” indicates a Nitro-based instance, while “xen” or “xen-on-nitro” indicates a Xen-based instance. Our system is a Nitro system, and yours most likely will be a Nitro system. If it is a Xen-based system, then you will need to Google the commands.
Next, Check whether the volume has a partition. Use the lsblk command:
sudo lsblk
In our output, nvme0n1 is our root volume, and it is set to the expected 100GB allotment. Our root volume has three partitions: nvme0n1p1, nvme0n1p14, and nvme0n1p15. If these partitions weren’t present, you could skip the following steps and move directly to extending the file system. However, since our partitions are present, we need to check a few things:
- Check whether the partition needs to be extended. In the lsblk command output from the previous step, compare the partition size and the volume size. If the partition size is smaller than the volume size, continue to the next step. If the partition size is equal to the volume size, the partition can’t be extended.
- Extend the partition. Use the growpart command and specify the partition to extend:
sudo growpart /dev/nvme0n1 1
3. Verify that the partition has been extended. Use the lsblk command. The partition size should now be equal to the volume size.
If your partitions are not present, you need to extend the file system as follows
- Get the name, size, type, and mount point for the file system you need to extend:
df -hT
2. Extend the file system based on its type:
- For XFS file systems, use the xfs_growfs command and specify the mount point of the file system.
sudo xfs_growfs -d /
- For ext4 file systems, use the resize2fs command and specify the name of the file system:
sudo resize2fs /dev/nvme0n1p1
3. Use the df -hT command again to confirm that the file system size is now equal to the volume size.