Skip to content

AWS Connector

The AWS connector provides visibility into your Amazon Web Services infrastructure with 9 live tools and comprehensive ETL ingestion of cloud resources into the knowledge graph.

Authentication

The AWS connector uses standard IAM credentials. Provide an access key ID, secret access key, and target region.

json
{
  "name": "Production AWS",
  "source_type": "aws",
  "config": {
    "access_key_id": "AKIAIOSFODNN7EXAMPLE",
    "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    "region": "us-east-1"
  }
}
VariableRequiredDescription
access_key_id / AWS_ACCESS_KEY_IDYesIAM user access key ID
secret_access_key / AWS_SECRET_ACCESS_KEYYesIAM user secret access key
region / AWS_REGIONYesAWS region (e.g., us-east-1)
session_tokenNoTemporary session token for STS / SSO credentials

TIP

For production deployments, use an IAM user or role with the minimum permissions required. See the IAM Policy section below for a ready-to-use policy document.

Temporary Credentials (STS)

If you use AWS SSO, IAM Identity Center, or assume-role workflows, provide a session token:

json
{
  "config": {
    "access_key_id": "ASIA...",
    "secret_access_key": "...",
    "session_token": "FwoGZX...",
    "region": "us-east-1"
  }
}

WARNING

Session tokens expire. You will need to update the source configuration when credentials rotate. For long-lived access, use a dedicated IAM user.

Multi-Region

To ingest data from multiple AWS regions, create one source per region or specify a list:

json
{
  "config": {
    "access_key_id": "AKIA...",
    "secret_access_key": "...",
    "regions": ["us-east-1", "us-west-2", "eu-west-1"]
  }
}

Live Tools (9)

ToolDescriptionArguments
aws_list_ec2_instancesList EC2 instances with status, type, and tagsfilters?, instance_ids?
aws_describe_ec2_instanceGet detailed information about a specific EC2 instanceinstance_id
aws_list_s3_bucketsList all S3 buckets with creation dates and regionsprefix?
aws_list_s3_objectsList objects in an S3 bucketbucket, prefix?, max_keys?
aws_list_lambda_functionsList Lambda functions with runtime, memory, and timeoutregion?
aws_describe_lambdaGet detailed info about a specific Lambda functionfunction_name
aws_list_iam_usersList IAM users with creation dates and group membershipspath_prefix?
aws_list_iam_rolesList IAM roles with attached policiespath_prefix?
aws_cliExecute a generic AWS CLI commandcommand, args?

Example: Agent Using AWS Tools

User: "Are any EC2 instances in us-east-1 running without tags?"

Agent: Let me check your EC2 instances.
→ Calls aws_list_ec2_instances()
→ Filters results for instances with empty or missing tags
→ Reports: "Found 3 instances without tags: i-0abc123, i-0def456, i-0ghi789.
  All are t3.medium instances in the default VPC."
User: "Show me details on the i-0abc123 instance"

Agent: I'll pull the details for that instance.
→ Calls aws_describe_ec2_instance(instance_id: "i-0abc123")
→ Returns instance type, launch time, security groups, VPC, subnet, IAM role

ETL Ingestion

When you trigger a sync, the AWS connector ingests the following resources into the knowledge graph.

Nodes Created

Node LabelPropertiesAWS Service
EC2Instanceinstance_id, instance_type, state, launch_time, vpc_id, subnet_id, public_ip, tagsEC2
S3Bucketname, region, creation_date, versioning, encryptionS3
LambdaFunctionfunction_name, runtime, handler, memory_size, timeout, last_modifiedLambda
IAMUseruser_name, arn, create_date, last_login, mfa_enabledIAM
IAMRolerole_name, arn, path, create_date, descriptionIAM
IAMPolicypolicy_name, arn, attachment_count, is_aws_managedIAM
SecurityGroupgroup_id, group_name, description, vpc_idEC2/VPC
VPCvpc_id, cidr_block, state, is_default, tagsVPC
Subnetsubnet_id, cidr_block, availability_zone, vpc_id, publicVPC

Relationships Created

