Class Pipe


  • public class Pipe
    extends com.pulumi.resources.CustomResource
    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
     
     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.ArrayList;
     import java.util.Arrays;
     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(GetCallerIdentityArgs.builder()
                 .build());
     
             var example = new Role("example", 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.accountId())
                                 ))
                             ))
                         ))
                     )))
                 .build());
     
             var sourceQueue = new Queue("sourceQueue");
     
             var source = new RolePolicy("source", RolePolicyArgs.builder()
                 .role(example.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 target = new RolePolicy("target", RolePolicyArgs.builder()
                 .role(example.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()
                 .name("example-pipe")
                 .roleArn(example.arn())
                 .source(sourceQueue.arn())
                 .target(targetQueue.arn())
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(                
                         source,
                         target)
                     .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.ArrayList;
     import java.util.Arrays;
     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()
                 .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())
                 .name("example-pipe")
                 .roleArn(exampleAwsIamRole.arn())
                 .source(source.arn())
                 .target(target.arn())
                 .enrichment(exampleAwsCloudwatchEventApiDestination.arn())
                 .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 com.pulumi.aws.pipes.inputs.PipeSourceParametersFilterCriteriaFilterArgs;
     import static com.pulumi.codegen.internal.Serialization.*;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .sourceParameters(PipeSourceParametersArgs.builder()
                     .filterCriteria(PipeSourceParametersFilterCriteriaArgs.builder()
                         .filters(PipeSourceParametersFilterCriteriaFilterArgs.builder()
                             .pattern(serializeJson(
                                 jsonObject(
                                     jsonProperty("source", jsonArray("event-source"))
                                 )))
                             .build())
                         .build())
                     .build())
                 .name("example-pipe")
                 .roleArn(exampleAwsIamRole.arn())
                 .source(source.arn())
                 .target(target.arn())
                 .build());
     
         }
     }
     
     
    ### CloudWatch Logs Logging Configuration Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatch.LogGroup;
     import com.pulumi.aws.cloudwatch.LogGroupArgs;
     import com.pulumi.aws.pipes.Pipe;
     import com.pulumi.aws.pipes.PipeArgs;
     import com.pulumi.aws.pipes.inputs.PipeLogConfigurationArgs;
     import com.pulumi.aws.pipes.inputs.PipeLogConfigurationCloudwatchLogsLogDestinationArgs;
     import com.pulumi.resources.CustomResourceOptions;
     import java.util.ArrayList;
     import java.util.Arrays;
     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 LogGroup("example", LogGroupArgs.builder()
                 .name("example-pipe-target")
                 .build());
     
             var examplePipe = new Pipe("examplePipe", PipeArgs.builder()
                 .logConfiguration(PipeLogConfigurationArgs.builder()
                     .cloudwatchLogsLogDestination(PipeLogConfigurationCloudwatchLogsLogDestinationArgs.builder()
                         .logGroupArn(targetAwsCloudwatchLogGroup.arn())
                         .build())
                     .includeExecutionDatas("ALL")
                     .level("INFO")
                     .build())
                 .name("example-pipe")
                 .roleArn(exampleAwsIamRole.arn())
                 .source(sourceAwsSqsQueue.arn())
                 .target(targetAwsSqsQueue.arn())
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(                
                         source,
                         target)
                     .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 com.pulumi.aws.pipes.inputs.PipeTargetParametersSqsQueueParametersArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .sourceParameters(PipeSourceParametersArgs.builder()
                     .sqsQueueParameters(PipeSourceParametersSqsQueueParametersArgs.builder()
                         .batchSize(1)
                         .maximumBatchingWindowInSeconds(2)
                         .build())
                     .build())
                 .targetParameters(PipeTargetParametersArgs.builder()
                     .sqsQueueParameters(PipeTargetParametersSqsQueueParametersArgs.builder()
                         .messageDeduplicationId("example-dedupe")
                         .messageGroupId("example-group")
                         .build())
                     .build())
                 .name("example-pipe")
                 .roleArn(exampleAwsIamRole.arn())
                 .source(source.arn())
                 .target(target.arn())
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import pipes using the `name`. For example: ```sh $ pulumi import aws:pipes/pipe:Pipe example my-pipe ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Pipe​(java.lang.String name)  
      Pipe​(java.lang.String name, PipeArgs args)  
      Pipe​(java.lang.String name, PipeArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> desiredState()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> enrichment()  
      com.pulumi.core.Output<java.util.Optional<PipeEnrichmentParameters>> enrichmentParameters()  
      static Pipe get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PipeState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyIdentifier()  
      com.pulumi.core.Output<java.util.Optional<PipeLogConfiguration>> logConfiguration()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> namePrefix()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> roleArn()  
      com.pulumi.core.Output<java.lang.String> source()  
      com.pulumi.core.Output<PipeSourceParameters> sourceParameters()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> target()  
      com.pulumi.core.Output<java.util.Optional<PipeTargetParameters>> targetParameters()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Pipe

        public Pipe​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Pipe

        public Pipe​(java.lang.String name,
                    PipeArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Pipe

        public Pipe​(java.lang.String name,
                    PipeArgs args,
                    @Nullable
                    com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of this pipe.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Description of the pipe. At most 512 characters.
      • desiredState

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> desiredState()
        Returns:
        State the pipe should be in. One of: `RUNNING`, `STOPPED`.
      • enrichment

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> enrichment()
        Returns:
        Enrichment resource of the pipe (typically an ARN). Read more about enrichment in the [User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html#pipes-enrichment).
      • enrichmentParameters

        public com.pulumi.core.Output<java.util.Optional<PipeEnrichmentParameters>> enrichmentParameters()
        Returns:
        Parameters to configure enrichment for the pipe. See `enrichmentParameters` Block for details.
      • kmsKeyIdentifier

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyIdentifier()
        Returns:
        Identifier of the AWS KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt pipe data. The identifier can be the key ARN, KeyId, key alias, or key alias ARN. If not set, EventBridge uses an AWS owned key to encrypt pipe data.
      • logConfiguration

        public com.pulumi.core.Output<java.util.Optional<PipeLogConfiguration>> logConfiguration()
        Returns:
        Logging configuration settings for the pipe. See `logConfiguration` Block for details.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the pipe. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
      • namePrefix

        public com.pulumi.core.Output<java.lang.String> namePrefix()
        Returns:
        Creates a unique name beginning with the specified prefix. Conflicts with `name`.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • roleArn

        public com.pulumi.core.Output<java.lang.String> roleArn()
        Returns:
        ARN of the role that allows the pipe to send data to the target.
      • source

        public com.pulumi.core.Output<java.lang.String> source()
        Returns:
        Source resource of the pipe. This field typically requires an ARN. However, when using a self-managed Kafka cluster, you should use a different format. Instead of an ARN, use 'smk://' followed by the bootstrap server's address.
      • sourceParameters

        public com.pulumi.core.Output<PipeSourceParameters> sourceParameters()
        Returns:
        Parameters to configure a source for the pipe. See `sourceParameters` Block for details.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • target

        public com.pulumi.core.Output<java.lang.String> target()
        Returns:
        Target resource of the pipe (typically an ARN). The following arguments are optional:
      • targetParameters

        public com.pulumi.core.Output<java.util.Optional<PipeTargetParameters>> targetParameters()
        Returns:
        Parameters to configure a target for the pipe. See `targetParameters` Block for details.
      • get

        public static Pipe get​(java.lang.String name,
                               com.pulumi.core.Output<java.lang.String> id,
                               @Nullable
                               PipeState state,
                               @Nullable
                               com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.