Setting Up and Migrating Development Environments with AWS Cloud9

Setting Up and Migrating Development Environments with AWS Cloud9

?? New customer access to AWS Cloud9 has been closed, effective July 25, 2024. To learn how to migrate from AWS Cloud9 to AWS IDE ToolKits or AWS CloudShell, you can click here .

This article was written by Irene Bonso. Irene is currently thriving as a Junior Software Engineer at Tutorials Dojo and also an active member of the AWS Community Builder Program. She is focused to gain knowledge and make it accessible to a broader audience through her contributions and insights.

Step into the realm of AWS Cloud9, where cloud-based development and effortless collaboration come together! Whether you're an experienced developer or beginning your coding adventure, Cloud9 transforms the way applications are built and deployed.

Envision the capability to write, execute, and debug your code entirely within a browser-based integrated development environment (IDE). This robust tool removes the need for intricate local configurations and allows you to work from anywhere, anytime, with only an internet connection.

Amazon Cloud9 allows for seamless collaboration with colleagues, making team projects easier than ever. Its real-time collaboration feature lets multiple developers work on code simultaneously, edit files together, and view updates instantly. Wave goodbye to version control issues and embrace smooth, efficient teamwork.

Cloud9 goes beyond that, offering extensive support for various programming languages, including popular ones like Python, JavaScript, PHP, and others. Whether you're developing web applications, mobile apps, or even working on machine learning models, Cloud9 provides everything you need.

How does AWS Cloud9 work?

The diagram below provides a high-level overview of how AWS Cloud9 operates.

The diagram demonstrates how you access your AWS Cloud9 environment by running the AWS Cloud9 IDE within a web browser on your local device. A computing resource, such as an Amazon EC2 instance or your personal server, links to this environment. Your work is then securely stored in a remote repository like AWS CodeCommit.

AWS Cloud9 environments

An AWS Cloud9 environment serves as a space where you store your project files and run the development tools needed to build your applications.

With the AWS Cloud9 IDE, you have the ability to:

  • You can store project files locally, whether on an instance or a server.
  • You can clone a remote code repository into your environment, such as one from AWS CodeCommit.
  • You can manage and work with a combination of local and cloned files within the environment.

You can create and switch between multiple environments, with each environment dedicated to a specific development project. By storing environments in the cloud, projects are no longer tied to a single machine or server setup. This eliminates the hassle of switching between devices and speeds up the process of onboarding new developers to your team.

Discover what you can do with AWS Cloud 9

AWS Cloud9 provides developers with a flexible platform for a range of tasks, allowing them to code, build, test, debug, and deploy software. It supports numerous use cases and options, including:

  • Multi-language Development: Leverage the capabilities of the AWS Cloud Development Kit (AWS CDK) to efficiently work with code across multiple programming languages.
  • Containerized Development: Write and execute code inside a live Docker container, providing greater flexibility and efficiency.
  • Online Code Repositories: Enable the use of online repositories to optimize collaboration and simplify version control.
  • Real-time Collaboration: Enables teamwork in real-time, allowing for synchronized and efficient collaboration.
  • Database and Website Interactions: Enable integration with various database and website technologies.
  • Serverless Applications: Emphasizes working with AWS Lambda, Amazon API Gateway, and AWS Serverless Application services.
  • Integration with AWS Services: Smoothly connect AWS Cloud9 with other AWS products, such as Amazon Lightsail, AWS CodeStar, and AWS CodePipeline.

Setting up AWS Cloud 9

To explore the world of AWS Cloud9, select a path that suits your Cloud9 experience. In this tutorial, however, we will focus on the Individual User Setup.

Individual user setup for AWS Cloud9

This step explains how to configure and use AWS Cloud9 as the sole user in your AWS account if you’re not a student. If you already have an AWS account, you can skip this step.

Sign up for an AWS account

  1. Open https://portal.aws.amazon.com/billing/signup .
  2. Follow the online instructions.

