UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

158 lines 7.19 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Addon = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an EKS add-on. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.eks.Addon("example", { * clusterName: exampleAwsEksCluster.name, * addonName: "vpc-cni", * }); * ``` * * ## Example Update add-on usage with resolveConflictsOnUpdate and PRESERVE * * `resolveConflictsOnUpdate` with `PRESERVE` can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.eks.Addon("example", { * clusterName: exampleAwsEksCluster.name, * addonName: "coredns", * addonVersion: "v1.10.1-eksbuild.1", * resolveConflictsOnUpdate: "PRESERVE", * }); * ``` * * ## Example add-on usage with custom configurationValues * * Custom add-on configuration can be passed using `configurationValues` as a single JSON string while creating or updating the add-on. * * > **Note:** `configurationValues` is a single JSON string should match the valid JSON schema for each add-on with specific version. * * To find the correct JSON schema for each add-on can be extracted using [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html) call. * This below is an example for extracting the `configurationValues` schema for `coredns`. * * Example to create a `coredns` managed addon with custom `configurationValues`. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.eks.Addon("example", { * clusterName: "mycluster", * addonName: "coredns", * addonVersion: "v1.10.1-eksbuild.1", * resolveConflictsOnCreate: "OVERWRITE", * configurationValues: JSON.stringify({ * replicaCount: 4, * resources: { * limits: { * cpu: "100m", * memory: "150Mi", * }, * requests: { * cpu: "100m", * memory: "150Mi", * }, * }, * }), * }); * ``` * * ## Import * * Using `pulumi import`, import EKS add-on using the `cluster_name` and `addon_name` separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:eks/addon:Addon my_eks_addon my_cluster_name:my_addon_name * ``` */ class Addon extends pulumi.CustomResource { /** * Get an existing Addon resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Addon(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Addon. 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'] === Addon.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["addonName"] = state ? state.addonName : undefined; resourceInputs["addonVersion"] = state ? state.addonVersion : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["clusterName"] = state ? state.clusterName : undefined; resourceInputs["configurationValues"] = state ? state.configurationValues : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["modifiedAt"] = state ? state.modifiedAt : undefined; resourceInputs["podIdentityAssociations"] = state ? state.podIdentityAssociations : undefined; resourceInputs["preserve"] = state ? state.preserve : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["resolveConflictsOnCreate"] = state ? state.resolveConflictsOnCreate : undefined; resourceInputs["resolveConflictsOnUpdate"] = state ? state.resolveConflictsOnUpdate : undefined; resourceInputs["serviceAccountRoleArn"] = state ? state.serviceAccountRoleArn : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.addonName === undefined) && !opts.urn) { throw new Error("Missing required property 'addonName'"); } if ((!args || args.clusterName === undefined) && !opts.urn) { throw new Error("Missing required property 'clusterName'"); } resourceInputs["addonName"] = args ? args.addonName : undefined; resourceInputs["addonVersion"] = args ? args.addonVersion : undefined; resourceInputs["clusterName"] = args ? args.clusterName : undefined; resourceInputs["configurationValues"] = args ? args.configurationValues : undefined; resourceInputs["podIdentityAssociations"] = args ? args.podIdentityAssociations : undefined; resourceInputs["preserve"] = args ? args.preserve : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["resolveConflictsOnCreate"] = args ? args.resolveConflictsOnCreate : undefined; resourceInputs["resolveConflictsOnUpdate"] = args ? args.resolveConflictsOnUpdate : undefined; resourceInputs["serviceAccountRoleArn"] = args ? args.serviceAccountRoleArn : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["modifiedAt"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Addon.__pulumiType, name, resourceInputs, opts); } } exports.Addon = Addon; /** @internal */ Addon.__pulumiType = 'aws:eks/addon:Addon'; //# sourceMappingURL=addon.js.map