EC2 — Launch & Install
Progress checklist
Overview
Section titled “Overview”This page launches a t3.micro Amazon Linux 2023 instance into the same VPC as the S3 Files mount targets, attaches the compute instance profile created in IAM, and connects using SSM Session Manager — no key pair or public IP required.
-
Confirm base exports. Required
Re-run these in your current shell. Resolve
COMPUTE_SG_IDby name if the variable is not still set.Terminal window export AWS_REGION=ap-southeast-6export VPC_ID=vpc-0123456789abcdef0 # ← replace with your VPC IDexport BUCKET=my-s3-files-bucket # ← replace with your real bucket nameexport BUCKET_ARN=arn:aws:s3:::${BUCKET}export FS_ID=$(aws s3files list-file-systems \--region "$AWS_REGION" \--bucket "$BUCKET_ARN" \--query 'fileSystems[0].fileSystemId' \--output text)echo "FS_ID=$FS_ID"export COMPUTE_SG_ID=$(aws ec2 describe-security-groups \--filters \"Name=group-name,Values=s3files-ec2-compute-sg" \"Name=vpc-id,Values=$VPC_ID" \--region "$AWS_REGION" \--query 'SecurityGroups[0].GroupId' \--output text)echo "COMPUTE_SG_ID=$COMPUTE_SG_ID"FS_IDmust befs-…andCOMPUTE_SG_IDmust besg-…. If either isNone, complete the Setup pages first. -
Add HTTPS egress to the compute security group. Required
SSM Session Manager requires outbound HTTPS (port 443) so the agent can reach AWS API endpoints.
Terminal window aws ec2 authorize-security-group-egress \--group-id "$COMPUTE_SG_ID" \--protocol tcp \--port 443 \--cidr 0.0.0.0/0 \--region "$AWS_REGION" -
Resolve the latest Amazon Linux 2023 AMI. Required
Terminal window export AMI_ID=$(aws ec2 describe-images \--owners amazon \--filters \"Name=name,Values=al2023-ami-*-kernel-*-x86_64" \"Name=virtualization-type,Values=hvm" \"Name=architecture,Values=x86_64" \--query 'sort_by(Images, &CreationDate)[-1].ImageId' \--output text \--region "$AWS_REGION")echo "AMI_ID=$AMI_ID" -
Choose a subnet for the instance. Required
The subnet must be in the same AZ as one of your mount targets and have outbound internet access (via IGW or NAT) for SSM.
Terminal window export INSTANCE_SUBNET_ID=subnet-0123456789abcdef0 # ← replace with your subnet IDecho "INSTANCE_SUBNET_ID=$INSTANCE_SUBNET_ID" -
Launch the EC2 instance. Required
Terminal window export INSTANCE_ID=$(aws ec2 run-instances \--image-id "$AMI_ID" \--instance-type t3.micro \--subnet-id "$INSTANCE_SUBNET_ID" \--iam-instance-profile Name=s3files-ec2-instance-profile \--security-group-ids "$COMPUTE_SG_ID" \--metadata-options "HttpTokens=required,HttpEndpoint=enabled,HttpPutResponseHopLimit=2" \--tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=s3files-demo-ec2}]" \--region "$AWS_REGION" \--query 'Instances[0].InstanceId' \--output text)echo "INSTANCE_ID=$INSTANCE_ID" -
Wait for the instance to reach running state. Required
Terminal window aws ec2 wait instance-running \--instance-ids "$INSTANCE_ID" \--region "$AWS_REGION"echo "Instance running" -
Wait for SSM registration. Required
The SSM agent installed on Amazon Linux 2023 registers automatically within about 60 seconds. Poll until the instance appears:
Terminal window until aws ssm describe-instance-information \--filters "Key=InstanceIds,Values=$INSTANCE_ID" \--region "$AWS_REGION" \--query 'InstanceInformationList[0].InstanceId' \--output text 2>/dev/null | grep -q "^i-"; doecho "Waiting for SSM registration…"sleep 15doneecho "SSM registered" -
Open an SSM session. Required
Terminal window aws ssm start-session \--target "$INSTANCE_ID" \--region "$AWS_REGION"You are now in a shell on the instance as
ssm-user. Continue to Mount.