Class AccessGrant


  • public class AccessGrant
    extends com.pulumi.resources.CustomResource
    Manages a CloudWatch Omni Access Grant. An access grant gives a principal a permission within a CloudWatch Omni space. > **NOTE:** CloudWatch Omni does not support updating an access grant, so changing any argument other than `tags` replaces it. Tags are updated in place. > **NOTE:** Except for `CUSTOM` grants, a principal can hold only one grant of each permission in a space. Creating a duplicate returns `ConflictException`. > **NOTE:** CloudWatch Omni creates service-managed access grants alongside each space. They cannot be deleted and are not managed by this resource. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatchomni.AccessGrant;
     import com.pulumi.aws.cloudwatchomni.AccessGrantArgs;
     import com.pulumi.aws.cloudwatchomni.inputs.AccessGrantPrincipalArgs;
     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 AccessGrant("example", AccessGrantArgs.builder()
                 .principal(AccessGrantPrincipalArgs.builder()
                     .principalType("IAM_ROLE")
                     .principalId(exampleAwsIamRole.arn())
                     .build())
                 .name("example")
                 .domainId(exampleAwsCloudwatchomniDomain.domainId())
                 .spaceId(exampleAwsCloudwatchomniSpace.spaceId())
                 .permission("READ")
                 .tags(Map.of("Environment", "production"))
                 .build());
     
         }
     }
     
     
    ### Custom Permission A `CUSTOM` permission requires at least one `scopedAction` block.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatchomni.AccessGrant;
     import com.pulumi.aws.cloudwatchomni.AccessGrantArgs;
     import com.pulumi.aws.cloudwatchomni.inputs.AccessGrantPrincipalArgs;
     import com.pulumi.aws.cloudwatchomni.inputs.AccessGrantScopedActionArgs;
     import com.pulumi.aws.cloudwatchomni.inputs.AccessGrantScopedActionResourceArgs;
     import com.pulumi.aws.cloudwatchomni.inputs.AccessGrantScopedActionResourceRowScopeGroupArgs;
     import com.pulumi.aws.cloudwatchomni.inputs.AccessGrantScopedActionResourceRowScopeGroupRowScopeArgs;
     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 AccessGrant("example", AccessGrantArgs.builder()
                 .principal(AccessGrantPrincipalArgs.builder()
                     .principalType("IAM_ROLE")
                     .principalId(exampleAwsIamRole.arn())
                     .build())
                 .scopedActions(AccessGrantScopedActionArgs.builder()
                     .resources(AccessGrantScopedActionResourceArgs.builder()
                         .rowScopeGroups(AccessGrantScopedActionResourceRowScopeGroupArgs.builder()
                             .rowScopes(AccessGrantScopedActionResourceRowScopeGroupRowScopeArgs.builder()
                                 .field("serviceName")
                                 .operator("IN")
                                 .values(                            
                                     "checkout",
                                     "payments")
                                 .build())
                             .build())
                         .resourceType("DataSet")
                         .signalTypes("LOGS")
                         .build())
                     .actions("cloudwatch:GetRecords")
                     .build())
                 .name("example")
                 .domainId(exampleAwsCloudwatchomniDomain.domainId())
                 .spaceId(exampleAwsCloudwatchomniSpace.spaceId())
                 .permission("CUSTOM")
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `grantId` (String) Access grant ID. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import a CloudWatch Omni Access Grant using the `grantId`. For example: ```sh $ pulumi import aws:cloudwatchomni/accessGrant:AccessGrant example 12345678-1234-1234-1234-123456789012 ```
    • 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
    • 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> domainId()  
      static AccessGrant get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, AccessGrantState 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> grantId()  
      com.pulumi.core.Output<java.lang.String> grantType()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> permission()  
      com.pulumi.core.Output<AccessGrantPrincipal> principal()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<AccessGrantScopedAction>>> scopedActions()  
      com.pulumi.core.Output<java.lang.String> spaceId()  
      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

      • AccessGrant

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

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

        public AccessGrant​(java.lang.String name,
                           AccessGrantArgs 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 access grant.
      • domainId

        public com.pulumi.core.Output<java.lang.String> domainId()
        Returns:
        ID of the CloudWatch Omni domain that contains the space. Changing this forces a new resource.
      • grantId

        public com.pulumi.core.Output<java.lang.String> grantId()
        Returns:
        Unique ID of the access grant.
      • grantType

        public com.pulumi.core.Output<java.lang.String> grantType()
        Returns:
        Who manages the access grant.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the access grant. Must be 1-64 characters and contain only letters, numbers, underscores (`_`) and hyphens (`-`). Changing this forces a new resource.
      • permission

        public com.pulumi.core.Output<java.lang.String> permission()
        Returns:
        Permission to grant. Valid values are `SPACE_ADMIN`, `READ`, `READ_WRITE_DELETE` and `CUSTOM`. Changing this forces a new resource.
      • principal

        public com.pulumi.core.Output<AccessGrantPrincipal> principal()
        Returns:
        Principal receiving the grant. See below. Changing this forces a new resource.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource is managed. Defaults to the Region set in the provider configuration.
      • scopedActions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<AccessGrantScopedAction>>> scopedActions()
        Returns:
        Group of actions to allow, with the resource scopes and conditions that limit them. Up to 20 blocks. Required for the `CUSTOM` permission, and can also be used with the other permissions. See below. Changing this forces a new resource.
      • spaceId

        public com.pulumi.core.Output<java.lang.String> spaceId()
        Returns:
        ID of the CloudWatch Omni space to scope the grant to. Changing this forces a new resource. The following arguments are optional:
      • 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.
      • get

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