Class Topic


  • public class Topic
    extends com.pulumi.resources.CustomResource
    Manages an AWS Managed Streaming for Kafka Topic. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.msk.Topic;
     import com.pulumi.aws.msk.TopicArgs;
     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 Topic("example", TopicArgs.builder()
                 .name("Example")
                 .clusterArn(exampleAwsMskCluster.arn())
                 .partitionCount(2)
                 .replicationFactor(2)
                 .configs(serializeJson(
                     jsonObject(
                         jsonProperty("retention.ms", "604800000"),
                         jsonProperty("retention.bytes", "-1"),
                         jsonProperty("cleanup.policy", "delete"),
                         jsonProperty("min.insync.replicas", "2")
                     )))
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `clusterArn` (String) ARN that uniquely identifies MSK Cluster. * `name` (String) Name of Topic. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Managed Streaming for Kafka Topic using the `clusterArn` and `name`. For example: ```sh $ pulumi import aws:msk/topic:Topic example arn:aws:kafka:us-west-2:123456789012:cluster/example/279c0212-d057-4dba-9aa9-1c4e5a25bfc7-3,topicname ```
    • 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
      Topic​(java.lang.String name)  
      Topic​(java.lang.String name, TopicArgs args)  
      Topic​(java.lang.String name, TopicArgs 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.lang.String> clusterArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> configs()  
      com.pulumi.core.Output<java.lang.String> configsActual()  
      static Topic get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TopicState 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.lang.String> name()  
      com.pulumi.core.Output<java.lang.Integer> partitionCount()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.Integer> replicationFactor()  
      com.pulumi.core.Output<java.util.Optional<TopicTimeouts>> timeouts()  
      • 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

      • Topic

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

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

        public Topic​(java.lang.String name,
                     TopicArgs 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 the Topic.
      • clusterArn

        public com.pulumi.core.Output<java.lang.String> clusterArn()
        Returns:
        ARN that uniquely identifies MSK Cluster.
      • configs

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> configs()
        Returns:
        Explicit configured Kafka configuration in JSON format for Topic.
      • configsActual

        public com.pulumi.core.Output<java.lang.String> configsActual()
        Returns:
        Aggregated Kafka configuration in JSON format for Topic, both explicit set values from `configs` and implicit set values (AWS default configuration, historically set values or manual configuration from outside Terraform).
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of Topic.
      • partitionCount

        public com.pulumi.core.Output<java.lang.Integer> partitionCount()
        Returns:
        Number of partitions for Topic.
      • 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.
      • replicationFactor

        public com.pulumi.core.Output<java.lang.Integer> replicationFactor()
        Returns:
        Replication factor for Topic. The following arguments are optional:
      • timeouts

        public com.pulumi.core.Output<java.util.Optional<TopicTimeouts>> timeouts()
      • get

        public static Topic get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                TopicState 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.