# KubectlProviderAttributes

Kubectl Provider Attributes.

- Source: [`aws-eks/lib/kubectl-provider.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-eks/lib/kubectl-provider.ts#L40)
- Type last changed: v2.4.0 · 6 Jan 2022

## Example

```ts
const handlerRole = iam.Role.fromRoleArn(this, 'HandlerRole', 'arn:aws:iam::123456789012:role/lambda-role');
// get the serviceToken from the custom resource provider
const functionArn = lambda.Function.fromFunctionName(this, 'ProviderOnEventFunc', 'ProviderframeworkonEvent-XXX').functionArn;
const kubectlProvider = eks.KubectlProvider.fromKubectlProviderAttributes(this, 'KubectlProvider', {
  functionArn,
  kubectlRoleArn: 'arn:aws:iam::123456789012:role/kubectl-role',
  handlerRole,
});

const cluster = eks.Cluster.fromClusterAttributes(this, 'Cluster', {
  clusterName: 'cluster',
  kubectlProvider,
});
```

## Properties

- `functionArn`: string (required) — The custom resource provider's service token.

- `handlerRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) (required) — The IAM execution role of the handler.

  This role must be able to assume kubectlRoleArn

- `kubectlRoleArn`: string (required) — The IAM role to assume in order to perform kubectl operations against this cluster.
