com.amazonaws.services.elasticmapreduce.model.BlockPublicAccessConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-emr Show documentation
/*
* Copyright 2015-2020 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.elasticmapreduce.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A configuration for Amazon EMR block public access. When BlockPublicSecurityGroupRules
is set to
* true
, Amazon EMR prevents cluster creation if one of the cluster's security groups has a rule that
* allows inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using
* PermittedPublicSecurityGroupRuleRanges
.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BlockPublicAccessConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (false
).
* By default, the value is false
for accounts that have created EMR clusters before July 2019. For
* accounts created after this, the default is true
.
*
*/
private Boolean blockPublicSecurityGroupRules;
/**
*
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from
* all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security group
* associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port
* ::/0 as the source.
*
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*
*/
private com.amazonaws.internal.SdkInternalList permittedPublicSecurityGroupRuleRanges;
/**
*
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (false
).
* By default, the value is false
for accounts that have created EMR clusters before July 2019. For
* accounts created after this, the default is true
.
*
*
* @param blockPublicSecurityGroupRules
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (
* false
). By default, the value is false
for accounts that have created EMR
* clusters before July 2019. For accounts created after this, the default is true
.
*/
public void setBlockPublicSecurityGroupRules(Boolean blockPublicSecurityGroupRules) {
this.blockPublicSecurityGroupRules = blockPublicSecurityGroupRules;
}
/**
*
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (false
).
* By default, the value is false
for accounts that have created EMR clusters before July 2019. For
* accounts created after this, the default is true
.
*
*
* @return Indicates whether Amazon EMR block public access is enabled (true
) or disabled (
* false
). By default, the value is false
for accounts that have created EMR
* clusters before July 2019. For accounts created after this, the default is true
.
*/
public Boolean getBlockPublicSecurityGroupRules() {
return this.blockPublicSecurityGroupRules;
}
/**
*
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (false
).
* By default, the value is false
for accounts that have created EMR clusters before July 2019. For
* accounts created after this, the default is true
.
*
*
* @param blockPublicSecurityGroupRules
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (
* false
). By default, the value is false
for accounts that have created EMR
* clusters before July 2019. For accounts created after this, the default is true
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BlockPublicAccessConfiguration withBlockPublicSecurityGroupRules(Boolean blockPublicSecurityGroupRules) {
setBlockPublicSecurityGroupRules(blockPublicSecurityGroupRules);
return this;
}
/**
*
* Indicates whether Amazon EMR block public access is enabled (true
) or disabled (false
).
* By default, the value is false
for accounts that have created EMR clusters before July 2019. For
* accounts created after this, the default is true
.
*
*
* @return Indicates whether Amazon EMR block public access is enabled (true
) or disabled (
* false
). By default, the value is false
for accounts that have created EMR
* clusters before July 2019. For accounts created after this, the default is true
.
*/
public Boolean isBlockPublicSecurityGroupRules() {
return this.blockPublicSecurityGroupRules;
}
/**
*
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from
* all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security group
* associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port
* ::/0 as the source.
*
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*
*
* @return Specifies ports and port ranges that are permitted to have security group rules that allow inbound
* traffic from all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security
* group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0
* or IPv6 port ::/0 as the source.
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*/
public java.util.List getPermittedPublicSecurityGroupRuleRanges() {
if (permittedPublicSecurityGroupRuleRanges == null) {
permittedPublicSecurityGroupRuleRanges = new com.amazonaws.internal.SdkInternalList();
}
return permittedPublicSecurityGroupRuleRanges;
}
/**
*
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from
* all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security group
* associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port
* ::/0 as the source.
*
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*
*
* @param permittedPublicSecurityGroupRuleRanges
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic
* from all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security
* group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or
* IPv6 port ::/0 as the source.
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*/
public void setPermittedPublicSecurityGroupRuleRanges(java.util.Collection permittedPublicSecurityGroupRuleRanges) {
if (permittedPublicSecurityGroupRuleRanges == null) {
this.permittedPublicSecurityGroupRuleRanges = null;
return;
}
this.permittedPublicSecurityGroupRuleRanges = new com.amazonaws.internal.SdkInternalList(permittedPublicSecurityGroupRuleRanges);
}
/**
*
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from
* all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security group
* associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port
* ::/0 as the source.
*
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPermittedPublicSecurityGroupRuleRanges(java.util.Collection)} or
* {@link #withPermittedPublicSecurityGroupRuleRanges(java.util.Collection)} if you want to override the existing
* values.
*
*
* @param permittedPublicSecurityGroupRuleRanges
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic
* from all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security
* group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or
* IPv6 port ::/0 as the source.
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BlockPublicAccessConfiguration withPermittedPublicSecurityGroupRuleRanges(PortRange... permittedPublicSecurityGroupRuleRanges) {
if (this.permittedPublicSecurityGroupRuleRanges == null) {
setPermittedPublicSecurityGroupRuleRanges(new com.amazonaws.internal.SdkInternalList(permittedPublicSecurityGroupRuleRanges.length));
}
for (PortRange ele : permittedPublicSecurityGroupRuleRanges) {
this.permittedPublicSecurityGroupRuleRanges.add(ele);
}
return this;
}
/**
*
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from
* all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security group
* associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port
* ::/0 as the source.
*
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
*
*
* @param permittedPublicSecurityGroupRuleRanges
* Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic
* from all public sources. For example, if Port 23 (Telnet) is specified for
* PermittedPublicSecurityGroupRuleRanges
, Amazon EMR allows cluster creation if a security
* group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or
* IPv6 port ::/0 as the source.
*
* By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of
* PermittedPublicSecurityGroupRuleRanges
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BlockPublicAccessConfiguration withPermittedPublicSecurityGroupRuleRanges(java.util.Collection permittedPublicSecurityGroupRuleRanges) {
setPermittedPublicSecurityGroupRuleRanges(permittedPublicSecurityGroupRuleRanges);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getBlockPublicSecurityGroupRules() != null)
sb.append("BlockPublicSecurityGroupRules: ").append(getBlockPublicSecurityGroupRules()).append(",");
if (getPermittedPublicSecurityGroupRuleRanges() != null)
sb.append("PermittedPublicSecurityGroupRuleRanges: ").append(getPermittedPublicSecurityGroupRuleRanges());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BlockPublicAccessConfiguration == false)
return false;
BlockPublicAccessConfiguration other = (BlockPublicAccessConfiguration) obj;
if (other.getBlockPublicSecurityGroupRules() == null ^ this.getBlockPublicSecurityGroupRules() == null)
return false;
if (other.getBlockPublicSecurityGroupRules() != null
&& other.getBlockPublicSecurityGroupRules().equals(this.getBlockPublicSecurityGroupRules()) == false)
return false;
if (other.getPermittedPublicSecurityGroupRuleRanges() == null ^ this.getPermittedPublicSecurityGroupRuleRanges() == null)
return false;
if (other.getPermittedPublicSecurityGroupRuleRanges() != null
&& other.getPermittedPublicSecurityGroupRuleRanges().equals(this.getPermittedPublicSecurityGroupRuleRanges()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBlockPublicSecurityGroupRules() == null) ? 0 : getBlockPublicSecurityGroupRules().hashCode());
hashCode = prime * hashCode + ((getPermittedPublicSecurityGroupRuleRanges() == null) ? 0 : getPermittedPublicSecurityGroupRuleRanges().hashCode());
return hashCode;
}
@Override
public BlockPublicAccessConfiguration clone() {
try {
return (BlockPublicAccessConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.elasticmapreduce.model.transform.BlockPublicAccessConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}