ImageScanningConfigurationProperty Struct
Contains settings for Image Builder image resource and container image scans.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
const imageScanningConfigurationProperty: imagebuilder.CfnImage.ImageScanningConfigurationProperty = {
ecrConfiguration: {
containerTags: ['containerTags'],
repositoryName: 'repositoryName',
},
imageScanningEnabled: false,
imageScanningTypes: ['imageScanningTypes'],
scanResultCondition: {
maximumSeverityLabel: 'maximumSeverityLabel',
// the properties below are optional
fixAvailable: false,
},
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_imagebuilder as imagebuilder
image_scanning_configuration_property = imagebuilder.CfnImage.ImageScanningConfigurationProperty(
ecr_configuration=imagebuilder.CfnImage.EcrConfigurationProperty(
container_tags=["containerTags"],
repository_name="repositoryName"
),
image_scanning_enabled=False,
image_scanning_types=["imageScanningTypes"],
scan_result_condition=imagebuilder.CfnImage.ScanResultConditionProperty(
maximum_severity_label="maximumSeverityLabel",
# the properties below are optional
fix_available=False
)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.imagebuilder.*;
ImageScanningConfigurationProperty imageScanningConfigurationProperty = ImageScanningConfigurationProperty.builder()
.ecrConfiguration(EcrConfigurationProperty.builder()
.containerTags(List.of("containerTags"))
.repositoryName("repositoryName")
.build())
.imageScanningEnabled(false)
.imageScanningTypes(List.of("imageScanningTypes"))
.scanResultCondition(ScanResultConditionProperty.builder()
.maximumSeverityLabel("maximumSeverityLabel")
// the properties below are optional
.fixAvailable(false)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ImageBuilder;
var imageScanningConfigurationProperty = new ImageScanningConfigurationProperty {
EcrConfiguration = new EcrConfigurationProperty {
ContainerTags = new [] { "containerTags" },
RepositoryName = "repositoryName"
},
ImageScanningEnabled = false,
ImageScanningTypes = new [] { "imageScanningTypes" },
ScanResultCondition = new ScanResultConditionProperty {
MaximumSeverityLabel = "maximumSeverityLabel",
// the properties below are optional
FixAvailable = false
}
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
imageScanningConfigurationProperty := &ImageScanningConfigurationProperty{
EcrConfiguration: &EcrConfigurationProperty{
ContainerTags: []*string{
jsii.String("containerTags"),
},
RepositoryName: jsii.String("repositoryName"),
},
ImageScanningEnabled: jsii.Boolean(false),
ImageScanningTypes: []*string{
jsii.String("imageScanningTypes"),
},
ScanResultCondition: &ScanResultConditionProperty{
MaximumSeverityLabel: jsii.String("maximumSeverityLabel"),
// the properties below are optional
FixAvailable: jsii.Boolean(false),
},
}
Properties
ecrConfigurationoptionalIResolvable | CfnImage.EcrConfigurationPropertyecr_configurationoptionaltyping.Union[IResolvable, EcrConfigurationProperty]ecrConfigurationoptionalIResolvableEcrConfigurationoptionalIResolvableEcrConfigurationoptionalinterface{}#Contains Amazon ECR settings for vulnerability scans.
imageScanningEnabledoptionalboolean | IResolvableimage_scanning_enabledoptionaltyping.Union[bool, IResolvable]imageScanningEnabledoptionalBooleanImageScanningEnabledoptionalboolImageScanningEnabledoptionalinterface{}#A setting that indicates whether Image Builder keeps a snapshot of the vulnerability scans that Amazon Inspector runs against the build instance when you create a new image.
imageScanningTypesoptionalstring[]image_scanning_typesoptionaltyping.List[str]imageScanningTypesoptionalList<String>ImageScanningTypesoptionalstring[]ImageScanningTypesoptional*[]*string#The type of vulnerability scan that Image Builder runs for AMI output when ImageScanningEnabled is true.
notes
Specify a single value. If you omit ImageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests, and you must activate Amazon Inspector for Amazon EC2 scanning in your account. With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. You must build from an image recipe, but you do not need to activate Amazon Inspector in your account.
scanResultConditionoptionalIResolvable | CfnImage.ScanResultConditionPropertyscan_result_conditionoptionaltyping.Union[IResolvable, ScanResultConditionProperty]scanResultConditionoptionalIResolvableScanResultConditionoptionalIResolvableScanResultConditionoptionalinterface{}#The condition that the output AMI's scan results must meet for the image to pass.
When you set it, the test phase waits for the scan to finish, and Image Builder fails the image if a counted finding exceeds MaximumSeverityLabel.