Connect an AWS account

Connecting an AWS account lets Alpacon discover your EC2 instances and (optionally) install the agent for you. Setup is guided by a wizard that provisions an IAM role in your account through AWS CloudFormation.

Before you start

  • You need permission to create a CloudFormation stack that provisions IAM roles and a Lambda function (for example, an administrator). On the Quick Create page, select the acknowledgment that CloudFormation may create named IAM resources before you create the stack.
  • Have a server registration token ready (or create one during the wizard). The token determines which groups onboarded servers are assigned to and is required for agent installation.

Connection steps

On the Cloud accounts page, click Connect AWS and follow the wizard.

  1. Name the account—Enter a display name for the account. Choose whether to allow agent installation via AWS SSM, and select the server registration token to use.
  2. Generate the Quick Create URL—Click Open AWS Console to open AWS CloudFormation with the stack pre-filled. Each account gets its own stack name: AlpaconConnect- followed by the first 8 characters of the account’s ID in Alpacon, the ID at the end of the account page’s address. Connecting a second account from the same AWS account and region therefore does not collide with the first. The control-plane region is us-east-1. Create the stack in AWS.
  3. Verify the connection—Keep the Alpacon tab open. Alpacon waits for the CloudFormation stack to finish and confirms it can assume the IAM role. The steps shown are: submit stack → create stack → assume IAM role → connection verified. If verification fails, you can Retry verification or delete and start over.
  4. Discover instances—Alpacon starts syncing your EC2 inventory and shows the instances found per region in real time. A scan can also finish without every region, stop on an error, or never report back; the panel says which happened and offers Scan again.

Permissions Alpacon receives

The CloudFormation stack grants Alpacon a role named AlpaconCrossAccountRole- followed by the stack’s ID—the UUID at the end of the stack ID shown in CloudFormation—so each connection gets its own role. An account connected with an earlier template version has a role named AlpaconCrossAccountRole, with no suffix. The role grants:

  • Read EC2 inventory (required)—list instances, regions, and tags across all regions.
  • Install agent via AWS SSM (optional)—send install commands so you can onboard instances with one click. This permission is controlled by the stack’s EnableRemoteCommand parameter, which is fixed when the stack is created. Allowing agent installation in the wizard sets that parameter in the Quick Create link, but turning Remote agent installation on in Alpacon later does not add the permission to an existing stack.

To change the choice after connecting, update the account’s CloudFormation stack in AWS with EnableRemoteCommand set to the value you want, then recheck the permission in Alpacon. See Remote command permission.

You can revoke access at any time by deleting the CloudFormation stack in your AWS account.

Troubleshooting

Verification failed—Confirm the CloudFormation stack finished creating and that the IAM role trust policy is intact. Use Retry verification, or delete the stack and run the wizard again. Check AWS CloudTrail for permission errors.

Agent installation is blocked—an install refused with the API error code cloud_remote_command_permission_missing has one of two causes, and the account’s AWS stack permission state tells them apart. When it reads Denied, the IAM role lacks the SSM permission, typically because the stack was created with EnableRemoteCommand off: update the stack with EnableRemoteCommand set to true, then use Recheck on the account page if you are allowed to recheck. Otherwise a policy outside the role refused it: check the service control policies, permission boundaries, and explicit denies that apply to the instance and its region. See Remote command permission.

Discovery failed—The scan stopped before it could finish, so anything it had not reached yet is missing. The panel shows the reason AWS returned; a permission missing from the IAM role is the usual cause. Fix the role and use Scan again. If discovery cannot be made to work at all, you can still register a server by hand with a server registration token.

Some regions were skipped—The scan finished, but could not read every region, so instances in the skipped ones are missing from the list. The panel names each region it skipped and why; a region marked Access denied in this region was denied outright—commonly a region the account has not enabled, an organization policy (such as an SCP) that denies the role in that region, or a permission missing from the IAM role for that region specifically. A region skipped for another reason is usually temporary and clears on its own. Skipping regions does not fail the account by itself; see The account is marked failed below for what does. Enable or grant the region, then use Scan again.

Access denied in every region—The scan reached every region, but each one denied the role. The panel shows Access denied in every region: Nothing could be scanned this time. If this keeps happening, the account will be marked failed. One denied scan does not fail the account by itself—that takes three in a row (see The account is marked failed below). Fix the role or the region’s organization policy, then use Scan again.

No response from the scan—The account is connected, but the scan never reported back, so nothing is known about its instances yet. This is not the same as an account that holds none. Use Scan again.

The account is marked failed—AWS denied the role outright: at verification (the first check after connecting, or a later use of Retry verification), or across three discovery scans in a row where AssumeRole was refused, every region was denied, or listing regions was refused. A scan that still finds instances resets the refusal count. Scan again is refused in this state; open the account and use Retry verification in its failure banner to bring it back, which also clears the failure count and starts a new scan on its own. Fix what the panel reported first, or the scan that follows fails the same way. A temporary problem—AWS throttling, an AWS outage, a timeout, or an expired credential on Alpacon’s side—does not fail the account on its own: Alpacon records the error and keeps scanning. The one exception is the first verification after connecting, which retries automatically a few times before marking the account failed if the problem does not clear up.

Last updated: