Skip to content

Migrating a Cloud9 Environment to an EC2 Instance via Cloned AMI

0

Hello everyone,

I hope you are well.

I use Cloud 9 for Code editing (Python + AWS CDK) and running cdk deploy for infrastructure changes but the Security Department of the company I work for has requested that we discontinue the use of AWS Cloud9. Therefore, I would like to migrate my current Cloud9 environment to an EC2 instance.

For that reason I consider to migrate via Cloned AMI.

Proposed Migration Approach:

  1. Create an AMI from the EC2 instance backing the Cloud9 environment (including its root EBS volume).
  2. Launch a new EC2 instance from that AMI in the same VPC/Subnet, with a similar IAM instance profile, and connect through AWS Systems Manager Session Manager.
  3. Post-launch adjustments:
  • Disable the Cloud9 agent to avoid unnecessary processes.
  • Switch from Cloud9’s managed temporary credentials to the instance-profile role or credentials.
  • Confirm whether rerunning cdk bootstrap is required (it is already in place for this account/region).

My questions are:

  1. Are there any technical or support limitations to cloning the AMI of a Cloud9 instance for development and deployment purposes?
  2. Will the AMI retain all configurations (e.g., IAM policies attached to the Cloud9 instance profile), or do any settings need to be recreated manually?
  3. Does AWS recommend removing or disabling the Cloud9 agent in the new EC2 instance to prevent unnecessary overhead or costs?
  4. From a billing perspective, will there be additional charges beyond the EBS snapshot and standard EC2/EBS usage?
  5. Are there official guidelines or best-practice documents for migrating from Cloud9 to EC2 while preserving CDK deployment workflows?

Your confirmation of the feasibility of this plan, along with any additional recommendations, would be greatly appreciated.

Thank you very much for your assistance.

Kind regards,

1 Answer
0

While your proposed approach for migrating from AWS Cloud9 to an EC2 instance is creative, there are some important considerations and limitations to be aware of:

  1. AWS does not support cloning Cloud9 instances directly. The "Launch more like this" feature in EC2 does not actually clone instances, but rather replicates some configuration details. Creating an AMI from a Cloud9 instance is not a recommended or supported method.

  2. Instead of cloning, AWS recommends migrating your development environment to either AWS IDE Toolkits or AWS CloudShell. These solutions offer similar capabilities for interacting with AWS resources without the need for Cloud9.

  3. If you choose to proceed with creating an EC2 instance, you'll need to manually configure it to work similarly to your Cloud9 environment. This includes installing necessary software packages, setting up your development environment, and configuring AWS CLI and other tools.

  4. Regarding your specific questions:

    • IAM policies and instance profiles are not retained in AMIs. You'll need to manually attach the appropriate IAM role to your new EC2 instance.
    • There's no need to disable the Cloud9 agent as it won't be present in a standard EC2 instance.
    • Billing will be based on standard EC2 and EBS usage. There are no additional charges specific to this migration process.
    • AWS doesn't provide official guidelines for migrating from Cloud9 to EC2 while preserving CDK deployment workflows. You'll need to ensure your new environment has the necessary tools and configurations for CDK deployments.
  5. To maintain your CDK deployment workflows, ensure that you have the AWS CLI, Node.js, and the CDK toolkit installed on your new EC2 instance. You may need to reconfigure your AWS credentials and region settings.

  6. Consider using AWS Systems Manager Session Manager for secure access to your EC2 instance without the need for opening inbound ports.

  7. Remember to delete your Cloud9 EC2 instances once you've successfully migrated to avoid unnecessary costs.

While your proposed approach isn't directly supported, you can achieve a similar result by setting up a new EC2 instance with the necessary development tools and configurations. This will require more manual setup but will give you full control over your development environment.
Sources
Launch an EC2 instance using details from an existing instance - Amazon Elastic Compute Cloud
How to migrate from AWS Cloud9 to AWS IDE Toolkits or AWS CloudShell | AWS DevOps & Developer Productivity Blog
Working with environments in AWS Cloud9 - AWS Cloud9

answered 6 months ago
AWS
SUPPORT ENGINEER
reviewed 6 months ago
EXPERT
reviewed 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.