UNPKG

@pulumi/aws

Version:

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

144 lines 6.71 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.SamplingRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates and manages an AWS XRay Sampling Rule. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.xray.SamplingRule("example", { * ruleName: "example", * priority: 9999, * version: 1, * reservoirSize: 1, * fixedRate: 0.05, * urlPath: "*", * host: "*", * httpMethod: "*", * serviceType: "*", * serviceName: "*", * resourceArn: "*", * attributes: { * Hello: "Tris", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import XRay Sampling Rules using the name. For example: * * ```sh * $ pulumi import aws:xray/samplingRule:SamplingRule example example * ``` */ class SamplingRule extends pulumi.CustomResource { /** * Get an existing SamplingRule 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 SamplingRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SamplingRule. 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'] === SamplingRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["attributes"] = state ? state.attributes : undefined; resourceInputs["fixedRate"] = state ? state.fixedRate : undefined; resourceInputs["host"] = state ? state.host : undefined; resourceInputs["httpMethod"] = state ? state.httpMethod : undefined; resourceInputs["priority"] = state ? state.priority : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["reservoirSize"] = state ? state.reservoirSize : undefined; resourceInputs["resourceArn"] = state ? state.resourceArn : undefined; resourceInputs["ruleName"] = state ? state.ruleName : undefined; resourceInputs["serviceName"] = state ? state.serviceName : undefined; resourceInputs["serviceType"] = state ? state.serviceType : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["urlPath"] = state ? state.urlPath : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.fixedRate === undefined) && !opts.urn) { throw new Error("Missing required property 'fixedRate'"); } if ((!args || args.host === undefined) && !opts.urn) { throw new Error("Missing required property 'host'"); } if ((!args || args.httpMethod === undefined) && !opts.urn) { throw new Error("Missing required property 'httpMethod'"); } if ((!args || args.priority === undefined) && !opts.urn) { throw new Error("Missing required property 'priority'"); } if ((!args || args.reservoirSize === undefined) && !opts.urn) { throw new Error("Missing required property 'reservoirSize'"); } if ((!args || args.resourceArn === undefined) && !opts.urn) { throw new Error("Missing required property 'resourceArn'"); } if ((!args || args.serviceName === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceName'"); } if ((!args || args.serviceType === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceType'"); } if ((!args || args.urlPath === undefined) && !opts.urn) { throw new Error("Missing required property 'urlPath'"); } if ((!args || args.version === undefined) && !opts.urn) { throw new Error("Missing required property 'version'"); } resourceInputs["attributes"] = args ? args.attributes : undefined; resourceInputs["fixedRate"] = args ? args.fixedRate : undefined; resourceInputs["host"] = args ? args.host : undefined; resourceInputs["httpMethod"] = args ? args.httpMethod : undefined; resourceInputs["priority"] = args ? args.priority : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["reservoirSize"] = args ? args.reservoirSize : undefined; resourceInputs["resourceArn"] = args ? args.resourceArn : undefined; resourceInputs["ruleName"] = args ? args.ruleName : undefined; resourceInputs["serviceName"] = args ? args.serviceName : undefined; resourceInputs["serviceType"] = args ? args.serviceType : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["urlPath"] = args ? args.urlPath : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SamplingRule.__pulumiType, name, resourceInputs, opts); } } exports.SamplingRule = SamplingRule; /** @internal */ SamplingRule.__pulumiType = 'aws:xray/samplingRule:SamplingRule'; //# sourceMappingURL=samplingRule.js.map