Skip to content

Commit 0525378

Browse files
Added JobLevelCostAllocationConfiguration field to enable cost allocation reporting at the job level, providing more granular visibility into EMR Serverless charges
1 parent f33f54a commit 0525378

12 files changed

+332
-3
lines changed

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.api.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@
303303
"monitoringConfiguration":{"shape":"MonitoringConfiguration"},
304304
"interactiveConfiguration":{"shape":"InteractiveConfiguration"},
305305
"schedulerConfiguration":{"shape":"SchedulerConfiguration"},
306-
"identityCenterConfiguration":{"shape":"IdentityCenterConfiguration"}
306+
"identityCenterConfiguration":{"shape":"IdentityCenterConfiguration"},
307+
"jobLevelCostAllocationConfiguration":{"shape":"JobLevelCostAllocationConfiguration"}
307308
}
308309
},
309310
"ApplicationArn":{
@@ -543,7 +544,8 @@
543544
"monitoringConfiguration":{"shape":"MonitoringConfiguration"},
544545
"interactiveConfiguration":{"shape":"InteractiveConfiguration"},
545546
"schedulerConfiguration":{"shape":"SchedulerConfiguration"},
546-
"identityCenterConfiguration":{"shape":"IdentityCenterConfigurationInput"}
547+
"identityCenterConfiguration":{"shape":"IdentityCenterConfigurationInput"},
548+
"jobLevelCostAllocationConfiguration":{"shape":"JobLevelCostAllocationConfiguration"}
547549
}
548550
},
549551
"CreateApplicationResponse":{
@@ -835,6 +837,12 @@
835837
},
836838
"union":true
837839
},
840+
"JobLevelCostAllocationConfiguration":{
841+
"type":"structure",
842+
"members":{
843+
"enabled":{"shape":"Boolean"}
844+
}
845+
},
838846
"JobRun":{
839847
"type":"structure",
840848
"required":[
@@ -1579,7 +1587,8 @@
15791587
"runtimeConfiguration":{"shape":"ConfigurationList"},
15801588
"monitoringConfiguration":{"shape":"MonitoringConfiguration"},
15811589
"schedulerConfiguration":{"shape":"SchedulerConfiguration"},
1582-
"identityCenterConfiguration":{"shape":"IdentityCenterConfigurationInput"}
1590+
"identityCenterConfiguration":{"shape":"IdentityCenterConfigurationInput"},
1591+
"jobLevelCostAllocationConfiguration":{"shape":"JobLevelCostAllocationConfiguration"}
15831592
}
15841593
},
15851594
"UpdateApplicationResponse":{

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.docs.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
"IdentityCenterConfigurationInput$userBackgroundSessionsEnabled": "<p>Enables user background sessions for this application so Livy sessions can continue running after users log out of their interactive notebook or their Identity Center sessions expire.</p>",
154154
"InteractiveConfiguration$studioEnabled": "<p>Enables you to connect an application to Amazon EMR Studio to run interactive workloads in a notebook.</p>",
155155
"InteractiveConfiguration$livyEndpointEnabled": "<p>Enables an Apache Livy endpoint that you can connect to and run interactive jobs.</p>",
156+
"JobLevelCostAllocationConfiguration$enabled": "<p>Enables job level cost allocation for the application.</p>",
156157
"ManagedPersistenceMonitoringConfiguration$enabled": "<p>Enables managed logging and defaults to true. If set to false, managed logging will be turned off.</p>"
157158
}
158159
},
@@ -484,6 +485,14 @@
484485
"StartJobRunRequest$jobDriver": "<p>The job driver for the job run.</p>"
485486
}
486487
},
488+
"JobLevelCostAllocationConfiguration": {
489+
"base": "<p>The configuration object that enables job level cost allocation.</p>",
490+
"refs": {
491+
"Application$jobLevelCostAllocationConfiguration": "<p>The configuration object that enables job level cost allocation.</p>",
492+
"CreateApplicationRequest$jobLevelCostAllocationConfiguration": "<p>The configuration object that enables job level cost allocation.</p>",
493+
"UpdateApplicationRequest$jobLevelCostAllocationConfiguration": "<p>The configuration object that enables job level cost allocation.</p>"
494+
}
495+
},
487496
"JobRun": {
488497
"base": "<p>Information about a job run. A job run is a unit of work, such as a Spark JAR, Hive query, or SparkSQL query, that you submit to an Amazon EMR Serverless application.</p>",
489498
"refs": {

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.normal.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@
385385
"identityCenterConfiguration":{
386386
"shape":"IdentityCenterConfiguration",
387387
"documentation":"<p>The IAM Identity Center configuration applied to enable trusted identity propagation.</p>"
388+
},
389+
"jobLevelCostAllocationConfiguration":{
390+
"shape":"JobLevelCostAllocationConfiguration",
391+
"documentation":"<p>The configuration object that enables job level cost allocation.</p>"
388392
}
389393
},
390394
"documentation":"<p>Information about an application. Amazon EMR Serverless uses applications to run jobs.</p>"
@@ -763,6 +767,10 @@
763767
"identityCenterConfiguration":{
764768
"shape":"IdentityCenterConfigurationInput",
765769
"documentation":"<p>The IAM Identity Center Configuration accepts the Identity Center instance parameter required to enable trusted identity propagation. This configuration allows identity propagation between integrated services and the Identity Center instance.</p>"
770+
},
771+
"jobLevelCostAllocationConfiguration":{
772+
"shape":"JobLevelCostAllocationConfiguration",
773+
"documentation":"<p>The configuration object that enables job level cost allocation.</p>"
766774
}
767775
}
768776
},
@@ -1142,6 +1150,16 @@
11421150
"documentation":"<p>The driver that the job runs on.</p>",
11431151
"union":true
11441152
},
1153+
"JobLevelCostAllocationConfiguration":{
1154+
"type":"structure",
1155+
"members":{
1156+
"enabled":{
1157+
"shape":"Boolean",
1158+
"documentation":"<p>Enables job level cost allocation for the application.</p>"
1159+
}
1160+
},
1161+
"documentation":"<p>The configuration object that enables job level cost allocation.</p>"
1162+
},
11451163
"JobRun":{
11461164
"type":"structure",
11471165
"required":[
@@ -2281,6 +2299,10 @@
22812299
"identityCenterConfiguration":{
22822300
"shape":"IdentityCenterConfigurationInput",
22832301
"documentation":"<p>Specifies the IAM Identity Center configuration used to enable or disable trusted identity propagation. When provided, this configuration determines how the application interacts with IAM Identity Center for user authentication and access control.</p>"
2302+
},
2303+
"jobLevelCostAllocationConfiguration":{
2304+
"shape":"JobLevelCostAllocationConfiguration",
2305+
"documentation":"<p>The configuration object that enables job level cost allocation.</p>"
22842306
}
22852307
}
22862308
},

