createAssessmentTemplate
abstract suspend fun createAssessmentTemplate(input: CreateAssessmentTemplateRequest): CreateAssessmentTemplateResponse
Creates an assessment template for the assessment target that is specified by the ARN of the assessment target. If the service-linked role isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments.
Samples
import aws.sdk.kotlin.services.inspector.model.Attribute
fun main() {
//sampleStart
// Creates an assessment template for the assessment target that is specified by the ARN of the
// assessment target.
val resp = inspectorClient.createAssessmentTemplate {
assessmentTargetArn = "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX"
assessmentTemplateName = "ExampleAssessmentTemplate"
durationInSeconds = 180
rulesPackageArns = listOf<String>(
"arn:aws:inspector:us-west-2:758058086616:rulespackage/0-11B9DBXp"
)
userAttributesForFindings = listOf<Attribute>(
Attribute {
key = "Example"
value = "example"
}
)
}
//sampleEnd
}