Skip to content

Commit

Permalink
Amazon EMR now includes the ability to use a custom Amazon Linux AMI …
Browse files Browse the repository at this point in the history
…and adjustable root volume size when launching a cluster.
  • Loading branch information
sstevenkang committed Jul 20, 2017
1 parent ce00d66 commit 9aa0d95
Show file tree
Hide file tree
Showing 20 changed files with 378 additions and 138 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "1.0",
"examples": {
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
<min>0</min>
<max>10280</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.ElasticMapReduce.Model.RunJobFlowRequest.CustomAmiId</property>
<min>0</min>
<max>256</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.ElasticMapReduce.Model.RunJobFlowRequest.JobFlowRole</property>
<min>0</min>
Expand Down Expand Up @@ -119,6 +124,11 @@
<min>0</min>
<max>10280</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.ElasticMapReduce.Model.Cluster.CustomAmiId</property>
<min>0</min>
<max>256</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.ElasticMapReduce.Model.Cluster.SecurityConfiguration</property>
<min>0</min>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Amazon.ElasticMapReduce.Model
/// </para>
/// </li> </ul> <note>
/// <para>
/// In Amazon EMR releases 4.0 and greater, the only accepted parameter is the application
/// In Amazon EMR releases 4.x and later, the only accepted parameter is the application
/// name. To pass arguments to applications, you supply a configuration for each application.
/// </para>
/// </note>
Expand Down
73 changes: 65 additions & 8 deletions sdk/src/Services/ElasticMapReduce/Generated/Model/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public partial class Cluster
private string _autoScalingRole;
private bool? _autoTerminate;
private List<Configuration> _configurations = new List<Configuration>();
private string _customAmiId;
private int? _ebsRootVolumeSize;
private Ec2InstanceAttributes _ec2InstanceAttributes;
private string _id;
private InstanceCollectionType _instanceCollectionType;
Expand All @@ -44,6 +46,7 @@ public partial class Cluster
private string _name;
private int? _normalizedInstanceHours;
private string _releaseLabel;
private RepoUpgradeOnBoot _repoUpgradeOnBoot;
private string _requestedAmiVersion;
private string _runningAmiVersion;
private ScaleDownBehavior _scaleDownBehavior;
Expand Down Expand Up @@ -111,13 +114,10 @@ internal bool IsSetAutoTerminate()
}

/// <summary>
/// Gets and sets the property Configurations. <note>
/// Gets and sets the property Configurations.
/// <para>
/// Amazon EMR releases 4.x or later.
/// </para>
/// </note>
/// <para>
/// The list of Configurations supplied to the EMR cluster.
/// Applies only to Amazon EMR releases 4.x and later. The list of Configurations supplied
/// to the EMR cluster.
/// </para>
/// </summary>
public List<Configuration> Configurations
Expand All @@ -132,6 +132,44 @@ internal bool IsSetConfigurations()
return this._configurations != null && this._configurations.Count > 0;
}

/// <summary>
/// Gets and sets the property CustomAmiId.
/// <para>
/// Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed
/// Linux AMI if the cluster uses a custom AMI.
/// </para>
/// </summary>
public string CustomAmiId
{
get { return this._customAmiId; }
set { this._customAmiId = value; }
}

// Check to see if CustomAmiId property is set
internal bool IsSetCustomAmiId()
{
return this._customAmiId != null;
}

/// <summary>
/// Gets and sets the property EbsRootVolumeSize.
/// <para>
/// The size, in GiB, of the EBS root device volume of the Linux AMI that is used for
/// each EC2 instance. Available in Amazon EMR version 4.x and later.
/// </para>
/// </summary>
public int EbsRootVolumeSize
{
get { return this._ebsRootVolumeSize.GetValueOrDefault(); }
set { this._ebsRootVolumeSize = value; }
}

// Check to see if EbsRootVolumeSize property is set
internal bool IsSetEbsRootVolumeSize()
{
return this._ebsRootVolumeSize.HasValue;
}