sdk/src/Services/EMRServerless/Generated/Model/Application.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public partial class Application
4444
private ImageConfiguration _imageConfiguration;
4545
private Dictionary<string, InitialCapacityConfig> _initialCapacity = AWSConfigs.InitializeCollections ? new Dictionary<string, InitialCapacityConfig>() : null;
4646
private InteractiveConfiguration _interactiveConfiguration;
47+
private JobLevelCostAllocationConfiguration _jobLevelCostAllocationConfiguration;
4748
private MaximumAllowedResources _maximumCapacity;
4849
private MonitoringConfiguration _monitoringConfiguration;
4950
private string _name;
@@ -249,6 +250,24 @@ internal bool IsSetInteractiveConfiguration()
249250
return this._interactiveConfiguration != null;
250251
}
251252

253+
/// <summary>
254+
/// Gets and sets the property JobLevelCostAllocationConfiguration.
255+
/// <para>
256+
/// The configuration object that enables job level cost allocation.
257+
/// </para>
258+
/// </summary>
259+
public JobLevelCostAllocationConfiguration JobLevelCostAllocationConfiguration
260+
{
261+
get { return this._jobLevelCostAllocationConfiguration; }
262+
set { this._jobLevelCostAllocationConfiguration = value; }
263+
}
264+
265+
// Check to see if JobLevelCostAllocationConfiguration property is set
266+
internal bool IsSetJobLevelCostAllocationConfiguration()
267+
{
268+
return this._jobLevelCostAllocationConfiguration != null;
269+
}
270+
252271
/// <summary>
253272
/// Gets and sets the property MaximumCapacity.
254273
/// <para>

