{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.KMS.UpdateKeyDescription -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Updates the description of a KMS key. To see the description of a KMS -- key, use DescribeKey. -- -- The KMS key that you use for this operation must be in a compatible key -- state. For details, see -- -- in the /Key Management Service Developer Guide/. -- -- __Cross-account use__: No. You cannot perform this operation on a KMS -- key in a different Amazon Web Services account. -- -- __Required permissions__: -- -- (key policy) -- -- __Related operations__ -- -- - CreateKey -- -- - DescribeKey module Amazonka.KMS.UpdateKeyDescription ( -- * Creating a Request UpdateKeyDescription (..), newUpdateKeyDescription, -- * Request Lenses updateKeyDescription_keyId, updateKeyDescription_description, -- * Destructuring the Response UpdateKeyDescriptionResponse (..), newUpdateKeyDescriptionResponse, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.KMS.Types import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newUpdateKeyDescription' smart constructor. data UpdateKeyDescription = UpdateKeyDescription' { -- | Updates the description of the specified KMS key. -- -- Specify the key ID or key ARN of the KMS key. -- -- For example: -- -- - Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@ -- -- - Key ARN: -- @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@ -- -- To get the key ID and key ARN for a KMS key, use ListKeys or -- DescribeKey. keyId :: Prelude.Text, -- | New description for the KMS key. description :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'UpdateKeyDescription' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'keyId', 'updateKeyDescription_keyId' - Updates the description of the specified KMS key. -- -- Specify the key ID or key ARN of the KMS key. -- -- For example: -- -- - Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@ -- -- - Key ARN: -- @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@ -- -- To get the key ID and key ARN for a KMS key, use ListKeys or -- DescribeKey. -- -- 'description', 'updateKeyDescription_description' - New description for the KMS key. newUpdateKeyDescription :: -- | 'keyId' Prelude.Text -> -- | 'description' Prelude.Text -> UpdateKeyDescription newUpdateKeyDescription pKeyId_ pDescription_ = UpdateKeyDescription' { keyId = pKeyId_, description = pDescription_ } -- | Updates the description of the specified KMS key. -- -- Specify the key ID or key ARN of the KMS key. -- -- For example: -- -- - Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@ -- -- - Key ARN: -- @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@ -- -- To get the key ID and key ARN for a KMS key, use ListKeys or -- DescribeKey. updateKeyDescription_keyId :: Lens.Lens' UpdateKeyDescription Prelude.Text updateKeyDescription_keyId = Lens.lens (\UpdateKeyDescription' {keyId} -> keyId) (\s@UpdateKeyDescription' {} a -> s {keyId = a} :: UpdateKeyDescription) -- | New description for the KMS key. updateKeyDescription_description :: Lens.Lens' UpdateKeyDescription Prelude.Text updateKeyDescription_description = Lens.lens (\UpdateKeyDescription' {description} -> description) (\s@UpdateKeyDescription' {} a -> s {description = a} :: UpdateKeyDescription) instance Core.AWSRequest UpdateKeyDescription where type AWSResponse UpdateKeyDescription = UpdateKeyDescriptionResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveNull UpdateKeyDescriptionResponse' instance Prelude.Hashable UpdateKeyDescription where hashWithSalt _salt UpdateKeyDescription' {..} = _salt `Prelude.hashWithSalt` keyId `Prelude.hashWithSalt` description instance Prelude.NFData UpdateKeyDescription where rnf UpdateKeyDescription' {..} = Prelude.rnf keyId `Prelude.seq` Prelude.rnf description instance Data.ToHeaders UpdateKeyDescription where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ( "TrentService.UpdateKeyDescription" :: Prelude.ByteString ), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON UpdateKeyDescription where toJSON UpdateKeyDescription' {..} = Data.object ( Prelude.catMaybes [ Prelude.Just ("KeyId" Data..= keyId), Prelude.Just ("Description" Data..= description) ] ) instance Data.ToPath UpdateKeyDescription where toPath = Prelude.const "/" instance Data.ToQuery UpdateKeyDescription where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newUpdateKeyDescriptionResponse' smart constructor. data UpdateKeyDescriptionResponse = UpdateKeyDescriptionResponse' { } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'UpdateKeyDescriptionResponse' with all optional fields omitted. -- -- Use or to modify other optional fields. newUpdateKeyDescriptionResponse :: UpdateKeyDescriptionResponse newUpdateKeyDescriptionResponse = UpdateKeyDescriptionResponse' instance Prelude.NFData UpdateKeyDescriptionResponse where rnf _ = ()