UNPKG

@pulumi/aws

Version:

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

205 lines • 8.05 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.HostedConfigurationVersion = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an AppConfig Hosted Configuration Version resource. * * ## Example Usage * * ### Freeform * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.appconfig.HostedConfigurationVersion("example", { * applicationId: exampleAwsAppconfigApplication.id, * configurationProfileId: exampleAwsAppconfigConfigurationProfile.configurationProfileId, * description: "Example Freeform Hosted Configuration Version", * contentType: "application/json", * content: JSON.stringify({ * foo: "bar", * fruit: [ * "apple", * "pear", * "orange", * ], * isThingEnabled: true, * }), * }); * ``` * * ### Feature Flags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.appconfig.HostedConfigurationVersion("example", { * applicationId: exampleAwsAppconfigApplication.id, * configurationProfileId: exampleAwsAppconfigConfigurationProfile.configurationProfileId, * description: "Example Feature Flag Configuration Version", * contentType: "application/json", * content: JSON.stringify({ * flags: { * foo: { * name: "foo", * _deprecation: { * status: "planned", * }, * }, * bar: { * name: "bar", * attributes: { * someAttribute: { * constraints: { * type: "string", * required: true, * }, * }, * someOtherAttribute: { * constraints: { * type: "number", * required: true, * }, * }, * }, * }, * }, * values: { * foo: { * enabled: "true", * }, * bar: { * enabled: "true", * someAttribute: "Hello World", * someOtherAttribute: 123, * }, * }, * version: "1", * }), * }); * ``` * * ### Multi-variant Feature Flags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as std from "@pulumi/std"; * * const example = new aws.appconfig.HostedConfigurationVersion("example", { * applicationId: exampleAwsAppconfigApplication.id, * configurationProfileId: exampleAwsAppconfigConfigurationProfile.configurationProfileId, * description: "Example Multi-variant Feature Flag Configuration Version", * contentType: "application/json", * content: JSON.stringify({ * flags: { * loggingenabled: { * name: "loggingEnabled", * }, * }, * values: { * loggingenabled: { * _variants: std.concat({ * input: [ * .map(userId => ({ * enabled: true, * name: `usersWithLoggingEnabled_${userId}`, * rule: `(or (eq $userId "${userId}"))`, * })), * [{ * enabled: false, * name: "Default", * }], * ], * }).then(invoke => invoke.result), * }, * }, * version: "1", * }), * }); * ``` * * ## Import * * Using `pulumi import`, import AppConfig Hosted Configuration Versions using the application ID, configuration profile ID, and version number separated by a slash (`/`). For example: * * ```sh * $ pulumi import aws:appconfig/hostedConfigurationVersion:HostedConfigurationVersion example 71abcde/11xxxxx/2 * ``` */ class HostedConfigurationVersion extends pulumi.CustomResource { /** * Get an existing HostedConfigurationVersion 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 HostedConfigurationVersion(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of HostedConfigurationVersion. 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'] === HostedConfigurationVersion.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationId"] = state?.applicationId; resourceInputs["arn"] = state?.arn; resourceInputs["configurationProfileId"] = state?.configurationProfileId; resourceInputs["content"] = state?.content; resourceInputs["contentType"] = state?.contentType; resourceInputs["description"] = state?.description; resourceInputs["region"] = state?.region; resourceInputs["versionNumber"] = state?.versionNumber; } else { const args = argsOrState; if (args?.applicationId === undefined && !opts.urn) { throw new Error("Missing required property 'applicationId'"); } if (args?.configurationProfileId === undefined && !opts.urn) { throw new Error("Missing required property 'configurationProfileId'"); } if (args?.content === undefined && !opts.urn) { throw new Error("Missing required property 'content'"); } if (args?.contentType === undefined && !opts.urn) { throw new Error("Missing required property 'contentType'"); } resourceInputs["applicationId"] = args?.applicationId; resourceInputs["configurationProfileId"] = args?.configurationProfileId; resourceInputs["content"] = args?.content ? pulumi.secret(args.content) : undefined; resourceInputs["contentType"] = args?.contentType; resourceInputs["description"] = args?.description; resourceInputs["region"] = args?.region; resourceInputs["arn"] = undefined /*out*/; resourceInputs["versionNumber"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["content"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(HostedConfigurationVersion.__pulumiType, name, resourceInputs, opts); } } exports.HostedConfigurationVersion = HostedConfigurationVersion; /** @internal */ HostedConfigurationVersion.__pulumiType = 'aws:appconfig/hostedConfigurationVersion:HostedConfigurationVersion'; //# sourceMappingURL=hostedConfigurationVersion.js.map