File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/boto_cloudtrail.cpython-310.pyc
Back
o ;jo4 � @ sj d Z ddlZddlZddlZddlZe�e�Zdd� Z ddd�Z dd d �ZdS ) a� Manage CloudTrail Objects ========================= .. versionadded:: 2016.3.0 Create and destroy CloudTrail objects. Be aware that this interacts with Amazon's services, and so may incur charges. :depends: - 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 <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 a pillar file or in the minion's config file: .. code-block:: yaml 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: .. code-block:: yaml myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1 .. code-block:: yaml Ensure trail exists: boto_cloudtrail.present: - Name: mytrail - S3BucketName: mybucket - S3KeyPrefix: prefix - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs � Nc C s dt v rdS dS )z) Only load if boto is available. �boto_cloudtrail.existsZboto_cloudtrail)Fz*boto_cloudtrail module could not be loaded)�__salt__� r r �O/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/boto_cloudtrail.py�__virtual__? s r TFc C s� |ddi d�}t d || |||d�}d|v r'd|d<