/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Provides information about how to store model training results (model artifacts). *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class OutputDataConfig implements Serializable, Cloneable, StructuredPojo { /** *
* The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that SageMaker uses to encrypt the
* model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId
can be any of the
* following formats:
*
* // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions to
* call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the default KMS key for Amazon
* S3 for your role's account. SageMaker uses server-side encryption with KMS-managed keys for
* OutputDataConfig
. If you use a bucket policy with an s3:PutObject
permission that only
* allows objects with server-side encryption, set the condition key of s3:x-amz-server-side-encryption
* to "aws:kms"
. For more information, see KMS-Managed Encryption
* Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your CreateTrainingJob
,
* CreateTransformJob
, or CreateHyperParameterTuningJob
requests. For more information,
* see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
*
* Identifies the S3 path where you want SageMaker to store the model artifacts. For example,
* s3://bucket-name/key-name-prefix
.
*
* The model output compression type. Select None
to output an uncompressed model, recommended for
* large model outputs. Defaults to gzip.
*
* The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that SageMaker uses to encrypt the
* model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId
can be any of the
* following formats:
*
* // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions to
* call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the default KMS key for Amazon
* S3 for your role's account. SageMaker uses server-side encryption with KMS-managed keys for
* OutputDataConfig
. If you use a bucket policy with an s3:PutObject
permission that only
* allows objects with server-side encryption, set the condition key of s3:x-amz-server-side-encryption
* to "aws:kms"
. For more information, see KMS-Managed Encryption
* Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your CreateTrainingJob
,
* CreateTransformJob
, or CreateHyperParameterTuningJob
requests. For more information,
* see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
*
KmsKeyId
can
* be any of the following formats:
* * // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions
* to call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the default KMS key
* for Amazon S3 for your role's account. SageMaker uses server-side encryption with KMS-managed keys for
* OutputDataConfig
. If you use a bucket policy with an s3:PutObject
permission
* that only allows objects with server-side encryption, set the condition key of
* s3:x-amz-server-side-encryption
to "aws:kms"
. For more information, see KMS-Managed
* Encryption Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your
* CreateTrainingJob
, CreateTransformJob
, or
* CreateHyperParameterTuningJob
requests. For more information, see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that SageMaker uses to encrypt the
* model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId
can be any of the
* following formats:
*
* // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions to
* call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the default KMS key for Amazon
* S3 for your role's account. SageMaker uses server-side encryption with KMS-managed keys for
* OutputDataConfig
. If you use a bucket policy with an s3:PutObject
permission that only
* allows objects with server-side encryption, set the condition key of s3:x-amz-server-side-encryption
* to "aws:kms"
. For more information, see KMS-Managed Encryption
* Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your CreateTrainingJob
,
* CreateTransformJob
, or CreateHyperParameterTuningJob
requests. For more information,
* see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
*
KmsKeyId
can
* be any of the following formats:
* * // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include
* permissions to call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the
* default KMS key for Amazon S3 for your role's account. SageMaker uses server-side encryption with
* KMS-managed keys for OutputDataConfig
. If you use a bucket policy with an
* s3:PutObject
permission that only allows objects with server-side encryption, set the
* condition key of s3:x-amz-server-side-encryption
to "aws:kms"
. For more
* information, see KMS-Managed
* Encryption Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your
* CreateTrainingJob
, CreateTransformJob
, or
* CreateHyperParameterTuningJob
requests. For more information, see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that SageMaker uses to encrypt the
* model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId
can be any of the
* following formats:
*
* // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions to
* call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the default KMS key for Amazon
* S3 for your role's account. SageMaker uses server-side encryption with KMS-managed keys for
* OutputDataConfig
. If you use a bucket policy with an s3:PutObject
permission that only
* allows objects with server-side encryption, set the condition key of s3:x-amz-server-side-encryption
* to "aws:kms"
. For more information, see KMS-Managed Encryption
* Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your CreateTrainingJob
,
* CreateTransformJob
, or CreateHyperParameterTuningJob
requests. For more information,
* see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
*
KmsKeyId
can
* be any of the following formats:
* * // KMS Key ID *
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // Amazon Resource Name (ARN) of a KMS Key *
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
* // KMS Key Alias *
*
* "alias/ExampleAlias"
*
* // Amazon Resource Name (ARN) of a KMS Key Alias *
*
* "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"
*
* If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions
* to call kms:Encrypt
. If you don't provide a KMS key ID, SageMaker uses the default KMS key
* for Amazon S3 for your role's account. SageMaker uses server-side encryption with KMS-managed keys for
* OutputDataConfig
. If you use a bucket policy with an s3:PutObject
permission
* that only allows objects with server-side encryption, set the condition key of
* s3:x-amz-server-side-encryption
to "aws:kms"
. For more information, see KMS-Managed
* Encryption Keys in the Amazon Simple Storage Service Developer Guide.
*
* The KMS key policy must grant permission to the IAM role that you specify in your
* CreateTrainingJob
, CreateTransformJob
, or
* CreateHyperParameterTuningJob
requests. For more information, see Using Key Policies in
* Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OutputDataConfig withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
*
* Identifies the S3 path where you want SageMaker to store the model artifacts. For example,
* s3://bucket-name/key-name-prefix
.
*
s3://bucket-name/key-name-prefix
.
*/
public void setS3OutputPath(String s3OutputPath) {
this.s3OutputPath = s3OutputPath;
}
/**
*
* Identifies the S3 path where you want SageMaker to store the model artifacts. For example,
* s3://bucket-name/key-name-prefix
.
*
s3://bucket-name/key-name-prefix
.
*/
public String getS3OutputPath() {
return this.s3OutputPath;
}
/**
*
* Identifies the S3 path where you want SageMaker to store the model artifacts. For example,
* s3://bucket-name/key-name-prefix
.
*
s3://bucket-name/key-name-prefix
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OutputDataConfig withS3OutputPath(String s3OutputPath) {
setS3OutputPath(s3OutputPath);
return this;
}
/**
*
* The model output compression type. Select None
to output an uncompressed model, recommended for
* large model outputs. Defaults to gzip.
*
None
to output an uncompressed model, recommended
* for large model outputs. Defaults to gzip.
* @see OutputCompressionType
*/
public void setCompressionType(String compressionType) {
this.compressionType = compressionType;
}
/**
*
* The model output compression type. Select None
to output an uncompressed model, recommended for
* large model outputs. Defaults to gzip.
*
None
to output an uncompressed model, recommended
* for large model outputs. Defaults to gzip.
* @see OutputCompressionType
*/
public String getCompressionType() {
return this.compressionType;
}
/**
*
* The model output compression type. Select None
to output an uncompressed model, recommended for
* large model outputs. Defaults to gzip.
*
None
to output an uncompressed model, recommended
* for large model outputs. Defaults to gzip.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OutputCompressionType
*/
public OutputDataConfig withCompressionType(String compressionType) {
setCompressionType(compressionType);
return this;
}
/**
*
* The model output compression type. Select None
to output an uncompressed model, recommended for
* large model outputs. Defaults to gzip.
*
None
to output an uncompressed model, recommended
* for large model outputs. Defaults to gzip.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OutputCompressionType
*/
public OutputDataConfig withCompressionType(OutputCompressionType compressionType) {
this.compressionType = compressionType.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
if (getS3OutputPath() != null)
sb.append("S3OutputPath: ").append(getS3OutputPath()).append(",");
if (getCompressionType() != null)
sb.append("CompressionType: ").append(getCompressionType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OutputDataConfig == false)
return false;
OutputDataConfig other = (OutputDataConfig) obj;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
if (other.getS3OutputPath() == null ^ this.getS3OutputPath() == null)
return false;
if (other.getS3OutputPath() != null && other.getS3OutputPath().equals(this.getS3OutputPath()) == false)
return false;
if (other.getCompressionType() == null ^ this.getCompressionType() == null)
return false;
if (other.getCompressionType() != null && other.getCompressionType().equals(this.getCompressionType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getS3OutputPath() == null) ? 0 : getS3OutputPath().hashCode());
hashCode = prime * hashCode + ((getCompressionType() == null) ? 0 : getCompressionType().hashCode());
return hashCode;
}
@Override
public OutputDataConfig clone() {
try {
return (OutputDataConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.sagemaker.model.transform.OutputDataConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}