2016.3.0 新版功能.
Create and destroy IoT objects. Be aware that this interacts with Amazon's services, and so may incur charges.
This module uses boto3
, which can be installed via package, or pip.
This module accepts explicit vpc 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 here.
If IAM roles are not used you need to specify them either in a pillar file or in the minion's config file:
vpc.keyid: GKTADJGHEIQSXMKKRBJ08H
vpc.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
It's also possible to specify key
, keyid
and region
via a profile,
either passed in as a dict, or as a string to pull from pillars or minion
config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
Ensure policy exists:
boto_iot.policy_present:
- policyName: mypolicy
- policyDocument:
Version: "2012-10-17"
Statement:
Action:
- iot:Publish
Resource:
- "*"
Effect: "Allow"
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
Ensure topic rule exists:
boto_iot.topic_rule_present:
- ruleName: myrule
- sql: "SELECT * FROM 'iot/test'"
- description: 'test rule'
- ruleDisabled: false
- actions:
- lambda:
functionArn: "arn:aws:us-east-1:1234:function/functionname"
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_iot.
policy_absent
(name, policyName, region=None, key=None, keyid=None, profile=None)¶Ensure policy with passed properties is absent.
salt.states.boto_iot.
policy_attached
(name, policyName, principal, region=None, key=None, keyid=None, profile=None)¶Ensure policy is attached to the given principal.
salt.states.boto_iot.
policy_detached
(name, policyName, principal, region=None, key=None, keyid=None, profile=None)¶Ensure policy is attached to the given principal.
salt.states.boto_iot.
policy_present
(name, policyName, policyDocument, region=None, key=None, keyid=None, profile=None)¶Ensure policy exists.
salt.states.boto_iot.
topic_rule_absent
(name, ruleName, region=None, key=None, keyid=None, profile=None)¶Ensure topic rule with passed properties is absent.
salt.states.boto_iot.
topic_rule_present
(name, ruleName, sql, actions, description='', ruleDisabled=False, region=None, key=None, keyid=None, profile=None)¶Ensure topic rule exists.