RecycleBin / Client / lock_rule
lock_rule#
- RecycleBin.Client.lock_rule(**kwargs)#
Locks a Region-level retention rule. A locked retention rule can’t be modified or deleted.
Note
You can’t lock tag-level retention rules, or Region-level retention rules that have exclusion tags.
See also: AWS API Documentation
Request Syntax
response = client.lock_rule( Identifier='string', LockConfiguration={ 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } } )
- Parameters:
Identifier (string) –
[REQUIRED]
The unique ID of the retention rule.
LockConfiguration (dict) –
[REQUIRED]
Information about the retention rule lock configuration.
UnlockDelay (dict) – [REQUIRED]
Information about the retention rule unlock delay.
UnlockDelayValue (integer) – [REQUIRED]
The unlock delay period, measured in the unit specified for UnlockDelayUnit.
UnlockDelayUnit (string) – [REQUIRED]
The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
- Return type:
dict
- Returns:
Response Syntax
{ 'Identifier': 'string', 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT'|'EC2_IMAGE', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available', 'LockConfiguration': { 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'RuleArn': 'string', 'ExcludeResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] }
Response Structure
(dict) –
Identifier (string) –
The unique ID of the retention rule.
Description (string) –
The retention rule description.
ResourceType (string) –
The resource type retained by the retention rule.
RetentionPeriod (dict) –
Information about the retention period for which the retention rule is to retain resources.
RetentionPeriodValue (integer) –
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) –
The unit of time in which the retention period is measured. Currently, only
DAYS
is supported.
ResourceTags (list) –
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.
(dict) –
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.
ResourceTagKey (string) –
The tag key.
ResourceTagValue (string) –
The tag value.
Status (string) –
The state of the retention rule. Only retention rules that are in the
available
state retain resources.LockConfiguration (dict) –
Information about the retention rule lock configuration.
UnlockDelay (dict) –
Information about the retention rule unlock delay.
UnlockDelayValue (integer) –
The unlock delay period, measured in the unit specified for UnlockDelayUnit.
UnlockDelayUnit (string) –
The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
LockState (string) –
[Region-level retention rules only] The lock state for the retention rule.
locked
- The retention rule is locked and can’t be modified or deleted.pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between thelocked
andunlocked
states only; it can never transition back tonull
.
RuleArn (string) –
The Amazon Resource Name (ARN) of the retention rule.
ExcludeResourceTags (list) –
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.
(dict) –
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.
ResourceTagKey (string) –
The tag key.
ResourceTagValue (string) –
The tag value.
Exceptions
RecycleBin.Client.exceptions.InternalServerException
RecycleBin.Client.exceptions.ResourceNotFoundException
RecycleBin.Client.exceptions.ValidationException
RecycleBin.Client.exceptions.ConflictException