@pulumi/eks
Version:
[](https://github.com/pulumi/pulumi-eks/actions/workflows/master.yml) [](https://slack.pulumi.com) [![n
173 lines • 11 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-gen-eks. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cluster = void 0;
const pulumi = require("@pulumi/pulumi");
const inputs = require("./types/input");
const utilities = require("./utilities");
/**
* Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.
*
* ## Example Usage
*
* ### Provisioning a New EKS Cluster
*
* <!--Start PulumiCodeChooser -->
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as eks from "@pulumi/eks";
*
* // Create an EKS cluster with the default configuration.
* const cluster = new eks.Cluster("cluster", {});
*
* // Export the cluster's kubeconfig.
* export const kubeconfig = cluster.kubeconfig;
* ```
* <!--End PulumiCodeChooser -->
*/
class Cluster extends pulumi.ComponentResource {
/**
* Returns true if the given object is an instance of Cluster. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Cluster.__pulumiType;
}
/**
* Create a Cluster resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
resourceInputs["accessEntries"] = args ? args.accessEntries : undefined;
resourceInputs["authenticationMode"] = args ? args.authenticationMode : undefined;
resourceInputs["autoMode"] = args ? (args.autoMode ? inputs.autoModeOptionsArgsProvideDefaults(args.autoMode) : undefined) : undefined;
resourceInputs["bootstrapSelfManagedAddons"] = args ? args.bootstrapSelfManagedAddons : undefined;
resourceInputs["clusterSecurityGroup"] = args ? args.clusterSecurityGroup : undefined;
resourceInputs["clusterSecurityGroupTags"] = args ? args.clusterSecurityGroupTags : undefined;
resourceInputs["clusterTags"] = args ? args.clusterTags : undefined;
resourceInputs["corednsAddonOptions"] = args ? (args.corednsAddonOptions ? inputs.coreDnsAddonOptionsArgsProvideDefaults(args.corednsAddonOptions) : undefined) : undefined;
resourceInputs["createInstanceRole"] = args ? args.createInstanceRole : undefined;
resourceInputs["createOidcProvider"] = args ? args.createOidcProvider : undefined;
resourceInputs["creationRoleProvider"] = args ? args.creationRoleProvider : undefined;
resourceInputs["desiredCapacity"] = args ? args.desiredCapacity : undefined;
resourceInputs["enableConfigMapMutable"] = args ? args.enableConfigMapMutable : undefined;
resourceInputs["enabledClusterLogTypes"] = args ? args.enabledClusterLogTypes : undefined;
resourceInputs["encryptionConfigKeyArn"] = args ? args.encryptionConfigKeyArn : undefined;
resourceInputs["endpointPrivateAccess"] = args ? args.endpointPrivateAccess : undefined;
resourceInputs["endpointPublicAccess"] = args ? args.endpointPublicAccess : undefined;
resourceInputs["fargate"] = args ? args.fargate : undefined;
resourceInputs["gpu"] = args ? args.gpu : undefined;
resourceInputs["instanceProfileName"] = args ? args.instanceProfileName : undefined;
resourceInputs["instanceRole"] = args ? args.instanceRole : undefined;
resourceInputs["instanceRoles"] = args ? args.instanceRoles : undefined;
resourceInputs["instanceType"] = args ? args.instanceType : undefined;
resourceInputs["ipFamily"] = args ? args.ipFamily : undefined;
resourceInputs["kubeProxyAddonOptions"] = args ? (args.kubeProxyAddonOptions ? inputs.kubeProxyAddonOptionsArgsProvideDefaults(args.kubeProxyAddonOptions) : undefined) : undefined;
resourceInputs["kubernetesServiceIpAddressRange"] = args ? args.kubernetesServiceIpAddressRange : undefined;
resourceInputs["maxSize"] = args ? args.maxSize : undefined;
resourceInputs["minSize"] = args ? args.minSize : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nodeAmiId"] = args ? args.nodeAmiId : undefined;
resourceInputs["nodeAssociatePublicIpAddress"] = args ? args.nodeAssociatePublicIpAddress : undefined;
resourceInputs["nodeGroupOptions"] = args ? args.nodeGroupOptions : undefined;
resourceInputs["nodePublicKey"] = args ? args.nodePublicKey : undefined;
resourceInputs["nodeRootVolumeEncrypted"] = args ? args.nodeRootVolumeEncrypted : undefined;
resourceInputs["nodeRootVolumeSize"] = args ? args.nodeRootVolumeSize : undefined;
resourceInputs["nodeSecurityGroupTags"] = args ? args.nodeSecurityGroupTags : undefined;
resourceInputs["nodeSubnetIds"] = args ? args.nodeSubnetIds : undefined;
resourceInputs["nodeUserData"] = args ? args.nodeUserData : undefined;
resourceInputs["privateSubnetIds"] = args ? args.privateSubnetIds : undefined;
resourceInputs["providerCredentialOpts"] = args ? args.providerCredentialOpts : undefined;
resourceInputs["proxy"] = args ? args.proxy : undefined;
resourceInputs["publicAccessCidrs"] = args ? args.publicAccessCidrs : undefined;
resourceInputs["publicSubnetIds"] = args ? args.publicSubnetIds : undefined;
resourceInputs["roleMappings"] = args ? args.roleMappings : undefined;
resourceInputs["serviceRole"] = args ? args.serviceRole : undefined;
resourceInputs["skipDefaultNodeGroup"] = args ? args.skipDefaultNodeGroup : undefined;
resourceInputs["skipDefaultSecurityGroups"] = args ? args.skipDefaultSecurityGroups : undefined;
resourceInputs["storageClasses"] = args ? args.storageClasses : undefined;
resourceInputs["subnetIds"] = args ? args.subnetIds : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["upgradePolicy"] = args ? args.upgradePolicy : undefined;
resourceInputs["useDefaultVpcCni"] = args ? args.useDefaultVpcCni : undefined;
resourceInputs["userMappings"] = args ? args.userMappings : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["vpcCniOptions"] = args ? (args.vpcCniOptions ? inputs.vpcCniOptionsArgsProvideDefaults(args.vpcCniOptions) : undefined) : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["autoModeNodeRoleName"] = undefined /*out*/;
resourceInputs["awsProvider"] = undefined /*out*/;
resourceInputs["clusterIngressRuleId"] = undefined /*out*/;
resourceInputs["clusterSecurityGroupId"] = undefined /*out*/;
resourceInputs["core"] = undefined /*out*/;
resourceInputs["defaultNodeGroup"] = undefined /*out*/;
resourceInputs["defaultNodeGroupAsgName"] = undefined /*out*/;
resourceInputs["eksCluster"] = undefined /*out*/;
resourceInputs["eksClusterIngressRule"] = undefined /*out*/;
resourceInputs["fargateProfileId"] = undefined /*out*/;
resourceInputs["fargateProfileStatus"] = undefined /*out*/;
resourceInputs["kubeconfig"] = undefined /*out*/;
resourceInputs["kubeconfigJson"] = undefined /*out*/;
resourceInputs["nodeSecurityGroup"] = undefined /*out*/;
resourceInputs["nodeSecurityGroupId"] = undefined /*out*/;
resourceInputs["oidcIssuer"] = undefined /*out*/;
resourceInputs["oidcProviderArn"] = undefined /*out*/;
resourceInputs["oidcProviderUrl"] = undefined /*out*/;
}
else {
resourceInputs["autoModeNodeRoleName"] = undefined /*out*/;
resourceInputs["awsProvider"] = undefined /*out*/;
resourceInputs["clusterIngressRuleId"] = undefined /*out*/;
resourceInputs["clusterSecurityGroup"] = undefined /*out*/;
resourceInputs["clusterSecurityGroupId"] = undefined /*out*/;
resourceInputs["core"] = undefined /*out*/;
resourceInputs["defaultNodeGroup"] = undefined /*out*/;
resourceInputs["defaultNodeGroupAsgName"] = undefined /*out*/;
resourceInputs["eksCluster"] = undefined /*out*/;
resourceInputs["eksClusterIngressRule"] = undefined /*out*/;
resourceInputs["fargateProfileId"] = undefined /*out*/;
resourceInputs["fargateProfileStatus"] = undefined /*out*/;
resourceInputs["instanceRoles"] = undefined /*out*/;
resourceInputs["kubeconfig"] = undefined /*out*/;
resourceInputs["kubeconfigJson"] = undefined /*out*/;
resourceInputs["nodeSecurityGroup"] = undefined /*out*/;
resourceInputs["nodeSecurityGroupId"] = undefined /*out*/;
resourceInputs["oidcIssuer"] = undefined /*out*/;
resourceInputs["oidcProviderArn"] = undefined /*out*/;
resourceInputs["oidcProviderUrl"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Cluster.__pulumiType, name, resourceInputs, opts, true /*remote*/);
}
/**
* Generate a kubeconfig for cluster authentication that does not use the default AWS credential provider chain, and instead is scoped to the supported options in `KubeconfigOptions`.
*
* The kubeconfig generated is automatically stringified for ease of use with the pulumi/kubernetes provider.
*
* See for more details:
* - https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html
* - https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html
* - https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html
*/
getKubeconfig(args) {
args = args || {};
return pulumi.runtime.call("eks:index:Cluster/getKubeconfig", {
"__self__": this,
"profileName": args.profileName,
"roleArn": args.roleArn,
}, this);
}
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'eks:index:Cluster';
//# sourceMappingURL=cluster.js.map