@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
158 lines • 6.63 kB
JavaScript
;
// *** 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.
*
* You can use [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html) to extract each add-on's JSON schema.
* Here's an example command to extract 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, { ...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?.addonName;
resourceInputs["addonVersion"] = state?.addonVersion;
resourceInputs["arn"] = state?.arn;
resourceInputs["clusterName"] = state?.clusterName;
resourceInputs["configurationValues"] = state?.configurationValues;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["modifiedAt"] = state?.modifiedAt;
resourceInputs["podIdentityAssociations"] = state?.podIdentityAssociations;
resourceInputs["preserve"] = state?.preserve;
resourceInputs["region"] = state?.region;
resourceInputs["resolveConflictsOnCreate"] = state?.resolveConflictsOnCreate;
resourceInputs["resolveConflictsOnUpdate"] = state?.resolveConflictsOnUpdate;
resourceInputs["serviceAccountRoleArn"] = state?.serviceAccountRoleArn;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.addonName === undefined && !opts.urn) {
throw new Error("Missing required property 'addonName'");
}
if (args?.clusterName === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterName'");
}
resourceInputs["addonName"] = args?.addonName;
resourceInputs["addonVersion"] = args?.addonVersion;
resourceInputs["clusterName"] = args?.clusterName;
resourceInputs["configurationValues"] = args?.configurationValues;
resourceInputs["podIdentityAssociations"] = args?.podIdentityAssociations;
resourceInputs["preserve"] = args?.preserve;
resourceInputs["region"] = args?.region;
resourceInputs["resolveConflictsOnCreate"] = args?.resolveConflictsOnCreate;
resourceInputs["resolveConflictsOnUpdate"] = args?.resolveConflictsOnUpdate;
resourceInputs["serviceAccountRoleArn"] = args?.serviceAccountRoleArn;
resourceInputs["tags"] = args?.tags;
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