Given a valid config, update the Lifecycle rules for a bucket.

    Returns {updated: true} if Lifecycle was updated and returns
    {updated: False} if Lifecycle was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_lifecycle_configuration my_bucket '[{\\
              "Expiration": {...},\\
              "ID": "idstring",\\
              "Prefix": "prefixstring",\\
              "Status": "enabled",\\
              "Transitions": [{...},],\\
              "NoncurrentVersionTransitions": [{...},],\\
              "NoncurrentVersionExpiration": {...},\\
        }]'

def put_lifecycle_configuration(Bucket,
           Rules,
           region=None, key=None, keyid=None, profile=None):
    '''
    Given a valid config, update the Lifecycle rules for a bucket.

    Returns {updated: true} if Lifecycle was updated and returns
    {updated: False} if Lifecycle was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_lifecycle_configuration my_bucket '[{\\
              "Expiration": {...},\\
              "ID": "idstring",\\
              "Prefix": "prefixstring",\\
              "Status": "enabled",\\
              "Transitions": [{...},],\\
              "NoncurrentVersionTransitions": [{...},],\\
              "NoncurrentVersionExpiration": {...},\\
        }]'

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        if Rules is not None and isinstance(Rules, six.string_types):
            Rules = salt.utils.json.loads(Rules)
        conn.put_bucket_lifecycle_configuration(Bucket=Bucket, LifecycleConfiguration={'Rules': Rules})
        return {'updated': True, 'name': Bucket}
    except ClientError as e:
        return {'updated': False, 'error': __utils__['boto3.get_error'](e)}