Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Amazon EC2 Cookbook

You're reading from   Amazon EC2 Cookbook Over 40 hands-on recipes to develop and deploy real-world applications using Amazon EC2

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher Packt
ISBN-13 9781785280047
Length 194 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Selecting and Configuring Amazon EC2 Instances FREE CHAPTER 2. Configuring and Securing a Virtual Private Cloud 3. Managing AWS Resources Using AWS CloudFormation 4. Securing Access to Amazon EC2 Instances 5. Monitoring Amazon EC2 Instances 6. Using AWS Data Services 7. Accessing Other AWS Services 8. Deploying AWS Applications Index

Creating instances for AWS Marketplace

The AWS Marketplace helps customers find software from a set of third-party vendors. There is no need to set up a new billing account for another company; those bills can be paid via the AWS monthly bills. We can read reviews from other customers to help us make the most appropriate selection. We can also share or sell our AMIs with the public so that the wider community can use them.

In this recipe, we list the commands for creating AMIs for offering them to other users on AWS Marketplace.

How to do it…

Here we list the commands for creating AMIs for offering them to other users on AWS Marketplace.

Creating an AMI from EC2 instance

By running the following command, you can create the image from EC2 instance. You have to provide the instance ID, image name, and image description.

$ aws ec2 create-image 
--instance-id [InstanceId]
--name [Name] 
--description [Description]

The parameters used in this command are described as follows:

  • [InstanceId]: This option provides the EC2 instance ID
  • [Name]: This option gives the name of the image
  • [Description]: This one provides the image description

The following command creates an image of the EC2 instance with ID i-2e7dace3:

$ aws ec2 create-image 
--instance-id i-2e7dace3 
--name "WebServerImage" 
--description "Image of web server"

Making the AMI public

By running the following command, you can make your image public. You have to provide the image ID and launch permissions.

$ aws ec2 modify-image-attribute 
--image-id [ImageId] 
--launch-permission [LaunchPermission]

The parameters used in this command are described as follows:

  • [ImageId]: This option provides the image ID
  • [LaunchPermission]: This option is used to launch permissions

    Syntax:

    "{\"Add\": [{\"Group\":\"all\"}]}"

By running following command, you can make your image public.

$ aws ec2 modify-image-attribute 
--image-id ami-97e6cbc5 
--launch-permission "{\"Add\": [{\"Group\":\"all\"}]}"
You have been reading a chapter from
Amazon EC2 Cookbook
Published in: Nov 2015
Publisher: Packt
ISBN-13: 9781785280047
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime