createInstance
inline suspend fun SupplyChainClient.createInstance(crossinline block: CreateInstanceRequest.Builder.() -> Unit): CreateInstanceResponse
Enables you to programmatically create an Amazon Web Services Supply Chain instance by applying KMS keys and relevant information associated with the API without using the Amazon Web Services console.
This is an asynchronous operation. Upon receiving a CreateInstance request, Amazon Web Services Supply Chain immediately returns the instance resource, instance ID, and the initializing state while simultaneously creating all required Amazon Web Services resources for an instance creation. You can use GetInstance to check the status of the instance. If the instance results in an unhealthy state, you need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.
Samples
fun main() {
//sampleStart
// Successful CreateInstance request with all input data
val resp = supplyChainClient.createInstance {
instanceName = "example instance name"
instanceDescription = "example instance description"
kmsKeyArn = "arn:aws:kms:us-west-2:123456789012:key/b14ffc39-b7d4-45ab-991a-6257a7f0d24d"
tags = mapOf<String, String>(
"tagKey1" to "tagValue1"
)
}
//sampleEnd
}
fun main() {
//sampleStart
// Successful CreateInstance request with no input data
val resp = supplyChainClient.createInstance()
//sampleEnd
}