Skip to content

Commit 2451ef9

Browse files
This release allows you to create and register AMIs while maintaining their underlying EBS snapshots within Local Zones.
1 parent 191cd2e commit 2451ef9

20 files changed

+346
-52
lines changed

generator/ServiceModels/ec2/ec2-2016-11-15.api.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12065,6 +12065,7 @@
1206512065
"shape":"TagSpecificationList",
1206612066
"locationName":"TagSpecification"
1206712067
},
12068+
"SnapshotLocation":{"shape":"SnapshotLocationEnum"},
1206812069
"DryRun":{
1206912070
"shape":"Boolean",
1207012071
"locationName":"dryRun"
@@ -23249,11 +23250,16 @@
2324923250
"shape":"String",
2325023251
"locationName":"outpostArn"
2325123252
},
23253+
"AvailabilityZone":{
23254+
"shape":"String",
23255+
"locationName":"availabilityZone"
23256+
},
2325223257
"Encrypted":{
2325323258
"shape":"Boolean",
2325423259
"locationName":"encrypted"
2325523260
},
23256-
"VolumeInitializationRate":{"shape":"Integer"}
23261+
"VolumeInitializationRate":{"shape":"Integer"},
23262+
"AvailabilityZoneId":{"shape":"String"}
2325723263
}
2325823264
},
2325923265
"EbsBlockDeviceResponse":{

generator/ServiceModels/ec2/ec2-2016-11-15.docs.json

Lines changed: 9 additions & 6 deletions
Large diffs are not rendered by default.

generator/ServiceModels/ec2/ec2-2016-11-15.normal.json

Lines changed: 19 additions & 6 deletions
Large diffs are not rendered by default.

sdk/src/Services/EC2/Generated/Model/CreateImageRequest.cs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ namespace Amazon.EC2.Model
4343
/// </para>
4444
///
4545
/// <para>
46+
/// The location of the source instance determines where you can create the snapshots
47+
/// of the AMI:
48+
/// </para>
49+
/// <ul> <li>
50+
/// <para>
51+
/// If the source instance is in a Region, you must create the snapshots in the same Region
52+
/// as the instance.
53+
/// </para>
54+
/// </li> <li>
55+
/// <para>
56+
/// If the source instance is in a Local Zone, you can create the snapshots in the same
57+
/// Local Zone or in its parent Region.
58+
/// </para>
59+
/// </li> </ul>
60+
/// <para>
4661
/// For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html">Create
4762
/// an Amazon EBS-backed AMI</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.
4863
/// </para>
@@ -55,6 +70,7 @@ public partial class CreateImageRequest : AmazonEC2Request
5570
private string _instanceId;
5671
private string _name;
5772
private bool? _noReboot;
73+
private SnapshotLocationEnum _snapshotLocation;
5874
private List<TagSpecification> _tagSpecifications = AWSConfigs.InitializeCollections ? new List<TagSpecification>() : null;
5975

6076
/// <summary>
@@ -235,6 +251,42 @@ internal bool IsSetNoReboot()
235251
return this._noReboot.HasValue;
236252
}
237253

254+
/// <summary>
255+
/// Gets and sets the property SnapshotLocation. <note>
256+
/// <para>
257+
/// Only supported for instances in Local Zones. If the source instance is not in a Local
258+
/// Zone, omit this parameter.
259+
/// </para>
260+
/// </note>
261+
/// <para>
262+
/// The Amazon S3 location where the snapshots will be stored.
263+
/// </para>
264+
/// <ul> <li>
265+
/// <para>
266+
/// To create local snapshots in the same Local Zone as the source instance, specify <c>local</c>.
267+
/// </para>
268+
/// </li> <li>
269+
/// <para>
270+
/// To create regional snapshots in the parent Region of the Local Zone, specify <c>regional</c>
271+
/// or omit this parameter.
272+
/// </para>
273+
/// </li> </ul>
274+
/// <para>
275+
/// Default: <c>regional</c>
276+
/// </para>
277+
/// </summary>
278+
public SnapshotLocationEnum SnapshotLocation
279+
{
280+
get { return this._snapshotLocation; }
281+
set { this._snapshotLocation = value; }
282+
}
283+
284+
// Check to see if SnapshotLocation property is set
285+
internal bool IsSetSnapshotLocation()
286+
{
287+
return this._snapshotLocation != null;
288+
}
289+
238290
/// <summary>
239291
/// Gets and sets the property TagSpecifications.
240292
/// <para>

sdk/src/Services/EC2/Generated/Model/CreateInstanceConnectEndpointRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ namespace Amazon.EC2.Model
3737
/// <para>
3838
/// An EC2 Instance Connect Endpoint allows you to connect to an instance, without requiring
3939
/// the instance to have a public IPv4 address. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect-Endpoint.html">Connect
40-
/// to your instances without requiring a public IPv4 address using EC2 Instance Connect
41-
/// Endpoint</a> in the <i>Amazon EC2 User Guide</i>.
40+
/// to your instances using EC2 Instance Connect Endpoint</a> in the <i>Amazon EC2 User
41+
/// Guide</i>.
4242
/// </para>
4343
/// </summary>
4444
public partial class CreateInstanceConnectEndpointRequest : AmazonEC2Request

sdk/src/Services/EC2/Generated/Model/CreateSnapshotsRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ internal bool IsSetInstanceSpecification()
156156
/// </para>
157157
/// </li> <li>
158158
/// <para>
159-
/// To create a regional snapshots in the parent Region of the Local Zone, specify <c>regional</c>
159+
/// To create regional snapshots in the parent Region of the Local Zone, specify <c>regional</c>
160160
/// or omit this parameter.
161161
/// </para>
162162
/// </li> </ul>

sdk/src/Services/EC2/Generated/Model/EbsBlockDevice.cs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ namespace Amazon.EC2.Model
3434
/// </summary>
3535
public partial class EbsBlockDevice
3636
{
37+
private string _availabilityZone;
38+
private string _availabilityZoneId;
3739
private bool? _deleteOnTermination;
3840
private bool? _encrypted;
3941
private int? _iops;
@@ -45,6 +47,63 @@ public partial class EbsBlockDevice
4547
private int? _volumeSize;
4648
private VolumeType _volumeType;
4749

50+
/// <summary>
51+
/// Gets and sets the property AvailabilityZone.
52+
/// <para>
53+
/// The Availability Zone where the EBS volume will be created (for example, <c>us-east-1a</c>).
54+
/// </para>
55+
///
56+
/// <para>
57+
/// Either <c>AvailabilityZone</c> or <c>AvailabilityZoneId</c> can be specified, but
58+
/// not both. If neither is specified, Amazon EC2 automatically selects an Availability
59+
/// Zone within the Region.
60+
/// </para>
61+
///
62+
/// <para>
63+
/// This parameter is not supported when using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>.
64+
/// </para>
65+
/// </summary>
66+
public string AvailabilityZone
67+
{
68+
get { return this._availabilityZone; }
69+
set { this._availabilityZone = value; }
70+
}
71+
72+
// Check to see if AvailabilityZone property is set
73+
internal bool IsSetAvailabilityZone()
74+
{
75+
return this._availabilityZone != null;
76+
}
77+
78+
/// <summary>
79+
/// Gets and sets the property AvailabilityZoneId.
80+
/// <para>
81+
/// The ID of the Availability Zone where the EBS volume will be created (for example,
82+
/// <c>use1-az1</c>).
83+
/// </para>
84+
///
85+
/// <para>
86+
/// Either <c>AvailabilityZone</c> or <c>AvailabilityZoneId</c> can be specified, but
87+
/// not both. If neither is specified, Amazon EC2 automatically selects an Availability
88+
/// Zone within the Region.
89+
/// </para>
90+
///
91+
/// <para>
92+
/// This parameter is not supported when using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>.
93+
/// </para>
94+
/// </summary>
95+
public string AvailabilityZoneId
96+
{
97+
get { return this._availabilityZoneId; }
98+
set { this._availabilityZoneId = value; }
99+
}
100+
101+
// Check to see if AvailabilityZoneId property is set
102+
internal bool IsSetAvailabilityZoneId()
103+
{
104+
return this._availabilityZoneId != null;
105+
}
106+
48107
/// <summary>
49108
/// Gets and sets the property DeleteOnTermination.
50109
/// <para>

sdk/src/Services/EC2/Generated/Model/Instance.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,10 @@ internal bool IsSetProductCodes()
887887
/// <summary>
888888
/// Gets and sets the property PublicDnsName.
889889
/// <para>
890-
/// [IPv4 only] The public DNS name assigned to the instance. This name is not available
891-
/// until the instance enters the <c>running</c> state. This name is only available if
892-
/// you've enabled DNS hostnames for your VPC.
890+
/// The public DNS name assigned to the instance. This name is not available until the
891+
/// instance enters the <c>running</c> state. This name is only available if you've enabled
892+
/// DNS hostnames for your VPC. The format of this name depends on the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hostname-types.html#public-hostnames">public
893+
/// hostname type</a>.
893894
/// </para>
894895
/// </summary>
895896
public string PublicDnsName

sdk/src/Services/EC2/Generated/Model/Internal/MarshallTransformations/CreateImageRequestMarshaller.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ public IRequest Marshall(CreateImageRequest publicRequest)
7474
}
7575
if(publicRequestlistValue.IsSetEbs())
7676
{
77+
if(publicRequestlistValue.Ebs.IsSetAvailabilityZone())
78+
{
79+
request.Parameters.Add("BlockDeviceMapping" + "." + publicRequestlistValueIndex + "." + "Ebs" + "." + "AvailabilityZone", StringUtils.FromString(publicRequestlistValue.Ebs.AvailabilityZone));
80+
}
81+
if(publicRequestlistValue.Ebs.IsSetAvailabilityZoneId())
82+
{
83+
request.Parameters.Add("BlockDeviceMapping" + "." + publicRequestlistValueIndex + "." + "Ebs" + "." + "AvailabilityZoneId", StringUtils.FromString(publicRequestlistValue.Ebs.AvailabilityZoneId));
84+
}
7785
if(publicRequestlistValue.Ebs.IsSetDeleteOnTermination())
7886
{
7987
request.Parameters.Add("BlockDeviceMapping" + "." + publicRequestlistValueIndex + "." + "Ebs" + "." + "DeleteOnTermination", StringUtils.FromBool(publicRequestlistValue.Ebs.DeleteOnTermination));
@@ -147,6 +155,10 @@ public IRequest Marshall(CreateImageRequest publicRequest)
147155
{
148156
request.Parameters.Add("NoReboot", StringUtils.FromBool(publicRequest.NoReboot));
149157
}
158+
if(publicRequest.IsSetSnapshotLocation())
159+
{
160+
request.Parameters.Add("SnapshotLocation", StringUtils.FromString(publicRequest.SnapshotLocation));
161+
}
150162
if(publicRequest.IsSetTagSpecifications())
151163
{
152164
if (publicRequest.TagSpecifications.Count == 0)

sdk/src/Services/EC2/Generated/Model/Internal/MarshallTransformations/EbsBlockDeviceUnmarshaller.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ public EbsBlockDevice Unmarshall(XmlUnmarshallerContext context)
5555
{
5656
if (context.IsStartElement || context.IsAttribute)
5757
{
58+
if (context.TestExpression("availabilityZone", targetDepth))
59+
{
60+
var unmarshaller = StringUnmarshaller.Instance;
61+
unmarshalledObject.AvailabilityZone = unmarshaller.Unmarshall(context);
62+
continue;
63+
}
64+
if (context.TestExpression("availabilityZoneId", targetDepth))
65+
{
66+
var unmarshaller = StringUnmarshaller.Instance;
67+
unmarshalledObject.AvailabilityZoneId = unmarshaller.Unmarshall(context);
68+
continue;
69+
}
5870
if (context.TestExpression("deleteOnTermination", targetDepth))
5971
{
6072
var unmarshaller = NullableBoolUnmarshaller.Instance;

0 commit comments

Comments
 (0)