Pipe
Resource for managing an AWS EventBridge Pipes Pipe. You can find out more about EventBridge Pipes 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.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 com.pulumi.aws.pipes.inputs.PipeSourceParametersArgs;
import com.pulumi.aws.pipes.inputs.PipeTargetParametersArgs;
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 test = new Role("test", 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(test.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(test.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 example = new Pipe("example", PipeArgs.builder()
.roleArn(aws_iam_role.example().arn())
.source(sourceQueue.arn())
.target(targetQueue.arn())
.sourceParameters()
.targetParameters()
.build(), CustomResourceOptions.builder()
.dependsOn(
sourceRolePolicy,
targetRolePolicy)
.build());
}
}Content copied to clipboard
Import
Pipes can be imported using the name. For example
$ pulumi import aws:pipes/pipe:Pipe example my-pipeContent copied to clipboard
Properties
Link copied to clipboard
A description of the pipe. At most 512 characters.
Link copied to clipboard
The state the pipe should be in. One of: RUNNING, STOPPED.
Link copied to clipboard
Enrichment resource of the pipe (typically an ARN). Read more about enrichment in the User Guide.
Link copied to clipboard
Creates a unique name beginning with the specified prefix. Conflicts with name.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Parameters required to set up a source for the pipe. Detailed below.
Link copied to clipboard
Parameters required to set up a target for your pipe. Detailed below. The following arguments are optional: