def __create_cloud_front_www_edit_path_for_origin_lambda( self, webflow_aws_setup_bucket: str, lambda_execution_role: aws_iam.Role) -> aws_lambda.Function: return aws_lambda.Function( self, 'CloudFrontEditPathForOrigin', description= 'Appends .html extension to universal paths, preserving files with other extensions (ex .css)', handler='index.handler', runtime=aws_lambda.Runtime.NODEJS_12_X, timeout=Duration.seconds(5), memory_size=128, role=lambda_execution_role, code=Code.bucket( bucket=Bucket.from_bucket_name( self, "SourceBucketWWWEditPathForOriginLambda", bucket_name=webflow_aws_setup_bucket), key= 'lambda_function/cloudfront_www_edit_path_for_origin/package.zip' ))
def __create_s3_trigger_lambda_function( self, webflow_aws_setup_bucket: str, execution_role: aws_iam.Role, cloud_front_distribution: aws_cloudfront.Distribution ) -> aws_lambda.Function: return aws_lambda.Function( self, 'S3TriggerLambdaFunction', description= 'Function responsible of unzipping the zip file uploaded and move the files to the ' 'correct folder', handler='index.handler', role=execution_role, runtime=aws_lambda.Runtime.NODEJS_12_X, timeout=Duration.seconds(300), environment={ 'CDN_DISTRIBUTION_ID': cloud_front_distribution.distribution_id }, code=Code.bucket( bucket=Bucket.from_bucket_name( self, "WebflowAWSSupport", bucket_name=webflow_aws_setup_bucket), key='lambda_function/s3_trigger_artifacts_upload/package.zip'))