UNPKG

@pulumi/aws

Version:

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

129 lines 5.25 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.FargateProfile = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an EKS Fargate Profile. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.eks.FargateProfile("example", { * clusterName: exampleAwsEksCluster.name, * fargateProfileName: "example", * podExecutionRoleArn: exampleAwsIamRole.arn, * subnetIds: exampleAwsSubnet.map(__item => __item.id), * selectors: [{ * namespace: "example", * }], * }); * ``` * * ### Example IAM Role for EKS Fargate Profile * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.iam.Role("example", { * name: "eks-fargate-profile-example", * assumeRolePolicy: JSON.stringify({ * Statement: [{ * Action: "sts:AssumeRole", * Effect: "Allow", * Principal: { * Service: "eks-fargate-pods.amazonaws.com", * }, * }], * Version: "2012-10-17", * }), * }); * const example_AmazonEKSFargatePodExecutionRolePolicy = new aws.iam.RolePolicyAttachment("example-AmazonEKSFargatePodExecutionRolePolicy", { * policyArn: "arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy", * role: example.name, * }); * ``` * * ## Import * * Using `pulumi import`, import EKS Fargate Profiles using the `cluster_name` and `fargate_profile_name` separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:eks/fargateProfile:FargateProfile my_fargate_profile my_cluster:my_fargate_profile * ``` */ class FargateProfile extends pulumi.CustomResource { /** * Get an existing FargateProfile 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 FargateProfile(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of FargateProfile. 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'] === FargateProfile.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["clusterName"] = state?.clusterName; resourceInputs["fargateProfileName"] = state?.fargateProfileName; resourceInputs["podExecutionRoleArn"] = state?.podExecutionRoleArn; resourceInputs["region"] = state?.region; resourceInputs["selectors"] = state?.selectors; resourceInputs["status"] = state?.status; resourceInputs["subnetIds"] = state?.subnetIds; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.clusterName === undefined && !opts.urn) { throw new Error("Missing required property 'clusterName'"); } if (args?.podExecutionRoleArn === undefined && !opts.urn) { throw new Error("Missing required property 'podExecutionRoleArn'"); } if (args?.selectors === undefined && !opts.urn) { throw new Error("Missing required property 'selectors'"); } resourceInputs["clusterName"] = args?.clusterName; resourceInputs["fargateProfileName"] = args?.fargateProfileName; resourceInputs["podExecutionRoleArn"] = args?.podExecutionRoleArn; resourceInputs["region"] = args?.region; resourceInputs["selectors"] = args?.selectors; resourceInputs["subnetIds"] = args?.subnetIds; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FargateProfile.__pulumiType, name, resourceInputs, opts); } } exports.FargateProfile = FargateProfile; /** @internal */ FargateProfile.__pulumiType = 'aws:eks/fargateProfile:FargateProfile'; //# sourceMappingURL=fargateProfile.js.map