aws_mq_broker resource
Use the aws_mq_broker InSpec audit resource to test the properties of a single specific AWS MQ Broker.
For additional information, including details on parameters and properties, see the AWS documentation on AWS MQ Broker.
Syntax
Ensure that AWS MQ Broker exists.
describe aws_mq_broker(broker_id: 'BROKER_ID') do
it { should exist }
end
Parameters
broker_id(required)broker_id: The ID of the AWS MQ broker.
Properties
authentication_strategy- The authentication strategy used to secure the broker. The default is
SIMPLE. Field:
authentication_strategyauto_minor_version_upgrade- Enables automatic upgrades to new minor versions for brokers, as new versions are released and supported by Amazon MQ.
Field:
auto_minor_version_upgradebroker_arn- The broker’s Amazon Resource Name (ARN).
Field:
broker_arnbroker_name- The name of the broker.
Field:
broker_namebroker_state- The broker’s status.
Field:
broker_statecreated- Creation time of the broker’s profile.
Field:
createddeployment_mode- The deployment mode of the broker.
Field:
deployment_modeengine_type- The type of broker engine. Currently, Amazon MQ supports
ACTIVEMQandRABBITMQ.. Field:
engine_typeengine_version- The version of the broker engine.
Field:
engine_versionhost_instance_type- The broker’s instance type.
Field:
host_instance_typepending_engine_version- The broker engine version for the upgrade.
Field:
pending_engine_versionpending_host_instance_type- The broker’s host instance type for the upgrade.
Field:
pending_host_instance_typepublicly_accessible- Enables connections from applications outside of the VPC that hosts the broker’s subnets.
Field:
publicly_accessiblestorage_type- The broker’s storage type.
Field:
storage_typesubnet_ids- The list of groups defines which subnets and IP range the broker can use from different availability zones. If you specify more than one subnet, the subnets must be in different availability zones. Amazon MQ cannot create VPC endpoints for the broker with multiple subnets in the same availability zone. A
SINGLE_INSTANCEdeployment requires one subnet (for example, the default subnet). AnACTIVE_STANDBY_MULTI_AZ deployment (ACTIVEMQ)requires two subnets. ACLUSTER_MULTI_AZ deployment (RABBITMQ)has no subnet requirements when deployed with public accessibility, deployment without public accessibility requires at least one subnet. Field:
subnet_ids- The list of all tags associated with this broker.
Field:
tags
Examples
Ensure a broker ID is available:
describe aws_mq_broker(broker_id: 'BROKER_ID') do
its('broker_id') { should eq 'BROKER_ID }
end
Ensure a broker name is available:
describe aws_mq_broker(broker_id: 'BROKER_ID') do
its('broker_name') { should eq 'BROKER_NAME' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The control pass if the describe method returns at least one result.
exist
Use should to test that the entity exists.
describe aws_mq_broker(broker_id: 'BROKER_ID') do
it { should exist }
end
Use should_not to test the entity does not exist.
describe aws_mq_broker(broker_id: 'DUMMY') do
it { should_not exist }
end
be_available
Use should to check if the mq broker is available.
describe aws_mq_broker(broker_id: 'BROKER_ID') do
it { should be_available }
end
AWS Permissions
Your AWS principal will need the MQ:Client:DescribeBrokerResponse action with Effect set to Allow.