@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
200 lines • 7.09 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.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, { ...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?.arn;
resourceInputs["createdTime"] = state?.createdTime;
resourceInputs["defaultVariation"] = state?.defaultVariation;
resourceInputs["description"] = state?.description;
resourceInputs["entityOverrides"] = state?.entityOverrides;
resourceInputs["evaluationRules"] = state?.evaluationRules;
resourceInputs["evaluationStrategy"] = state?.evaluationStrategy;
resourceInputs["lastUpdatedTime"] = state?.lastUpdatedTime;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["region"] = state?.region;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["valueType"] = state?.valueType;
resourceInputs["variations"] = state?.variations;
}
else {
const args = argsOrState;
if (args?.project === undefined && !opts.urn) {
throw new Error("Missing required property 'project'");
}
if (args?.variations === undefined && !opts.urn) {
throw new Error("Missing required property 'variations'");
}
resourceInputs["defaultVariation"] = args?.defaultVariation;
resourceInputs["description"] = args?.description;
resourceInputs["entityOverrides"] = args?.entityOverrides;
resourceInputs["evaluationStrategy"] = args?.evaluationStrategy;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["variations"] = args?.variations;
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