Skip to content

Commit b947d44

Browse files
This release allows you to create and register AMIs while maintaining their underlying EBS snapshots within Local Zones.
1 parent 2ac65c6 commit b947d44

22 files changed

+390
-62
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>
@@ -54,6 +69,7 @@ public partial class CreateImageRequest : AmazonEC2Request
5469
private string _instanceId;
5570
private string _name;
5671
private bool? _noReboot;
72+
private SnapshotLocationEnum _snapshotLocation;
5773
private List<TagSpecification> _tagSpecifications = AWSConfigs.InitializeCollections ? new List<TagSpecification>() : null;
5874

5975
/// <summary>
@@ -209,6 +225,42 @@ internal bool IsSetNoReboot()
209225
return this._noReboot.HasValue;
210226
}
211227

228+
/// <summary>
229+
/// Gets and sets the property SnapshotLocation. <note>
230+
/// <para>
231+
/// Only supported for instances in Local Zones. If the source instance is not in a Local
232+
/// Zone, omit this parameter.
233+
/// </para>
234+
/// </note>
235+
/// <para>
236+
/// The Amazon S3 location where the snapshots will be stored.
237+
/// </para>
238+
/// <ul> <li>
239+
/// <para>
240+
/// To create local snapshots in the same Local Zone as the source instance, specify <c>local</c>.
241+
/// </para>
242+
/// </li> <li>
243+
/// <para>
244+
/// To create regional snapshots in the parent Region of the Local Zone, specify <c>regional</c>
245+
/// or omit this parameter.
246+
/// </para>
247+
/// </li> </ul>
248+
/// <para>
249+
/// Default: <c>regional</c>
250+
/// </para>
251+
/// </summary>
252+
public SnapshotLocationEnum SnapshotLocation
253+
{
254+
get { return this._snapshotLocation; }
255+
set { this._snapshotLocation = value; }
256+
}
257+
258+
// Check to see if SnapshotLocation property is set
259+
internal bool IsSetSnapshotLocation()
260+
{
261+
return this._snapshotLocation != null;
262+
}
263+
212264
/// <summary>
213265
/// Gets and sets the property TagSpecifications.
214266
/// <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
@@ -135,7 +135,7 @@ internal bool IsSetInstanceSpecification()
135135
/// </para>
136136
/// </li> <li>
137137
/// <para>
138-
/// To create a regional snapshots in the parent Region of the Local Zone, specify <c>regional</c>
138+
/// To create regional snapshots in the parent Region of the Local Zone, specify <c>regional</c>
139139
/// or omit this parameter.
140140
/// </para>
141141
/// </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
@@ -857,9 +857,10 @@ internal bool IsSetProductCodes()
857857
/// <summary>
858858
/// Gets and sets the property PublicDnsName.
859859
/// <para>
860-
/// [IPv4 only] The public DNS name assigned to the instance. This name is not available
861-
/// until the instance enters the <c>running</c> state. This name is only available if
862-
/// you've enabled DNS hostnames for your VPC.
860+
/// The public DNS name assigned to the instance. This name is not available until the
861+
/// instance enters the <c>running</c> state. This name is only available if you've enabled
862+
/// 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
863+
/// hostname type</a>.
863864
/// </para>
864865
/// </summary>
865866
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
@@ -70,6 +70,14 @@ public IRequest Marshall(CreateImageRequest publicRequest)
7070
}
7171
if(publicRequestlistValue.IsSetEbs())
7272
{
73+
if(publicRequestlistValue.Ebs.IsSetAvailabilityZone())
74+
{
75+
request.Parameters.Add("BlockDeviceMapping" + "." + publicRequestlistValueIndex + "." + "Ebs" + "." + "AvailabilityZone", StringUtils.FromString(publicRequestlistValue.Ebs.AvailabilityZone));
76+
}
77+
if(publicRequestlistValue.Ebs.IsSetAvailabilityZoneId())
78+
{
79+
request.Parameters.Add("BlockDeviceMapping" + "." + publicRequestlistValueIndex + "." + "Ebs" + "." + "AvailabilityZoneId", StringUtils.FromString(publicRequestlistValue.Ebs.AvailabilityZoneId));
80+
}
7381
if(publicRequestlistValue.Ebs.IsSetDeleteOnTermination())
7482
{
7583
request.Parameters.Add("BlockDeviceMapping" + "." + publicRequestlistValueIndex + "." + "Ebs" + "." + "DeleteOnTermination", StringUtils.FromBool(publicRequestlistValue.Ebs.DeleteOnTermination));
@@ -138,6 +146,10 @@ public IRequest Marshall(CreateImageRequest publicRequest)
138146
{
139147
request.Parameters.Add("NoReboot", StringUtils.FromBool(publicRequest.NoReboot));
140148
}
149+
if(publicRequest.IsSetSnapshotLocation())
150+
{
151+
request.Parameters.Add("SnapshotLocation", StringUtils.FromString(publicRequest.SnapshotLocation));
152+
}
141153
if(publicRequest.IsSetTagSpecifications())
142154
{
143155
int publicRequestlistValueIndex = 1;

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 = BoolUnmarshaller.Instance;

0 commit comments

Comments
 (0)