Question : Select the appropriate commands which allows the user to share the AMI with his peers using the AWS EC CLI? 1. ec2-modify-image-attribute 2. ec2-share-image-account 3. Access Mostly Uused Products by 50000+ Subscribers 4. ec2-share-image-public
Correct Answer : Get Lastest Questions and Answer : Explanation: A user can share an AMI with another user / peer using the command: ec2-modify-image-attribute -l -a Sharing an AMI Using the AWS CLI
Use the modify-image-attribute command to share an AMI as shown in the following examples. To grant explicit launch permissions The following command grants launch permissions for the specified AMI to the specified AWS account. $ aws ec2 modify-image-attribute --image-id ami-2bb65342 --launch-permission "{\"Add\":[{\"UserId\":\"123456789012\"}]}"
To remove launch permissions for an account The following command removes launch permissions for the specified AMI from the specified AWS account: $ aws ec2 modify-image-attribute --image-id ami-2bb65342 "{\"Remove\":[{\"UserId\":\"123456789012\"}]}" To remove all launch permissions The following command removes all public and explicit launch permissions from the specified AMI. Note that the owner of the AMI always has launch permissions and is therefore unaffected by this command. $ aws ec2 reset-image-attribute --image-id ami-2bb65342 --attribute launchPermission Sharing an AMI Using the Amazon EC2 CLI Use the ec2-modify-image-attribute command to share an AMI as shown in the following examples.
To grant explicit launch permissions The following command grants launch permissions for the specified AMI to the specified AWS account. $ ec2-modify-image-attribute ami-2bb65342 -l -a 111122223333 To remove launch permissions for an account The following command removes launch permissions for the specified AMI from the specified AWS account: $ ec2-modify-image-attribute ami-2bb65342 -l -r 111122223333
To remove all launch permissions The following command removes all public and explicit launch permissions from the specified AMI. Note that the owner of the AMI always has launch permissions and is therefore unaffected by this command. $ ec2-reset-image-attribute ami-2bb65342 -l
Question : You have launched an EC instance and installed a website with domain "www.AcmeShell.com" with the Apache webserver. The webserver is running however , you are not able to access the website from the internet. What can be the possible reason for this failure? 1. The Apache website cannot be accessed from the internet. 2. The instance is not configured with the proper key-pairs. 3. Access Mostly Uused Products by 50000+ Subscribers 4. Instance is not configured with an elastic IP.
Correct Answer : Get Lastest Questions and Answer : Explanation: A security group acts as a virtual firewall that controls the traffic for one or more instances. When you launch an instance, you associate one or more security groups with the instance. You add rules to each security group that allow traffic to or from its associated instances. You can modify the rules for a security group at any time; the new rules are automatically applied to all instances that are associated with the security group. When we decide whether to allow traffic to reach an instance, we evaluate all the rules from all the security groups that are associated with the instance.In Amazon Web Services, when a user has configured an instance with Apache, the user needs to ensure that the ports in the security group are opened as configured in Apache config. E.g. If Apache is running on port 80, the user should open port 80 in the security group. Security Groups for EC2-Classic
If you're using EC2-Classic, you must use security groups created specifically for EC2-Classic. When you launch an instance in EC2-Classic, you must specify a security group in the same region as the instance. You can't specify a security group that you created for a VPC when you launch an instance in EC2-Classic.
After you launch an instance in EC2-Classic, you can't change its security groups. However, you can add rules to or remove rules from a security group, and those changes are automatically applied to all instances that are associated with the security group.
Note : In EC2-Classic, you can associate an instance with up to 500 security groups and add up to 100 rules to a security group. Security Groups for EC2-VPC
If you're using EC2-VPC, you must use security groups created specifically for your VPC. When you launch an instance in a VPC, you must specify a security group for that VPC. You can't specify a security group that you created for EC2-Classic when you launch an instance in a VPC.
After you launch an instance in a VPC, you can change its security groups. You can also change the rules of a security group, and those changes are automatically applied to all instances that are associated with the security group.
Note : In EC2-VPC, you can associate a network interface with up to 5 security groups and add up to 50 rules to a security group.
When you specify a security group for a nondefault VPC to the CLI or the API actions, you must use the security group ID and not the security group name to identify the security group. Security groups for EC2-VPC have additional capabilities that aren't supported by security groups for EC2-Classic. For more information about security groups for EC2-VPC, see Security Groups for Your VPC in the Amazon VPC User Guide. Security Group Rules
The rules of a security group control the inbound traffic that's allowed to reach the instances that are associated with the security group and the outbound traffic that's allowed to leave them. By default, security groups allow all outbound traffic. You can add and remove rules at any time. Your changes are automatically applied to the instances associated with the security group after a short period. You can either edit an existing rule in a security group, or delete it and add a new rule. You can copy the rules from an existing security group to a new security group. You can't change the outbound rules for EC2-Classic. Security group rules are always permissive; you can't create rules that deny access.
Question : You have created a bucket called "hadoopexam" and you are trying to find the state of an S bucket with respect to versioning. Which of the below mentioned states AWS will not return when queried? 1. versioning-suspended 2. versioning-enabled 3. Access Mostly Uused Products by 50000+ Subscribers 4. unversioned
Explanation: Versioning is a means of keeping multiple variants of an object in the same bucket. You can use versioning to preserve, retrieve, and restore every version of every object stored in your Amazon S3 bucket. With versioning, you can easily recover from both unintended user actions and application failures.
In one bucket, for example, you can have two objects with the same key, but different version IDs, such as photo.gif (version 111111) and photo.gif (version 121212). S3 buckets can be in one of the three states: unversioned (the default), versioning-enabled or versioning-suspended. The bucket owner can configure the versioning state of a bucket. The versioning state applies to all (never some) of the objects in that bucket. The first time owner enables a bucket for versioning, objects in it are thereafter always versioned and given a unique version ID. Versioning-enabled buckets enable you to recover objects from accidental deletion or overwrite. For example:
If you delete an object, instead of removing it permanently, Amazon S3 inserts a delete marker, which becomes the current object version. You can always restore the previous version. For more information, see Deleting Object Versions.
If you overwrite an object, it results in a new object version in the bucket. You can always restore the previous version.
Buckets can be in one of three states: unversioned (the default), versioning-enabled, or versioning-suspended.
Important
Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
The versioning state applies to all (never some) of the objects in that bucket. The first time you enable a bucket for versioning, objects in it are thereafter always versioned and given a unique version ID. Note the following:
Objects stored in your bucket before you set the versioning state have a version ID of null. When you enable versioning, existing objects in your bucket do not change. What changes is how Amazon S3 handles the objects in future requests.
The bucket owner (or any user with appropriate permissions) can suspend versioning to stop accruing object versions. When you suspend versioning, existing objects in your bucket do not change. What changes is how Amazon S3 handles objects in future requests.