sdk/src/Services/EMRServerless/Generated/Model/CreateApplicationRequest.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public partial class CreateApplicationRequest : AmazonEMRServerlessRequest
4343
private ImageConfigurationInput _imageConfiguration;
4444
private Dictionary<string, InitialCapacityConfig> _initialCapacity = AWSConfigs.InitializeCollections ? new Dictionary<string, InitialCapacityConfig>() : null;
4545
private InteractiveConfiguration _interactiveConfiguration;
46+
private JobLevelCostAllocationConfiguration _jobLevelCostAllocationConfiguration;
4647
private MaximumAllowedResources _maximumCapacity;
4748
private MonitoringConfiguration _monitoringConfiguration;
4849
private string _name;
@@ -211,6 +212,24 @@ internal bool IsSetInteractiveConfiguration()
211212
return this._interactiveConfiguration != null;
212213
}
213214

215+
/// <summary>
216+
/// Gets and sets the property JobLevelCostAllocationConfiguration.
217+
/// <para>
218+
/// The configuration object that enables job level cost allocation.
219+
/// </para>
220+
/// </summary>
221+
public JobLevelCostAllocationConfiguration JobLevelCostAllocationConfiguration
222+
{
223+
get { return this._jobLevelCostAllocationConfiguration; }
224+
set { this._jobLevelCostAllocationConfiguration = value; }
225+
}
226+
227+
// Check to see if JobLevelCostAllocationConfiguration property is set
228+
internal bool IsSetJobLevelCostAllocationConfiguration()
229+
{
230+
return this._jobLevelCostAllocationConfiguration != null;
231+
}
232+
214233
/// <summary>
215234
/// Gets and sets the property MaximumCapacity.
216235
/// <para>

sdk/src/Services/EMRServerless/Generated/Model/Internal/MarshallTransformations/ApplicationUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ public Application Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8
116116
unmarshalledObject.InteractiveConfiguration = unmarshaller.Unmarshall(context, ref reader);
117117
continue;
118118
}
119+
if (context.TestExpression("jobLevelCostAllocationConfiguration", targetDepth))
120+
{
121+
var unmarshaller = JobLevelCostAllocationConfigurationUnmarshaller.Instance;
122+
unmarshalledObject.JobLevelCostAllocationConfiguration = unmarshaller.Unmarshall(context, ref reader);
123+
continue;
124+
}
119125
if (context.TestExpression("maximumCapacity", targetDepth))
120126
{
121127
var unmarshaller = MaximumAllowedResourcesUnmarshaller.Instance;

sdk/src/Services/EMRServerless/Generated/Model/Internal/MarshallTransformations/CreateApplicationRequestMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,17 @@ public IRequest Marshall(CreateApplicationRequest publicRequest)
164164
context.Writer.WriteEndObject();
165165
}
166166

