The Nautilus DevOps team continues to explore serverless architecture by setting up another Lambda function. This time, the task must be completed using the AWS Console to familiarize the team with the web interface. The function will return a custom greeting and demonstrate the capabilities of AWS Lambda effectively.
-
Create Python Script: Create a Python script named
lambda_function.py with a function that returns the body Welcome to KKE AWS Labs! and status code 200.
-
Zip the Python Script: Zip the script into a file named
function.zip.
-
Create Lambda Function: Create a Lambda function named
xfusion-lambda-cli using the zipped file and specify Python as the runtime.
-
IAM Role: Use the IAM role named
lambda_execution_role.
Use AWS CLI which is already configured on the aws-client host.
Did you run this lab once before, copy that command at the time, and then paste it into a re-run of this lab?
I done this but it is not working.
I ask, because the 12 digit AWS account number is different every time you run the lab.
I strongly suspect that 533266994003 is not the actual account number of the lab in the screen shot, hence the cross-account error.
So please provide account no to get cross account role.
This question is not about cross-account communication. There is only ever one account in a lab.
If you run showcreds in the lab terminal, you can get the correct account number from the AWS URL
https://XXXXXXXXXXXX.signin.aws.amazon.com/console?region=us-east-1
Where XXXXXXXXXXXX is the 12 digit account number. This is the number you should use in any role ARN you use for the question.
Another way you can get the account number is to run
aws sts get-caller-identity
1 Like