Skip to content

Commit

Permalink
SageMaker Ground Truth now supports Virtual Private Cloud. Customers …
Browse files Browse the repository at this point in the history
…can launch labeling jobs and access to their private workforce in VPC mode.
  • Loading branch information
aws-sdk-dotnet-automation committed Jun 23, 2022
1 parent 0ff327e commit 12a6e3f
Show file tree
Hide file tree
Showing 34 changed files with 1,206 additions and 64 deletions.
90 changes: 85 additions & 5 deletions generator/ServiceModels/sagemaker/sagemaker-2017-07-24.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2762,7 +2762,10 @@
"requestUri":"/"
},
"input":{"shape":"UpdateWorkforceRequest"},
"output":{"shape":"UpdateWorkforceResponse"}
"output":{"shape":"UpdateWorkforceResponse"},
"errors":[
{"shape":"ConflictException"}
]
},
"UpdateWorkteam":{
"name":"UpdateWorkteam",
Expand Down Expand Up @@ -5580,7 +5583,8 @@
"OidcConfig":{"shape":"OidcConfig"},
"SourceIpConfig":{"shape":"SourceIpConfig"},
"WorkforceName":{"shape":"WorkforceName"},
"Tags":{"shape":"TagList"}
"Tags":{"shape":"TagList"},
"WorkforceVpcConfig":{"shape":"WorkforceVpcConfigRequest"}
}
},
"CreateWorkforceResponse":{
Expand Down Expand Up @@ -9932,7 +9936,8 @@
"LabelingJobResourceConfig":{
"type":"structure",
"members":{
"VolumeKmsKeyId":{"shape":"KmsKeyId"}
"VolumeKmsKeyId":{"shape":"KmsKeyId"},
"VpcConfig":{"shape":"VpcConfig"}
}
},
"LabelingJobS3DataSource":{
Expand Down Expand Up @@ -16492,7 +16497,8 @@
"members":{
"WorkforceName":{"shape":"WorkforceName"},
"SourceIpConfig":{"shape":"SourceIpConfig"},
"OidcConfig":{"shape":"OidcConfig"}
"OidcConfig":{"shape":"OidcConfig"},
"WorkforceVpcConfig":{"shape":"WorkforceVpcConfigRequest"}
}
},
"UpdateWorkforceResponse":{
Expand Down Expand Up @@ -16706,20 +16712,94 @@
"SubDomain":{"shape":"String"},
"CognitoConfig":{"shape":"CognitoConfig"},
"OidcConfig":{"shape":"OidcConfigForResponse"},
"CreateDate":{"shape":"Timestamp"}
"CreateDate":{"shape":"Timestamp"},
"WorkforceVpcConfig":{"shape":"WorkforceVpcConfigResponse"},
"Status":{"shape":"WorkforceStatus"},
"FailureReason":{"shape":"WorkforceFailureReason"}
}
},
"WorkforceArn":{
"type":"string",
"max":256,
"pattern":"arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:workforce/.*"
},
"WorkforceFailureReason":{
"type":"string",
"max":1024,
"min":1,
"pattern":".+"
},
"WorkforceName":{
"type":"string",
"max":63,
"min":1,
"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9\\-]){0,62}$"
},
"WorkforceSecurityGroupId":{
"type":"string",
"max":32,
"pattern":"^sg-[0-9a-z]*$"
},
"WorkforceSecurityGroupIds":{
"type":"list",
"member":{"shape":"WorkforceSecurityGroupId"},
"max":5,
"min":1
},
"WorkforceStatus":{
"type":"string",
"enum":[
"Initializing",
"Updating",
"Deleting",
"Failed",
"Active"
]
},
"WorkforceSubnetId":{
"type":"string",
"max":32,
"pattern":"^subnet-[0-9a-z]*$"
},
"WorkforceSubnets":{
"type":"list",
"member":{"shape":"WorkforceSubnetId"},
"max":16,
"min":1
},
"WorkforceVpcConfigRequest":{
"type":"structure",
"members":{
"VpcId":{"shape":"WorkforceVpcId"},
"SecurityGroupIds":{"shape":"WorkforceSecurityGroupIds"},
"Subnets":{"shape":"WorkforceSubnets"}
}
},
"WorkforceVpcConfigResponse":{
"type":"structure",
"required":[
"VpcId",
"SecurityGroupIds",
"Subnets"
],
"members":{
"VpcId":{"shape":"WorkforceVpcId"},
"SecurityGroupIds":{"shape":"WorkforceSecurityGroupIds"},
"Subnets":{"shape":"WorkforceSubnets"},
"VpcEndpointId":{"shape":"WorkforceVpcEndpointId"}
}
},
"WorkforceVpcEndpointId":{
"type":"string",
"max":255,
"min":1,
"pattern":"^vpce-[0-9a-z]*$"
},
"WorkforceVpcId":{
"type":"string",
"max":32,
"pattern":"^vpc-[0-9a-z]*$"
},
"Workforces":{
"type":"list",
"member":{"shape":"Workforce"}
Expand Down
83 changes: 74 additions & 9 deletions generator/ServiceModels/sagemaker/sagemaker-2017-07-24.docs.json

Large diffs are not rendered by default.

138 changes: 128 additions & 10 deletions generator/ServiceModels/sagemaker/sagemaker-2017-07-24.normal.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8328,6 +8328,12 @@
<property>Amazon.SageMaker.Model.Vertex.Type</property>
<max>40</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.SageMaker.Model.Workforce.FailureReason</property>
<min>1</min>
<max>1024</max>
<pattern>.+</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.SageMaker.Model.Workforce.WorkforceArn</property>
<max>256</max>
Expand All @@ -8339,6 +8345,22 @@
<max>63</max>
<pattern>^[a-zA-Z0-9]([a-zA-Z0-9\-]){0,62}$</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.SageMaker.Model.WorkforceVpcConfigRequest.VpcId</property>
<max>32</max>
<pattern>^vpc-[0-9a-z]*$</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.SageMaker.Model.WorkforceVpcConfigResponse.VpcEndpointId</property>
<min>1</min>
<max>255</max>
<pattern>^vpce-[0-9a-z]*$</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.SageMaker.Model.WorkforceVpcConfigResponse.VpcId</property>
<max>32</max>
<pattern>^vpc-[0-9a-z]*$</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.SageMaker.Model.Workteam.Description</property>
<min>1</min>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ public partial class AutoMLDataSource
/// <para>
/// The Amazon S3 location of the input data.
/// </para>
/// <note>
/// <para>
/// The input data must be in CSV format and contain at least 500 rows.
/// </para>
/// </note>
/// </summary>
[AWSProperty(Required=true)]
public AutoMLS3DataSource S3DataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
namespace Amazon.SageMaker.Model
{
/// <summary>
/// This structure specifies how to split the data into train and test datasets. The validation
/// and training datasets must contain the same headers. The validation dataset must be
/// less than 2 GB in size.
/// This structure specifies how to split the data into train and validation datasets.
/// The validation and training datasets must contain the same headers. The validation
/// dataset must be less than 2 GB in size.
/// </summary>
public partial class AutoMLDataSplitConfig
{
Expand Down
29 changes: 29 additions & 0 deletions sdk/src/Services/SageMaker/Generated/Model/AutoMLS3DataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,35 @@ public partial class AutoMLS3DataSource
/// <para>
/// The data type.
/// </para>
///
/// <para>
/// A ManifestFile should have the format shown below:
/// </para>
///
/// <para>
/// <code>[ {"prefix": "s3://DOC-EXAMPLE-BUCKET/DOC-EXAMPLE-FOLDER/DOC-EXAMPLE-PREFIX/"},
/// </code>
/// </para>
///
/// <para>
/// <code>"DOC-EXAMPLE-RELATIVE-PATH/DOC-EXAMPLE-FOLDER/DATA-1",</code>
/// </para>
///
/// <para>
/// <code>"DOC-EXAMPLE-RELATIVE-PATH/DOC-EXAMPLE-FOLDER/DATA-2",</code>
/// </para>
///
/// <para>
/// <code>... "DOC-EXAMPLE-RELATIVE-PATH/DOC-EXAMPLE-FOLDER/DATA-N" ]</code>
/// </para>
///
/// <para>
/// An S3Prefix should have the following format:
/// </para>
///
/// <para>
/// <code>s3://DOC-EXAMPLE-BUCKET/DOC-EXAMPLE-FOLDER-OR-FILE</code>
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public AutoMLS3DataType S3DataType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ internal bool IsSetDomainId()
/// The instance type and the Amazon Resource Name (ARN) of the SageMaker image created
/// on the instance.
/// </para>
/// <note>
/// <para>
/// The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code>
/// in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code>
/// configured for the user profile or the domain. If <code>InstanceType</code> is not
/// specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code>
/// app, the <code>CreateApp</code> call fails with a request validation error.
/// </para>
/// </note>
/// </summary>
public ResourceSpec ResourceSpec
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ namespace Amazon.SageMaker.Model
///
/// <para>
/// For an example that calls this method when deploying a model to SageMaker hosting
/// services, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/ex1-deploy-model.html#ex1-deploy-model-boto">Deploy
/// the Model to Amazon SageMaker Hosting Services (Amazon Web Services SDK for Python
/// (Boto 3)).</a>
/// services, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints-deployment.html#realtime-endpoints-deployment-create-model">Create
/// a Model (Amazon Web Services SDK for Python (Boto 3)).</a>
/// </para>
///
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public partial class CreateWorkforceRequest : AmazonSageMakerRequest
private SourceIpConfig _sourceIpConfig;
private List<Tag> _tags = new List<Tag>();
private string _workforceName;
private WorkforceVpcConfigRequest _workforceVpcConfig;

/// <summary>
/// Gets and sets the property CognitoConfig.
Expand Down Expand Up @@ -165,5 +166,23 @@ internal bool IsSetWorkforceName()
return this._workforceName != null;
}

/// <summary>
/// Gets and sets the property WorkforceVpcConfig.
/// <para>
/// Use this parameter to configure a workforce using VPC.
/// </para>
/// </summary>
public WorkforceVpcConfigRequest WorkforceVpcConfig
{
get { return this._workforceVpcConfig; }
set { this._workforceVpcConfig = value; }
}

// Check to see if WorkforceVpcConfig property is set
internal bool IsSetWorkforceVpcConfig()
{
return this._workforceVpcConfig != null;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ public IRequest Marshall(CreateWorkforceRequest publicRequest)
context.Writer.Write(publicRequest.WorkforceName);
}

if(publicRequest.IsSetWorkforceVpcConfig())
{
context.Writer.WritePropertyName("WorkforceVpcConfig");
context.Writer.WriteObjectStart();

var marshaller = WorkforceVpcConfigRequestMarshaller.Instance;
marshaller.Marshall(publicRequest.WorkforceVpcConfig, context);

context.Writer.WriteObjectEnd();
}

writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ public void Marshall(LabelingJobResourceConfig requestObject, JsonMarshallerCont
context.Writer.Write(requestObject.VolumeKmsKeyId);
}

if(requestObject.IsSetVpcConfig())
{
context.Writer.WritePropertyName("VpcConfig");
context.Writer.WriteObjectStart();

var marshaller = VpcConfigMarshaller.Instance;
marshaller.Marshall(requestObject.VpcConfig, context);

context.Writer.WriteObjectEnd();
}

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public LabelingJobResourceConfig Unmarshall(JsonUnmarshallerContext context)
unmarshalledObject.VolumeKmsKeyId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("VpcConfig", targetDepth))
{
var unmarshaller = VpcConfigUnmarshaller.Instance;
unmarshalledObject.VpcConfig = unmarshaller.Unmarshall(context);
continue;
}
}

return unmarshalledObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ public IRequest Marshall(UpdateWorkforceRequest publicRequest)
context.Writer.Write(publicRequest.WorkforceName);
}

if(publicRequest.IsSetWorkforceVpcConfig())
{
context.Writer.WritePropertyName("WorkforceVpcConfig");
context.Writer.WriteObjectStart();

var marshaller = WorkforceVpcConfigRequestMarshaller.Instance;
marshaller.Marshall(publicRequest.WorkforceVpcConfig, context);

context.Writer.WriteObjectEnd();
}

writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException"))
{
return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonSageMakerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
Expand Down
Loading

0 comments on commit 12a6e3f

Please sign in to comment.