RelationshipFromTo
RUNS_INEC2InstanceSubnet
BELONGS_TOSubnetVPC
SECURED_BYEC2InstanceSecurityGroup
ASSUMESLambdaFunctionIAMRole
HAS_POLICYIAMRoleIAMPolicy
MEMBER_OFIAMUserIAMRole
CONNECTS_TOSecurityGroupSecurityGroup
STORES_INLambdaFunctionS3Bucket
TRIGGERED_BYLambdaFunctionS3Bucket

Graph Queries

cypher
-- Find all EC2 instances in a specific VPC with their security groups
MATCH (i:EC2Instance)-[:RUNS_IN]->(s:Subnet)-[:BELONGS_TO]->(v:VPC),
      (i)-[:SECURED_BY]->(sg:SecurityGroup)
WHERE v.vpc_id = "vpc-0abc123"
RETURN i.instance_id, i.instance_type, sg.group_name

-- Find Lambda functions with overly permissive IAM roles
MATCH (f:LambdaFunction)-[:ASSUMES]->(r:IAMRole)-[:HAS_POLICY]->(p:IAMPolicy)
WHERE p.policy_name CONTAINS "FullAccess"
RETURN f.function_name, r.role_name, p.policy_name

-- Map IAM users to the roles they can assume
MATCH (u:IAMUser)-[:MEMBER_OF]->(r:IAMRole)-[:HAS_POLICY]->(p:IAMPolicy)
RETURN u.user_name, r.role_name, collect(p.policy_name) AS policies

IAM Policy

Use this minimum-privilege IAM policy for the Agentcy AWS connector:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AgentcyReadOnly",
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets",
        "s3:ListBucket",
        "s3:GetBucketLocation",
        "s3:GetBucketVersioning",
        "s3:GetEncryptionConfiguration",
        "ec2:DescribeInstances",
        "ec2:DescribeSecurityGroups",
        "ec2:DescribeVpcs",
        "ec2:DescribeSubnets",
        "lambda:ListFunctions",
        "lambda:GetFunction",
        "iam:ListUsers",
        "iam:ListRoles",
        "iam:ListAttachedRolePolicies",
        "iam:ListPolicies",
        "iam:ListGroupsForUser"
      ],
      "Resource": "*"
    }
  ]
}

TIP

This policy is read-only. If you want the agent to perform write operations (e.g., tagging resources), add the corresponding write permissions.

Configuration Reference

json
{
  "name": "Production AWS",
  "source_type": "aws",
  "config": {
    "access_key_id": "AKIA...",
    "secret_access_key": "...",
    "region": "us-east-1",
    "regions": ["us-east-1", "us-west-2"],
    "session_token": null,
    "sync_s3": true,
    "sync_ec2": true,
    "sync_lambda": true,
    "sync_iam": true,
    "sync_vpc": true,
    "tag_filters": {
      "Environment": ["production", "staging"]
    }
  }
}
FieldTypeDefaultDescription
access_key_idstringrequiredAWS access key ID
secret_access_keystringrequiredAWS secret access key
regionstringus-east-1Primary AWS region
regionsstring[][region]List of regions to ingest from
session_tokenstring--Temporary session token (STS)
sync_s3booltrueInclude S3 buckets in ingestion
sync_ec2booltrueInclude EC2 instances in ingestion
sync_lambdabooltrueInclude Lambda functions in ingestion
sync_iambooltrueInclude IAM users, roles, and policies in ingestion
sync_vpcbooltrueInclude VPCs, subnets, and security groups
tag_filtersobject--Only ingest resources matching these tags

Troubleshooting

ErrorCauseFix
InvalidClientTokenIdAccess key ID is invalidVerify the access key in IAM console
SignatureDoesNotMatchSecret key is incorrectRegenerate the access key pair
AccessDeniedIAM policy lacks required permissionsAttach the policy above to the IAM user/role
ExpiredTokenSession token has expiredRefresh temporary credentials
RegionDisabledExceptionAWS region is not enabled for your accountEnable the region in account settings or remove it from the config

Verifying Access

Test your credentials from the command line:

bash
aws sts get-caller-identity \
  --region us-east-1

aws ec2 describe-instances \
  --region us-east-1 \
  --query 'Reservations[].Instances[].[InstanceId,State.Name]'

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.