<commit_before>#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function

__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}


DOCUMENTATION = '''
---
module: cloudwatchlogs_log_group
short_description: create or delete log_group in CloudWatchLogs
notes:
    - for details of the parameters and returns see U(http://boto3.readthedocs.io/en/latest/reference/services/logs.html)
description:
    - Create or delete log_group in CloudWatchLogs.
version_added: "2.5"
author:
    - <NAME> (@willricardo) <<EMAIL>>
requirements: [ json, botocore, boto3 ]
options:
    state:
      description:
        - Whether the rule is present, absent or get
      choices: ["present", "absent"]
      default: present
      required: false
    log_group_name:
      description:
        - The name of the log group.
      required: true
    kms_key_id:
      description:
        - The Amazon Resource Name (ARN) of the CMK to use when encrypting log data.
      required: false
    tags:
      description:
        - The key-value pairs to use for the tags.
      required: false
    retention:
      description:
        - "The number of days to retain the log events in the specified log group.
           Valid values are: [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653]"
      required: false
    overwrite:
     description:
        - Whether an existing log group should be overwritten on create.
     default: false
     required: false
     type: bool
extends_documentation_fragment:
    - aws
    - ec2
'''

EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.

- cloudwatchlogs_log_group:
    log_group_name: test-log-group

- cloudwatchlogs_log_group:
    state: present
    log_group_name: test-log-group
    tags: { "Name": "test-log-group", "Env" : "QA" }

- cloudwatchlogs_log_group:
    state: present
    log_group_name: test-log-group
    tags: { "Name": "test-log-group", "Env" : "QA" }
    kms_key_id: arn:aws:kms:region:account-id:key/key-id

- cloudwatchlogs_log_group:
    state: absent
    log_group_name: test-log-group

'''

RETURN = '''
log_groups:
    description: Return the list of complex objetcs representing log groups
    returned: success
    type: complex<commit_msg>Fix typo in aws log group return documentation (#56335)<commit_after>#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function

__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}


DOCUMENTATION = '''
---
module: cloudwatchlogs_log_group
short_description: create or delete log_group in CloudWatchLogs
notes:
    - for details of the parameters and returns see U(http://boto3.readthedocs.io/en/latest/reference/services/logs.html)
description:
    - Create or delete log_group in CloudWatchLogs.
version_added: "2.5"
author:
    - <NAME> (@willricardo) <<EMAIL>>
requirements: [ json, botocore, boto3 ]
options:
    state:
      description:
        - Whether the rule is present, absent or get
      choices: ["present", "absent"]
      default: present
      required: false
    log_group_name:
      description:
        - The name of the log group.
      required: true
    kms_key_id:
      description:
        - The Amazon Resource Name (ARN) of the CMK to use when encrypting log data.
      required: false
    tags:
      description:
        - The key-value pairs to use for the tags.
      required: false
    retention:
      description:
        - "The number of days to retain the log events in the specified log group.
           Valid values are: [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653]"
      required: false
    overwrite:
     description:
        - Whether an existing log group should be overwritten on create.
     default: false
     required: false
     type: bool
extends_documentation_fragment:
    - aws
    - ec2
'''

EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.

- cloudwatchlogs_log_group:
    log_group_name: test-log-group

- cloudwatchlogs_log_group:
    state: present
    log_group_name: test-log-group
    tags: { "Name": "test-log-group", "Env" : "QA" }

- cloudwatchlogs_log_group:
    state: present
    log_group_name: test-log-group
    tags: { "Name": "test-log-group", "Env" : "QA" }
    kms_key_id: arn:aws:kms:region:account-id:key/key-id

- cloudwatchlogs_log_group:
    state: absent
    log_group_name: test-log-group

'''

RETURN = '''
log_groups:
    description: Return the list of complex objects representing log groups
    returned: success
    type: complex
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.021414538310412574, 'mean_word_length': 2.925212027756361, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7057681', 'n_tokens_mistral': 1678, 'n_tokens_neox': 1577, 'n_words': 493}