{"id":8742,"date":"2020-01-15T05:18:12","date_gmt":"2020-01-15T05:18:12","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=8742"},"modified":"2021-11-13T11:39:11","modified_gmt":"2021-11-13T11:39:11","slug":"aws-interview-questions-and-answer-part-19-2","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/aws-interview-questions-and-answer-part-19-2\/","title":{"rendered":"AWS Interview Questions and Answer Part \u2013 20"},"content":{"rendered":"\n<p><strong>Which of the following options describes Infrastructure in Code?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Script containing all needed steps to transform current state into target state.    <\/li><li>Checklist containing all steps needed to transform current state into target state manually.<\/li><li><strong>Blueprint containing target state. Tool transforming current sate into target state. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>CloudFormation allows you to <\/strong><em><strong>__<\/strong><\/em><strong> a stack.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>create, update, and delete (Ans)    <\/strong><\/li><li>create and update<\/li><li>create<\/li><\/ul>\n\n\n\n<p><strong>A minimal CloudFormation template contains:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Format Version, Description, Resources (Ans)    <\/strong><\/li><li>Resources, Inputs, Outputs<\/li><li>Resources<\/li><\/ul>\n\n\n\n<p><strong>A resource definition consists of:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Identifier, Type, Properties (Ans)    <\/strong><\/li><li>Ordinal Number, Identifier, Properties<\/li><li>Type, Properties<\/li><\/ul>\n\n\n\n<p><strong>The following resources describe\u2026<\/strong><\/p>\n\n\n\n<p>&#8220;Resources&#8221;: {<br>\n    &#8220;EC2Instance&#8221;: {<br>\n        &#8220;Type&#8221;: &#8220;AWS::EC2::Instance&#8221;,<br>\n        &#8220;Properties&#8221;: {<br>\n            &#8220;ImageId&#8221;: &#8220;ami-bff32ccc&#8221;,<br>\n            &#8220;InstanceType&#8221;: &#8220;t2.nano&#8221;<br>\n        }<br>\n    }<br>\n}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>a S3 Bucket.<\/li><li><strong>an EC2 Instance. (Ans)<\/strong><\/li><li>a RDS Database Instance.<\/li><li>an AMI.<\/li><\/ul>\n\n\n\n<p><strong>Which value is valid for the following parameter?<\/strong><\/p>\n\n\n\n<p>&#8220;Parameters&#8221;: {<br>\n    &#8220;VPC&#8221;: {<br>\n        &#8220;Description&#8221;: &#8220;The default VPC&#8221;,<br>\n        &#8220;Type&#8221;: &#8220;AWS::EC2::VPC::Id&#8221;<br>\n    }<br>\n }<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>vpc-ssh-bastion-host (Ans)    <\/strong><\/li><li>vpc-6b53320e<\/li><li>subnet-e16fa6ca<\/li><\/ul>\n\n\n\n<p><strong>Which of the following options adds the private IP address of the EC2 instance to the outputs?<\/strong><\/p>\n\n\n\n<p>{<br>\n    &#8220;Resources&#8221;: {<br>\n        &#8220;EC2Instance&#8221;: {<br>\n            &#8220;Type&#8221;: &#8220;AWS::EC2::Instance&#8221;<br>\n        },<br>\n    },<br>\n    &#8220;Outputs&#8221;: {<br>\n        &#8220;PrivateIp&#8221;: {<br>\n            &#8220;Value&#8221;: {&#8220;Fn::GetAtt&#8221;: [&#8220;EC2Instance&#8221;, &#8220;PrivateIp&#8221;]}<br>\n        }<br>\n    }<br>\n}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>{&#8220;Ref&#8221;: &#8220;EC2Instance&#8221;}    <\/li><li>{&#8220;Ref&#8221;: [&#8220;EC2Instance&#8221;, &#8220;PrivateIp&#8221;]}<\/li><li><strong>{&#8220;Fn::GetAtt&#8221;: [&#8220;EC2Instance&#8221;, &#8220;PrivateIp&#8221;]} (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>A CloudFormation template includes the following mappings section.<\/strong><\/p>\n\n\n\n<p>&#8220;Mappings&#8221;: {<br>\n    &#8220;RegionAMI&#8221;: {<br>\n        &#8220;us-east-1&#8221;: {&#8220;AmazonLinux&#8221;: &#8220;ami-8fcee4e5&#8221;, &#8220;Ubuntu&#8221;: &#8220;ami-fce3c696&#8221;},<br>\n        &#8220;eu-west-1&#8221;: {&#8220;AmazonLinux&#8221;: &#8220;ami-e1398992&#8221;, &#8220;Ubuntu&#8221;: &#8220;ami-f95ef58a&#8221;},<br>\n        &#8220;ap-northeast-1&#8221;: {&#8220;AmazonLinux&#8221;: &#8220;ami-59bdb937&#8221;, &#8220;Ubuntu&#8221;: &#8220;ami-a21529cc&#8221;}<br>\n    }<br>\n}<\/p>\n\n\n\n<p>What&#8217;s the output of the following function?<\/p>\n\n\n\n<p>{&#8220;Fn::FindInMap&#8221;: [&#8220;RegionAMI&#8221;, &#8220;eu-west-1&#8221;, &#8220;AmazonLinux&#8221;]}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>ami-e1398992 (Ans)    <\/strong><\/li><li>ami-f95ef58a<\/li><li>Nothing, the parameters are invalid.<\/li><li>ami-59bdb937<\/li><\/ul>\n\n\n\n<p><strong>A stack named webapp was created in region eu-west-1. What&#8217;s the output of the following function?<\/strong><\/p>\n\n\n\n<p>{&#8220;Fn::Select&#8221;: [&#8220;0&#8221;, {&#8220;Fn::GetAZs&#8221;: {&#8220;Ref&#8221;: &#8220;AWS::Region&#8221;}}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>az-1    <\/li><li><strong>eu-west-1a (Ans)<\/strong><\/li><li>eu-west-1<\/li><\/ul>\n\n\n\n<p><strong>CloudFormation parameters allow you to:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Add additional properties to resources without changing the template    <\/li><li>Create multiple stacks based on the same template<\/li><li><strong>Specify input for a template when creating or updating a stack (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What&#8217;s wrong with the described EC2 instance?<\/strong><\/p>\n\n\n\n<p>&#8220;EC2Instance&#8221;: {<br>\n    &#8220;Type&#8221;: &#8220;AWS::EC2::Instance&#8221;,<br>\n    &#8220;Properties&#8221;: {<br>\n        \u2026<br>\n        &#8220;UserData&#8221;: {&#8220;Fn::Join&#8221;: [&#8220;\\n&#8221;, [<br>\n            &#8220;#!\/bin\/bash -ex&#8221;,<br>\n            &#8220;yum install -y httpd&#8221;,<br>\n            &#8220;cd \/var\/www\/html&#8221;,<br>\n            &#8220;echo &#8216;Hello World!&#8217; &gt; index.html&#8221;,<br>\n            &#8220;service httpd start&#8221;<br>\n        ]]}<br>\n    }<br>\n  }<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>User Data is limited to 128 characters.    <\/li><li>There is no package called httpd.<\/li><li><strong>User Data needs to be encoded in Base64. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>A CloudFormation template is written in\u2026<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Bash Script    <\/li><li>XML<\/li><li>JavaScript<\/li><li><strong>JSON (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is true of ECS?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>ECS automatically launches a fully-managed EC2 instance for every cluster created.    <\/li><li>At the cluster level, ECS can only be managed from the browser-based console.<\/li><li>Besides for the regular AWS resources in use, ECS charges users on a per-cluster basis.<\/li><li><strong>ECS offers integration with either the ECS registry or Docker Hub images. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>You can display detailed information about an ECS cluster from the command line using\u2026<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>aws ecs clusters &#8211;list    <\/li><li>aws ecs list-clusters<\/li><li><strong>aws ecs describe-clusters (Ans)<\/strong><\/li><li>aws ecs cluster &#8211;help<\/li><\/ul>\n\n\n\n<p><strong>You can set load balancing and auto scaling for a deployment in the <\/strong><em><strong>__<\/strong><\/em><strong> configuration menu of the console.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Container (Ans)    <\/strong><\/li><li>Services<\/li><li>Cluster Update<\/li><li>Task Definitions<\/li><\/ul>\n\n\n\n<p><strong>Which of the following commands will return authentication credentials for the EC2 Container Repository service?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>aws ecr login &#8211;region     <\/li><li>aws get-login &#8211;region <\/li><li><strong>aws ecr get-login &#8211;region  (Ans)<\/strong><\/li><li>aws get-region <\/li><\/ul>\n\n\n\n<p><strong>Adding the &#8220;Amazon EC2 Container Service for EC2 Role&#8221; to your EC2 instance allows <\/strong><em><strong>_<\/strong><\/em><strong>.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>the EC2 instance to be registered within an ECS system    <\/li><li>the account root user to manage the EC2 instance<\/li><li>ECS resources to connect to the EC2 instance<\/li><li><strong>the EC2 instance to connect to ECS resources (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following files on an EC2 ECS-optimized AMI instance must be edited to permit access to Docker Hub private repositories?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\/ecs\/ecs.config    <\/li><li>\/etc\/ecs\/ecs-config<\/li><li>\/etc\/ecs-config<\/li><li><strong>\/etc\/ecs\/ecs.config (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the primary purpose of adding a tag to a Docker image?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To allow for easier visual identification once your infrastructure grows    <\/li><li><strong>To direct Docker to the appropriate remote repository (Ans)<\/strong><\/li><li>To identify the object as an image<\/li><li>To identify the image&#8217;s ownership and origin<\/li><\/ul>\n\n\n\n<p><strong>For security, the Docker website uses encryption certificates to <\/strong><em><strong>_<\/strong><\/em><strong>.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>ensure that all images uploaded to Docker Hub are free of malware    <\/li><li>secure the computers of local Docker clients<\/li><li>ensure that all &#8220;docker run&#8221; operations are valid<\/li><li><strong>secure connections between the website and clients (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the role of apache2ctl in this command?<br>    docker run -d -p 80:80 webserver \/usr\/sbin\/apache2ctl -D FOREGROUND<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>apache2ctl will check to make sure the Apache webserve software package is properly installed on a container.    <\/li><li>apache2ctl is the name of a Docker image.<\/li><li><strong>apache2tcl will run the Apache webserver software package when the container boots. (Ans)<\/strong><\/li><li>apache2ctl will launch a new Docker container as a backend server to your main container.<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_14165\"><iframe loading=\"lazy\"  id=\"_ytid_80443\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_14165\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Which of the following options describes Infrastructure in Code? Script containing all needed steps to transform current state into target state. Checklist containing all steps needed to transform current state&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5633],"tags":[],"class_list":["post-8742","post","type-post","status-publish","format-standard","hentry","category-aws"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=8742"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8742\/revisions"}],"predecessor-version":[{"id":25131,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8742\/revisions\/25131"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}