AWS Setup
The AWS integration lets you manage EC2 instances directly from Reoclo. Once connected, you can reboot, shut down, and power on instances, view CloudWatch metrics, inspect security groups and volumes, and execute commands remotely via SSM Run Command.
The same credential can also run build servers, EC2 builders that Reoclo creates for your builds and deletes or stops when they are idle, and test servers, machines Reoclo creates for each test job and deletes when the job ends. Tick Build servers or Test servers in the policy builder below to set them up with the same key.
Prerequisites
Section titled “Prerequisites”- An AWS account
- Permission to create IAM users and policies in that account
- A Reoclo account with server management access
Step 1: Build the Policy
Section titled “Step 1: Build the Policy”Pick what Reoclo may do and in which regions, then copy the result. The policy grants only the calls Reoclo makes, and you can narrow it further:
- Regions limit every write action (start, stop, reboot, Run Command, builder and test machine launches) to the regions you add. Leave the list empty to cover every region.
- Only instances tagged
reoclo-managed=truelimits power operations and Run Command to instances you have tagged. - AWS account ID replaces the wildcard account in each ARN.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReocloEC2Read",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeInstanceStatus",
"ec2:DescribeInstanceTypes",
"ec2:DescribeRegions",
"ec2:DescribeVolumes"
],
"Resource": "*"
},
{
"Sid": "ReocloEC2Control",
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:RebootInstances"
],
"Resource": "arn:aws:ec2:*:*:instance/*"
},
{
"Sid": "ReocloCloudWatch",
"Effect": "Allow",
"Action": "cloudwatch:GetMetricStatistics",
"Resource": "*"
},
{
"Sid": "ReocloCostExplorer",
"Effect": "Allow",
"Action": "ce:GetCostAndUsage",
"Resource": "*"
},
{
"Sid": "ReocloSSMRead",
"Effect": "Allow",
"Action": [
"ssm:DescribeInstanceInformation",
"ssm:GetCommandInvocation",
"ssm:ListCommandInvocations"
],
"Resource": "*"
},
{
"Sid": "ReocloSSMDocument",
"Effect": "Allow",
"Action": "ssm:SendCommand",
"Resource": "arn:aws:ssm:*::document/AWS-RunShellScript"
},
{
"Sid": "ReocloSSMInstances",
"Effect": "Allow",
"Action": "ssm:SendCommand",
"Resource": "arn:aws:ec2:*:*:instance/*"
},
{
"Sid": "ReocloVerify",
"Effect": "Allow",
"Action": "sts:GetCallerIdentity",
"Resource": "*"
}
]
} Policy size: 1,066 of 6,144 characters.
Step 2: Create an IAM User with the Policy
Section titled “Step 2: Create an IAM User with the Policy”The AWS CLI and Terraform tabs above create the user, the policy and an access key in one go. If you used them, skip to Step 4. In the AWS console:
- Log into the AWS Console and open IAM > Users > Create user
- Enter a username (for example,
reoclo-service) - Leave Provide user access to the AWS Management Console unchecked, and click Next
- Choose Attach policies directly, then click Create policy
- Open the JSON tab and paste the policy from Step 1
- Name the policy (for example,
ReocloAccess) and create it - Back on the user, refresh the list, select the new policy, and finish creating the user
Step 3: Create Access Keys
Section titled “Step 3: Create Access Keys”- Open the new IAM user
- Navigate to Security credentials > Access keys
- Click Create access key
- Select Third-party service as the use case
- Copy both the Access Key ID (starts with
AKIA) and the Secret Access Key
Step 4: Add the Credential in Reoclo
Section titled “Step 4: Add the Credential in Reoclo”- In Reoclo, navigate to Cloud Providers in the sidebar
- Click Add Provider
- Select Amazon Web Services from the dropdown
- Enter a label (for example,
my-aws-prod) - Paste your Access Key ID and Secret Access Key
- Choose its Regions: the regions build and test pools on this credential may use. The first is the default for new pools. Server management works in every region the policy allows, whatever you pick.
- Click Test & Save to verify the credential
Reoclo will call sts:GetCallerIdentity to confirm the keys are valid. If successful, you will see your AWS account ID and IAM user displayed.
You can add or remove regions later with Edit next to Regions on the credential’s page. A region a pool still uses cannot be removed.
Step 5: Add a Server
Section titled “Step 5: Add a Server”- Navigate to Servers and click Add Server
- Select your AWS credential as the cloud provider
- Enter the EC2 Instance ID (for example,
i-0123456789abcdef0) - Select the Region where the instance runs (for example,
us-east-1) - Save
Reoclo will begin syncing instance metadata, including status, IP addresses, specs, security groups, tags, and attached volumes.
Servers you added another way, for example by installing the runner, link to their EC2 instance automatically when the instance’s IP address matches. Reoclo searches the regions listed on the credential, so list every region your instances run in. The server’s region fills in from the instance. See Automatic linking.
Features
Section titled “Features”Power Operations
Section titled “Power Operations”From the server detail page, you can:
- Power On a stopped instance
- Shutdown (graceful stop)
- Reboot the instance
- Hard Reset (force stop, then start)
Operations are tracked in real time with progress indicators.
Metrics
Section titled “Metrics”Reoclo pulls CPU, network, and disk I/O metrics from CloudWatch automatically and shows them on the server detail page.
Cost per Instance
Section titled “Cost per Instance”With the Cost Explorer permission, each sync shows the instance’s month-to-date cost. Cost Explorer must be enabled in your account’s billing console, and AWS charges $0.01 per Cost Explorer API request.
SSM Run Command
Section titled “SSM Run Command”If your EC2 instances have the SSM Agent installed, you can execute commands directly from Reoclo without SSH access.
Requirements for SSM:
- The instance must have an IAM instance profile with the
AmazonSSMManagedInstanceCoremanaged policy attached - The SSM Agent must be installed and running (pre-installed on Amazon Linux 2, Amazon Linux 2023, Ubuntu 16.04+, and Windows Server 2016+)
- The instance must have a network path to SSM endpoints (direct internet access, or VPC endpoints for
ssm,ssmmessages, andec2messages)
When SSM is available, the server detail page shows a green SSM ready badge and a Run Command panel where you can execute shell commands and view output.
If SSM is not available, a gray SSM unavailable badge appears with troubleshooting guidance.
Build Servers
Section titled “Build Servers”Ephemeral and sleep build pools create EC2 builders with this credential, in the pool’s region and that region’s default VPC. Builders carry the reoclo-managed=true tag, and the policy only lets the key start, stop and terminate tagged instances. See Build servers to create a pool.
Test Servers
Section titled “Test Servers”Test pools create their machines with this credential too, in the pool’s region. Test machines carry the same reoclo-managed=true tag as builders. The policy from Step 1 covers them when Test servers or Build servers was ticked. A policy built for server management alone cannot launch them: build it again with Test servers ticked and replace the policy in IAM.
A test pool can use spot instances. The first spot request in an AWS account needs the EC2 Spot service-linked role, and the policy builder adds permission to create just that role (iam:CreateServiceLinkedRole, limited to spot.amazonaws.com) when Test servers is ticked. A key built before spot pools existed needs the policy built again, or run aws iam create-service-linked-role --aws-service-name spot.amazonaws.com once. See Spot instances and Run tests on test servers.
Troubleshooting
Section titled “Troubleshooting”Credential verification fails
Section titled “Credential verification fails”- Confirm the Access Key ID starts with
AKIA - Confirm the Secret Access Key was copied completely (no trailing spaces)
- Check that the IAM user has not been deactivated or deleted
An operation fails with “UnauthorizedOperation”
Section titled “An operation fails with “UnauthorizedOperation””The policy does not allow the call. The usual causes are an instance in a region the policy does not list, or an untagged instance when the policy is limited to tagged ones. Rebuild the policy in Step 1 with the region or option you need, and replace the policy on the IAM user.
Power operations fail with “IncorrectInstanceState”
Section titled “Power operations fail with “IncorrectInstanceState””This means the instance is in a state that does not allow the requested operation. For example, you cannot start an instance that is already running. Wait for the current transition to complete and try again.
SSM badge shows “unavailable”
Section titled “SSM badge shows “unavailable””Check the three requirements listed above:
- Instance profile with
AmazonSSMManagedInstanceCore - SSM Agent installed and running
- Network path to SSM endpoints
You can verify SSM Agent status in the AWS Console under Systems Manager > Fleet Manager.
Metrics show “Requires CloudWatch Agent”
Section titled “Metrics show “Requires CloudWatch Agent””Basic EC2 monitoring includes CPU and network metrics. Disk usage requires the CloudWatch Agent to be installed on the instance.
Next Steps
Section titled “Next Steps”- Build servers to build images on EC2 builders instead of your application servers
- Cloud Credentials for managing credentials across all providers
- Servers Overview to understand server management
- Scheduled Operations to automate power operations on a schedule
- API Overview for programmatic access to cloud operations