Questions From Udemy I Flashcards
In addition to regular sign-in credentials, AWS supports Multi-Factor Authentication (MFA) for accounts with privileged access.
There are 4 ways to use MFA but only one is not available for the root user
- Virtual MFA devices (A software app that runs on a phone)
- U2F security key (A device that you plug into a USB port on your computer)
- Hardware MFA device (A hardware device that generates a six-digit numeric code based upon a time-synchronized one-time password algorithm)
- SMS text message-based MFA (A type of MFA in which the IAM user settings include the phone number of the user’s SMS-compatible mobile device)
- You cannot use this type of MFA with the AWS account root user**
Trust policies define which principal entities (accounts, users, roles, and federated users) can assume the role. An IAM role is both an identity and a resource that supports resource-based policies. For this reason, you must attach both a trust policy and an identity-based policy to an IAM role. The IAM service supports only one type of resource-based policy called a role trust policy, which is attached to an IAM role.
There are 6 Policy types in the answer
Identity-based policies – Attach managed and inline policies to IAM identities (users, groups to which users belong, or roles). Identity-based policies grant permissions to an identity.
Resource-based policies – Attach inline policies to resources. The most common examples of resource-based policies are Amazon S3 bucket policies and IAM role trust policies. Resource-based policies grant permissions to the principal that is specified in the policy. Principals can be in the same account as the resource or in other accounts. Permissions boundaries – Use a managed policy as the permissions boundary for an IAM entity (user or role). That policy defines the maximum permissions that the identity-based policies can grant to an entity, but does not grant permissions. Permissions boundaries do not define the maximum permissions that a resource-based policy can grant to an entity. Organizations SCPs – Use an AWS Organizations service control policy (SCP) to define the maximum permissions for account members of an organization or organizational unit (OU). SCPs limit permissions that identity-based policies or resource-based policies grant to entities (users or roles) within the account, but do not grant permissions. Access control lists (ACLs) – Use ACLs to control which principals in other accounts can access the resource to which the ACL is attached. ACLs are similar to resource-based policies, although they are the only policy type that does not use the JSON policy document structure. ACLs are cross-account permissions policies that grant permissions to the specified principal. ACLs cannot grant permissions to entities within the same account. Session policies – Pass advanced session policies when you use the AWS CLI or AWS API to assume a role or a federated user. Session policies limit the permissions that the role or user's identity-based policies grant to the session. Session policies limit permissions for a created session, but do not grant permissions. For more information, see Session Policies.
A company is looking at optimizing their Amazon EC2 instance costs. Few instances are sure to run for a few years, but the instance type might change based on business requirements.
Which EC2 instance purchasing option should they opt to meet the reduced cost criteria?
Whate are some Instance purchasing options, there are 7 types
Anser: Convertible Reserved instances - A Convertible Reserved Instance can be exchanged during the term for another Convertible Reserved Instance with new attributes including instance family, instance type, platform, scope, or tenancy. This is the best fit for the current requirement.
https://image.slidesharecdn.com/venhtue1530win301-161226230140/95/aws-reinvent-2016-bring-microsoft-applications-to-aws-to-save-money-and-stay-license-compliant-using-powershell-windows-kms-and-dedicated-hosts-win301-15-638.jpg?cb=1482793363
Types:
On-Demand Instances – Pay, by the second, for the instances that you launch. Savings Plans – Reduce your Amazon EC2 costs by making a commitment to a consistent amount of usage, in USD per hour, for a term of 1 or 3 years. Reserved Instances – Reduce your Amazon EC2 costs by making a commitment to a consistent instance configuration, including instance type and Region, for a term of 1 or 3 years. The offering class of a Reserved Instance is either Standard or Convertible. A Standard Reserved Instance provides a more significant discount than a Convertible Reserved Instance, but you can't exchange a Standard Reserved Instance. You can exchange Convertible Reserved Instances. You can modify Standard and Convertible Reserved Instances. Spot Instances – Request unused EC2 instances, which can reduce your Amazon EC2 costs significantly. Dedicated Hosts – Pay for a physical host that is fully dedicated to running your instances, and bring your existing per-socket, per-core, or per-VM software licenses to reduce costs. Dedicated Instances – Pay, by the hour, for instances that run on single-tenant hardware. Capacity Reservations – Reserve capacity for your EC2 instances in a specific Availability Zone for any duration.
A firm runs its technology operations on a fleet of Amazon EC2 instances. The firm needs a certain software to be available on the instances to support their daily workflows. The developer team has been told to use the user data feature of EC2 instances.
Which of the following are true about the user data EC2 configuration?
User Data is generally used to perform common automated configuration tasks and even run scripts after the instance starts. When you launch an instance in Amazon EC2, you can pass two types of user data - shell scripts and cloud-init directives. You can also pass this data into the launch wizard as plain text or as a file.
By default, scripts entered as user data are executed with root user privileges - Scripts entered as user data are executed as the root user, hence do not need the sudo command in the script. Any files you create will be owned by root; if you need non-root users to have file access, you should modify the permissions accordingly in the script.
By default, user data runs only during the boot cycle when you first launch an instance - By default, user data scripts and cloud-init directives run only during the boot cycle when you first launch an instance. You can update your configuration to ensure that your user data scripts and cloud-init directives run every time you restart your instance.
Incorrect options:
The development team at an IT company would like to provision their own Docker images that can be used as input sources for CodeBuild. These images will contain cached dependencies as well as special tooling for builds that are proprietary to the company.
Which of the following services can be used to store and deploy these Docker images?
ECR
Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images. Amazon ECR is integrated with Amazon Elastic Container Service (ECS), simplifying your development to production workflow.
This section contains reference information for the AWS SAM resource and property types.
What are the 7 serverless resource type
AWS::Serverless
::Api
Creates a collection of Amazon API Gateway resources and methods that can be invoked through HTTPS endpoints
::Application
Embeds a serverless application from the AWS Serverless Application Repository or from an Amazon S3 bucket as a nested application
::Function
Creates an AWS Lambda function, an IAM execution role, and event source mappings that trigger the function.
::HttpApi
Creates an Amazon API Gateway HTTP API, which enables you to create RESTful APIs with lower latency and lower costs than REST APIs.
::LayerVersion
Creates a Lambda LayerVersion that contains library or runtime code needed by a Lambda Function.
::SimpleTable
Creates a DynamoDB table with a single attribute primary key. It is useful when data only needs to be accessed via a primary key.
::StateMachine
Creates an AWS Step Functions state machine, which you can use to orchestrate AWS Lambda functions and other AWS resources to form complex and robust workflows.
X has configured forecast-based AWS Budgets alerts for cost management. However, no alerts have been received even though the account and the budgets have been created almost three weeks ago.
What could be the issue with the AWS Budgets configuration?
AWS requires approximately 5 weeks of usage data to generate budget forecasts. If you set a budget to alert based on a forecasted amount, this budget alert isn’t triggered until you have enough historical usage information.
This allow you to map parameters one-to-one and map a family of integration response status codes (matched by a regular expression) to a single response status code
They cannot be used with proxy integration endpoints, which lack data mappings. For more information about integration types, see Choose an API Gateway API integration type.
Mapping templates
Using IAM with CodeCommit:
Git credentials, an IAM -generated user name and password pair you can use to communicate with CodeCommit repositories over HTTPS.
SSH keys, a locally generated public-private key pair that you can associate with your IAM user to communicate with CodeCommit repositories over SSH. AWS access keys, which you can use with the credential helper included with the AWS CLI to communicate with CodeCommit repositories over HTTPS.
Two things about ASG
Auto Scaling groups can span across the availability Zones of a Region
Amazon EC2 Auto Scaling attempts to distribute instances evenly between the Availability Zones that are enabled for your Auto Scaling group
X running on an EC2 instance takes about 20 seconds on average to process each X. The application picks the new job messages from an SQS queue. The development team needs to account for the use-case when X takes longer than usual so that the same X is not processed by multiple consumers.
Use ChangeMessageVisibility action to extend a message’s visibility timeout
For example, you have a message with a visibility timeout of 5 minutes. After 3 minutes, you call ChangeMessageVisibility with a timeout of 10 minutes. You can continue to call ChangeMessageVisibility to extend the visibility timeout to the maximum allowed time. If you try to extend the visibility timeout beyond the maximum, your request is rejected. So, for the given use-case, the application can set the initial visibility timeout to 1 minute and then continue to update the ChangeMessageVisibility value if required.
Which of the following security credentials can only be created by the AWS Account root user?
CloudFront Key Pairs - IAM users can’t create CloudFront key pairs. You must log in using root credentials to create key pairs.
To create signed URLs or signed cookies, you need a signer. A signer is either a trusted key group that you create in CloudFront, or an AWS account that contains a CloudFront key pair. AWS recommends that you use trusted key groups with signed URLs and signed cookies instead of using CloudFront key pairs.
The rest of the credentials can be created by any user with permissions
A developer in your company has configured a build using AWS CodeBuild. The build fails and the developer needs to quickly troubleshoot the issue to see which commands or settings located in the BuildSpec file are causing an issue.
Which approach will help them accomplish this?
Run AWS CodeBuild locally using CodeBuild Agent
AWS CodeBuild is a fully managed build service. There are no servers to provision and scale, or software to install, configure, and operate.
With the Local Build support for AWS CodeBuild, you just specify the location of your source code, choose your build settings, and CodeBuild runs build scripts for compiling, testing, and packaging your code. You can use the AWS CodeBuild agent to test and debug builds on a local machine.
By building an application on a local machine you can:
Test the integrity and contents of a buildspec file locally.
Test and build an application locally before committing.
Identify and fix errors quickly from your local development environment.
- Install Git on your local machine.
- Install and setup Docker on your local machine.
- To run the CodeBuild agent
What characteristics of an Elastic Load Balancer make it a winning choice? (Select two)
- Separate public traffic from private traffic
- Build a highly available system
You now want to ensure that the team has only the minimum permissions required to finish their work.
Which of the following will help her identify unused IAM roles and remove them without disrupting any service?
Access Advisor feature on IAM console
To help identify the unused roles, IAM reports the last-used timestamp that represents when a role was last used to make an AWS request. Your security team can use this information to identify, analyze, and then confidently remove unused roles. This helps improve the security posture of your AWS environments. Additionally, by removing unused roles, you can simplify your monitoring and auditing efforts by focusing only on roles that are in use.
A development team lead is configuring policies for his team at an IT company.
Which of the following policy types only limit permissions but cannot grant permissions (Select two)?
- AWS Organizations Service Control Policy (SCP)
- Permissions boundary
- Access control list (ACL)
- Resource-based policy
- Identity-based policy
- Permissions boundary
Permissions boundary is a managed policy that is used for an IAM entity (user or role). The policy defines the maximum permissions that the identity-based policies can grant to an entity, but does not grant permissions. - AWS Organizations Service Control Policy (SCP)
SCPs limit permissions that identity-based policies or resource-based policies grant to entities (users or roles) within the account, but do not grant permissions.
- Number of minutes you can specify in a build project for the build timeout of all related builds
- Number of minutes you can specify for the build timeout of a single build
5 to 480 (8 hours)
When do you chose latency?
If your application is hosted in multiple AWS Regions, you can improve performance for your users by serving their requests from the AWS Region that provides the lowest latency.
You have just configured and attached the IAM policy needed to access AWS Billing and Cost Management for all users under the Finance department. But, the users are unable to see AWS Billing and Cost Management service in the AWS console.
You need to activate IAM user access to the Billing and Cost Management console for all the users who need access
By default, IAM users do not have access to the AWS Billing and Cost Management console. You or your account administrator must grant users access. You can do this by activating IAM user access to the Billing and Cost Management console and attaching an IAM policy to your users. Then, you need to activate IAM user access for IAM policies to take effect. You only need to activate IAM user access once.
To enable HTTPS connections for his web application deployed on the AWS Cloud, a developer is in the process of creating server certificate.
Which AWS entities can be used to deploy SSL/TLS server certificates? (Select two)
- AWS Certificate Manager
- IAM - IAM is used as a certificate manager only when you must support HTTPS connections in a Region that is not supported by ACM. IAM securely encrypts your private keys and stores the encrypted version in IAM SSL certificate storage. IAM supports deploying server certificates in all Regions, but you must obtain your certificate from an external provider for use with AWS. You cannot upload an ACM certificate to IAM. Additionally, you cannot manage your certificates from the IAM Console.
You didn’t assig a target group to you ALB.
Which error code should he expect in his debug logs?
HTTP 503 - HTTP 503 indicates ‘Service unavailable’ error. This error in ALB is an indicator of the target groups for the load balancer having no registered targets.
What are some of the 8 Pseudo parameters ?
AWS::AccountId
Returns the AWS account ID of the account in which the stack is being created, such as 123456789012.
AWS::NotificationARNs
Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
AWS::NoValue
Removes the corresponding resource property when specified as a return value in the Fn::If intrinsic function.
For example, you can use the AWS::NoValue parameter when you want to use a snapshot for an Amazon RDS DB instance only if a snapshot ID is provided
AWS::Partition
Returns the partition that the resource is in. For standard AWS regions, the partition is aws.
AWS::Region
AWS::StackId
(arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123)
AWS::StackName
(the aws cloudformation create-stack command, such as teststack)
AWS::URLSuffix
(The suffix is typically amazonaws.com)
The team wants to analyze the incoming requests for latencies and the client’s IP address patterns.
Which feature of the Load Balancer will help collect the required information?
ALB access logs
Elastic Load Balancing provides access logs that capture detailed information about requests sent to your load balancer. Each log contains information such as the time the request was received, the client’s IP address, latencies, request paths, and server responses. You can use these access logs to analyze traffic patterns and troubleshoot issues. Access logging is an optional feature of Elastic Load Balancing that is disabled by default.
Which section of a CloudFormation template does not allow for conditions?
Parameters enable you to input custom values to your CloudFormation template each time you create or update a stack.
Conditions cannot be used within the Parameters section. After you define all your conditions, you can associate them with resources and resource properties only in the Resources and Outputs sections of a template.