Class FileSystemPolicy


  • public class FileSystemPolicy
    extends com.pulumi.resources.CustomResource
    Provides an Elastic File System (EFS) File System Policy resource. ## Example Usage <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.efs.FileSystem;
     import com.pulumi.aws.efs.FileSystemArgs;
     import com.pulumi.aws.iam.IamFunctions;
     import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
     import com.pulumi.aws.efs.FileSystemPolicy;
     import com.pulumi.aws.efs.FileSystemPolicyArgs;
     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 fs = new FileSystem("fs", FileSystemArgs.builder()
                 .creationToken("my-product")
                 .build());
     
             final var policy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                 .statements(GetPolicyDocumentStatementArgs.builder()
                     .sid("ExampleStatement01")
                     .effect("Allow")
                     .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                         .type("AWS")
                         .identifiers("*")
                         .build())
                     .actions(                
                         "elasticfilesystem:ClientMount",
                         "elasticfilesystem:ClientWrite")
                     .resources(fs.arn())
                     .conditions(GetPolicyDocumentStatementConditionArgs.builder()
                         .test("Bool")
                         .variable("aws:SecureTransport")
                         .values("true")
                         .build())
                     .build())
                 .build());
     
             var policyFileSystemPolicy = new FileSystemPolicy("policyFileSystemPolicy", FileSystemPolicyArgs.builder()
                 .fileSystemId(fs.id())
                 .policy(policy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(policy -> policy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import the EFS file system policies using the `id`. For example: ```sh $ pulumi import aws:efs/fileSystemPolicy:FileSystemPolicy foo fs-6fa144c6 ```
    • 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.util.Optional<java.lang.Boolean>> bypassPolicyLockoutSafetyCheck()  
      com.pulumi.core.Output<java.lang.String> fileSystemId()  
      static FileSystemPolicy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FileSystemPolicyState 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> policy()  
      • 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

      • FileSystemPolicy

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

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

        public FileSystemPolicy​(java.lang.String name,
                                FileSystemPolicyArgs 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

      • bypassPolicyLockoutSafetyCheck

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> bypassPolicyLockoutSafetyCheck()
        Returns:
        A flag to indicate whether to bypass the `aws.efs.FileSystemPolicy` lockout safety check. The policy lockout safety check determines whether the policy in the request will prevent the principal making the request will be locked out from making future `PutFileSystemPolicy` requests on the file system. Set `bypass_policy_lockout_safety_check` to `true` only when you intend to prevent the principal that is making the request from making a subsequent `PutFileSystemPolicy` request on the file system. The default value is `false`.
      • fileSystemId

        public com.pulumi.core.Output<java.lang.String> fileSystemId()
        Returns:
        The ID of the EFS file system.
      • policy

        public com.pulumi.core.Output<java.lang.String> policy()
        Returns:
        The JSON formatted file system policy for the EFS file system. see [Docs](https://docs.aws.amazon.com/efs/latest/ug/access-control-overview.html#access-control-manage-access-intro-resource-policies) for more info. The following arguments are optional:
      • get

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