/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.accessanalyzer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* 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 AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class KmsKeyConfiguration implements Serializable, Cloneable, StructuredPojo { /** *
* 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.
*
* 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. *
*/ private java.util.List
* 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.
*
default
. For more information, see Default
* key policy.
*/
public java.util.Map
* 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.
*
default
. For more information, see Default
* key policy.
*/
public void setKeyPolicies(java.util.Map
* 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.
*
default
. For more information, see Default
* key policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public KmsKeyConfiguration withKeyPolicies(java.util.Map* 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. *
* * @return 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. */ public java.util.List* 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. *
* * @param 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. */ public void setGrants(java.util.Collection* 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. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setGrants(java.util.Collection)} or {@link #withGrants(java.util.Collection)} if you want to override the * existing values. *
* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public KmsKeyConfiguration withGrants(KmsGrantConfiguration... grants) { if (this.grants == null) { setGrants(new java.util.ArrayList* 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. *
* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public KmsKeyConfiguration withGrants(java.util.Collection