createCluster
inline suspend fun SnowballClient.createCluster(crossinline block: CreateClusterRequest.Builder.() -> Unit): CreateClusterResponse
Creates an empty cluster. Each cluster supports five nodes. You use the CreateJob action separately to create the jobs for each of these nodes. The cluster does not ship until these five node jobs have been created.
Samples
import aws.sdk.kotlin.services.snowball.model.JobResource
import aws.sdk.kotlin.services.snowball.model.JobState
import aws.sdk.kotlin.services.snowball.model.JobType
import aws.sdk.kotlin.services.snowball.model.KeyRange
import aws.sdk.kotlin.services.snowball.model.Notification
import aws.sdk.kotlin.services.snowball.model.S3Resource
import aws.sdk.kotlin.services.snowball.model.ShippingOption
import aws.sdk.kotlin.services.snowball.model.SnowballType
fun main() {
//sampleStart
// Creates an empty cluster. Each cluster supports five nodes. You use the CreateJob action separately
// to create the jobs for each of these nodes. The cluster does not ship until these five node jobs have
// been created.
val resp = snowballClient.createCluster {
jobType = JobType.fromValue("LOCAL_USE")
resources = JobResource {
s3Resources = listOf<S3Resource>(
S3Resource {
bucketArn = "arn:aws:s3:::MyBucket"
keyRange = KeyRange {
}
}
)
}
description = "MyCluster"
addressId = "ADID1234ab12-3eec-4eb3-9be6-9374c10eb51b"
kmsKeyArn = "arn:aws:kms:us-east-1:123456789012:key/abcd1234-12ab-34cd-56ef-123456123456"
roleArn = "arn:aws:iam::123456789012:role/snowball-import-S3-role"
snowballType = SnowballType.fromValue("EDGE")
shippingOption = ShippingOption.fromValue("SECOND_DAY")
notification = Notification {
notifyAll = false
jobStatesToNotify = listOf<JobState>(
)
}
}
//sampleEnd
}