title | platform |
---|---|
About the aws_application_autoscaling_scaling_policies Resource |
aws |
Use the aws_application_autoscaling_scaling_policies
InSpec audit resource to test properties of multiple AWS Application Auto Scaling scaling policies.
Ensure a scaling policy exists.
describe aws_application_autoscaling_scaling_policies( service_namespace: 'SERVICE_NAMESPACE' ) do
it { should exist }
end
service_namespace
(required)
The namespace of the AWS service that provides the resource, or a custom-resource.
For additional information, see the AWS ApplicationAutoScaling ScalingPolicy documentation.
Property | Description |
---|---|
policy_arns | The Amazon Resource Name (ARN) of the scaling policy. |
policy_names | The name of the scaling policy. |
service_namespaces | The namespace of the AWS service that provides the resource, or a custom-resource. |
resource_ids | The identifier of the resource associated with the scaling policy. This string consists of the resource type and unique identifier. |
scalable_dimensions | The scalable dimension. This string consists of the service namespace, resource type, and scaling property. |
policy_types | The scaling policy type. |
step_scaling_policy_configurations | A step scaling policy. |
target_tracking_scaling_policy_configurations | A target tracking scaling policy. |
alarms | The CloudWatch alarms associated with the scaling policy. |
creation_times | The Unix timestamp for when the scaling policy was created. |
describe aws_application_autoscaling_scaling_policies( service_namespace: 'SERVICE_NAMESPACE' ) do
its('policy_names') { should include 'POLICY_NAME' }
end
describe aws_application_autoscaling_scaling_policies( service_namespace: 'SERVICE_NAMESPACE' ) do
its('policy_types') { should include "POLICY_TYPE" }
end
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
The controls will pass if the describe
method returns at least one result.
Use should
to test that the entity exists.
describe aws_application_autoscaling_scaling_policies( service_namespace: 'SERVICE_NAMESPACE' ) do
it { should exist }
end
Use should
to check if the scalable policy is available.
describe aws_application_autoscaling_scaling_policies( service_namespace: 'SERVICE_NAMESPACE' ) do
it { should be_available }
end
Your Principal will need the ApplicationAutoScaling:Client:DescribeScalingPoliciesResponse
action with Effect
set to Allow
.