2026/07/10 - Inspector2 - 2 updated api methods
Changes Support for 3 day and 7 day ECR re-scan durations
{'ecrConfiguration': {'rescanDurationState': {'pullDateRescanDuration': {'DAYS_3',
'DAYS_7'},
'rescanDuration': {'DAYS_3',
'DAYS_7'}}}}
Retrieves setting configurations for Amazon Inspector scans. If you specify an accountId, this operation returns the scan configuration for that member account. You must be the delegated administrator for the specified member account. If you do not specify an accountId, this operation returns your own scan configuration.
See also: AWS API Documentation
Request Syntax
client.get_configuration(
accountId='string'
)
string
The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to retrieve. When specified, you must be the delegated administrator for this member account. If not specified, the operation returns your own configuration.
dict
Response Syntax
{
'ecrConfiguration': {
'rescanDurationState': {
'rescanDuration': 'LIFETIME'|'DAYS_30'|'DAYS_180'|'DAYS_14'|'DAYS_60'|'DAYS_90'|'DAYS_3'|'DAYS_7',
'status': 'SUCCESS'|'PENDING'|'FAILED',
'updatedAt': datetime(2015, 1, 1),
'pullDateRescanDuration': 'DAYS_14'|'DAYS_30'|'DAYS_60'|'DAYS_90'|'DAYS_180'|'DAYS_3'|'DAYS_7',
'pullDateRescanMode': 'LAST_PULL_DATE'|'LAST_IN_USE_AT'
}
},
'ec2Configuration': {
'scanModeState': {
'scanMode': 'EC2_SSM_AGENT_BASED'|'EC2_HYBRID',
'scanModeStatus': 'SUCCESS'|'PENDING'
},
'vmScannerState': {
'activated': True|False,
'activatedAt': datetime(2015, 1, 1),
'status': 'SUCCESS'|'PENDING'|'FAILED'
}
}
}
Response Structure
(dict) --
ecrConfiguration (dict) --
Specifies how the ECR automated re-scan duration is currently configured for your environment.
rescanDurationState (dict) --
An object that contains details about the state of the ECR re-scan settings.
rescanDuration (string) --
The rescan duration configured for image push date.
status (string) --
The status of changes to the ECR automated re-scan duration.
updatedAt (datetime) --
A timestamp representing when the last time the ECR scan duration setting was changed.
pullDateRescanDuration (string) --
The rescan duration configured for image pull date.
pullDateRescanMode (string) --
The pull date for the re-scan mode.
ec2Configuration (dict) --
Specifies how the Amazon EC2 automated scan mode is currently configured for your environment.
scanModeState (dict) --
An object that contains details about the state of the Amazon EC2 scan mode.
scanMode (string) --
The scan method that is applied to the instance.
scanModeStatus (string) --
The status of the Amazon EC2 scan mode setting.
vmScannerState (dict) --
An object that contains details about the state of the Amazon Inspector VM scanner.
activated (boolean) --
Whether the VM scanner is activated.
activatedAt (datetime) --
The date and time the VM scanner was activated.
status (string) --
The status of the VM scanner.
{'ecrConfiguration': {'pullDateRescanDuration': {'DAYS_7', 'DAYS_3'},
'rescanDuration': {'DAYS_7', 'DAYS_3'}}}
Updates the scan configuration for your Amazon Inspector account. If you don't specify an accountId, this operation updates the delegated administrator's configuration and propagates it to member accounts that have not been individually configured. If you specify an accountId, this operation updates that member account's configuration. Only the delegated administrator can specify an accountId; member accounts cannot call this operation.
See also: AWS API Documentation
Request Syntax
client.update_configuration(
accountId='string',
ecrConfiguration={
'rescanDuration': 'LIFETIME'|'DAYS_30'|'DAYS_180'|'DAYS_14'|'DAYS_60'|'DAYS_90'|'DAYS_3'|'DAYS_7',
'pullDateRescanDuration': 'DAYS_14'|'DAYS_30'|'DAYS_60'|'DAYS_90'|'DAYS_180'|'DAYS_3'|'DAYS_7',
'pullDateRescanMode': 'LAST_PULL_DATE'|'LAST_IN_USE_AT'
},
ec2Configuration={
'scanMode': 'EC2_SSM_AGENT_BASED'|'EC2_HYBRID',
'activateVMScanner': True|False
},
updateConfigurationInheritance={
'ec2Configuration': 'INHERIT_FROM_ADMIN',
'ecrConfiguration': 'INHERIT_FROM_ADMIN'
}
)
string
The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.
dict
Specifies how the ECR automated re-scan will be updated for your environment.
rescanDuration (string) -- [REQUIRED]
The rescan duration configured for image push date.
pullDateRescanDuration (string) --
The rescan duration configured for image pull date.
pullDateRescanMode (string) --
The pull date for the re-scan mode.
dict
Specifies how the Amazon EC2 automated scan will be updated for your environment.
scanMode (string) -- [REQUIRED]
The scan method that is applied to the instance.
activateVMScanner (boolean) --
Whether to activate Amazon Inspector VM scanner for Amazon EC2 scanning.
dict
Specifies which scan-type configurations to reset to the delegated administrator's inherited values for the targeted member account. Each member of this structure is independently optional. When specified, ec2Configuration and ecrConfiguration must be absent, and accountId must also be present. Only INHERIT_FROM_ADMIN is valid for each member. If not specified, the operation uses the ec2Configuration and ecrConfiguration parameters instead.
ec2Configuration (string) --
The inheritance mode for Amazon EC2 scan configuration. Set to INHERIT_FROM_ADMIN to reset the member account's Amazon EC2 scan configuration to inherit from the delegated administrator. If omitted, the member account's existing Amazon EC2 scan configuration is not changed.
ecrConfiguration (string) --
The inheritance mode for Amazon ECR scan configuration. Set to INHERIT_FROM_ADMIN to reset the member account's Amazon ECR scan configuration to inherit from the delegated administrator. If omitted, the member account's existing Amazon ECR scan configuration is not changed.
dict
Response Syntax
{}
Response Structure
(dict) --