Control: Elastic Beanstalk managed platform updates should be enabled
Description
This control checks whether Elastic Beanstalk environments have managed platform updates enabled.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.elasticbeanstalk_environment_use_managed_updates
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.elasticbeanstalk_environment_use_managed_updates --share
SQL
This control uses a named query:
select address as resource, case when jsonb_typeof(attributes_std -> 'setting') = 'array' and exists(select 1 from jsonb_array_elements(attributes_std -> 'setting') as setting where (setting ->> 'namespace') = 'aws:elasticbeanstalk:managedactions' and (setting ->> 'name') = 'ManagedActionsEnabled' and (setting ->> 'value')::boolean) then 'ok' when jsonb_typeof(attributes_std -> 'setting') = 'object' and (attributes_std -> 'setting' ->> 'namespace') = 'aws:elasticbeanstalk:managedactions' and (attributes_std -> 'setting' ->> 'name') = 'ManagedActionsEnabled' and (attributes_std -> 'setting' ->> 'value')::boolean then 'ok' else 'alarm' end status, split_part(address, '.', 2) || case when jsonb_typeof(attributes_std -> 'setting') = 'array' and exists(select 1 from jsonb_array_elements(attributes_std -> 'setting') as setting where (setting ->> 'namespace') = 'aws:elasticbeanstalk:managedactions' and (setting ->> 'name') = 'ManagedActionsEnabled' and (setting ->> 'value')::boolean) then ' managed updates enabled' when jsonb_typeof(attributes_std -> 'setting') = 'object' and (attributes_std -> 'setting' ->> 'namespace') = 'aws:elasticbeanstalk:managedactions' and (attributes_std -> 'setting' ->> 'name') = 'ManagedActionsEnabled' and (attributes_std -> 'setting' ->> 'value')::boolean then ' managed updates enabled' else ' managed updates disabled' end || '.' as reason , path || ':' || start_linefrom terraform_resourcewhere type = 'aws_elastic_beanstalk_environment';