Class FileSystemAssociation


  • public class FileSystemAssociation
    extends com.pulumi.resources.CustomResource
    Associate an Amazon FSx file system with the FSx File Gateway. After the association process is complete, the file shares on the Amazon FSx file system are available for access through the gateway. This operation only supports the FSx File Gateway type. [FSx File Gateway requirements](https://docs.aws.amazon.com/filegateway/latest/filefsxw/Requirements.html). ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.storagegateway.FileSystemAssociation;
     import com.pulumi.aws.storagegateway.FileSystemAssociationArgs;
     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 FileSystemAssociation("example", FileSystemAssociationArgs.builder()
                 .gatewayArn(exampleAwsStoragegatewayGateway.arn())
                 .locationArn(exampleAwsFsxWindowsFileSystem.arn())
                 .username("Admin")
                 .password("avoid-plaintext-passwords")
                 .auditDestinationArn(exampleAwsS3Bucket.arn())
                 .build());
     
         }
     }
     
     
    ### Required Services Example
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ssm.SsmFunctions;
     import com.pulumi.aws.ssm.inputs.GetParameterArgs;
     import com.pulumi.aws.ec2.Instance;
     import com.pulumi.aws.ec2.InstanceArgs;
     import com.pulumi.aws.storagegateway.Gateway;
     import com.pulumi.aws.storagegateway.GatewayArgs;
     import com.pulumi.aws.storagegateway.inputs.GatewaySmbActiveDirectorySettingsArgs;
     import com.pulumi.aws.fsx.WindowsFileSystem;
     import com.pulumi.aws.fsx.WindowsFileSystemArgs;
     import com.pulumi.aws.storagegateway.FileSystemAssociation;
     import com.pulumi.aws.storagegateway.FileSystemAssociationArgs;
     import com.pulumi.aws.storagegateway.inputs.FileSystemAssociationCacheAttributesArgs;
     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 awsServiceStoragegatewayAmiFILES3Latest = SsmFunctions.getParameter(GetParameterArgs.builder()
                 .name("/aws/service/storagegateway/ami/FILE_S3/latest")
                 .build());
     
             var test = new Instance("test", InstanceArgs.builder()
                 .ami(awsServiceStoragegatewayAmiFILES3Latest.value())
                 .associatePublicIpAddress(true)
                 .instanceType(available.instanceType())
                 .vpcSecurityGroupIds(testAwsSecurityGroup.id())
                 .subnetId(testAwsSubnet[0].id())
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(                
                         testAwsRoute,
                         testAwsVpcDhcpOptionsAssociation)
                     .build());
     
             var testGateway = new Gateway("testGateway", GatewayArgs.builder()
                 .smbActiveDirectorySettings(GatewaySmbActiveDirectorySettingsArgs.builder()
                     .domainName(testAwsDirectoryServiceDirectory.name())
                     .password(testAwsDirectoryServiceDirectory.password())
                     .username("Admin")
                     .build())
                 .gatewayIpAddress(test.publicIp())
                 .gatewayName("test-sgw")
                 .gatewayTimezone("GMT")
                 .gatewayType("FILE_FSX_SMB")
                 .build());
     
             var testWindowsFileSystem = new WindowsFileSystem("testWindowsFileSystem", WindowsFileSystemArgs.builder()
                 .activeDirectoryId(testAwsDirectoryServiceDirectory.id())
                 .securityGroupIds(testAwsSecurityGroup.id())
                 .skipFinalBackup(true)
                 .storageCapacity(32)
                 .subnetIds(testAwsSubnet[0].id())
                 .throughputCapacity(8)
                 .build());
     
             var fsx = new FileSystemAssociation("fsx", FileSystemAssociationArgs.builder()
                 .cacheAttributes(FileSystemAssociationCacheAttributesArgs.builder()
                     .cacheStaleTimeoutInSeconds(400)
                     .build())
                 .gatewayArn(testGateway.arn())
                 .locationArn(testWindowsFileSystem.arn())
                 .username("Admin")
                 .password(testAwsDirectoryServiceDirectory.password())
                 .auditDestinationArn(testAwsCloudwatchLogGroup.arn())
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import `aws.storagegateway.FileSystemAssociation` using the FSx file system association ARN. For example: ```sh $ pulumi import aws:storagegateway/fileSystemAssociation:FileSystemAssociation example arn:aws:storagegateway:us-east-1:123456789012:fs-association/fsa-0DA347732FDB40125 ```
    • 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.util.Optional<java.lang.String>> auditDestinationArn()  
      com.pulumi.core.Output<java.util.Optional<FileSystemAssociationCacheAttributes>> cacheAttributes()  
      com.pulumi.core.Output<java.lang.String> gatewayArn()  
      static FileSystemAssociation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FileSystemAssociationState 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> locationArn()  
      com.pulumi.core.Output<java.lang.String> password()  
      com.pulumi.core.Output<java.lang.String> region()  
      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> username()  
      • 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

      • FileSystemAssociation

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

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

        public FileSystemAssociation​(java.lang.String name,
                                     FileSystemAssociationArgs 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 newly created file system association.
      • auditDestinationArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> auditDestinationArn()
        Returns:
        ARN of the storage used for the audit logs.
      • cacheAttributes

        public com.pulumi.core.Output<java.util.Optional<FileSystemAssociationCacheAttributes>> cacheAttributes()
        Returns:
        Refresh cache information. see Cache Attributes for more details.
      • gatewayArn

        public com.pulumi.core.Output<java.lang.String> gatewayArn()
        Returns:
        ARN of the gateway.
      • locationArn

        public com.pulumi.core.Output<java.lang.String> locationArn()
        Returns:
        ARN of the Amazon FSx file system to associate with the FSx File Gateway.
      • password

        public com.pulumi.core.Output<java.lang.String> password()
        Returns:
        The password of the user credential.
      • 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.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value map of resource tags. 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:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • username

        public com.pulumi.core.Output<java.lang.String> username()
        Returns:
        The user name of the user credential that has permission to access the root share of the Amazon FSx file system. The user account must belong to the Amazon FSx delegated admin user group.
      • get

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