UNPKG

@pulumi/aws

Version:

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

200 lines • 7.61 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.Feature = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a CloudWatch Evidently Feature resource. * * > **Warning:** This resource is deprecated. Use [AWS AppConfig feature flags](https://aws.amazon.com/blogs/mt/using-aws-appconfig-feature-flags/) instead. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.evidently.Feature("example", { * name: "example", * project: exampleAwsEvidentlyProject.name, * description: "example description", * variations: [{ * name: "Variation1", * value: { * stringValue: "example", * }, * }], * tags: { * Key1: "example Feature", * }, * }); * ``` * * ### With default variation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.evidently.Feature("example", { * name: "example", * project: exampleAwsEvidentlyProject.name, * defaultVariation: "Variation2", * variations: [ * { * name: "Variation1", * value: { * stringValue: "exampleval1", * }, * }, * { * name: "Variation2", * value: { * stringValue: "exampleval2", * }, * }, * ], * }); * ``` * * ### With entity overrides * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.evidently.Feature("example", { * name: "example", * project: exampleAwsEvidentlyProject.name, * entityOverrides: { * test1: "Variation1", * }, * variations: [ * { * name: "Variation1", * value: { * stringValue: "exampleval1", * }, * }, * { * name: "Variation2", * value: { * stringValue: "exampleval2", * }, * }, * ], * }); * ``` * * ### With evaluation strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.evidently.Feature("example", { * name: "example", * project: exampleAwsEvidentlyProject.name, * evaluationStrategy: "ALL_RULES", * entityOverrides: { * test1: "Variation1", * }, * variations: [{ * name: "Variation1", * value: { * stringValue: "exampleval1", * }, * }], * }); * ``` * * ## Import * * Using `pulumi import`, import CloudWatch Evidently Feature using the feature `name` and `name` or `arn` of the hosting CloudWatch Evidently Project separated by a `:`. For example: * * ```sh * $ pulumi import aws:evidently/feature:Feature example exampleFeatureName:arn:aws:evidently:us-east-1:123456789012:project/example * ``` */ class Feature extends pulumi.CustomResource { /** * Get an existing Feature 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 Feature(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Feature. 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'] === Feature.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["createdTime"] = state ? state.createdTime : undefined; resourceInputs["defaultVariation"] = state ? state.defaultVariation : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["entityOverrides"] = state ? state.entityOverrides : undefined; resourceInputs["evaluationRules"] = state ? state.evaluationRules : undefined; resourceInputs["evaluationStrategy"] = state ? state.evaluationStrategy : undefined; resourceInputs["lastUpdatedTime"] = state ? state.lastUpdatedTime : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["valueType"] = state ? state.valueType : undefined; resourceInputs["variations"] = state ? state.variations : undefined; } else { const args = argsOrState; if ((!args || args.project === undefined) && !opts.urn) { throw new Error("Missing required property 'project'"); } if ((!args || args.variations === undefined) && !opts.urn) { throw new Error("Missing required property 'variations'"); } resourceInputs["defaultVariation"] = args ? args.defaultVariation : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["entityOverrides"] = args ? args.entityOverrides : undefined; resourceInputs["evaluationStrategy"] = args ? args.evaluationStrategy : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["variations"] = args ? args.variations : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["createdTime"] = undefined /*out*/; resourceInputs["evaluationRules"] = undefined /*out*/; resourceInputs["lastUpdatedTime"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["valueType"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Feature.__pulumiType, name, resourceInputs, opts); } } exports.Feature = Feature; /** @internal */ Feature.__pulumiType = 'aws:evidently/feature:Feature'; //# sourceMappingURL=feature.js.map