167+
if(publicRequest.IsSetJobLevelCostAllocationConfiguration())
168+
{
169+
context.Writer.WritePropertyName("jobLevelCostAllocationConfiguration");
170+
context.Writer.WriteStartObject();
171+
172+
var marshaller = JobLevelCostAllocationConfigurationMarshaller.Instance;
173+
marshaller.Marshall(publicRequest.JobLevelCostAllocationConfiguration, context);
174+
175+
context.Writer.WriteEndObject();
176+
}
177+
167178
if(publicRequest.IsSetMaximumCapacity())
168179
{
169180
context.Writer.WritePropertyName("maximumCapacity");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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 emr-serverless-2021-07-13.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Text;
24+
using System.Xml.Serialization;
25+
26+
using Amazon.EMRServerless.Model;
27+
using Amazon.Runtime;
28+
using Amazon.Runtime.Internal;
29+
using Amazon.Runtime.Internal.Transform;
30+
using Amazon.Runtime.Internal.Util;
31+
#pragma warning disable CS0612,CS0618
32+
namespace Amazon.EMRServerless.Model.Internal.MarshallTransformations
33+
{
34+
/// <summary>
35+
/// JobLevelCostAllocationConfiguration Marshaller
36+
/// </summary>
37+
public class JobLevelCostAllocationConfigurationMarshaller : IRequestMarshaller<JobLevelCostAllocationConfiguration, JsonMarshallerContext>
38+
{
39+
/// <summary>
40+
/// Unmarshaller the response from the service to the response class.
41+
/// </summary>
42+
/// <param name="requestObject"></param>
43+
/// <param name="context"></param>
44+
/// <returns></returns>
45+
public void Marshall(JobLevelCostAllocationConfiguration requestObject, JsonMarshallerContext context)
46+
{
47+
if(requestObject == null)
48+
return;
49+
if(requestObject.IsSetEnabled())
50+
{
51+
context.Writer.WritePropertyName("enabled");
52+
context.Writer.WriteBooleanValue(requestObject.Enabled.Value);
53+
}
54+
55+
}
56+
57+
/// <summary>
58+
/// Singleton Marshaller.
59+
/// </summary>
60+
public readonly static JobLevelCostAllocationConfigurationMarshaller Instance = new JobLevelCostAllocationConfigurationMarshaller();
61+
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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 emr-serverless-2021-07-13.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.EMRServerless.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
using System.Text.Json;
33+
#pragma warning disable CS0612,CS0618
34+
namespace Amazon.EMRServerless.Model.Internal.MarshallTransformations
35+
{
36+
/// <summary>
37+
/// Response Unmarshaller for JobLevelCostAllocationConfiguration Object
38+
/// </summary>
39+
public class JobLevelCostAllocationConfigurationUnmarshaller : IJsonUnmarshaller<JobLevelCostAllocationConfiguration, JsonUnmarshallerContext>
40+
{
41+
/// <summary>
42+
/// Unmarshaller the response from the service to the response class.
43+
/// </summary>
44+
/// <param name="context"></param>
45+
/// <param name="reader"></param>
46+
/// <returns>The unmarshalled object</returns>
47+
public JobLevelCostAllocationConfiguration Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8JsonReader reader)
48+
{
49+
JobLevelCostAllocationConfiguration unmarshalledObject = new JobLevelCostAllocationConfiguration();
50+
if (context.IsEmptyResponse)
51+
return null;
52+
context.Read(ref reader);
53+
if (context.CurrentTokenType == JsonTokenType.Null)
54+
return null;
55+
56+
int targetDepth = context.CurrentDepth;
57+
while (context.ReadAtDepth(targetDepth, ref reader))
58+
{
59+
if (context.TestExpression("enabled", targetDepth))
60+
{
61+
var unmarshaller = NullableBoolUnmarshaller.Instance;
62+
unmarshalledObject.Enabled = unmarshaller.Unmarshall(context, ref reader);
63+
continue;
64+
}
65+
}
66+
return unmarshalledObject;
67+
}
68+
69+
70+
private static JobLevelCostAllocationConfigurationUnmarshaller _instance = new JobLevelCostAllocationConfigurationUnmarshaller();
71+
72+
/// <summary>
73+
/// Gets the singleton.
74+
/// </summary>
75+
public static JobLevelCostAllocationConfigurationUnmarshaller Instance
76+
{
77+
get
78+
{
79+
return _instance;
80+
}
81+
}
82+
}
83+
}

sdk/src/Services/EMRServerless/Generated/Model/Internal/MarshallTransformations/UpdateApplicationRequestMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ public IRequest Marshall(UpdateApplicationRequest publicRequest)
167167
context.Writer.WriteEndObject();
168168
}
169169

170+
if(publicRequest.IsSetJobLevelCostAllocationConfiguration())
171+
{
172+
context.Writer.WritePropertyName("jobLevelCostAllocationConfiguration");
173+
context.Writer.WriteStartObject();
174+
175+
var marshaller = JobLevelCostAllocationConfigurationMarshaller.Instance;
176+
marshaller.Marshall(publicRequest.JobLevelCostAllocationConfiguration, context);
177+
178+
context.Writer.WriteEndObject();
179+
}
180+
170181
if(publicRequest.IsSetMaximumCapacity())
171182
{
172183
context.Writer.WritePropertyName("maximumCapacity");

0 commit comments

Comments
 (0)