- What's the command-line command to create an IAM role for an AWS Lambda function?
Answer: Create an IAM role with the below command; it allows Lambda function to call AWS services under your account:
aws iam create-role ROLE_NAME --assume-role-policy-document file://assume-role-lambda.json
The assume-role-lambda.json file contains the following:
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"AWS":"*"
},
"Action":"sts:AssumeRole"
}
]
}
- What's the command-line command to create a new S3 bucket in the Virginia region (us-east-1) and upload a Lambda deployment package to it?
Answer: The following command can be used to create an S3 bucket:
aws s3 mb s3://BUCKET_NAME...