Lambda Function error when uploading in Service Catalog

0

Hey guys,

I wanted to create a new product in the service catalog. I followed this article to automate the account creation: https://aws.amazon.com/de/blogs/mt/automate-account-creation-and-resource-provisioning-using-aws-service-catalog-aws-organizations-and-aws-lambda/

Because we dont need the resources getting deployed with the configuration files from this article, I deleted them in Accountbaseline.yml and accountbuilder.yml and also removed the functions for their deployment in AccountCreationLambda.py . The AccountBuilderLambda and the LambdaExecuteRole event are executing successfully but the TriggerLambda event is in status "Create in progress" for a hour, then I get the error message:

The following resource(s) failed to create: [TriggerLambda]. Rollback requested by user.}, {LogicalResourceId : TriggerLambda, ResourceType : Custom::TriggerLambda, StatusReason : CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [7dd4b91c-8ef2-4405-9e1c-6b45118b931a]. If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version.}, {LogicalResourceId : AccountBuilderLambda, ResourceType : AWS::Lambda::Function, StatusReason : Resource creation Initiated}, {LogicalResourceId : LambdaExecuteRole, ResourceType : AWS::IAM::Role, StatusReason : Resource creation Initiated}, {LogicalResourceId : SC-761183374848-pp-laowqzpxqaghw, ResourceType : AWS::CloudFormation::Stack, StatusReason : User Initiated}]

The only error I can find in the CloudWatch logs for the Lambda function is: [ERROR] Runtime.HandlerNotFound: Handler 'main' missing on module 'AccountCreationLambda'

I put the three files on GitHub: https://github.com/MarkWie/aws_template/blob/fecb660c79d41988018ffc96f202c88a69ef6c78/AccountCreationLambda.py The parts with the ''' ''' were commented out by me aswell as single lines with ##

Can anyone help with this issue?

Best regards Mark

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen