# NodegroupRemoteAccess

The remote access (SSH) configuration to use with your node group.

- Source: [`aws-eks/lib/managed-nodegroup.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts#L138)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_eks as eks } from 'aws-cdk-lib';

declare const securityGroup: ec2.SecurityGroup;
const nodegroupRemoteAccess: eks.NodegroupRemoteAccess = {
  sshKeyName: 'sshKeyName',

  // the properties below are optional
  sourceSecurityGroups: [securityGroup],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_eks as eks

# security_group: ec2.SecurityGroup

nodegroup_remote_access = eks.NodegroupRemoteAccess(
    ssh_key_name="sshKeyName",

    # the properties below are optional
    source_security_groups=[security_group]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.eks.*;

SecurityGroup securityGroup;

NodegroupRemoteAccess nodegroupRemoteAccess = NodegroupRemoteAccess.builder()
        .sshKeyName("sshKeyName")

        // the properties below are optional
        .sourceSecurityGroups(List.of(securityGroup))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.EKS;

SecurityGroup securityGroup;

var nodegroupRemoteAccess = new NodegroupRemoteAccess {
    SshKeyName = "sshKeyName",

    // the properties below are optional
    SourceSecurityGroups = new [] { securityGroup }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var securityGroup SecurityGroup

nodegroupRemoteAccess := &NodegroupRemoteAccess{
	SshKeyName: jsii.String("sshKeyName"),

	// the properties below are optional
	SourceSecurityGroups: []ISecurityGroup{
		securityGroup,
	},
}
```

## Properties

- `sourceSecurityGroups`: [ISecurityGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] — The security groups that are allowed SSH access (port 22) to the worker nodes.

  **Default:** port 22 on the worker nodes is opened to the internet (0.0.0.0/0)

  If you specify an Amazon EC2 SSH
  key but do not specify a source security group when you create a managed node group, then port 22 on the worker
  nodes is opened to the internet (0.0.0.0/0).

- `sshKeyName`: string (required) — The Amazon EC2 SSH key that provides access for SSH communication with the worker nodes in the managed node group.
