AWS Certified Developer Associate practice questions, page 14 of 18, with answer review and explanations.
Question 66
A developer needs to use the AWS CLI on an on-premises development server temporarily to access AWS services while performing maintenance. The developer needs to authenticate to AWS with their identity for several hours. What is the MOST secure way to call AWS CLI commands with the developer's IAM identity?
Specify the developer's IAM access key ID and secret access key as parameters for each CLI command
Run the aws configure CLI command. Provide the developer's IAM access key ID and secret access key.
Specify the developer's IAM profile as a parameter for each CLI command.
Run the get-session-token CLI command with the developer's IAM user. Use the returned credentials to call the CLI
Question 67
An AWS Lambda function accesses two Amazon DynamoDB tables. A developer wants to improve the performance of the Lambda function by identifying bottlenecks in the function. How can the developer inspect the timing of the DynamoDB API calls?
Add DynamoDB as an event source to the Lambda function. View the performance with Amazon CloudWatch metrics
Place an Application Load Balancer (ALB) in front of the two DynamoDB tables. Inspect the ALB logs
Limit Lambda to no more than five concurrent invocations. Monitor from the Lambda console.
Enable AWS X-Ray tracing for the function. View the traces from the X-Ray service.
Question 68
A developer deployed an application to an Amazon EC2 instance. The application needs to know the public IPv4 address of the instance. How can the application find this information?
Query the instance metadata from http://169.254.169.254/latest/meta-data/.
Query the instance user data from http://169.254.169.254/latest/user-data/.
Query the Amazon Machine Image (AMI) information from http://169.254 169.254/latest/meta-data/ami/.
Check the hosts file of the operating system.
Question 69
A developer is designing an AWS Lambda function to perform a maintenance activity. The developer will use Amazon EventBridge (Amazon CloudWatch Events) to invoke the function on an hourly schedule. The developer wants the function to log information at different levels of detail according to the value of a log level variable. The developer must design the function so that the log level can be set without requiring a change to the function code. Which solution will meet these requirements?
Add a custom log level parameter for the Lambda function. Set the parameter by using the Lambda console
Set the log level in a Lambda environment variable
Set the log level in the Amazon CloudWatch Logs console.
Add a custom log level parameter for the Lambda function. Set the parameter by using the AWS CLI.
Question 70
A developer is creating a serverless application that uses an AWS Lambda function The developer will use AWS CloudFormation to deploy the application The application will write logs to Amazon CloudWatch Logs. The developer has created a log group in a CloudFormation template for the application to use. The developer needs to modify the CloudFormation template to make the name of the log group available to the application at runtime. Which solution will meet this requirement?
Use the AWS::Include transform in CloudFormation to provide the log group's name to the application.
Pass the log group's name to the application in the user data section of the CloudFormation template
Use the CloudFormation template's Mappings section to specify the log group's name for the application.
Pass the log group's Amazon Resource Name (ARN) as an environment variable to the Lambda function.