amazonka-rbin-2.0: Amazon Recycle Bin SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.RBin.CreateRule

Description

Creates a Recycle Bin retention rule. For more information, see Create Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.

Synopsis

Creating a Request

data CreateRule Source #

See: newCreateRule smart constructor.

Constructors

CreateRule' 

Fields

  • description :: Maybe Text

    The retention rule description.

  • lockConfiguration :: Maybe LockConfiguration

    Information about the retention rule lock configuration.

  • resourceTags :: Maybe [ResourceTag]

    Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.

    You can add the same tag key and value pair to a maximum or five retention rules.

    To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.

  • tags :: Maybe [Tag]

    Information about the tags to assign to the retention rule.

  • retentionPeriod :: RetentionPeriod

    Information about the retention period for which the retention rule is to retain resources.

  • resourceType :: ResourceType

    The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify EC2_IMAGE.

Instances

Instances details
ToJSON CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

ToHeaders CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Methods

toHeaders :: CreateRule -> [Header] #

ToPath CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

ToQuery CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

AWSRequest CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Associated Types

type AWSResponse CreateRule #

Generic CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Associated Types

type Rep CreateRule :: Type -> Type #

Read CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Show CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

NFData CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Methods

rnf :: CreateRule -> () #

Eq CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Hashable CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

type AWSResponse CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

type Rep CreateRule Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

newCreateRule Source #

Create a value of CreateRule with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateRule, createRule_description - The retention rule description.

CreateRule, createRule_lockConfiguration - Information about the retention rule lock configuration.

CreateRule, createRule_resourceTags - Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.

You can add the same tag key and value pair to a maximum or five retention rules.

To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.

CreateRule, createRule_tags - Information about the tags to assign to the retention rule.

CreateRule, createRule_retentionPeriod - Information about the retention period for which the retention rule is to retain resources.

CreateRule, createRule_resourceType - The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify EC2_IMAGE.

Request Lenses

createRule_description :: Lens' CreateRule (Maybe Text) Source #

The retention rule description.

createRule_lockConfiguration :: Lens' CreateRule (Maybe LockConfiguration) Source #

Information about the retention rule lock configuration.

createRule_resourceTags :: Lens' CreateRule (Maybe [ResourceTag]) Source #

Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.

You can add the same tag key and value pair to a maximum or five retention rules.

To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.

createRule_tags :: Lens' CreateRule (Maybe [Tag]) Source #

Information about the tags to assign to the retention rule.

createRule_retentionPeriod :: Lens' CreateRule RetentionPeriod Source #

Information about the retention period for which the retention rule is to retain resources.

createRule_resourceType :: Lens' CreateRule ResourceType Source #

The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify EC2_IMAGE.

Destructuring the Response

data CreateRuleResponse Source #

See: newCreateRuleResponse smart constructor.

Constructors

CreateRuleResponse' 

Fields

  • description :: Maybe Text

    The retention rule description.

  • identifier :: Maybe Text

    The unique ID of the retention rule.

  • lockConfiguration :: Maybe LockConfiguration

    Information about the retention rule lock configuration.

  • lockState :: Maybe LockState

    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 the locked and unlocked states only; it can never transition back to null.
  • resourceTags :: Maybe [ResourceTag]

    Information about the resource tags used to identify resources that are retained by the retention rule.

  • resourceType :: Maybe ResourceType

    The resource type retained by the retention rule.

  • retentionPeriod :: Maybe RetentionPeriod
     
  • status :: Maybe RuleStatus

    The state of the retention rule. Only retention rules that are in the available state retain resources.

  • tags :: Maybe [Tag]

    Information about the tags assigned to the retention rule.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic CreateRuleResponse Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Associated Types

type Rep CreateRuleResponse :: Type -> Type #

Read CreateRuleResponse Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Show CreateRuleResponse Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

NFData CreateRuleResponse Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

Methods

rnf :: CreateRuleResponse -> () #

Eq CreateRuleResponse Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

type Rep CreateRuleResponse Source # 
Instance details

Defined in Amazonka.RBin.CreateRule

newCreateRuleResponse Source #

Create a value of CreateRuleResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateRule, createRuleResponse_description - The retention rule description.

CreateRuleResponse, createRuleResponse_identifier - The unique ID of the retention rule.

CreateRule, createRuleResponse_lockConfiguration - Information about the retention rule lock configuration.

CreateRuleResponse, createRuleResponse_lockState - 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 the locked and unlocked states only; it can never transition back to null.

CreateRule, createRuleResponse_resourceTags - Information about the resource tags used to identify resources that are retained by the retention rule.

CreateRule, createRuleResponse_resourceType - The resource type retained by the retention rule.

CreateRule, createRuleResponse_retentionPeriod - Undocumented member.

$sel:status:CreateRuleResponse', createRuleResponse_status - The state of the retention rule. Only retention rules that are in the available state retain resources.

CreateRule, createRuleResponse_tags - Information about the tags assigned to the retention rule.

$sel:httpStatus:CreateRuleResponse', createRuleResponse_httpStatus - The response's http status code.

Response Lenses

createRuleResponse_identifier :: Lens' CreateRuleResponse (Maybe Text) Source #

The unique ID of the retention rule.

createRuleResponse_lockConfiguration :: Lens' CreateRuleResponse (Maybe LockConfiguration) Source #

Information about the retention rule lock configuration.

createRuleResponse_lockState :: Lens' CreateRuleResponse (Maybe LockState) Source #

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 the locked and unlocked states only; it can never transition back to null.

createRuleResponse_resourceTags :: Lens' CreateRuleResponse (Maybe [ResourceTag]) Source #

Information about the resource tags used to identify resources that are retained by the retention rule.

createRuleResponse_resourceType :: Lens' CreateRuleResponse (Maybe ResourceType) Source #

The resource type retained by the retention rule.

createRuleResponse_status :: Lens' CreateRuleResponse (Maybe RuleStatus) Source #

The state of the retention rule. Only retention rules that are in the available state retain resources.

createRuleResponse_tags :: Lens' CreateRuleResponse (Maybe [Tag]) Source #

Information about the tags assigned to the retention rule.