As part of the sign-up process, you will receive a phone call and be prompted to enter a verification code using your phone's keypad.

Upon signing up for an AWS account, a root user is created with full access to all services and resources within the account. To enhance security, it is recommended that administrative privileges be granted to a designated user and that the root user’s usage be limited to tasks that specifically require access.

After completing the sign-up process, AWS will send a confirmation email. You can monitor your account activity and manage your account by visiting https://aws.amazon.com/ and selecting the My Account option.

Create an administrative user

Once you've signed up for an AWS account, create an administrative user to avoid using the root user for routine tasks.

Secure your AWS account root user

  1. Log in to the AWS Management Console as the account owner by selecting the Root user option and providing your AWS account email address. Then, enter your password on the following page.
  2. Enable multi-factor authentication (MFA) for your root user.

Create an administrative user

  • Assign administrative access to a user in the AWS IAM Identity Center for handling your routine administrative tasks.

Sign in as the administrative user

  • To log in with your IAM Identity Center user, use the sign-in URL provided in the email you received when the IAM Identity Center user was created.

Basic Tutorials for AWS Cloud9

Create an EC2 Environment with the console

1. Log in to the AWS Cloud9 console:

  • If you're the sole user of your AWS account or an IAM user within a single AWS account, visit https://console.aws.amazon.com/cloud9/ .
  • If your organization uses AWS IAM Identity Center, contact your AWS account administrator for sign-in details.
  • If you're a student in a class, request sign-in instructions from your instructor.

2. After logging in, choose an AWS Region to set up your environment from the top navigation bar of the AWS Cloud9 console. To view a list of available AWS Regions, refer to AWS Cloud9 in the AWS General Reference.

3. Click the Create Environment button in one of the displayed locations.

If you haven't set up any AWS Cloud9 environments yet, the button will appear on the welcome page.

If you already have AWS Cloud9 environments, the button will appear as shown below.

4. On the Create Environment page, input a name for your environment in the Name field.

5. In the Description field, provide details about your environment. For this tutorial, indicate that this environment is intended for the AWS Cloud9 tutorial.

6. Under Environment type, select New EC2 instance to create an Amazon EC2 environment.

  • New EC2 instance – Starts a fresh Amazon EC2 instance that AWS Cloud9 connects to directly via SSH. You can also use AWS Systems Manager to manage these new EC2 instances. For further details, refer to Accessing no-ingress EC2 instances with AWS Systems Manager .
  • Existing compute – Utilizes an existing Amazon EC2 instance that requires SSH credentials, with the condition that the instance must have an inbound security group rule configured.

? When you choose the Existing compute option, a service role is automatically generated. The name of this service role can be found in a note at the bottom of the setup screen.

7. In the New EC2 instance panel, under Instance type, retain the default selection. While this option may have lower RAM and fewer vCPUs, it is sufficient for this tutorial. Keep in mind that choosing an instance type with more RAM and vCPUs could incur additional costs to your AWS account for Amazon EC2.

8. Under Platform, select the Amazon EC2 instance type you prefer. For this tutorial, we will go with the recommended option, as it offers a secure, stable, and high-performance runtime environment. The Amazon Linux 2023 AMI includes long-term support through 2024. AWS Cloud9 will create the instance and connect the environment to it.

9. Select a Timeout period to determine how long AWS Cloud9 remains idle before automatically entering hibernation. AWS Cloud9 will wait for the specified time before shutting down the Amazon EC2 instance once all web browser sessions connected to the environment's IDE are closed. Be aware that selecting a longer timeout period could lead to increased charges on your AWS account.

10. In the Network settings panel, select how your environment will be accessed by choosing from the two available options:

  • AWS Systems Manager (SSM) – This approach allows access to the environment via SSM without the need to open inbound ports.
  • Secure Shell (SSH) – This method provides access to the environment via SSH and requires inbound ports to be open.

11. Select VPC Settings to view the Amazon Virtual Private Cloud (VPC) and Subnet assigned to your environment. AWS Cloud9 leverages Amazon VPC to interact with the newly created Amazon EC2 instance. For this tutorial, it is advised to use the default VPC. With the default configuration, AWS Cloud9 will try to automatically connect to the default VPC and its single subnet within the same AWS account and Region as the new environment.

12. You can add up to 50 tags by providing a Key and Value for each one. To do this, click on Add new tag. These tags will be applied to the AWS Cloud9 environment as resource tags and passed along to underlying resources such as the AWS CloudFormation stack, the Amazon EC2 instance, and Amazon EC2 security groups. Keep in mind that any changes made to these tags after creation will not be automatically updated across associated resources. For more details on tags, refer to Control Access Using AWS Resource Tags in the IAM User Guide and further advanced information in this guide.

13. Click on Create to set up your environment, after which you will be redirected to the homepage. Once the environment is created successfully, a green notification bar will appear at the top of the AWS Cloud9 console. You can then select the newly created environment and click Open in Cloud9 to launch the IDE.

If the account creation fails, a red notification bar will appear at the top of the AWS Cloud9 console. This issue could be due to problems with your web browser, AWS access permissions, the instance, or the associated network. For potential solutions, refer to the AWS Cloud9 Troubleshooting section .


How to migrate from AWS Cloud9 to AWS IDE ToolKits or CloudShell?

Take note that if you are an existing customer, you can still access AWS Cloud9 right now. Only new customer access has been closed last July 25, 2024. You can follow the steps here to migrate your development environment from AWS Cloud9 to AWS IDE ToolKits or AWS CloudShell.

If you are using the Microsoft Visual Studio Code IDE, you can install the AWS Toolkit for Visual Studio Code plugin. The AWS Toolkit for Visual Studio Code is basically an open-source plugin designed to simplify creating, debugging, and deploying applications on your AWS account. This plugin enhances productivity and accelerates software development when building applications on AWS using the Visual Studio Code IDE. This toolkit offers a seamless experience for developing serverless applications, with features like easy onboarding, machine learning-powered code suggestions, step-through debugging, and deployment directly from the IDE.

Another alternative to the Cloud9 service is AWS CloudShell. This is a browser-based shell integrated directly into the AWS Management Console that provides a pre-authenticated and pre-configured environment for interacting with your various AWS resources. Under the hood, it has AWS CLI pre-installed in its CloudShell environment which removes the need for local installation or configuration – simplifying interaction with AWS resources from any location.

AWS CloudShell can be used for various tasks such as checking or updating configuration files, making quick changes to production environments, or experimenting with new AWS services and features. Importantly, AWS CloudShell is free to use. Its accessibility from any location via the AWS Management Console makes it an excellent alternative for command-line interaction with AWS resources, especially when local desktop access is restricted. You can use this service as an alternative to your AWS Cloud9 environment.


Summary

In summary, this is the first step in setting up an environment. We covered how to create both an administrator and root user account for AWS Cloud9. Additionally, we explored using the console to create and configure an EC2 environment. It's important to remember that adjusting settings, like extending the timeout beyond 30 minutes for testing or personal projects, may lead to charges on your AWS account for Amazon EC2.

Moreover, starting with Amazon Cloud9 involves several tasks and features, including writing, running, debugging code, and deleting the environment (including its associated Cloud9 EC2 instances) to avoid incurring costs on your AWS account. These topics will be covered in the next tutorial. I hope this guide has been helpful as you begin your AWS Cloud9 journey.


* This newsletter was sourced from this Tutorials Dojo article .

Jon Bonso

Co-Founder @ TutorialsDojo.com | Linkedin Top Voice | AWS Community Builder | 10x AWS Certified

1 个月

?? New customer access to AWS Cloud9 has been closed, effective July 25, 2024, but existing users can still create new development environments. A better alternative would either be AWS IDE ToolKits or AWS CloudShell

要查看或添加评论,请登录

社区洞察

其他会员也浏览了