How can I use a Lambda function to call a Glue function (ETL) when a text file is loaded to an S3 bucketIs there any way to trigger a AWS Lambda function at the end of an AWS Glue job?Can an AWS Lambda function call anotherAWS lambda function ConnectionError when configured with VPCHow to get latest file-name or file from S3 bucket using event triggered lambdaCall a Lambda Function with AWS Glue"EndpointConnectionError : unable to connect to endpoint https://lambda-xyz/wehwk.comHow to programmatically add files to AWS S3 Bucket?Glue with Lambda function callingPython Boto3 Lambda Upload Temp FileWhy Records in missing in the cloudwatch?Issue while executing a script on ec2 using Lambda

Why are sugars in whole fruits not digested the same way sugars in juice are?

Could flaps be raised upward to serve as spoilers / lift dumpers?

How is Sword Coast North governed?

Why have both: BJT and FET transistors on IC output?

Delete the following space

May a hotel provide accommodation for fewer people than booked?

A game of red and black

Is this mechanically safe?

How do I find SFDX CLI default installation folder on Mac?

Password management for kids - what's a good way to start?

Is this popular optical illusion made of a grey-scale image with coloured lines?

Constant Scan spooling

Why don't short runways use ramps for takeoff?

How to innovate in OR

Are some indefinite integrals impossible to compute or just don't exist?

How do I safety check that there is no light in Darkroom / Darkbag?

How to let cacti grow even if no player is near?

Novel - Accidental exploration ship, broadcasts a TV show to let people know what they find

Why did the United States not resort to nuclear weapons in Vietnam?

Is it unprofessional to mention your cover letter and resume are best viewed in Chrome?

Being told my "network" isn't PCI Complaint. I don't even have a server! Do I have to comply?

Adjective for when skills are not improving and I'm depressed about it

Oath of redemption: Does Emmissary of Peace reflect damage taken from Aura of the Guardian?

What are the effects of the elements on 3D printed objects made with "infused" PLA



How can I use a Lambda function to call a Glue function (ETL) when a text file is loaded to an S3 bucket


Is there any way to trigger a AWS Lambda function at the end of an AWS Glue job?Can an AWS Lambda function call anotherAWS lambda function ConnectionError when configured with VPCHow to get latest file-name or file from S3 bucket using event triggered lambdaCall a Lambda Function with AWS Glue"EndpointConnectionError : unable to connect to endpoint https://lambda-xyz/wehwk.comHow to programmatically add files to AWS S3 Bucket?Glue with Lambda function callingPython Boto3 Lambda Upload Temp FileWhy Records in missing in the cloudwatch?Issue while executing a script on ec2 using Lambda






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am trying to set up a lambda function that activates a Glue function when a .txt file is uploaded to an S3 bucket, I am using python 3.7



So far I have this:



from __future__ import print_function

import json
import boto3
import urllib

print('Loading function')

s3 = boto3.client('s3')

def lambda_handler(event, context): # handler
source_bucket = event['Records'][0]['s3']['bucket']['name']
key = urllib.parse.quote_plus(event['Records'][0]['s3']['object']['key'].encode('utf8'))
try:
# what to put here
except Exception as e:
print(e)
print('Error')
raise e


But I don't understand how can I call the glue function










share|improve this question
































    2















    I am trying to set up a lambda function that activates a Glue function when a .txt file is uploaded to an S3 bucket, I am using python 3.7



    So far I have this:



    from __future__ import print_function

    import json
    import boto3
    import urllib

    print('Loading function')

    s3 = boto3.client('s3')

    def lambda_handler(event, context): # handler
    source_bucket = event['Records'][0]['s3']['bucket']['name']
    key = urllib.parse.quote_plus(event['Records'][0]['s3']['object']['key'].encode('utf8'))
    try:
    # what to put here
    except Exception as e:
    print(e)
    print('Error')
    raise e


    But I don't understand how can I call the glue function










    share|improve this question




























      2












      2








      2








      I am trying to set up a lambda function that activates a Glue function when a .txt file is uploaded to an S3 bucket, I am using python 3.7



      So far I have this:



      from __future__ import print_function

      import json
      import boto3
      import urllib

      print('Loading function')

      s3 = boto3.client('s3')

      def lambda_handler(event, context): # handler
      source_bucket = event['Records'][0]['s3']['bucket']['name']
      key = urllib.parse.quote_plus(event['Records'][0]['s3']['object']['key'].encode('utf8'))
      try:
      # what to put here
      except Exception as e:
      print(e)
      print('Error')
      raise e


      But I don't understand how can I call the glue function










      share|improve this question
















      I am trying to set up a lambda function that activates a Glue function when a .txt file is uploaded to an S3 bucket, I am using python 3.7



      So far I have this:



      from __future__ import print_function

      import json
      import boto3
      import urllib

      print('Loading function')

      s3 = boto3.client('s3')

      def lambda_handler(event, context): # handler
      source_bucket = event['Records'][0]['s3']['bucket']['name']
      key = urllib.parse.quote_plus(event['Records'][0]['s3']['object']['key'].encode('utf8'))
      try:
      # what to put here
      except Exception as e:
      print(e)
      print('Error')
      raise e


      But I don't understand how can I call the glue function







      python-3.x amazon-s3 aws-lambda aws-glue






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 12:15







      Jose

















      asked Mar 26 at 22:52









      JoseJose

      9510 bronze badges




      9510 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          1














          I manage to do it like this:



          from __future__ import print_function
          import json
          import boto3

          client = boto3.client('glue')

          def lambda_handler(event, context):
          response = client.start_job_run(JobName = 'GLUE_CODE_NAME')


          Later I will post the S3 event






          share|improve this answer

























          • @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

            – Jose
            Mar 28 at 19:59


















          0














          You can configure an S3 Event Notification that will trigger this Lambda function when PUT object actions is called on an S3 prefix.



          https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html



          This lambda function can then trigger the StartJobRun action of Glue API.



          https://docs.aws.amazon.com/glue/latest/webapi/API_StartJobRun.html






          share|improve this answer



























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367322%2fhow-can-i-use-a-lambda-function-to-call-a-glue-function-etl-when-a-text-file-i%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            I manage to do it like this:



            from __future__ import print_function
            import json
            import boto3

            client = boto3.client('glue')

            def lambda_handler(event, context):
            response = client.start_job_run(JobName = 'GLUE_CODE_NAME')


            Later I will post the S3 event






            share|improve this answer

























            • @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

              – Jose
              Mar 28 at 19:59















            1














            I manage to do it like this:



            from __future__ import print_function
            import json
            import boto3

            client = boto3.client('glue')

            def lambda_handler(event, context):
            response = client.start_job_run(JobName = 'GLUE_CODE_NAME')


            Later I will post the S3 event






            share|improve this answer

























            • @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

              – Jose
              Mar 28 at 19:59













            1












            1








            1







            I manage to do it like this:



            from __future__ import print_function
            import json
            import boto3

            client = boto3.client('glue')

            def lambda_handler(event, context):
            response = client.start_job_run(JobName = 'GLUE_CODE_NAME')


            Later I will post the S3 event






            share|improve this answer













            I manage to do it like this:



            from __future__ import print_function
            import json
            import boto3

            client = boto3.client('glue')

            def lambda_handler(event, context):
            response = client.start_job_run(JobName = 'GLUE_CODE_NAME')


            Later I will post the S3 event







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 28 at 19:55









            JoseJose

            9510 bronze badges




            9510 bronze badges















            • @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

              – Jose
              Mar 28 at 19:59

















            • @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

              – Jose
              Mar 28 at 19:59
















            @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

            – Jose
            Mar 28 at 19:59





            @CodeHunter still I would like if you can check the way I did it, and if the same as yours, Thanks

            – Jose
            Mar 28 at 19:59













            0














            You can configure an S3 Event Notification that will trigger this Lambda function when PUT object actions is called on an S3 prefix.



            https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html



            This lambda function can then trigger the StartJobRun action of Glue API.



            https://docs.aws.amazon.com/glue/latest/webapi/API_StartJobRun.html






            share|improve this answer





























              0














              You can configure an S3 Event Notification that will trigger this Lambda function when PUT object actions is called on an S3 prefix.



              https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html



              This lambda function can then trigger the StartJobRun action of Glue API.



              https://docs.aws.amazon.com/glue/latest/webapi/API_StartJobRun.html






              share|improve this answer



























                0












                0








                0







                You can configure an S3 Event Notification that will trigger this Lambda function when PUT object actions is called on an S3 prefix.



                https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html



                This lambda function can then trigger the StartJobRun action of Glue API.



                https://docs.aws.amazon.com/glue/latest/webapi/API_StartJobRun.html






                share|improve this answer













                You can configure an S3 Event Notification that will trigger this Lambda function when PUT object actions is called on an S3 prefix.



                https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html



                This lambda function can then trigger the StartJobRun action of Glue API.



                https://docs.aws.amazon.com/glue/latest/webapi/API_StartJobRun.html







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 27 at 14:18









                Ujjwal BhardwajUjjwal Bhardwaj

                1501 silver badge9 bronze badges




                1501 silver badge9 bronze badges






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367322%2fhow-can-i-use-a-lambda-function-to-call-a-glue-function-etl-when-a-text-file-i%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript