New in version 2016.3.0.
Create and destroy CloudTrail objects. Be aware that this interacts with Amazon's services, and so may incur charges.
boto
boto3
The dependencies listed above 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 trail exists:
boto_cloudtrail.present:
- Name: mytrail
- S3BucketName: mybucket
- S3KeyPrefix: prefix
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
Ensure trail with passed properties is absent.
The name of the state definition.
Name of the trail.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
Ensure trail exists.
The name of the state definition
Name of the trail.
Specifies the name of the Amazon S3 bucket designated for publishing log files.
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery.
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
Specifies whether the trail is publishing events from global services such as IAM to the log files.
Specifies whether log file integrity validation is enabled. The default is false.
Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be a an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
Whether logging should be enabled for the trail
A dictionary of tags that should be set on the trail
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.