/* * 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.eks.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* An object representing the remote access configuration for the managed node group. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RemoteAccessConfig implements Serializable, Cloneable, StructuredPojo { /** *

* The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node group. * For more information, see Amazon * EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. * For Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and Windows * instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. *

*/ private String ec2SshKey; /** *

* The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. If you * specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed node group, * then the port on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC * in the Amazon Virtual Private Cloud User Guide. *

*/ private java.util.List sourceSecurityGroups; /** *

* The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node group. * For more information, see Amazon * EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. * For Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and Windows * instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. *

* * @param ec2SshKey * The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node * group. For more information, see Amazon EC2 key pairs and * Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For * Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and * Windows instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. */ public void setEc2SshKey(String ec2SshKey) { this.ec2SshKey = ec2SshKey; } /** *

* The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node group. * For more information, see Amazon * EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. * For Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and Windows * instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. *

* * @return The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node * group. For more information, see Amazon EC2 key pairs and * Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For * Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and * Windows instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. */ public String getEc2SshKey() { return this.ec2SshKey; } /** *

* The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node group. * For more information, see Amazon * EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. * For Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and Windows * instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. *

* * @param ec2SshKey * The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node * group. For more information, see Amazon EC2 key pairs and * Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For * Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and * Windows instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public RemoteAccessConfig withEc2SshKey(String ec2SshKey) { setEc2SshKey(ec2SshKey); return this; } /** *

* The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. If you * specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed node group, * then the port on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC * in the Amazon Virtual Private Cloud User Guide. *

* * @return The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. * If you specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed * node group, then the port on the nodes is opened to the internet (0.0.0.0/0). For more * information, see Security Groups for Your * VPC in the Amazon Virtual Private Cloud User Guide. */ public java.util.List getSourceSecurityGroups() { return sourceSecurityGroups; } /** *

* The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. If you * specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed node group, * then the port on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC * in the Amazon Virtual Private Cloud User Guide. *

* * @param sourceSecurityGroups * The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. * If you specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed * node group, then the port on the nodes is opened to the internet (0.0.0.0/0). For more * information, see Security Groups for Your * VPC in the Amazon Virtual Private Cloud User Guide. */ public void setSourceSecurityGroups(java.util.Collection sourceSecurityGroups) { if (sourceSecurityGroups == null) { this.sourceSecurityGroups = null; return; } this.sourceSecurityGroups = new java.util.ArrayList(sourceSecurityGroups); } /** *

* The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. If you * specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed node group, * then the port on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC * in the Amazon Virtual Private Cloud User Guide. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSourceSecurityGroups(java.util.Collection)} or {@link #withSourceSecurityGroups(java.util.Collection)} * if you want to override the existing values. *

* * @param sourceSecurityGroups * The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. * If you specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed * node group, then the port on the nodes is opened to the internet (0.0.0.0/0). For more * information, see Security Groups for Your * VPC in the Amazon Virtual Private Cloud User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RemoteAccessConfig withSourceSecurityGroups(String... sourceSecurityGroups) { if (this.sourceSecurityGroups == null) { setSourceSecurityGroups(new java.util.ArrayList(sourceSecurityGroups.length)); } for (String ele : sourceSecurityGroups) { this.sourceSecurityGroups.add(ele); } return this; } /** *

* The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. If you * specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed node group, * then the port on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC * in the Amazon Virtual Private Cloud User Guide. *

* * @param sourceSecurityGroups * The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. * If you specify an Amazon EC2 SSH key but don't specify a source security group when you create a managed * node group, then the port on the nodes is opened to the internet (0.0.0.0/0). For more * information, see Security Groups for Your * VPC in the Amazon Virtual Private Cloud User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RemoteAccessConfig withSourceSecurityGroups(java.util.Collection sourceSecurityGroups) { setSourceSecurityGroups(sourceSecurityGroups); 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 (getEc2SshKey() != null) sb.append("Ec2SshKey: ").append(getEc2SshKey()).append(","); if (getSourceSecurityGroups() != null) sb.append("SourceSecurityGroups: ").append(getSourceSecurityGroups()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RemoteAccessConfig == false) return false; RemoteAccessConfig other = (RemoteAccessConfig) obj; if (other.getEc2SshKey() == null ^ this.getEc2SshKey() == null) return false; if (other.getEc2SshKey() != null && other.getEc2SshKey().equals(this.getEc2SshKey()) == false) return false; if (other.getSourceSecurityGroups() == null ^ this.getSourceSecurityGroups() == null) return false; if (other.getSourceSecurityGroups() != null && other.getSourceSecurityGroups().equals(this.getSourceSecurityGroups()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEc2SshKey() == null) ? 0 : getEc2SshKey().hashCode()); hashCode = prime * hashCode + ((getSourceSecurityGroups() == null) ? 0 : getSourceSecurityGroups().hashCode()); return hashCode; } @Override public RemoteAccessConfig clone() { try { return (RemoteAccessConfig) 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.eks.model.transform.RemoteAccessConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }