Skip to content

Commit fc63624

Browse files
Add Nitro TPM support on DescribeInstanceTypes
1 parent 45b7a42 commit fc63624

File tree

8 files changed

+351
-4
lines changed

8 files changed

+351
-4
lines changed

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6150,7 +6150,7 @@
61506150
"type":"string",
61516151
"max":30,
61526152
"min":1,
6153-
"pattern":"[a-zA-Z0-9\\.\\*]+"
6153+
"pattern":"[a-zA-Z0-9\\.\\*\\-]+"
61546154
},
61556155
"AllowedInstanceTypeSet":{
61566156
"type":"list",
@@ -20884,7 +20884,7 @@
2088420884
"type":"string",
2088520885
"max":30,
2088620886
"min":1,
20887-
"pattern":"[a-zA-Z0-9\\.\\*]+"
20887+
"pattern":"[a-zA-Z0-9\\.\\*\\-]+"
2088820888
},
2088920889
"ExcludedInstanceTypeSet":{
2089020890
"type":"list",
@@ -27404,6 +27404,14 @@
2740427404
"NitroEnclavesSupport":{
2740527405
"shape":"NitroEnclavesSupport",
2740627406
"locationName":"nitroEnclavesSupport"
27407+
},
27408+
"NitroTpmSupport":{
27409+
"shape":"NitroTpmSupport",
27410+
"locationName":"nitroTpmSupport"
27411+
},
27412+
"NitroTpmInfo":{
27413+
"shape":"NitroTpmInfo",
27414+
"locationName":"nitroTpmInfo"
2740727415
}
2740827416
}
2740927417
},
@@ -33538,6 +33546,30 @@
3353833546
"supported"
3353933547
]
3354033548
},
33549+
"NitroTpmInfo":{
33550+
"type":"structure",
33551+
"members":{
33552+
"SupportedVersions":{
33553+
"shape":"NitroTpmSupportedVersionsList",
33554+
"locationName":"supportedVersions"
33555+
}
33556+
}
33557+
},
33558+
"NitroTpmSupport":{
33559+
"type":"string",
33560+
"enum":[
33561+
"unsupported",
33562+
"supported"
33563+
]
33564+
},
33565+
"NitroTpmSupportedVersionType":{"type":"string"},
33566+
"NitroTpmSupportedVersionsList":{
33567+
"type":"list",
33568+
"member":{
33569+
"shape":"NitroTpmSupportedVersionType",
33570+
"locationName":"item"
33571+
}
33572+
},
3354133573
"OccurrenceDayRequestSet":{
3354233574
"type":"list",
3354333575
"member":{

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15198,6 +15198,30 @@
1519815198
"InstanceTypeInfo$NitroEnclavesSupport": "<p>Indicates whether Nitro Enclaves is supported.</p>"
1519915199
}
1520015200
},
15201+
"NitroTpmInfo": {
15202+
"base": "<p>Describes the supported NitroTPM versions for the instance type.</p>",
15203+
"refs": {
15204+
"InstanceTypeInfo$NitroTpmInfo": "<p>Describes the supported NitroTPM versions for the instance type.</p>"
15205+
}
15206+
},
15207+
"NitroTpmSupport": {
15208+
"base": null,
15209+
"refs": {
15210+
"InstanceTypeInfo$NitroTpmSupport": "<p>Indicates whether NitroTPM is supported.</p>"
15211+
}
15212+
},
15213+
"NitroTpmSupportedVersionType": {
15214+
"base": null,
15215+
"refs": {
15216+
"NitroTpmSupportedVersionsList$member": null
15217+
}
15218+
},
15219+
"NitroTpmSupportedVersionsList": {
15220+
"base": null,
15221+
"refs": {
15222+
"NitroTpmInfo$SupportedVersions": "<p>Indicates the supported NitroTPM versions.</p>"
15223+
}
15224+
},
1520115225
"OccurrenceDayRequestSet": {
1520215226
"base": null,
1520315227
"refs": {

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6971,7 +6971,7 @@
69716971
"type":"string",
69726972
"max":30,
69736973
"min":1,
6974-
"pattern":"[a-zA-Z0-9\\.\\*]+"
6974+
"pattern":"[a-zA-Z0-9\\.\\*\\-]+"
69756975
},
69766976
"AllowedInstanceTypeSet":{
69776977
"type":"list",
@@ -27167,7 +27167,7 @@
2716727167
"type":"string",
2716827168
"max":30,
2716927169
"min":1,
27170-
"pattern":"[a-zA-Z0-9\\.\\*]+"
27170+
"pattern":"[a-zA-Z0-9\\.\\*\\-]+"
2717127171
},
2717227172
"ExcludedInstanceTypeSet":{
2717327173
"type":"list",
@@ -35422,6 +35422,16 @@
3542235422
"shape":"NitroEnclavesSupport",
3542335423
"documentation":"<p>Indicates whether Nitro Enclaves is supported.</p>",
3542435424
"locationName":"nitroEnclavesSupport"
35425+
},
35426+
"NitroTpmSupport":{
35427+
"shape":"NitroTpmSupport",
35428+
"documentation":"<p>Indicates whether NitroTPM is supported.</p>",
35429+
"locationName":"nitroTpmSupport"
35430+
},
35431+
"NitroTpmInfo":{
35432+
"shape":"NitroTpmInfo",
35433+
"documentation":"<p>Describes the supported NitroTPM versions for the instance type.</p>",
35434+
"locationName":"nitroTpmInfo"
3542535435
}
3542635436
},
3542735437
"documentation":"<p>Describes the instance type.</p>"
@@ -43666,6 +43676,32 @@
4366643676
"supported"
4366743677
]
4366843678
},
43679+
"NitroTpmInfo":{
43680+
"type":"structure",
43681+
"members":{
43682+
"SupportedVersions":{
43683+
"shape":"NitroTpmSupportedVersionsList",
43684+
"documentation":"<p>Indicates the supported NitroTPM versions.</p>",
43685+
"locationName":"supportedVersions"
43686+
}
43687+
},
43688+
"documentation":"<p>Describes the supported NitroTPM versions for the instance type.</p>"
43689+
},
43690+
"NitroTpmSupport":{
43691+
"type":"string",
43692+
"enum":[
43693+
"unsupported",
43694+
"supported"
43695+
]
43696+
},
43697+
"NitroTpmSupportedVersionType":{"type":"string"},
43698+
"NitroTpmSupportedVersionsList":{
43699+
"type":"list",
43700+
"member":{
43701+
"shape":"NitroTpmSupportedVersionType",
43702+
"locationName":"item"
43703+
}
43704+
},
4366943705
"OccurrenceDayRequestSet":{
4367043706
"type":"list",
4367143707
"member":{

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public partial class InstanceTypeInfo
5151
private MemoryInfo _memoryInfo;
5252
private NetworkInfo _networkInfo;
5353
private NitroEnclavesSupport _nitroEnclavesSupport;
54+
private NitroTpmInfo _nitroTpmInfo;
55+
private NitroTpmSupport _nitroTpmSupport;
5456
private PlacementGroupInfo _placementGroupInfo;
5557
private ProcessorInfo _processorInfo;
5658
private List<string> _supportedBootModes = new List<string>();
@@ -384,6 +386,42 @@ internal bool IsSetNitroEnclavesSupport()
384386
return this._nitroEnclavesSupport != null;
385387
}
386388

389+
/// <summary>
390+
/// Gets and sets the property NitroTpmInfo.
391+
/// <para>
392+
/// Describes the supported NitroTPM versions for the instance type.
393+
/// </para>
394+
/// </summary>
395+
public NitroTpmInfo NitroTpmInfo
396+
{
397+
get { return this._nitroTpmInfo; }
398+
set { this._nitroTpmInfo = value; }
399+
}
400+
401+
// Check to see if NitroTpmInfo property is set
402+
internal bool IsSetNitroTpmInfo()
403+
{
404+
return this._nitroTpmInfo != null;
405+
}
406+
407+
/// <summary>
408+
/// Gets and sets the property NitroTpmSupport.
409+
/// <para>
410+
/// Indicates whether NitroTPM is supported.
411+
/// </para>
412+
/// </summary>
413+
public NitroTpmSupport NitroTpmSupport
414+
{
415+
get { return this._nitroTpmSupport; }
416+
set { this._nitroTpmSupport = value; }
417+
}
418+
419+
// Check to see if NitroTpmSupport property is set
420+
internal bool IsSetNitroTpmSupport()
421+
{
422+
return this._nitroTpmSupport != null;
423+
}
424+
387425
/// <summary>
388426
/// Gets and sets the property PlacementGroupInfo.
389427
/// <para>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ public InstanceTypeInfo Unmarshall(XmlUnmarshallerContext context)
162162
unmarshalledObject.NitroEnclavesSupport = unmarshaller.Unmarshall(context);
163163
continue;
164164
}
165+
if (context.TestExpression("nitroTpmInfo", targetDepth))
166+
{
167+
var unmarshaller = NitroTpmInfoUnmarshaller.Instance;
168+
unmarshalledObject.NitroTpmInfo = unmarshaller.Unmarshall(context);
169+
continue;
170+
}
171+
if (context.TestExpression("nitroTpmSupport", targetDepth))
172+
{
173+
var unmarshaller = StringUnmarshaller.Instance;
174+
unmarshalledObject.NitroTpmSupport = unmarshaller.Unmarshall(context);
175+
continue;
176+
}
165177
if (context.TestExpression("placementGroupInfo", targetDepth))
166178
{
167179
var unmarshaller = PlacementGroupInfoUnmarshaller.Instance;
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Net;
24+
using System.Text;
25+
using System.Xml.Serialization;
26+
27+
using Amazon.EC2.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
namespace Amazon.EC2.Model.Internal.MarshallTransformations
33+
{
34+
/// <summary>
35+
/// Response Unmarshaller for NitroTpmInfo Object
36+
/// </summary>
37+
public class NitroTpmInfoUnmarshaller : IUnmarshaller<NitroTpmInfo, XmlUnmarshallerContext>, IUnmarshaller<NitroTpmInfo, JsonUnmarshallerContext>
38+
{
39+
/// <summary>
40+
/// Unmarshaller the response from the service to the response class.
41+
/// </summary>
42+
/// <param name="context"></param>
43+
/// <returns></returns>
44+
public NitroTpmInfo Unmarshall(XmlUnmarshallerContext context)
45+
{
46+
NitroTpmInfo unmarshalledObject = new NitroTpmInfo();
47+
int originalDepth = context.CurrentDepth;
48+
int targetDepth = originalDepth + 1;
49+
50+
if (context.IsStartOfDocument)
51+
targetDepth += 2;
52+
53+
while (context.ReadAtDepth(originalDepth))
54+
{
55+
if (context.IsStartElement || context.IsAttribute)
56+
{
57+
if (context.TestExpression("supportedVersions/item", targetDepth))
58+
{
59+
var unmarshaller = StringUnmarshaller.Instance;
60+
var item = unmarshaller.Unmarshall(context);
61+
unmarshalledObject.SupportedVersions.Add(item);
62+
continue;
63+
}
64+
}
65+
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
66+
{
67+
return unmarshalledObject;
68+
}
69+
}
70+
71+
return unmarshalledObject;
72+
}
73+
74+
/// <summary>
75+
/// Unmarshaller error response to exception.
76+
/// </summary>
77+
/// <param name="context"></param>
78+
/// <returns></returns>
79+
public NitroTpmInfo Unmarshall(JsonUnmarshallerContext context)
80+
{
81+
return null;
82+
}
83+
84+
85+
private static NitroTpmInfoUnmarshaller _instance = new NitroTpmInfoUnmarshaller();
86+
87+
/// <summary>
88+
/// Gets the singleton.
89+
/// </summary>
90+
public static NitroTpmInfoUnmarshaller Instance
91+
{
92+
get
93+
{
94+
return _instance;
95+
}
96+
}
97+
}
98+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
namespace Amazon.EC2.Model
30+
{
31+
/// <summary>
32+
/// Describes the supported NitroTPM versions for the instance type.
33+
/// </summary>
34+
public partial class NitroTpmInfo
35+
{
36+
private List<string> _supportedVersions = new List<string>();
37+
38+
/// <summary>
39+
/// Gets and sets the property SupportedVersions.
40+
/// <para>
41+
/// Indicates the supported NitroTPM versions.
42+
/// </para>
43+
/// </summary>
44+
public List<string> SupportedVersions
45+
{
46+
get { return this._supportedVersions; }
47+
set { this._supportedVersions = value; }
48+
}
49+
50+
// Check to see if SupportedVersions property is set
51+
internal bool IsSetSupportedVersions()
52+
{
53+
return this._supportedVersions != null && this._supportedVersions.Count > 0;
54+
}
55+
56+
}
57+
}

0 commit comments

Comments
 (0)