# Path: stacker_blueprints/policies.py
# def flowlogs_assumerole_policy():
#     return make_simple_assume_policy("vpc-flow-logs.amazonaws.com")
# 
# 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 troposphere import (
    GetAtt,
    Join,
    Output,
    Ref,
    iam,
    logs,
    ec2,
)
from troposphere.iam import Policy as TropoPolicy
from stacker.blueprints.base import Blueprint
from awacs.aws import (
    Statement,
    Policy,
)
from .policies import flowlogs_assumerole_policy
from .cloudwatch_logs import (
    LOG_RETENTION_STRINGS,
    validate_cloudwatch_log_retention
)
import awacs
import awacs.logs
                ],
            ),
        ]
    )


def validate_traffic_type(traffic_type):
    if traffic_type not in ALLOWED_TRAFFIC_TYPES:
        raise ValueError(
            "Traffic type must be one of the following: " +
            "%s" % JOINED_TRAFFIC_TYPES
        )

    return traffic_type


class FlowLogs(Blueprint):
    VARIABLES = {
        "Retention": {
            "type": int,
            "description": "Time in days to retain Cloudwatch Logs. Accepted "
                           "values: %s. Default 0 - retain forever." % (
                               ', '.join(LOG_RETENTION_STRINGS)),
            "default": LOG_RETENTION_DEFAULT,
            "validator": validate_cloudwatch_log_retention,

        },
        "VpcId": {
            "type": str,
            "description": "ID of the VPC that flow logs will be enabled "

# Path: stacker_blueprints/policies.py
# def flowlogs_assumerole_policy():
#     return make_simple_assume_policy("vpc-flow-logs.amazonaws.com")
# 
# 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/vpc_flow_logs.py
from troposphere import (
    GetAtt,
    Join,
    Output,
    Ref,
    iam,
    logs,
    ec2,
)
from troposphere.iam import Policy as TropoPolicy
from stacker.blueprints.base import Blueprint
from awacs.aws import (
    Statement,
    Policy,
)
from .policies import flowlogs_assumerole_policy
from .cloudwatch_logs import (
    LOG_RETENTION_STRINGS,
    validate_cloudwatch_log_retention
)
import awacs
import awacs.logs

                ],
            ),
        ]
    )


def validate_traffic_type(traffic_type):
    if traffic_type not in ALLOWED_TRAFFIC_TYPES:
        raise ValueError(
            "Traffic type must be one of the following: " +
            "%s" % JOINED_TRAFFIC_TYPES
        )

    return traffic_type


class FlowLogs(Blueprint):
    VARIABLES = {
        "Retention": {
            "type": int,
            "description": "Time in days to retain Cloudwatch Logs. Accepted "
                           "values: %s. Default 0 - retain forever." % (
                               ', '.join(LOG_RETENTION_STRINGS)),
            "default": LOG_RETENTION_DEFAULT,
            "validator": validate_cloudwatch_log_retention,

        },
        "VpcId": {
            "type": str,
            "description": "ID of the VPC that flow logs will be enabled "

                           "for.",