# Path: stacker_blueprints/policies.py
# def s3_arn(bucket):
#     if isinstance(bucket, AWSHelperFn):
#         return Sub('arn:aws:s3:::${Bucket}', Bucket=bucket)
#     else:
#         return 'arn:aws:s3:::%s' % bucket
# 
# def write_to_cloudwatch_logs_stream_statements(log_group_name,
#                                                log_stream_name):
#     return [
#         Statement(
#             Effect=Allow,
#             Action=[logs.PutLogEvents],
#             Resource=[log_stream_arn(log_group_name, log_stream_name)]
#         )
#     ]
# 
# Path: stacker_blueprints/cloudwatch_logs.py
# LOG_RETENTION_STRINGS = [str(x) for x in LOG_RETENTION_VALUES]
# 
# def validate_cloudwatch_log_retention(value):
#     if value not in LOG_RETENTION_VALUES:
#         raise ValueError(
#             "%d is not a valid retention period. Must be one of: %s" % (
#                 value,
#                 ', '.join(LOG_RETENTION_STRINGS)
#             )
#         )
#     return value


from awacs.aws import (
    Allow,
    Condition,
    Policy,
    Statement,
    StringEquals,
    StringLike,
)
from awacs.helpers.trust import make_simple_assume_statement
from stacker.blueprints.base import Blueprint
from troposphere import (
    iam,
    logs,
    firehose,
    Join,
    GetAtt,
    Output,
    Ref,
    Sub,
)
from ..policies import (
    s3_arn,
    write_to_cloudwatch_logs_stream_statements,
)
from ..cloudwatch_logs import (
    LOG_RETENTION_STRINGS,
    validate_cloudwatch_log_retention,
)
import awacs.logs
import awacs.s3
import awacs.firehose
import awacs.kms
        "BucketName": {
            "type": str,
            "description": "Name of existing bucket to stream firehose "
                           "data to."
        },
        "S3Prefix": {
            "type": str,
            "description": "The prefix used when writing objects in the s3 "
                           "bucket.",
            "default": "/",
        },
        "EncryptionKeyArn": {
            "type": str,
            "description": "ARN of the KMS key to use to encrypt objects in "
                           "the s3 bucket.",
            "default": "",
        },
        "BufferingHints": {
            "type": dict,
            "description": "A dictionary with buffering hints for writing "
                           "objects to the s3 bucket. Valid keys are: "
                           "IntervalInSeconds, SizeInMBs",
            "default": {"IntervalInSeconds": 300, "SizeInMBs": 5},
        },
        "CompressionFormat": {
            "type": str,
            "description": "The compression format used by the Firehose when "
                           "writing objects in the s3 bucket.",
            "default": "UNCOMPRESSED",
        },

# Path: stacker_blueprints/policies.py
# def s3_arn(bucket):
#     if isinstance(bucket, AWSHelperFn):
#         return Sub('arn:aws:s3:::${Bucket}', Bucket=bucket)
#     else:
#         return 'arn:aws:s3:::%s' % bucket
# 
# def write_to_cloudwatch_logs_stream_statements(log_group_name,
#                                                log_stream_name):
#     return [
#         Statement(
#             Effect=Allow,
#             Action=[logs.PutLogEvents],
#             Resource=[log_stream_arn(log_group_name, log_stream_name)]
#         )
#     ]
# 
# Path: stacker_blueprints/cloudwatch_logs.py
# LOG_RETENTION_STRINGS = [str(x) for x in LOG_RETENTION_VALUES]
# 
# def validate_cloudwatch_log_retention(value):
#     if value not in LOG_RETENTION_VALUES:
#         raise ValueError(
#             "%d is not a valid retention period. Must be one of: %s" % (
#                 value,
#                 ', '.join(LOG_RETENTION_STRINGS)
#             )
#         )
#     return value


# Path: stacker_blueprints/firehose/base.py
from awacs.aws import (
    Allow,
    Condition,
    Policy,
    Statement,
    StringEquals,
    StringLike,
)
from awacs.helpers.trust import make_simple_assume_statement
from stacker.blueprints.base import Blueprint
from troposphere import (
    iam,
    logs,
    firehose,
    Join,
    GetAtt,
    Output,
    Ref,
    Sub,
)
from ..policies import (
    s3_arn,
    write_to_cloudwatch_logs_stream_statements,
)
from ..cloudwatch_logs import (
    LOG_RETENTION_STRINGS,
    validate_cloudwatch_log_retention,
)
import awacs.logs
import awacs.s3
import awacs.firehose
import awacs.kms

        "BucketName": {
            "type": str,
            "description": "Name of existing bucket to stream firehose "
                           "data to."
        },
        "S3Prefix": {
            "type": str,
            "description": "The prefix used when writing objects in the s3 "
                           "bucket.",
            "default": "/",
        },
        "EncryptionKeyArn": {
            "type": str,
            "description": "ARN of the KMS key to use to encrypt objects in "
                           "the s3 bucket.",
            "default": "",
        },
        "BufferingHints": {
            "type": dict,
            "description": "A dictionary with buffering hints for writing "
                           "objects to the s3 bucket. Valid keys are: "
                           "IntervalInSeconds, SizeInMBs",
            "default": {"IntervalInSeconds": 300, "SizeInMBs": 5},
        },
        "CompressionFormat": {
            "type": str,
            "description": "The compression format used by the Firehose when "
                           "writing objects in the s3 bucket.",
            "default": "UNCOMPRESSED",
        },

        "LogRetentionDays": {