Question 37:
You are a software engineer and are creating a new web service in AWS. The service is about daily schedules where end users can configure and fetch. It contains an AngularJs front end that deals with data in a DynamoDB table called "UserScheduleData" with read and write permissions. You plan to use API gateway and Lambda to handle the backend service. During development, you also need to do integration testings frequently using curl for the API endpoints. You have created a role “ScheduleRoleLambda” for the Lambda itself. What below options should you perform to ensure that the Lambda contains the necessary permissions in the service role? (Select TWO).
Answer options:
A.AWSXrayWriteOnlyAccess policy is needed for “ScheduleRoleLambda” so that a segment record with details about the function invocation and execution can be saved for tracking and debug purpose. B.“ScheduleRoleLambda” should have a policy for CloudWatch Logs including CreateLogGroup, CreateLogStream and PutLogEvents. C.Invoke permissions are needed to the permissions policy associated with your Lambda function so that the API Gateway can call the lambda function. D.“sns:publish” allow inline policy should be added into “ScheduleRoleLambda” for error handlings. For example, when exception appears, the message can be put into a dead letter queue via SNS publish. E.“ScheduleRoleLambda” should contain an inline policy to allow DynamoDb access. The resource should be “*” and the action should contain "dynamodb:FetchItem", "dynamodb:PutItem" and "dynamodb:Query". F.An IAM policy to allow DynamoDb access is needed for “ScheduleRoleLambda”. The resource should be the arn of “UserScheduleData” and the actions should contain "dynamodb:GetItem" and "dynamodb:PutItem".