update_lifecycle_policy
async
¶
update_lifecycle_policy(
policy_id: PolicyId,
*,
config_overrides: Optional[AsyncDLMClientConfig] = None,
execution_role_arn: Optional[ExecutionRoleArn] = None,
state: Optional[SettablePolicyStateValues] = None,
description: Optional[PolicyDescription] = None,
policy_details: Optional[PolicyDetails] = None,
create_interval: Optional[CreateInterval] = None,
retain_interval: Optional[RetainInterval] = None,
copy_tags: Optional[CopyTagsNullable] = None,
extend_deletion: Optional[ExtendDeletion] = None,
cross_region_copy_targets: Optional[CrossRegionCopyTargetList] = None,
cross_region_copy_configuration: Optional[CrossRegionCopyConfiguration] = None,
exclusions: Optional[Exclusions] = None,
) -> UpdateLifecyclePolicyResponse
Updates the specified lifecycle policy.
For more information about updating a policy, see Modify lifecycle policies.
Parameters:
-
policy_id(PolicyId) –The identifier of the lifecycle policy.
-
execution_role_arn(Optional[ExecutionRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
-
state(Optional[SettablePolicyStateValues], default:None) –The desired activation state of the lifecycle policy after creation.
-
description(Optional[PolicyDescription], default:None) –A description of the lifecycle policy.
-
policy_details(Optional[PolicyDetails], default:None) –The configuration of the lifecycle policy. You cannot update the policy type or the resource type.
-
create_interval(Optional[CreateInterval], default:None) –[Default policies only] Specifies how often the policy should run and create snapshots or AMIs. The creation frequency can range from 1 to 7 days.
-
retain_interval(Optional[RetainInterval], default:None) –[Default policies only] Specifies how long the policy should retain snapshots or AMIs before deleting them. The retention period can range from 2 to 14 days, but it must be greater than the creation frequency to ensure that the policy retains at least 1 snapshot or AMI at any given time.
-
copy_tags(Optional[CopyTagsNullable], default:None) –[Default and MultiAvailabilityZone policies only] Indicates whether the policy should copy tags from the source resource to the snapshot or AMI.
-
extend_deletion(Optional[ExtendDeletion], default:None) –[Default policies only] Defines the snapshot or AMI retention behavior for the policy if the source volume or instance is deleted, or if the policy enters the error, disabled, or deleted state.
By default (ExtendDeletion=false):
-
If a source resource is deleted, Amazon Data Lifecycle Manager will continue to delete previously created snapshots or AMIs, up to but not including the last one, based on the specified retention period. If you want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, including the last one, specify
true. -
If a policy enters the error, disabled, or deleted state, Amazon Data Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon Data Lifecycle Manager to continue deleting snapshots or AMIs, including the last one, if the policy enters one of these states, specify
true.
If you enable extended deletion (ExtendDeletion=true), you override both default behaviors simultaneously.
Default: false
-
-
cross_region_copy_targets(Optional[CrossRegionCopyTargetList], default:None) –[Default policies only] Specifies destination Regions for snapshot or AMI copies. You can specify up to 3 destination Regions. If you do not want to create cross-Region copies, omit this parameter.
[MultiAvailabilityZone policies only] Use
CrossRegionCopyConfigurationinstead. -
cross_region_copy_configuration(Optional[CrossRegionCopyConfiguration], default:None) –[MultiAvailabilityZone policies only] Specifies a new
CrossRegionCopyConfigurationfor the policy. The value you specify replaces the existingCrossRegionCopyConfigurationon the policy. To stop creating cross-Region copies, specify an empty configuration ({}). To leave the existing configuration unchanged, omit this parameter. -
exclusions(Optional[Exclusions], default:None) –[Default and MultiAvailabilityZone policies only] Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs. The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.
Raises:
-
InternalServerException–The service failed in an unexpected way.
-
InvalidRequestException–Bad request. The request is missing required parameters or has invalid parameters.
-
LimitExceededException–The request failed because a limit was exceeded.
-
ResourceNotFoundException–A requested resource was not found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_dlm/_services/async_dlm.py
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | |