boto3_iot¶
Connection module for Amazon IoT using boto3.¶
Renamed from
boto_iottoboto3_iotand rewritten to use the boto3iotclient APIs directly viasaltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.
- depends:
boto3 >= 1.28.0
botocore >= 1.31.0
- configuration:
This module accepts explicit IoT credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:
iot.keyid: GKTADJGHEIQSXMKKRBJ08H
iot.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
A region may also be specified in the configuration:
iot.region: us-east-1
It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
Added in version 1.0.0.
- saltext.boto3.modules.boto3_iot.thing_type_exists(thingTypeName, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if the given thing type exists.
- thingTypeName (str):
The name of the thing type to check for existence.
- region (str, optional):
The AWS region where the thing type is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.thing_type_exists thingTypeName
- saltext.boto3.modules.boto3_iot.describe_thing_type(thingTypeName, region=None, key=None, keyid=None, profile=None)[source]¶
Describe the given thing type.
- thingTypeName (str):
The name of the thing type to describe.
- region (str, optional):
The AWS region where the thing type is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.describe_thing_type
- saltext.boto3.modules.boto3_iot.create_thing_type(thingTypeName, thingTypeDescription, searchableAttributesList, region=None, key=None, keyid=None, profile=None)[source]¶
Create a thing type.
- thingTypeName (str):
The name of the thing type to create.
- thingTypeDescription (str):
A description of the thing type.
- searchableAttributesList (list):
A list of attributes that are searchable for the thing type.
- region (str, optional):
The AWS region where the thing type is to be created.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.create_thing_type thingTypeName="MyThingType" thingTypeDescription="MyThingTypeDescription" searchableAttributesList='["attribute1","attribute2"]'
- saltext.boto3.modules.boto3_iot.deprecate_thing_type(thingTypeName, undoDeprecate=False, region=None, key=None, keyid=None, profile=None)[source]¶
Deprecate or undeprecate the given thing type.
- thingTypeName (str):
The name of the thing type to deprecate or undeprecate.
- undoDeprecate (bool, optional):
Set to True to undeprecate the thing type, False to deprecate it.
- region (str, optional):
The AWS region where the thing type is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.deprecate_thing_type
- saltext.boto3.modules.boto3_iot.delete_thing_type(thingTypeName, region=None, key=None, keyid=None, profile=None)[source]¶
Delete the given thing type.
- thingTypeName (str):
The name of the thing type to delete.
- region (str, optional):
The AWS region where the thing type is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.delete_thing_type
- saltext.boto3.modules.boto3_iot.policy_exists(policyName, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if the given policy exists.
- policyName (str):
The name of the policy to check for existence.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.policy_exists
- saltext.boto3.modules.boto3_iot.create_policy(policyName, policyDocument, region=None, key=None, keyid=None, profile=None)[source]¶
Create a policy.
- policyName (str):
The name of the policy to create.
- policyDocument (str):
The JSON document that describes the policy.
- region (str, optional):
The AWS region where the policy is to be created.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.create_policy
- saltext.boto3.modules.boto3_iot.delete_policy(policyName, region=None, key=None, keyid=None, profile=None)[source]¶
Delete the given policy.
- policyName (str):
The name of the policy to delete.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.delete_policy
- saltext.boto3.modules.boto3_iot.describe_policy(policyName, region=None, key=None, keyid=None, profile=None)[source]¶
Describe the given policy.
- policyName (str):
The name of the policy to describe.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.describe_policy
- saltext.boto3.modules.boto3_iot.policy_version_exists(policyName, policyVersionId, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if the given policy version exists.
- policyName (str):
The name of the policy to check.
- policyVersionId (str):
The ID of the policy version to check.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.policy_version_exists
- saltext.boto3.modules.boto3_iot.create_policy_version(policyName, policyDocument, setAsDefault=False, region=None, key=None, keyid=None, profile=None)[source]¶
Create a new version of a policy.
- policyName (str):
The name of the policy to create a new version for.
- policyDocument (str):
The JSON document that describes the policy.
- setAsDefault (bool, optional):
Whether to set the new policy version as the default version. Defaults to False.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.create_policy_version
- saltext.boto3.modules.boto3_iot.delete_policy_version(policyName, policyVersionId, region=None, key=None, keyid=None, profile=None)[source]¶
Delete the given policy version.
- policyName (str):
The name of the policy to delete.
- policyVersionId (str):
The ID of the policy version to delete.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.delete_policy_version
- saltext.boto3.modules.boto3_iot.describe_policy_version(policyName, policyVersionId, region=None, key=None, keyid=None, profile=None)[source]¶
Describe the given policy version.
- policyName (str):
The name of the policy to describe.
- policyVersionId (str):
The ID of the policy version to describe.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.describe_policy_version
- saltext.boto3.modules.boto3_iot.list_policies(region=None, key=None, keyid=None, profile=None)[source]¶
List all policies.
- region (str, optional):
The AWS region where the policies are located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.list_policies
- saltext.boto3.modules.boto3_iot.list_policy_versions(policyName, region=None, key=None, keyid=None, profile=None)[source]¶
List the versions available for the given policy.
- policyName (str):
The name of the policy to list versions for.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.list_policy_versions
- saltext.boto3.modules.boto3_iot.set_default_policy_version(policyName, policyVersionId, region=None, key=None, keyid=None, profile=None)[source]¶
Set the given version as the default for the policy.
- policyName (str):
The name of the policy to set the default version for.
- policyVersionId (str):
The ID of the policy version to set as default.
- region (str, optional):
The AWS region where the policy is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.set_default_policy_version
- saltext.boto3.modules.boto3_iot.list_principal_policies(principal, region=None, key=None, keyid=None, profile=None)[source]¶
List the policies attached to the given principal.
- principal (str):
The principal (e.g., an AWS IoT certificate ARN) whose attached policies are to be listed.
- region (str, optional):
The AWS region where the principal is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.list_principal_policies
- saltext.boto3.modules.boto3_iot.attach_principal_policy(policyName, principal, region=None, key=None, keyid=None, profile=None)[source]¶
Attach the specified policy to the specified principal.
- policyName (str):
The name of the policy to attach.
- principal (str):
The principal (e.g., an AWS IoT certificate ARN) to attach the policy to.
- region (str, optional):
The AWS region where the principal is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.attach_principal_policy
- saltext.boto3.modules.boto3_iot.detach_principal_policy(policyName, principal, region=None, key=None, keyid=None, profile=None)[source]¶
Detach the specified policy from the specified principal.
- policyName (str):
The name of the policy to detach.
- principal (str):
The principal (e.g., an AWS IoT certificate ARN) from which to detach the policy.
- region (str, optional):
The AWS region where the principal is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.detach_principal_policy
- saltext.boto3.modules.boto3_iot.topic_rule_exists(ruleName, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if the given rule exists.
- ruleName (str):
The name of the topic rule to check for existence.
- region (str, optional):
The AWS region where the topic rule is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.topic_rule_exists
- saltext.boto3.modules.boto3_iot.create_topic_rule(ruleName, sql, actions, description, ruleDisabled=False, region=None, key=None, keyid=None, profile=None)[source]¶
Create a topic rule.
- ruleName (str):
The name of the topic rule to create.
- sql (str):
The SQL statement that defines the rule.
- actions (list):
A list of actions associated with the rule.
- description (str):
A description of the topic rule.
- ruleDisabled (bool, optional):
Whether the rule is disabled. Defaults to False.
- region (str, optional):
The AWS region where the topic rule is to be created.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.create_topic_rule
- saltext.boto3.modules.boto3_iot.replace_topic_rule(ruleName, sql, actions, description, ruleDisabled=False, region=None, key=None, keyid=None, profile=None)[source]¶
Replace a topic rule with the new values.
- ruleName (str):
The name of the topic rule to replace.
- sql (str):
The SQL statement that defines the rule.
- actions (list):
A list of actions associated with the rule.
- description (str):
A description of the topic rule.
- ruleDisabled (bool, optional):
Whether the rule is disabled. Defaults to False.
- region (str, optional):
The AWS region where the topic rule is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.replace_topic_rule
- saltext.boto3.modules.boto3_iot.delete_topic_rule(ruleName, region=None, key=None, keyid=None, profile=None)[source]¶
Delete the given topic rule.
- ruleName (str):
The name of the topic rule to delete.
- region (str, optional):
The AWS region where the topic rule is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.delete_topic_rule
- saltext.boto3.modules.boto3_iot.describe_topic_rule(ruleName, region=None, key=None, keyid=None, profile=None)[source]¶
Describe the given topic rule.
- ruleName (str):
The name of the topic rule to describe.
- region (str, optional):
The AWS region where the topic rule is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.describe_topic_rule
- saltext.boto3.modules.boto3_iot.list_topic_rules(topic=None, ruleDisabled=None, region=None, key=None, keyid=None, profile=None)[source]¶
List all rules (for a given topic, if specified).
- topic (str, optional):
The topic to filter the rules by.
- ruleDisabled (bool, optional):
Whether to include disabled rules.
- region (str, optional):
The AWS region where the topic rules are located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt-call boto3_iot.list_topic_rules