@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
276 lines • 9.81 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.Pipe = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS EventBridge Pipes Pipe.
*
* You can find out more about EventBridge Pipes in the [User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html).
*
* EventBridge Pipes are very configurable, and may require IAM permissions to work correctly. More information on the configuration options and IAM permissions can be found in the [User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html).
*
* > **Note:** EventBridge was formerly known as CloudWatch Events. The functionality is identical.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = aws.getCallerIdentity({});
* const example = new aws.iam.Role("example", {assumeRolePolicy: JSON.stringify({
* Version: "2012-10-17",
* Statement: {
* Effect: "Allow",
* Action: "sts:AssumeRole",
* Principal: {
* Service: "pipes.amazonaws.com",
* },
* Condition: {
* StringEquals: {
* "aws:SourceAccount": main.then(main => main.accountId),
* },
* },
* },
* })});
* const sourceQueue = new aws.sqs.Queue("source", {});
* const source = new aws.iam.RolePolicy("source", {
* role: example.id,
* policy: pulumi.jsonStringify({
* Version: "2012-10-17",
* Statement: [{
* Effect: "Allow",
* Action: [
* "sqs:DeleteMessage",
* "sqs:GetQueueAttributes",
* "sqs:ReceiveMessage",
* ],
* Resource: [sourceQueue.arn],
* }],
* }),
* });
* const targetQueue = new aws.sqs.Queue("target", {});
* const target = new aws.iam.RolePolicy("target", {
* role: example.id,
* policy: pulumi.jsonStringify({
* Version: "2012-10-17",
* Statement: [{
* Effect: "Allow",
* Action: ["sqs:SendMessage"],
* Resource: [targetQueue.arn],
* }],
* }),
* });
* const examplePipe = new aws.pipes.Pipe("example", {
* name: "example-pipe",
* roleArn: example.arn,
* source: sourceQueue.arn,
* target: targetQueue.arn,
* }, {
* dependsOn: [
* source,
* target,
* ],
* });
* ```
*
* ### Enrichment Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.pipes.Pipe("example", {
* name: "example-pipe",
* roleArn: exampleAwsIamRole.arn,
* source: source.arn,
* target: target.arn,
* enrichment: exampleAwsCloudwatchEventApiDestination.arn,
* enrichmentParameters: {
* httpParameters: {
* pathParameterValues: "example-path-param",
* headerParameters: {
* "example-header": "example-value",
* "second-example-header": "second-example-value",
* },
* queryStringParameters: {
* "example-query-string": "example-value",
* "second-example-query-string": "second-example-value",
* },
* },
* },
* });
* ```
*
* ### Filter Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.pipes.Pipe("example", {
* name: "example-pipe",
* roleArn: exampleAwsIamRole.arn,
* source: source.arn,
* target: target.arn,
* sourceParameters: {
* filterCriteria: {
* filters: [{
* pattern: JSON.stringify({
* source: ["event-source"],
* }),
* }],
* },
* },
* });
* ```
*
* ### CloudWatch Logs Logging Configuration Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.cloudwatch.LogGroup("example", {name: "example-pipe-target"});
* const examplePipe = new aws.pipes.Pipe("example", {
* name: "example-pipe",
* roleArn: exampleAwsIamRole.arn,
* source: sourceAwsSqsQueue.arn,
* target: targetAwsSqsQueue.arn,
* logConfiguration: {
* includeExecutionDatas: ["ALL"],
* level: "INFO",
* cloudwatchLogsLogDestination: {
* logGroupArn: targetAwsCloudwatchLogGroup.arn,
* },
* },
* }, {
* dependsOn: [
* source,
* target,
* ],
* });
* ```
*
* ### SQS Source and Target Configuration Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.pipes.Pipe("example", {
* name: "example-pipe",
* roleArn: exampleAwsIamRole.arn,
* source: source.arn,
* target: target.arn,
* sourceParameters: {
* sqsQueueParameters: {
* batchSize: 1,
* maximumBatchingWindowInSeconds: 2,
* },
* },
* targetParameters: {
* sqsQueueParameters: {
* messageDeduplicationId: "example-dedupe",
* messageGroupId: "example-group",
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import pipes using the `name`. For example:
*
* ```sh
* $ pulumi import aws:pipes/pipe:Pipe example my-pipe
* ```
*/
class Pipe extends pulumi.CustomResource {
/**
* Get an existing Pipe 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 Pipe(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Pipe. 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'] === Pipe.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["desiredState"] = state?.desiredState;
resourceInputs["enrichment"] = state?.enrichment;
resourceInputs["enrichmentParameters"] = state?.enrichmentParameters;
resourceInputs["kmsKeyIdentifier"] = state?.kmsKeyIdentifier;
resourceInputs["logConfiguration"] = state?.logConfiguration;
resourceInputs["name"] = state?.name;
resourceInputs["namePrefix"] = state?.namePrefix;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["source"] = state?.source;
resourceInputs["sourceParameters"] = state?.sourceParameters;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["target"] = state?.target;
resourceInputs["targetParameters"] = state?.targetParameters;
}
else {
const args = argsOrState;
if (args?.roleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
if (args?.source === undefined && !opts.urn) {
throw new Error("Missing required property 'source'");
}
if (args?.target === undefined && !opts.urn) {
throw new Error("Missing required property 'target'");
}
resourceInputs["description"] = args?.description;
resourceInputs["desiredState"] = args?.desiredState;
resourceInputs["enrichment"] = args?.enrichment;
resourceInputs["enrichmentParameters"] = args?.enrichmentParameters;
resourceInputs["kmsKeyIdentifier"] = args?.kmsKeyIdentifier;
resourceInputs["logConfiguration"] = args?.logConfiguration;
resourceInputs["name"] = args?.name;
resourceInputs["namePrefix"] = args?.namePrefix;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["source"] = args?.source;
resourceInputs["sourceParameters"] = args?.sourceParameters;
resourceInputs["tags"] = args?.tags;
resourceInputs["target"] = args?.target;
resourceInputs["targetParameters"] = args?.targetParameters;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Pipe.__pulumiType, name, resourceInputs, opts);
}
}
exports.Pipe = Pipe;
/** @internal */
Pipe.__pulumiType = 'aws:pipes/pipe:Pipe';
//# sourceMappingURL=pipe.js.map
;