o Vc@sdZddlmZddlmZddlmZmZddlm Z ddl m Z m Z m ZmZmZmZmZddl Z ddlmZGd d d e ZdS) a Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. )runtime)timeout)RuleSchedule)Role)DurationStack aws_lambdaaws_iamtriggersaws_events_targetsaws_logsN) Constructcs*eZdZdededdffdd ZZS) ConfigReportscope construct_idreturnNc stj||fi|tj|ddddd}tj|ddddd}tj|d dd d d}tj|d dd dd}tj|ddddd}tj|ddddd} tj|ddddd} tj|dtjjtj dtj j dt d|j|j|jdd} | tjtjjdg| jgd|jid |jid!d"| tjtjjd#d$gd%gd&d'tjjgiid"t|d(tj|j| j|jd)d*} | t| tj|d+| d,} dS)-N AggregatorStringZ aggregatorzName of AWS Config Aggregator)typedefault description Recipientzrecipient@email.comzSES recipient email addressSenderzsender@email.comzSES sender email addressWeekday2zKDay-of-week 1-7 or SUN-SAT Lambda will run. For example: for Monday, type 2HourZ23zHThe time (hour) the Lambda will run. For example: for 23:50 UTC, type 23MinuteZ50zJThe time (minute) the Lambda will run. For example: for 23:50 UTC, type 50SESarnz7arn:aws:ses:us-east-1:888888888888:identity/example.comz_The preconfigured SES arn, for example: arn:aws:ses:us-east-1:888888888888:identity/example.comZconfig_reporterz../src/z$config_report_lambda.config_reporteri,)ZAGGREGATOR_NAMEZSENDERZ RECIPIENT) log_retentioncoderhandlerr environmentzses:SendRawEmailzses:Recipientszses:FromAddress)zForAllValues:StringLikeZ StringLike)effectactions resources conditionsz0config:GetAggregateComplianceDetailsByConfigRulez/config:DescribeAggregateComplianceByConfigRules*Z StringEqualszaws:ResourceAccountZConfigReporterCW)week_dayminutehour)scheduleZ TriggerLambda)r!)super__init__aws_cdk CfnParameter_lambdaFunctionlogs RetentionDays ONE_MONTHCode from_assetRuntime PYTHON_3_8rsecondsvalue_as_stringadd_to_role_policyiamPolicyStatementEffectALLOWAws ACCOUNT_IDrrcron add_targettargetsLambdaFunctionr Trigger)selfrrkwargsrrrrrrrZconfig_reporter_lambdaruletrigger __class__L/Users/ganswara/Downloads/Config-report/config_report/config_report_stack.pyr-$s    zConfigReport.__init__)__name__ __module__ __qualname__rstrr- __classcell__rMrMrKrNr"s"r)__doc__typing_extensionsrZ async_timeoutrZaws_cdk.aws_eventsrrZaws_cdk.aws_iamrr.rrr r0r r<r r rDr r2 constructsrrrMrMrMrNs   $