/// <summary>
/// Gets and sets the property Ec2InstanceAttributes.
/// <para>
Expand Down Expand Up @@ -273,8 +311,7 @@ internal bool IsSetNormalizedInstanceHours()
/// <summary>
/// Gets and sets the property ReleaseLabel.
/// <para>
/// The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use
/// amiVersion instead instead of ReleaseLabel.
/// The release label for the Amazon EMR release.
/// </para>
/// </summary>
public string ReleaseLabel
Expand All @@ -289,6 +326,26 @@ internal bool IsSetReleaseLabel()
return this._releaseLabel != null;
}

/// <summary>
/// Gets and sets the property RepoUpgradeOnBoot.
/// <para>
/// Applies only when <code>CustomAmiID</code> is used. Specifies the type of updates
/// that are applied from the Amazon Linux AMI package repositories when an instance boots
/// using the AMI.
/// </para>
/// </summary>
public RepoUpgradeOnBoot RepoUpgradeOnBoot
{
get { return this._repoUpgradeOnBoot; }
set { this._repoUpgradeOnBoot = value; }
}

// Check to see if RepoUpgradeOnBoot property is set
internal bool IsSetRepoUpgradeOnBoot()
{
return this._repoUpgradeOnBoot != null;
}

/// <summary>
/// Gets and sets the property RequestedAmiVersion.
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ internal bool IsSetIamInstanceProfile()
/// <summary>
/// Gets and sets the property RequestedEc2AvailabilityZones.
/// <para>
/// Applies to clusters configured with the The list of availability zones to choose from.
/// The service will choose the availability zone with the best mix of available capacity
/// and lowest cost to launch the cluster. If you do not specify this value, the cluster
/// is launched in any availability zone that the customer account has access to.
/// Applies to clusters configured with the instance fleets option. Specifies one or more
/// Availability Zones in which to launch EC2 cluster instances when the EC2-Classic network
/// configuration is supported. Amazon EMR chooses the Availability Zone with the best
/// fit from among the list of <code>RequestedEc2AvailabilityZones</code>, and then launches
/// all cluster instances within that Availability Zone. If you do not specify this value,
/// Amazon EMR chooses the Availability Zone for you. <code>RequestedEc2SubnetIDs</code>
/// and <code>RequestedEc2AvailabilityZones</code> cannot be specified together.
/// </para>
/// </summary>
public List<string> RequestedEc2AvailabilityZones
Expand All @@ -225,10 +228,14 @@ internal bool IsSetRequestedEc2AvailabilityZones()
/// <para>
/// Applies to clusters configured with the instance fleets option. Specifies the unique
/// identifier of one or more Amazon EC2 subnets in which to launch EC2 cluster instances.
/// Amazon EMR chooses the EC2 subnet with the best performance and cost characteristics
/// from among the list of RequestedEc2SubnetIds and launches all cluster instances within
/// that subnet. If this value is not specified, and the account supports EC2-Classic
/// networks, the cluster launches instances in the EC2-Classic network and uses Requested
/// Subnets must exist within the same VPC. Amazon EMR chooses the EC2 subnet with the
/// best fit from among the list of <code>RequestedEc2SubnetIds</code>, and then launches
/// all cluster instances within that Subnet. If this value is not specified, and the
/// account and region support EC2-Classic networks, the cluster launches instances in
/// the EC2-Classic network and uses <code>RequestedEc2AvailabilityZones</code> instead
/// of this setting. If EC2-Classic is not supported, and no Subnet is specified, Amazon
/// EMR chooses the subnet for you. <code>RequestedEc2SubnetIDs</code> and <code>RequestedEc2AvailabilityZones</code>
/// cannot be specified together.
/// </para>
/// </summary>
public List<string> RequestedEc2SubnetIds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ internal bool IsSetBidPrice()
/// Gets and sets the property BidPriceAsPercentageOfOnDemandPrice.
/// <para>
/// The bid price, as a percentage of On-Demand price, for each EC2 Spot instance as defined
/// by <code>InstanceType</code>. Expressed as a number between 0 and 1000 (for example,
/// 20 specifies 20%). If neither <code>BidPrice</code> nor <code>BidPriceAsPercentageOfOnDemandPrice</code>
/// by <code>InstanceType</code>. Expressed as a number (for example, 20 specifies 20%).
/// If neither <code>BidPrice</code> nor <code>BidPriceAsPercentageOfOnDemandPrice</code>
/// is provided, <code>BidPriceAsPercentageOfOnDemandPrice</code> defaults to 100%.
/// </para>
/// </summary>
Expand Down Expand Up @@ -151,8 +151,8 @@ internal bool IsSetInstanceType()
/// <para>
/// The number of units that a provisioned instance of this type provides toward fulfilling
/// the target capacities defined in <a>InstanceFleetConfig</a>. This value is 1 for a
/// master instance fleet, and must be greater than 0 for core and task instance fleets.
///
/// master instance fleet, and must be 1 or greater for core and task instance fleets.
/// Defaults to 1 if not specified.
/// </para>
/// </summary>
public int WeightedCapacity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ public Cluster Unmarshall(JsonUnmarshallerContext context)
unmarshalledObject.Configurations = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CustomAmiId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CustomAmiId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("EbsRootVolumeSize", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.EbsRootVolumeSize = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Ec2InstanceAttributes", targetDepth))
{
var unmarshaller = Ec2InstanceAttributesUnmarshaller.Instance;
Expand Down Expand Up @@ -136,6 +148,12 @@ public Cluster Unmarshall(JsonUnmarshallerContext context)
unmarshalledObject.ReleaseLabel = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RepoUpgradeOnBoot", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RepoUpgradeOnBoot = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RequestedAmiVersion", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ public IRequest Marshall(RunJobFlowRequest publicRequest)
context.Writer.WriteArrayEnd();
}

if(publicRequest.IsSetCustomAmiId())
{
context.Writer.WritePropertyName("CustomAmiId");
context.Writer.Write(publicRequest.CustomAmiId);
}

if(publicRequest.IsSetEbsRootVolumeSize())
{
context.Writer.WritePropertyName("EbsRootVolumeSize");
context.Writer.Write(publicRequest.EbsRootVolumeSize);
}

if(publicRequest.IsSetInstances())
{
context.Writer.WritePropertyName("Instances");
Expand Down Expand Up @@ -184,6 +196,12 @@ public IRequest Marshall(RunJobFlowRequest publicRequest)
context.Writer.Write(publicRequest.ReleaseLabel);
}

if(publicRequest.IsSetRepoUpgradeOnBoot())
{
context.Writer.WritePropertyName("RepoUpgradeOnBoot");
context.Writer.Write(publicRequest.RepoUpgradeOnBoot);
}

if(publicRequest.IsSetScaleDownBehavior())
{
context.Writer.WritePropertyName("ScaleDownBehavior");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ public JobFlowDetail(string jobFlowId, string name, JobFlowExecutionStatusDetail
/// <summary>
/// Gets and sets the property AmiVersion.
/// <para>
/// The version of the AMI used to initialize Amazon EC2 instances in the job flow. For
/// a list of AMI versions currently supported by Amazon EMR, see <a href="http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported">AMI
/// Used only for version 2.x and 3.x of Amazon EMR. The version of the AMI used to initialize
/// Amazon EC2 instances in the job flow. For a list of AMI versions supported by Amazon
/// EMR, see <a href="http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported">AMI
/// Versions Supported in EMR</a> in the <i>Amazon EMR Developer Guide.</i>
/// </para>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ namespace Amazon.ElasticMapReduce.Model
{
/// <summary>
/// Container for the parameters to the ListInstances operation.
/// Provides information about the cluster instances that Amazon EMR provisions on behalf
/// of a user when it creates the cluster. For example, this operation indicates when
/// the EC2 instances reach the Ready state, when instances become available to Amazon
/// EMR to use for jobs, and the IP addresses for cluster instances, etc.
/// Provides information for all active EC2 instances and EC2 instances terminated in
/// the last 30 days, up to a maximum of 2,000. EC2 instances in any of the following
/// states are considered active: AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING.
/// </summary>
public partial class ListInstancesRequest : AmazonElasticMapReduceRequest
{
Expand Down
Loading

0 comments on commit 9aa0d95

Please sign in to comment.