@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class KmsKeyConfiguration extends Object implements Serializable, Cloneable, StructuredPojo
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.
Constructor and Description |
---|
KmsKeyConfiguration() |
Modifier and Type | Method and Description |
---|---|
KmsKeyConfiguration |
addKeyPoliciesEntry(String key,
String value)
Add a single KeyPolicies entry
|
KmsKeyConfiguration |
clearKeyPoliciesEntries()
Removes all the entries added into KeyPolicies.
|
KmsKeyConfiguration |
clone() |
boolean |
equals(Object obj) |
List<KmsGrantConfiguration> |
getGrants()
A list of proposed grant configurations for the KMS key.
|
Map<String,String> |
getKeyPolicies()
Resource policy configuration for the KMS key.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setGrants(Collection<KmsGrantConfiguration> grants)
A list of proposed grant configurations for the KMS key.
|
void |
setKeyPolicies(Map<String,String> keyPolicies)
Resource policy configuration for the KMS key.
|
String |
toString()
Returns a string representation of this object.
|
KmsKeyConfiguration |
withGrants(Collection<KmsGrantConfiguration> grants)
A list of proposed grant configurations for the KMS key.
|
KmsKeyConfiguration |
withGrants(KmsGrantConfiguration... grants)
A list of proposed grant configurations for the KMS key.
|
KmsKeyConfiguration |
withKeyPolicies(Map<String,String> keyPolicies)
Resource policy configuration for the KMS key.
|
public List<KmsGrantConfiguration> getGrants()
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(Collection<KmsGrantConfiguration> 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.
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 KmsKeyConfiguration withGrants(KmsGrantConfiguration... 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.
NOTE: This method appends the values to the existing list (if any). Use
setGrants(java.util.Collection)
or withGrants(java.util.Collection)
if you want to override the
existing values.
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 KmsKeyConfiguration withGrants(Collection<KmsGrantConfiguration> 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.
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 Map<String,String> getKeyPolicies()
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(Map<String,String> 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.
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.public KmsKeyConfiguration withKeyPolicies(Map<String,String> 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.
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.public KmsKeyConfiguration addKeyPoliciesEntry(String key, String value)
public KmsKeyConfiguration clearKeyPoliciesEntries()
public String toString()
toString
in class Object
Object.toString()
public KmsKeyConfiguration clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.