Class KubectlProvider

All Implemented Interfaces:
ITaggable, IKubectlProvider,, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-24T02:42:37.914Z") @Stability(Stable) public class KubectlProvider extends NestedStack implements IKubectlProvider
Implementation of Kubectl Lambda.


 IRole handlerRole = Role.fromRoleArn(this, "HandlerRole", "arn:aws:iam::123456789012:role/lambda-role");
 // get the serivceToken from the custom resource provider
 String functionArn = Function.fromFunctionName(this, "ProviderOnEventFunc", "ProviderframeworkonEvent-XXX").getFunctionArn();
 IKubectlProvider kubectlProvider = KubectlProvider.fromKubectlProviderAttributes(this, "KubectlProvider", KubectlProviderAttributes.builder()
 ICluster cluster = Cluster.fromClusterAttributes(this, "Cluster", ClusterAttributes.builder()
  • Constructor Details

    • KubectlProvider

      protected KubectlProvider( objRef)
    • KubectlProvider

      protected KubectlProvider( initializationMode)
    • KubectlProvider

      @Stability(Stable) public KubectlProvider(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull KubectlProviderProps props)
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromKubectlProviderAttributes

      @Stability(Stable) @NotNull public static IKubectlProvider fromKubectlProviderAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull KubectlProviderAttributes attrs)
      Import an existing provider.

      scope - Construct. This parameter is required.
      id - an id of resource. This parameter is required.
      attrs - attributes for the provider. This parameter is required.
    • getOrCreate

      @Stability(Stable) @NotNull public static IKubectlProvider getOrCreate(@NotNull software.constructs.Construct scope, @NotNull ICluster cluster)
      Take existing provider or create new based on cluster.

      scope - Construct. This parameter is required.
      cluster - k8s cluster. This parameter is required.
    • getHandlerRole

      @Stability(Stable) @NotNull public IRole getHandlerRole()
      The IAM execution role of the handler.
      Specified by:
      getHandlerRole in interface IKubectlProvider
    • getRoleArn

      @Stability(Stable) @NotNull public String getRoleArn()
      The IAM role to assume in order to perform kubectl operations against this cluster.
      Specified by:
      getRoleArn in interface IKubectlProvider
    • getServiceToken

      @Stability(Stable) @NotNull public String getServiceToken()
      The custom resource provider's service token.
      Specified by:
      getServiceToken in interface IKubectlProvider