/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace AccessAnalyzer { namespace Model { /** *

Proposed access control configuration for a KMS key. You can propose a * configuration for a new KMS key or an existing KMS key that you own by * specifying the key policy and KMS grant configuration. If the configuration is * for an existing key and you do not specify the key policy, the access preview * uses the existing policy for the key. If the access preview is for a new * resource and you do not specify the key policy, then the access preview uses the * default key policy. The proposed key policy cannot be an empty string. For more * information, see Default * key policy. For more information about key policy limits, see Resource * quotas.

See Also:

AWS * API Reference

*/ class KmsKeyConfiguration { public: AWS_ACCESSANALYZER_API KmsKeyConfiguration(); AWS_ACCESSANALYZER_API KmsKeyConfiguration(Aws::Utils::Json::JsonView jsonValue); AWS_ACCESSANALYZER_API KmsKeyConfiguration& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_ACCESSANALYZER_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline const Aws::Map& GetKeyPolicies() const{ return m_keyPolicies; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline bool KeyPoliciesHasBeenSet() const { return m_keyPoliciesHasBeenSet; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline void SetKeyPolicies(const Aws::Map& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies = value; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline void SetKeyPolicies(Aws::Map&& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies = std::move(value); } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& WithKeyPolicies(const Aws::Map& value) { SetKeyPolicies(value); return *this;} /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& WithKeyPolicies(Aws::Map&& value) { SetKeyPolicies(std::move(value)); return *this;} /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(const Aws::String& key, const Aws::String& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(key, value); return *this; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(Aws::String&& key, const Aws::String& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(std::move(key), value); return *this; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(const Aws::String& key, Aws::String&& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(key, std::move(value)); return *this; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(Aws::String&& key, Aws::String&& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(std::move(key), std::move(value)); return *this; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(const char* key, Aws::String&& value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(key, std::move(value)); return *this; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(Aws::String&& key, const char* value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(std::move(key), value); return *this; } /** *

Resource policy configuration for the KMS key. The only valid value for the * name of the key policy is default. For more information, see Default * key policy.

*/ inline KmsKeyConfiguration& AddKeyPolicies(const char* key, const char* value) { m_keyPoliciesHasBeenSet = true; m_keyPolicies.emplace(key, value); return *this; } /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline const Aws::Vector& GetGrants() const{ return m_grants; } /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline bool GrantsHasBeenSet() const { return m_grantsHasBeenSet; } /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline void SetGrants(const Aws::Vector& value) { m_grantsHasBeenSet = true; m_grants = value; } /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline void SetGrants(Aws::Vector&& value) { m_grantsHasBeenSet = true; m_grants = std::move(value); } /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline KmsKeyConfiguration& WithGrants(const Aws::Vector& value) { SetGrants(value); return *this;} /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline KmsKeyConfiguration& WithGrants(Aws::Vector&& value) { SetGrants(std::move(value)); return *this;} /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline KmsKeyConfiguration& AddGrants(const KmsGrantConfiguration& value) { m_grantsHasBeenSet = true; m_grants.push_back(value); return *this; } /** *

A list of proposed grant configurations for the KMS key. If the proposed * grant configuration is for an existing key, the access preview uses the proposed * list of grant configurations in place of the existing grants. Otherwise, the * access preview uses the existing grants for the key.

*/ inline KmsKeyConfiguration& AddGrants(KmsGrantConfiguration&& value) { m_grantsHasBeenSet = true; m_grants.push_back(std::move(value)); return *this; } private: Aws::Map m_keyPolicies; bool m_keyPoliciesHasBeenSet = false; Aws::Vector m_grants; bool m_grantsHasBeenSet = false; }; } // namespace Model } // namespace AccessAnalyzer } // namespace Aws