3 O4\@s\ddlmZddlmZddlmZddlmZddlm Z ddl m Z Gdd d e Z d S) ) PropertyType)fnSub)SubscriptionFilter)is_str) ArnGenerator)PushEventSourcec@sJeZdZdZdZdZedeededZddZ ddZ d d Z d S) CloudWatchLogsz/CloudWatch Logs event source for SAM Functions.zlogs.amazonaws.comT) LogGroupName FilterPatterncKsD|jd}|std|j}|j||d}|j||}||g}|S)aIReturns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this push event expands :rtype: list functionz+Missing required keyword argument: function) source_arn)get TypeErrorget_source_arnZ_construct_permissionget_subscription_filter)selfkwargsr r permissionsubscription_filterZ resourcesr/Users/sshvans/Documents/Work/Quickstart/python-virtual-environments/env/lib/python3.6/site-packages/samtranslator/model/eventsources/cloudwatchlogs.pyto_cloudformations  z CloudWatchLogs.to_cloudformationcCs(d}tj}ttj|d|dd|jiS)Nzlog-group:${__LogGroupName__}:*Zlogs) partitionZserviceresourceZ__LogGroupName__)rZget_partition_namerZ generate_arnr )rrrrrrr&szCloudWatchLogs.get_source_arncCsNt|j|jgd}|j|_|j|_|jd|_d|jkrJ|jd|jd|S)N)Z depends_onZarn Condition)rZ logical_idr r Zget_runtime_attrZDestinationArnZresource_attributesZset_resource_attribute)rr rrrrrr-s  z&CloudWatchLogs.get_subscription_filterN) __name__ __module__ __qualname____doc__Z resource_typeZ principalrrZproperty_typesrrrrrrrr s r N) Zsamtranslator.modelrZsamtranslator.model.intrinsicsrZsamtranslator.model.logrZsamtranslator.model.typesrZ&samtranslator.translator.arn_generatorrpushrr rrrrs