Control: EC2 instances should be managed by AWS Systems Manager
Description
An inventory of the software platforms and applications within the organization is possible by managing AWS Elastic Compute Cloud (AWS EC2) instances with AWS Systems Manager.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.ec2_instance_ssm_managed
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.ec2_instance_ssm_managed --share
SQL
This control uses a named query:
select i.arn as resource, case when i.instance_state = 'stopped' then 'info' when m.instance_id is null then 'alarm' else 'ok' end as status, case when i.instance_state = 'stopped' then i.title || ' is in stopped state.' when m.instance_id is null then i.title || ' not managed by AWS SSM.' else i.title || ' managed by AWS SSM.' end as reason , i.region, i.account_idfrom aws_ec2_instance i left join aws_ssm_managed_instance m on m.instance_id = i.instance_id;