PipeArgs

data class PipeArgs(val description: Output<String>? = null, val desiredState: Output<String>? = null, val enrichment: Output<String>? = null, val enrichmentParameters: Output<PipeEnrichmentParametersArgs>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val roleArn: Output<String>? = null, val source: Output<String>? = null, val sourceParameters: Output<PipeSourceParametersArgs>? = null, val tags: Output<Map<String, String>>? = null, val target: Output<String>? = null, val targetParameters: Output<PipeTargetParametersArgs>? = null) : ConvertibleToJava<PipeArgs>

Resource for managing an AWS EventBridge Pipes Pipe. You can find out more about EventBridge Pipes in the User Guide. 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.

Note: EventBridge was formerly known as CloudWatch Events. The functionality is identical.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import com.pulumi.aws.pipes.Pipe;
import com.pulumi.aws.pipes.PipeArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var main = AwsFunctions.getCallerIdentity();
var exampleRole = new Role("exampleRole", RoleArgs.builder()
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonObject(
jsonProperty("Effect", "Allow"),
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "pipes.amazonaws.com")
)),
jsonProperty("Condition", jsonObject(
jsonProperty("StringEquals", jsonObject(
jsonProperty("aws:SourceAccount", main.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
))
))
))
)))
.build());
var sourceQueue = new Queue("sourceQueue");
var sourceRolePolicy = new RolePolicy("sourceRolePolicy", RolePolicyArgs.builder()
.role(exampleRole.id())
.policy(sourceQueue.arn().applyValue(arn -> serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Effect", "Allow"),
jsonProperty("Action", jsonArray(
"sqs:DeleteMessage",
"sqs:GetQueueAttributes",
"sqs:ReceiveMessage"
)),
jsonProperty("Resource", jsonArray(arn))
)))
))))
.build());
var targetQueue = new Queue("targetQueue");
var targetRolePolicy = new RolePolicy("targetRolePolicy", RolePolicyArgs.builder()
.role(exampleRole.id())
.policy(targetQueue.arn().applyValue(arn -> serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Effect", "Allow"),
jsonProperty("Action", jsonArray("sqs:SendMessage")),
jsonProperty("Resource", jsonArray(arn))
)))
))))
.build());
var examplePipe = new Pipe("examplePipe", PipeArgs.builder()
.roleArn(exampleRole.arn())
.source(sourceQueue.arn())
.target(targetQueue.arn())
.build(), CustomResourceOptions.builder()
.dependsOn(
sourceRolePolicy,
targetRolePolicy)
.build());
}
}

Enrichment Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.pipes.Pipe;
import com.pulumi.aws.pipes.PipeArgs;
import com.pulumi.aws.pipes.inputs.PipeEnrichmentParametersArgs;
import com.pulumi.aws.pipes.inputs.PipeEnrichmentParametersHttpParametersArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Pipe("example", PipeArgs.builder()
.roleArn(aws_iam_role.example().arn())
.source(aws_sqs_queue.source().arn())
.target(aws_sqs_queue.target().arn())
.enrichment(aws_cloudwatch_event_api_destination.example().arn())
.enrichmentParameters(PipeEnrichmentParametersArgs.builder()
.httpParameters(PipeEnrichmentParametersHttpParametersArgs.builder()
.pathParameterValues("example-path-param")
.headerParameters(Map.ofEntries(
Map.entry("example-header", "example-value"),
Map.entry("second-example-header", "second-example-value")
))
.queryStringParameters(Map.ofEntries(
Map.entry("example-query-string", "example-value"),
Map.entry("second-example-query-string", "second-example-value")
))
.build())
.build())
.build());
}
}

Filter Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.pipes.Pipe;
import com.pulumi.aws.pipes.PipeArgs;
import com.pulumi.aws.pipes.inputs.PipeSourceParametersArgs;
import com.pulumi.aws.pipes.inputs.PipeSourceParametersFilterCriteriaArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Pipe("example", PipeArgs.builder()
.roleArn(aws_iam_role.example().arn())
.source(aws_sqs_queue.source().arn())
.target(aws_sqs_queue.target().arn())
.sourceParameters(PipeSourceParametersArgs.builder()
.filterCriteria(PipeSourceParametersFilterCriteriaArgs.builder()
.filters(PipeSourceParametersFilterCriteriaFilterArgs.builder()
.pattern(serializeJson(
jsonObject(
jsonProperty("source", jsonArray("event-source"))
)))
.build())
.build())
.build())
.build());
}
}

SQS Source and Target Configuration Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.pipes.Pipe;
import com.pulumi.aws.pipes.PipeArgs;
import com.pulumi.aws.pipes.inputs.PipeSourceParametersArgs;
import com.pulumi.aws.pipes.inputs.PipeSourceParametersSqsQueueParametersArgs;
import com.pulumi.aws.pipes.inputs.PipeTargetParametersArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Pipe("example", PipeArgs.builder()
.roleArn(aws_iam_role.example().arn())
.source(aws_sqs_queue.source().arn())
.target(aws_sqs_queue.target().arn())
.sourceParameters(PipeSourceParametersArgs.builder()
.sqsQueueParameters(PipeSourceParametersSqsQueueParametersArgs.builder()
.batchSize(1)
.maximumBatchingWindowInSeconds(2)
.build())
.build())
.targetParameters(PipeTargetParametersArgs.builder()
.sqsQueue(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.build());
}
}

Import

Using pulumi import, import pipes using the name. For example:

$ pulumi import aws:pipes/pipe:Pipe example my-pipe

Constructors

Link copied to clipboard
fun PipeArgs(description: Output<String>? = null, desiredState: Output<String>? = null, enrichment: Output<String>? = null, enrichmentParameters: Output<PipeEnrichmentParametersArgs>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, roleArn: Output<String>? = null, source: Output<String>? = null, sourceParameters: Output<PipeSourceParametersArgs>? = null, tags: Output<Map<String, String>>? = null, target: Output<String>? = null, targetParameters: Output<PipeTargetParametersArgs>? = null)

Functions

Link copied to clipboard
open override fun toJava(): PipeArgs

Properties

Link copied to clipboard
val description: Output<String>? = null

A description of the pipe. At most 512 characters.

Link copied to clipboard
val desiredState: Output<String>? = null

The state the pipe should be in. One of: RUNNING, STOPPED.

Link copied to clipboard
val enrichment: Output<String>? = null

Enrichment resource of the pipe (typically an ARN). Read more about enrichment in the User Guide.

Link copied to clipboard

Parameters to configure enrichment for your pipe. Detailed below.

Link copied to clipboard
val name: Output<String>? = null

Name of the pipe. If omitted, the provider will assign a random, unique name. Conflicts with name_prefix.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name.

Link copied to clipboard
val roleArn: Output<String>? = null

ARN of the role that allows the pipe to send data to the target.

Link copied to clipboard
val source: Output<String>? = null

Source resource of the pipe (typically an ARN).

Link copied to clipboard

Parameters to configure a source for the pipe. Detailed below.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val target: Output<String>? = null

Target resource of the pipe (typically an ARN). The following arguments are optional:

Link copied to clipboard

Parameters to configure a target for your pipe. Detailed below.