Class Workspace


  • public class Workspace
    extends com.pulumi.resources.CustomResource
    Manages an Amazon Managed Service for Prometheus (AMP) Workspace. ## Example Usage <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.amp.Workspace;
     import com.pulumi.aws.amp.WorkspaceArgs;
     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 Workspace("example", WorkspaceArgs.builder()
                 .alias("example")
                 .tags(Map.of("Environment", "production"))
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### CloudWatch Logging <!--Start PulumiCodeChooser -->
     
     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.amp.Workspace;
     import com.pulumi.aws.amp.WorkspaceArgs;
     import com.pulumi.aws.amp.inputs.WorkspaceLoggingConfigurationArgs;
     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 LogGroup("example", LogGroupArgs.builder()
                 .name("example")
                 .build());
     
             var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
                 .loggingConfiguration(WorkspaceLoggingConfigurationArgs.builder()
                     .logGroupArn(example.arn().applyValue(arn -> String.format("%s:*", arn)))
                     .build())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### AWS KMS Customer Managed Keys (CMK) <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.kms.Key;
     import com.pulumi.aws.kms.KeyArgs;
     import com.pulumi.aws.amp.Workspace;
     import com.pulumi.aws.amp.WorkspaceArgs;
     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 exampleKey = new Key("exampleKey", KeyArgs.builder()
                 .description("example")
                 .deletionWindowInDays(7)
                 .build());
     
             var example = new Workspace("example", WorkspaceArgs.builder()
                 .alias("example")
                 .kmsKeyArn(exampleKey.arn())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import AMP Workspaces using the identifier. For example: ```sh $ pulumi import aws:amp/workspace:Workspace demo ws-C6DCB907-F2D7-4D96-957B-66691F865D8B ```
    • 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
      Workspace​(java.lang.String name)  
      Workspace​(java.lang.String name, WorkspaceArgs args)  
      Workspace​(java.lang.String name, WorkspaceArgs 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.util.Optional<java.lang.String>> alias()  
      com.pulumi.core.Output<java.lang.String> arn()  
      static Workspace get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, WorkspaceState 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>> kmsKeyArn()  
      com.pulumi.core.Output<java.util.Optional<WorkspaceLoggingConfiguration>> loggingConfiguration()  
      com.pulumi.core.Output<java.lang.String> prometheusEndpoint()  
      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()  
      • 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

      • Workspace

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

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

        public Workspace​(java.lang.String name,
                         @Nullable
                         WorkspaceArgs 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

      • alias

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> alias()
        Returns:
        The alias of the prometheus workspace. See more [in AWS Docs](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-onboard-create-workspace.html).
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        Amazon Resource Name (ARN) of the workspace.
      • kmsKeyArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyArn()
        Returns:
        The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more [in AWS Docs](https://docs.aws.amazon.com/prometheus/latest/userguide/encryption-at-rest-Amazon-Service-Prometheus.html)
      • loggingConfiguration

        public com.pulumi.core.Output<java.util.Optional<WorkspaceLoggingConfiguration>> loggingConfiguration()
        Returns:
        Logging configuration for the workspace. See Logging Configuration below for details.
      • prometheusEndpoint

        public com.pulumi.core.Output<java.lang.String> prometheusEndpoint()
        Returns:
        Prometheus endpoint available for this workspace.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        A map of tags to assign to the resource. If configured with a provider `default_tags` 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:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • get

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