Skip to content

Commit

Permalink
This release adds an optional parameter to RegisterImage and CopyImag…
Browse files Browse the repository at this point in the history
…e APIs to support tagging AMIs at the time of creation.
  • Loading branch information
aws-sdk-dotnet-automation committed Mar 7, 2024
1 parent 7c418e6 commit 11f5aae
Show file tree
Hide file tree
Showing 17 changed files with 422 additions and 39 deletions.
12 changes: 10 additions & 2 deletions generator/ServiceModels/ec2/ec2-2016-11-15.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -10037,7 +10037,11 @@
"shape":"Boolean",
"locationName":"dryRun"
},
"CopyImageTags":{"shape":"Boolean"}
"CopyImageTags":{"shape":"Boolean"},
"TagSpecifications":{
"shape":"TagSpecificationList",
"locationName":"TagSpecification"
}
}
},
"CopyImageResult":{
Expand Down Expand Up @@ -37029,7 +37033,11 @@
"BootMode":{"shape":"BootModeValues"},
"TpmSupport":{"shape":"TpmSupportValues"},
"UefiData":{"shape":"StringType"},
"ImdsSupport":{"shape":"ImdsSupportValues"}
"ImdsSupport":{"shape":"ImdsSupportValues"},
"TagSpecifications":{
"shape":"TagSpecificationList",
"locationName":"TagSpecification"
}
}
},
"RegisterImageResult":{
Expand Down
12 changes: 7 additions & 5 deletions generator/ServiceModels/ec2/ec2-2016-11-15.docs.json

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions generator/ServiceModels/ec2/ec2-2016-11-15.normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@
},
"input":{"shape":"DescribeBundleTasksRequest"},
"output":{"shape":"DescribeBundleTasksResult"},
"documentation":"<p>Describes the specified bundle tasks or all of your bundle tasks.</p> <note> <p>Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use <code>RegisterImage</code> with the Amazon S3 bucket name and image manifest name you provided to the bundle task.</p> </note>"
"documentation":"<p>Describes the specified bundle tasks or all of your bundle tasks.</p> <note> <p>Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use <code>RegisterImage</code> with the Amazon S3 bucket name and image manifest name you provided to the bundle task.</p> </note> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>"
},
"DescribeByoipCidrs":{
"name":"DescribeByoipCidrs",
Expand Down Expand Up @@ -2593,7 +2593,7 @@
},
"input":{"shape":"DescribeImageAttributeRequest"},
"output":{"shape":"ImageAttribute"},
"documentation":"<p>Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.</p>"
"documentation":"<p>Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.</p> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>"
},
"DescribeImages":{
"name":"DescribeImages",
Expand All @@ -2603,7 +2603,7 @@
},
"input":{"shape":"DescribeImagesRequest"},
"output":{"shape":"DescribeImagesResult"},
"documentation":"<p>Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you.</p> <p>The images available to you include public images, private images that you own, and private images owned by other Amazon Web Services accounts for which you have explicit launch permissions.</p> <p>Recently deregistered images appear in the returned results for a short interval and then return empty results. After all instances that reference a deregistered AMI are terminated, specifying the ID of the image will eventually return an error indicating that the AMI ID cannot be found.</p>"
"documentation":"<p>Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you.</p> <p>The images available to you include public images, private images that you own, and private images owned by other Amazon Web Services accounts for which you have explicit launch permissions.</p> <p>Recently deregistered images appear in the returned results for a short interval and then return empty results. After all instances that reference a deregistered AMI are terminated, specifying the ID of the image will eventually return an error indicating that the AMI ID cannot be found.</p> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>"
},
"DescribeImportImageTasks":{
"name":"DescribeImportImageTasks",
Expand Down Expand Up @@ -5545,7 +5545,7 @@
},
"input":{"shape":"RegisterImageRequest"},
"output":{"shape":"RegisterImageResult"},
"documentation":"<p>Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html\">Create your own AMI</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p> <note> <p>For Amazon EBS-backed instances, <a>CreateImage</a> creates and registers the AMI in a single request, so you don't have to register the AMI yourself. We recommend that you always use <a>CreateImage</a> unless you have a specific reason to use RegisterImage.</p> </note> <p>If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.</p> <p> <b>Register a snapshot of a root device volume</b> </p> <p>You can use <code>RegisterImage</code> to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. You specify the snapshot using a block device mapping. You can't set the encryption state of the volume using the block device mapping. If the snapshot is encrypted, or encryption by default is enabled, the root volume of an instance launched from the AMI is encrypted.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#creating-launching-ami-from-snapshot\">Create a Linux AMI from a snapshot</a> and <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html\">Use encryption with Amazon EBS-backed AMIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p> <p> <b>Amazon Web Services Marketplace product codes</b> </p> <p>If any snapshots have Amazon Web Services Marketplace product codes, they are copied to the new AMI.</p> <p>Windows and some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), use the Amazon EC2 billing product code associated with an AMI to verify the subscription status for package updates. To create a new AMI for operating systems that require a billing product code, instead of registering the AMI, do the following to preserve the billing product code association:</p> <ol> <li> <p>Launch an instance from an existing AMI with that billing product code.</p> </li> <li> <p>Customize the instance.</p> </li> <li> <p>Create an AMI from the instance using <a>CreateImage</a>.</p> </li> </ol> <p>If you purchase a Reserved Instance to apply to an On-Demand Instance that was launched from an AMI with a billing product code, make sure that the Reserved Instance has the matching billing product code. If you purchase a Reserved Instance without the matching billing product code, the Reserved Instance will not be applied to the On-Demand Instance. For information about how to obtain the platform details and billing information of an AMI, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html\">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>"
"documentation":"<p>Registers an AMI. When you're creating an instance-store backed AMI, registering the AMI is the final step in the creation process. For more information about creating AMIs, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html\">Create your own AMI</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p> <note> <p>For Amazon EBS-backed instances, <a>CreateImage</a> creates and registers the AMI in a single request, so you don't have to register the AMI yourself. We recommend that you always use <a>CreateImage</a> unless you have a specific reason to use RegisterImage.</p> </note> <p>If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.</p> <p> <b>Register a snapshot of a root device volume</b> </p> <p>You can use <code>RegisterImage</code> to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume. You specify the snapshot using a block device mapping. You can't set the encryption state of the volume using the block device mapping. If the snapshot is encrypted, or encryption by default is enabled, the root volume of an instance launched from the AMI is encrypted.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#creating-launching-ami-from-snapshot\">Create a Linux AMI from a snapshot</a> and <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html\">Use encryption with Amazon EBS-backed AMIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p> <p> <b>Amazon Web Services Marketplace product codes</b> </p> <p>If any snapshots have Amazon Web Services Marketplace product codes, they are copied to the new AMI.</p> <p>Windows and some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), use the Amazon EC2 billing product code associated with an AMI to verify the subscription status for package updates. To create a new AMI for operating systems that require a billing product code, instead of registering the AMI, do the following to preserve the billing product code association:</p> <ol> <li> <p>Launch an instance from an existing AMI with that billing product code.</p> </li> <li> <p>Customize the instance.</p> </li> <li> <p>Create an AMI from the instance using <a>CreateImage</a>.</p> </li> </ol> <p>If you purchase a Reserved Instance to apply to an On-Demand Instance that was launched from an AMI with a billing product code, make sure that the Reserved Instance has the matching billing product code. If you purchase a Reserved Instance without the matching billing product code, the Reserved Instance will not be applied to the On-Demand Instance. For information about how to obtain the platform details and billing information of an AMI, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html\">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>"
},
"RegisterInstanceEventNotificationAttributes":{
"name":"RegisterInstanceEventNotificationAttributes",
Expand Down Expand Up @@ -9439,7 +9439,7 @@
"members":{
"InstanceId":{
"shape":"InstanceId",
"documentation":"<p>The ID of the instance to bundle.</p> <p>Type: String</p> <p>Default: None</p> <p>Required: Yes</p>"
"documentation":"<p>The ID of the instance to bundle.</p> <p>Default: None</p>"
},
"Storage":{
"shape":"Storage",
Expand Down Expand Up @@ -11865,6 +11865,11 @@
"CopyImageTags":{
"shape":"Boolean",
"documentation":"<p>Indicates whether to include your user-defined AMI tags when copying the AMI.</p> <p>The following tags will not be copied:</p> <ul> <li> <p>System tags (prefixed with <code>aws:</code>)</p> </li> <li> <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p> </li> </ul> <p>Default: Your user-defined AMI tags are not copied.</p>"
},
"TagSpecifications":{
"shape":"TagSpecificationList",
"documentation":"<p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p> <ul> <li> <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p> </li> <li> <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p> </li> </ul> <p>If you specify other values for <code>ResourceType</code>, the request fails.</p> <p>To tag an AMI or snapshot after it has been created, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html\">CreateTags</a>.</p>",
"locationName":"TagSpecification"
}
},
"documentation":"<p>Contains the parameters for CopyImage.</p>"
Expand Down Expand Up @@ -48130,6 +48135,11 @@
"ImdsSupport":{
"shape":"ImdsSupportValues",
"documentation":"<p>Set to <code>v2.0</code> to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more information, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration\">Configure the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p> <note> <p>If you set the value to <code>v2.0</code>, make sure that your AMI software can support IMDSv2.</p> </note>"
},
"TagSpecifications":{
"shape":"TagSpecificationList",
"documentation":"<p>The tags to apply to the AMI.</p> <p>To tag the AMI, the value for <code>ResourceType</code> must be <code>image</code>. If you specify another value for <code>ResourceType</code>, the request fails.</p> <p>To tag an AMI after it has been registered, see <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html\">CreateTags</a>.</p>",
"locationName":"TagSpecification"
}
},
"documentation":"<p>Contains the parameters for RegisterImage.</p>"
Expand Down
10 changes: 1 addition & 9 deletions sdk/src/Services/EC2/Generated/Model/BundleInstanceRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public BundleInstanceRequest() { }
/// <summary>
/// Instantiates BundleInstanceRequest with the parameterized properties
/// </summary>
/// <param name="instanceId">The ID of the instance to bundle. Type: String Default: None Required: Yes</param>
/// <param name="instanceId">The ID of the instance to bundle. Default: None</param>
/// <param name="storage">The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</param>
public BundleInstanceRequest(string instanceId, Storage storage)
{
Expand All @@ -72,16 +72,8 @@ public BundleInstanceRequest(string instanceId, Storage storage)
/// </para>
///
/// <para>
/// Type: String
/// </para>
///
/// <para>
/// Default: None
/// </para>
///
/// <para>
/// Required: Yes
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string InstanceId
Expand Down
37 changes: 37 additions & 0 deletions sdk/src/Services/EC2/Generated/Model/CopyImageRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public partial class CopyImageRequest : AmazonEC2Request
private string _name;
private string _sourceImageId;
private string _sourceRegion;
private List<TagSpecification> _tagSpecifications = new List<TagSpecification>();

/// <summary>
/// Gets and sets the property ClientToken.
Expand Down Expand Up @@ -307,5 +308,41 @@ internal bool IsSetSourceRegion()
return this._sourceRegion != null;
}

/// <summary>
/// Gets and sets the property TagSpecifications.
/// <para>
/// The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots,
/// or both.
/// </para>
/// <ul> <li>
/// <para>
/// To tag the new AMI, the value for <c>ResourceType</c> must be <c>image</c>.
/// </para>
/// </li> <li>
/// <para>
/// To tag the new snapshots, the value for <c>ResourceType</c> must be <c>snapshot</c>.
/// The same tag is applied to all the new snapshots.
/// </para>
/// </li> </ul>
/// <para>
/// If you specify other values for <c>ResourceType</c>, the request fails.
/// </para>
///
/// <para>
/// To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.
/// </para>
/// </summary>
public List<TagSpecification> TagSpecifications
{
get { return this._tagSpecifications; }
set { this._tagSpecifications = value; }
}

// Check to see if TagSpecifications property is set
internal bool IsSetTagSpecifications()
{
return this._tagSpecifications != null && this._tagSpecifications.Count > 0;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ namespace Amazon.EC2.Model
/// with the Amazon S3 bucket name and image manifest name you provided to the bundle
/// task.
/// </para>
/// </note> <note>
/// <para>
/// The order of the elements in the response, including those within nested structures,
/// might vary. Applications should not assume the elements appear in a particular order.
/// </para>
/// </note>
/// </summary>
public partial class DescribeBundleTasksRequest : AmazonEC2Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ namespace Amazon.EC2.Model
/// Container for the parameters to the DescribeImageAttribute operation.
/// Describes the specified attribute of the specified AMI. You can specify only one attribute
/// at a time.
///
/// <note>
/// <para>
/// The order of the elements in the response, including those within nested structures,
/// might vary. Applications should not assume the elements appear in a particular order.
/// </para>
/// </note>
/// </summary>
public partial class DescribeImageAttributeRequest : AmazonEC2Request
{
Expand Down
6 changes: 6 additions & 0 deletions sdk/src/Services/EC2/Generated/Model/DescribeImagesRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ namespace Amazon.EC2.Model
/// terminated, specifying the ID of the image will eventually return an error indicating
/// that the AMI ID cannot be found.
/// </para>
/// <note>
/// <para>
/// The order of the elements in the response, including those within nested structures,
/// might vary. Applications should not assume the elements appear in a particular order.
/// </para>
/// </note>
/// </summary>
public partial class DescribeImagesRequest : AmazonEC2Request
{
Expand Down
Loading

0 comments on commit 11f5aae

Please sign in to comment.