io.cloudshiftdev.awscdk.services.inspector.CfnAssessmentTemplate.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.inspector
import io.cloudshiftdev.awscdk.CfnResource
import io.cloudshiftdev.awscdk.IInspectable
import io.cloudshiftdev.awscdk.IResolvable
import io.cloudshiftdev.awscdk.TreeInspector
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.Any
import kotlin.Number
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import io.cloudshiftdev.constructs.Construct as CloudshiftdevConstructsConstruct
import software.constructs.Construct as SoftwareConstructsConstruct
/**
* The `AWS::Inspector::AssessmentTemplate` resource creates an Amazon Inspector assessment
* template, which specifies the Inspector assessment targets that will be evaluated by an assessment
* run and its related configurations.
*
* Example:
*
* ```
* import io.cloudshiftdev.awscdk.services.inspector.*;
* CfnAssessmentTemplate assessmentTemplate;
* Schedule.Builder.create(this, "Schedule")
* .schedule(ScheduleExpression.rate(Duration.minutes(60)))
* .target(new InspectorStartAssessmentRun(assessmentTemplate))
* .build();
* ```
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html)
*/
public open class CfnAssessmentTemplate(
cdkObject: software.amazon.awscdk.services.inspector.CfnAssessmentTemplate,
) : CfnResource(cdkObject),
IInspectable {
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: CfnAssessmentTemplateProps,
) :
this(software.amazon.awscdk.services.inspector.CfnAssessmentTemplate(scope.let(CloudshiftdevConstructsConstruct.Companion::unwrap),
id, props.let(CfnAssessmentTemplateProps.Companion::unwrap))
)
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: CfnAssessmentTemplateProps.Builder.() -> Unit,
) : this(scope, id, CfnAssessmentTemplateProps(props)
)
/**
* The ARN of the assessment target to be included in the assessment template.
*/
public open fun assessmentTargetArn(): String = unwrap(this).getAssessmentTargetArn()
/**
* The ARN of the assessment target to be included in the assessment template.
*/
public open fun assessmentTargetArn(`value`: String) {
unwrap(this).setAssessmentTargetArn(`value`)
}
/**
* The user-defined name that identifies the assessment template that you want to create.
*/
public open fun assessmentTemplateName(): String? = unwrap(this).getAssessmentTemplateName()
/**
* The user-defined name that identifies the assessment template that you want to create.
*/
public open fun assessmentTemplateName(`value`: String) {
unwrap(this).setAssessmentTemplateName(`value`)
}
/**
* The Amazon Resource Name (ARN) that specifies the assessment template that is created.
*/
public open fun attrArn(): String = unwrap(this).getAttrArn()
/**
* The duration of the assessment run in seconds.
*/
public open fun durationInSeconds(): Number = unwrap(this).getDurationInSeconds()
/**
* The duration of the assessment run in seconds.
*/
public open fun durationInSeconds(`value`: Number) {
unwrap(this).setDurationInSeconds(`value`)
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector tree inspector to collect and process attributes.
*/
public override fun inspect(inspector: TreeInspector) {
unwrap(this).inspect(inspector.let(TreeInspector.Companion::unwrap))
}
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*/
public open fun rulesPackageArns(): List = unwrap(this).getRulesPackageArns()
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*/
public open fun rulesPackageArns(`value`: List) {
unwrap(this).setRulesPackageArns(`value`)
}
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*/
public open fun rulesPackageArns(vararg `value`: String): Unit =
rulesPackageArns(`value`.toList())
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*/
public open fun userAttributesForFindings(): Any? = unwrap(this).getUserAttributesForFindings()
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*/
public open fun userAttributesForFindings(`value`: IResolvable) {
unwrap(this).setUserAttributesForFindings(`value`.let(IResolvable.Companion::unwrap))
}
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*/
public open fun userAttributesForFindings(`value`: List) {
unwrap(this).setUserAttributesForFindings(`value`.map{CdkObjectWrappers.unwrap(it)})
}
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*/
public open fun userAttributesForFindings(vararg `value`: Any): Unit =
userAttributesForFindings(`value`.toList())
/**
* A fluent builder for [io.cloudshiftdev.awscdk.services.inspector.CfnAssessmentTemplate].
*/
@CdkDslMarker
public interface Builder {
/**
* The ARN of the assessment target to be included in the assessment template.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-assessmenttargetarn)
* @param assessmentTargetArn The ARN of the assessment target to be included in the assessment
* template.
*/
public fun assessmentTargetArn(assessmentTargetArn: String)
/**
* The user-defined name that identifies the assessment template that you want to create.
*
* You can create several assessment templates for the same assessment target. The names of the
* assessment templates that correspond to a particular assessment target must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-assessmenttemplatename)
* @param assessmentTemplateName The user-defined name that identifies the assessment template
* that you want to create.
*/
public fun assessmentTemplateName(assessmentTemplateName: String)
/**
* The duration of the assessment run in seconds.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-durationinseconds)
* @param durationInSeconds The duration of the assessment run in seconds.
*/
public fun durationInSeconds(durationInSeconds: Number)
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-rulespackagearns)
* @param rulesPackageArns The ARNs of the rules packages that you want to use in the assessment
* template.
*/
public fun rulesPackageArns(rulesPackageArns: List)
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-rulespackagearns)
* @param rulesPackageArns The ARNs of the rules packages that you want to use in the assessment
* template.
*/
public fun rulesPackageArns(vararg rulesPackageArns: String)
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*
* Within an assessment template, each key must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-userattributesforfindings)
* @param userAttributesForFindings The user-defined attributes that are assigned to every
* finding that is generated by the assessment run that uses this assessment template.
*/
public fun userAttributesForFindings(userAttributesForFindings: IResolvable)
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*
* Within an assessment template, each key must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-userattributesforfindings)
* @param userAttributesForFindings The user-defined attributes that are assigned to every
* finding that is generated by the assessment run that uses this assessment template.
*/
public fun userAttributesForFindings(userAttributesForFindings: List)
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*
* Within an assessment template, each key must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-userattributesforfindings)
* @param userAttributesForFindings The user-defined attributes that are assigned to every
* finding that is generated by the assessment run that uses this assessment template.
*/
public fun userAttributesForFindings(vararg userAttributesForFindings: Any)
}
private class BuilderImpl(
scope: SoftwareConstructsConstruct,
id: String,
) : Builder {
private val cdkBuilder: software.amazon.awscdk.services.inspector.CfnAssessmentTemplate.Builder
= software.amazon.awscdk.services.inspector.CfnAssessmentTemplate.Builder.create(scope, id)
/**
* The ARN of the assessment target to be included in the assessment template.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-assessmenttargetarn)
* @param assessmentTargetArn The ARN of the assessment target to be included in the assessment
* template.
*/
override fun assessmentTargetArn(assessmentTargetArn: String) {
cdkBuilder.assessmentTargetArn(assessmentTargetArn)
}
/**
* The user-defined name that identifies the assessment template that you want to create.
*
* You can create several assessment templates for the same assessment target. The names of the
* assessment templates that correspond to a particular assessment target must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-assessmenttemplatename)
* @param assessmentTemplateName The user-defined name that identifies the assessment template
* that you want to create.
*/
override fun assessmentTemplateName(assessmentTemplateName: String) {
cdkBuilder.assessmentTemplateName(assessmentTemplateName)
}
/**
* The duration of the assessment run in seconds.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-durationinseconds)
* @param durationInSeconds The duration of the assessment run in seconds.
*/
override fun durationInSeconds(durationInSeconds: Number) {
cdkBuilder.durationInSeconds(durationInSeconds)
}
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-rulespackagearns)
* @param rulesPackageArns The ARNs of the rules packages that you want to use in the assessment
* template.
*/
override fun rulesPackageArns(rulesPackageArns: List) {
cdkBuilder.rulesPackageArns(rulesPackageArns)
}
/**
* The ARNs of the rules packages that you want to use in the assessment template.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-rulespackagearns)
* @param rulesPackageArns The ARNs of the rules packages that you want to use in the assessment
* template.
*/
override fun rulesPackageArns(vararg rulesPackageArns: String): Unit =
rulesPackageArns(rulesPackageArns.toList())
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*
* Within an assessment template, each key must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-userattributesforfindings)
* @param userAttributesForFindings The user-defined attributes that are assigned to every
* finding that is generated by the assessment run that uses this assessment template.
*/
override fun userAttributesForFindings(userAttributesForFindings: IResolvable) {
cdkBuilder.userAttributesForFindings(userAttributesForFindings.let(IResolvable.Companion::unwrap))
}
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*
* Within an assessment template, each key must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-userattributesforfindings)
* @param userAttributesForFindings The user-defined attributes that are assigned to every
* finding that is generated by the assessment run that uses this assessment template.
*/
override fun userAttributesForFindings(userAttributesForFindings: List) {
cdkBuilder.userAttributesForFindings(userAttributesForFindings.map{CdkObjectWrappers.unwrap(it)})
}
/**
* The user-defined attributes that are assigned to every finding that is generated by the
* assessment run that uses this assessment template.
*
* Within an assessment template, each key must be unique.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-inspector-assessmenttemplate.html#cfn-inspector-assessmenttemplate-userattributesforfindings)
* @param userAttributesForFindings The user-defined attributes that are assigned to every
* finding that is generated by the assessment run that uses this assessment template.
*/
override fun userAttributesForFindings(vararg userAttributesForFindings: Any): Unit =
userAttributesForFindings(userAttributesForFindings.toList())
public fun build(): software.amazon.awscdk.services.inspector.CfnAssessmentTemplate =
cdkBuilder.build()
}
public companion object {
public val CFN_RESOURCE_TYPE_NAME: String =
software.amazon.awscdk.services.inspector.CfnAssessmentTemplate.CFN_RESOURCE_TYPE_NAME
public operator fun invoke(
scope: CloudshiftdevConstructsConstruct,
id: String,
block: Builder.() -> Unit = {},
): CfnAssessmentTemplate {
val builderImpl = BuilderImpl(CloudshiftdevConstructsConstruct.unwrap(scope), id)
return CfnAssessmentTemplate(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.inspector.CfnAssessmentTemplate):
CfnAssessmentTemplate = CfnAssessmentTemplate(cdkObject)
internal fun unwrap(wrapped: CfnAssessmentTemplate):
software.amazon.awscdk.services.inspector.CfnAssessmentTemplate = wrapped.cdkObject as
software.amazon.awscdk.services.inspector.CfnAssessmentTemplate
}
}