turbot/steampipe-mod-aws-compliance

Control: EC2 instances should have IAM profile attached

Description

Ensure that an AWS Elastic Compute Cloud (AWS EC2) instance has an Identity and Access Management (IAM) profile attached to it. This rule is non-compliant if no IAM profile is attached to the AWS EC2 instance.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.ec2_instance_iam_profile_attached

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.ec2_instance_iam_profile_attached --share

SQL

This control uses a named query:

select
arn as resource,
case
when iam_instance_profile_id is not null then 'ok'
else 'alarm'
end as status,
case
when iam_instance_profile_id is not null then title || ' IAM profile attached.'
else title || ' IAM profile not attached.'
end as reason
, region, account_id
from
aws_ec2_instance;

Tags