UNPKG

@pulumi/aws

Version:

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

158 lines 6.19 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.Pipeline = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS OpenSearch Ingestion Pipeline. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegion({}); * const example = new aws.iam.Role("example", {assumeRolePolicy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Action: "sts:AssumeRole", * Effect: "Allow", * Sid: "", * Principal: { * Service: "osis-pipelines.amazonaws.com", * }, * }], * })}); * const examplePipeline = new aws.opensearchingest.Pipeline("example", { * pipelineName: "example", * pipelineConfigurationBody: pulumi.all([example.arn, current]).apply(([arn, current]) => `version: "2" * example-pipeline: * source: * http: * path: "/example" * sink: * - s3: * aws: * sts_role_arn: "${arn}" * region: "${current.region}" * bucket: "example" * threshold: * event_collect_timeout: "60s" * codec: * ndjson: * `), * maxUnits: 1, * minUnits: 1, * }); * ``` * * ### Using file function * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as std from "@pulumi/std"; * * const example = new aws.opensearchingest.Pipeline("example", { * pipelineName: "example", * pipelineConfigurationBody: std.file({ * input: "example.yaml", * }).then(invoke => invoke.result), * maxUnits: 1, * minUnits: 1, * }); * ``` * * ## Import * * Using `pulumi import`, import OpenSearch Ingestion Pipeline using the `id`. For example: * * ```sh * $ pulumi import aws:opensearchingest/pipeline:Pipeline example example * ``` */ class Pipeline extends pulumi.CustomResource { /** * Get an existing Pipeline 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 Pipeline(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Pipeline. 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'] === Pipeline.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bufferOptions"] = state?.bufferOptions; resourceInputs["encryptionAtRestOptions"] = state?.encryptionAtRestOptions; resourceInputs["ingestEndpointUrls"] = state?.ingestEndpointUrls; resourceInputs["logPublishingOptions"] = state?.logPublishingOptions; resourceInputs["maxUnits"] = state?.maxUnits; resourceInputs["minUnits"] = state?.minUnits; resourceInputs["pipelineArn"] = state?.pipelineArn; resourceInputs["pipelineConfigurationBody"] = state?.pipelineConfigurationBody; resourceInputs["pipelineName"] = state?.pipelineName; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; resourceInputs["vpcOptions"] = state?.vpcOptions; } else { const args = argsOrState; if (args?.maxUnits === undefined && !opts.urn) { throw new Error("Missing required property 'maxUnits'"); } if (args?.minUnits === undefined && !opts.urn) { throw new Error("Missing required property 'minUnits'"); } if (args?.pipelineConfigurationBody === undefined && !opts.urn) { throw new Error("Missing required property 'pipelineConfigurationBody'"); } if (args?.pipelineName === undefined && !opts.urn) { throw new Error("Missing required property 'pipelineName'"); } resourceInputs["bufferOptions"] = args?.bufferOptions; resourceInputs["encryptionAtRestOptions"] = args?.encryptionAtRestOptions; resourceInputs["logPublishingOptions"] = args?.logPublishingOptions; resourceInputs["maxUnits"] = args?.maxUnits; resourceInputs["minUnits"] = args?.minUnits; resourceInputs["pipelineConfigurationBody"] = args?.pipelineConfigurationBody; resourceInputs["pipelineName"] = args?.pipelineName; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["vpcOptions"] = args?.vpcOptions; resourceInputs["ingestEndpointUrls"] = undefined /*out*/; resourceInputs["pipelineArn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Pipeline.__pulumiType, name, resourceInputs, opts); } } exports.Pipeline = Pipeline; /** @internal */ Pipeline.__pulumiType = 'aws:opensearchingest/pipeline:Pipeline'; //# sourceMappingURL=pipeline.js.map