Skip to content

Using AWS CloudShell Over Bastion Hosts for Seamless Access to Private Resources

4 minute read
Content level: Intermediate
1

This article explains how AWS CloudShell enables secure access to private VPC resources, offering a simpler, more secure alternative to bastion hosts with zero infrastructure management.

When accessing private resources in AWS, organizations traditionally rely on bastion hosts to establish secure connections. While effective, bastion hosts introduce operational overhead, require ongoing maintenance, and pose potential security risks if not managed correctly. AWS CloudShell VPC offers a modern alternative, providing seamless access to private resources without the need to manage infrastructure.

AWS CloudShell allows users to run a browser-based shell to interact with AWS resources. By default, CloudShell runs in a managed environment, but with CloudShell VPC, you can launch CloudShell instances inside your Virtual Private Cloud (VPC), enabling secure access to private resources.

Each CloudShell VPC environment allows you to:

  • Assign a VPC – Run CloudShell inside a selected VPC.
  • Define Subnets – Choose a subnet where CloudShell will operate.
  • Associate Security Groups – Up to five security groups can be attached.

Because CloudShell VPC inherits the network configuration of your VPC, it can seamlessly connect to other private resources within the same subnet—just like a bastion host, but without the management burden.

To create a CloudShell VPC environment [1]

  1. On the CloudShell console page, choose the + icon and then choose Create VPC environment from the dropdown menu.
  2. On the Create a VPC environment page, enter a name for your VPC environment in the Name box.
  3. From the Virtual private cloud (VPC) dropdown list, choose a VPC.
  4. From the Subnet dropdown list, choose a subnet.
  5. From the Security group dropdown list, choose one or more security groups that you want to assign to your VPC environment. You can choose a maximum of five security groups.
  6. Choose Create to create your VPC environment.

Key Benefits of Using AWS CloudShell Over Bastion Hosts

  1. Zero Infrastructure Maintenance

One of the biggest advantages of CloudShell VPC is that AWS fully manages the underlying infrastructure. You no longer have to worry about:

  • OS patching and updates
  • AMI lifecycle management
  • Security group configurations
  • Costs associated with running dedicated EC2 instances

With CloudShell, AWS takes care of everything, ensuring your shell environment is always up to date and secure.

  1. Enhanced Security

CloudShell VPC eliminates several security risks associated with bastion hosts:

  • IAM-controlled access – No need to manage SSH keys or passwords.
  • Built-in security controls – CloudShell adheres to AWS security best practices.
  • Zero Trust Compatible – Fine-grained IAM policies control access.
  • No public access exposure – Unlike bastion hosts, which often require a public IP, CloudShell remains fully private within your VPC.

Since CloudShell sessions expire after inactivity, there’s also no risk of persistent access that could be exploited.

  1. Seamless Access to Private Resources

With CloudShell VPC, you can directly connect to private AWS resources without additional networking setup:

  • Access RDS databases in private subnets for debugging.
  • Run CLI commands on EC2 instances inside your VPC.
  • No need for a public subnet, reducing attack surfaces.

Unlike bastion hosts, which require opening inbound security group rules and managing SSH access, CloudShell VPC provides a secure, direct connection to your private resources.

Key Requirements for Using CloudShell VPC

Before using CloudShell VPC, ensure you meet the following requirements:

  • IAM Permissions: Attach the AWSCloudShellFullAccess policy to your IAM user or role. [2]
  • VPC and Subnet Configuration: The VPC must have private subnets with necessary route table entries.
  • CloudShell Region Support: CloudShell VPC is available in specific AWS regions—confirm that your desired region [3]

References:

[1] https://docs.aws.amazon.com/cloudshell/latest/userguide/creating-vpc-environment.html

[2] https://docs.aws.amazon.com/cloudshell/latest/userguide/sec-auth-with-identities.html

[3] https://docs.aws.amazon.com/cloudshell/latest/userguide/supported-aws-regions.html

AWS
EXPERT
published a year ago774 views