

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# Code examples for Amazon EFS using AWS SDKs
<a name="efs_code_examples"></a>

The following code examples show you how to use Amazon Elastic File System with an AWS software development kit (SDK).

*Actions* are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

**More resources**
+  **[ Amazon EFS Developer Guide](https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html)** – More information about Amazon EFS.
+ **[Amazon EFS API Reference](https://docs.aws.amazon.com/efs/latest/ug/api-reference.html)** – Details about all available Amazon EFS actions.
+ **[AWS Developer Center](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23)** – Code examples that you can filter by category or full-text search.
+ **[AWS SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.

**Contents**
+ [Basics](efs_code_examples_basics.md)
  + [Actions](efs_code_examples_actions.md)
    + [`CreateFileSystem`](efs_example_efs_CreateFileSystem_section.md)
    + [`CreateMountTarget`](efs_example_efs_CreateMountTarget_section.md)
    + [`DeleteFileSystem`](efs_example_efs_DeleteFileSystem_section.md)
    + [`DeleteMountTarget`](efs_example_efs_DeleteMountTarget_section.md)
    + [`DescribeFileSystems`](efs_example_efs_DescribeFileSystems_section.md)
    + [`DescribeMountTargets`](efs_example_efs_DescribeMountTargets_section.md)
    + [`DescribeTags`](efs_example_efs_DescribeTags_section.md)

# Basic examples for Amazon EFS using AWS SDKs
<a name="efs_code_examples_basics"></a>

The following code examples show how to use the basics of Amazon Elastic File System with AWS SDKs. 

**Contents**
+ [Actions](efs_code_examples_actions.md)
  + [`CreateFileSystem`](efs_example_efs_CreateFileSystem_section.md)
  + [`CreateMountTarget`](efs_example_efs_CreateMountTarget_section.md)
  + [`DeleteFileSystem`](efs_example_efs_DeleteFileSystem_section.md)
  + [`DeleteMountTarget`](efs_example_efs_DeleteMountTarget_section.md)
  + [`DescribeFileSystems`](efs_example_efs_DescribeFileSystems_section.md)
  + [`DescribeMountTargets`](efs_example_efs_DescribeMountTargets_section.md)
  + [`DescribeTags`](efs_example_efs_DescribeTags_section.md)

# Actions for Amazon EFS using AWS SDKs
<a name="efs_code_examples_actions"></a>

The following code examples demonstrate how to perform individual Amazon EFS actions with AWS SDKs. Each example includes a link to GitHub, where you can find instructions for setting up and running the code. 

 The following examples include only the most commonly used actions. For a complete list, see the [Amazon Elastic File System API Reference](https://docs.aws.amazon.com/efs/latest/ug/api-reference.html). 

**Topics**
+ [`CreateFileSystem`](efs_example_efs_CreateFileSystem_section.md)
+ [`CreateMountTarget`](efs_example_efs_CreateMountTarget_section.md)
+ [`DeleteFileSystem`](efs_example_efs_DeleteFileSystem_section.md)
+ [`DeleteMountTarget`](efs_example_efs_DeleteMountTarget_section.md)
+ [`DescribeFileSystems`](efs_example_efs_DescribeFileSystems_section.md)
+ [`DescribeMountTargets`](efs_example_efs_DescribeMountTargets_section.md)
+ [`DescribeTags`](efs_example_efs_DescribeTags_section.md)

# Use `CreateFileSystem` with a CLI
<a name="efs_example_efs_CreateFileSystem_section"></a>

The following code examples show how to use `CreateFileSystem`.

------
#### [ CLI ]

**AWS CLI**  
**To create an encrypted file system**  
The following `create-file-system` example creates an encrypted file system using the default CMK. It also adds the tag `Name=my-file-system`.  

```
aws efs create-file-system \
    --performance-mode generalPurpose \
    --throughput-mode bursting \
    --encrypted \
    --tags Key=Name,Value=my-file-system
```
Output:  

```
{
    "OwnerId": "123456789012",
    "CreationToken": "console-d7f56c5f-e433-41ca-8307-9d9c0example",
    "FileSystemId": "fs-c7a0456e",
    "FileSystemArn": "arn:aws:elasticfilesystem:us-west-2:123456789012:file-system/fs-48499b4d",
    "CreationTime": 1595286880.0,
    "LifeCycleState": "creating",
    "Name": "my-file-system",
    "NumberOfMountTargets": 0,
    "SizeInBytes": {
        "Value": 0,
        "ValueInIA": 0,
        "ValueInStandard": 0
    },
    "PerformanceMode": "generalPurpose",
    "Encrypted": true,
    "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/a59b3472-e62c-42e4-adcf-30d92example",
    "ThroughputMode": "bursting",
    "Tags": [
        {
            "Key": "Name",
            "Value": "my-file-system"
        }
    ]
}
```
For more information, see [Creating Amazon EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/creating-using-create-fs.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [CreateFileSystem](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/create-file-system.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Creates a new, empty file system. The token used to ensure idempotent creation will be generated automatically and can be accessed from the `CreationToken` member of the returned object.**  

```
New-EFSFileSystem
```
**Output:**  

```
CreationTime         : 5/26/2015 4:02:38 PM
CreationToken        : 1a2bff54-85e0-4747-bd95-7bc172c4f555
FileSystemId         : fs-1a2b3c4d
LifeCycleState       : creating
Name                 :
NumberOfMountTargets : 0
OwnerId              : 123456789012
SizeInBytes          : Amazon.ElasticFileSystem.Model.FileSystemSize
```
**Example 2: Creates a new, empty file system using a custom token to ensure idempotent creation.**  

```
New-EFSFileSystem -CreationToken "MyUniqueToken"
```
+  For API details, see [CreateFileSystem](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Creates a new, empty file system. The token used to ensure idempotent creation will be generated automatically and can be accessed from the `CreationToken` member of the returned object.**  

```
New-EFSFileSystem
```
**Output:**  

```
CreationTime         : 5/26/2015 4:02:38 PM
CreationToken        : 1a2bff54-85e0-4747-bd95-7bc172c4f555
FileSystemId         : fs-1a2b3c4d
LifeCycleState       : creating
Name                 :
NumberOfMountTargets : 0
OwnerId              : 123456789012
SizeInBytes          : Amazon.ElasticFileSystem.Model.FileSystemSize
```
**Example 2: Creates a new, empty file system using a custom token to ensure idempotent creation.**  

```
New-EFSFileSystem -CreationToken "MyUniqueToken"
```
+  For API details, see [CreateFileSystem](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `CreateMountTarget` with a CLI
<a name="efs_example_efs_CreateMountTarget_section"></a>

The following code examples show how to use `CreateMountTarget`.

------
#### [ CLI ]

**AWS CLI**  
**To create a mount target**  
The following `create-mount-target` example creates a mount target for the specified file system.  

```
aws efs create-mount-target \
    --file-system-id fs-c7a0456e \
    --subnet-id subnet-02bf4c428bexample \
    --security-groups sg-068f739363example
```
Output:  

```
{
    "OwnerId": "123456789012",
    "MountTargetId": "fsmt-f9a14450",
    "FileSystemId": "fs-c7a0456e",
    "SubnetId": "subnet-02bf4c428bexample",
    "LifeCycleState": "creating",
    "IpAddress": "10.0.1.24",
    "NetworkInterfaceId": "eni-02d542216aexample",
    "AvailabilityZoneId": "use2-az2",
    "AvailabilityZoneName": "us-east-2b",
    "VpcId": "vpc-0123456789abcdef0"
}
```
For more information, see [Creating mount targets](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [CreateMountTarget](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/create-mount-target.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Creates a new mount target for a file system. The specified subnet will be used determine the Virtual Private Cloud (VPC) that the mount target will be created in and the IP address that will be auto-assigned (from the address range of the subnet). The assigned IP address can be used to then mount this file system on an Amazon EC2 instance. As no security groups were specified the network interface created for the target is associated with the default security group for the subnet's VPC.**  

```
New-EFSMountTarget -FileSystemId fs-1a2b3c4d -SubnetId subnet-1a2b3c4d
```
**Output:**  

```
FileSystemId       : fs-1a2b3c4d
IpAddress          : 10.0.0.131
LifeCycleState     : creating
MountTargetId      : fsmt-1a2b3c4d
NetworkInterfaceId : eni-1a2b3c4d
OwnerId            : 123456789012
SubnetId           : subnet-1a2b3c4d
```
**Example 2: Creates a new mount target for the specified file system with auto-assigned IP address. The network interface created for the mount target is associated with the specified security groups (up to 5, in the format "sg-xxxxxxxx", may be specified).**  

```
New-EFSMountTarget -FileSystemId fs-1a2b3c4d -SubnetId subnet-1a2b3c4d -SecurityGroup sg-group1,sg-group2,sg-group3
```
**Example 3: Creates a new mount target for the specified file system with the specified IP address.**  

```
New-EFSMountTarget -FileSystemId fs-1a2b3c4d -SubnetId subnet-1a2b3c4d -IpAddress 10.0.0.131
```
+  For API details, see [CreateMountTarget](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Creates a new mount target for a file system. The specified subnet will be used determine the Virtual Private Cloud (VPC) that the mount target will be created in and the IP address that will be auto-assigned (from the address range of the subnet). The assigned IP address can be used to then mount this file system on an Amazon EC2 instance. As no security groups were specified the network interface created for the target is associated with the default security group for the subnet's VPC.**  

```
New-EFSMountTarget -FileSystemId fs-1a2b3c4d -SubnetId subnet-1a2b3c4d
```
**Output:**  

```
FileSystemId       : fs-1a2b3c4d
IpAddress          : 10.0.0.131
LifeCycleState     : creating
MountTargetId      : fsmt-1a2b3c4d
NetworkInterfaceId : eni-1a2b3c4d
OwnerId            : 123456789012
SubnetId           : subnet-1a2b3c4d
```
**Example 2: Creates a new mount target for the specified file system with auto-assigned IP address. The network interface created for the mount target is associated with the specified security groups (up to 5, in the format "sg-xxxxxxxx", may be specified).**  

```
New-EFSMountTarget -FileSystemId fs-1a2b3c4d -SubnetId subnet-1a2b3c4d -SecurityGroup sg-group1,sg-group2,sg-group3
```
**Example 3: Creates a new mount target for the specified file system with the specified IP address.**  

```
New-EFSMountTarget -FileSystemId fs-1a2b3c4d -SubnetId subnet-1a2b3c4d -IpAddress 10.0.0.131
```
+  For API details, see [CreateMountTarget](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DeleteFileSystem` with a CLI
<a name="efs_example_efs_DeleteFileSystem_section"></a>

The following code examples show how to use `DeleteFileSystem`.

------
#### [ CLI ]

**AWS CLI**  
**To delete a file system**  
The following `delete-file-system` example deletes the specified file system.  

```
aws efs delete-file-system \
    --file-system-id fs-c7a0456e
```
This command produces no output.  
For more information, see [Deleting an Amazon EFS file system](https://docs.aws.amazon.com/efs/latest/ug/delete-efs-fs.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [DeleteFileSystem](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/delete-file-system.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Deletes the specified file system that is no longer in use (if the file system has mount targets they must be removed first). You are prompted for confirmation before the cmdlet proceeds - to suppress confirmation, use the `-Force` switch.**  

```
Remove-EFSFileSystem -FileSystemId fs-1a2b3c4d
```
+  For API details, see [DeleteFileSystem](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Deletes the specified file system that is no longer in use (if the file system has mount targets they must be removed first). You are prompted for confirmation before the cmdlet proceeds - to suppress confirmation, use the `-Force` switch.**  

```
Remove-EFSFileSystem -FileSystemId fs-1a2b3c4d
```
+  For API details, see [DeleteFileSystem](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DeleteMountTarget` with a CLI
<a name="efs_example_efs_DeleteMountTarget_section"></a>

The following code examples show how to use `DeleteMountTarget`.

------
#### [ CLI ]

**AWS CLI**  
**To delete a mount target**  
The following `delete-mount-target` example deletes the specified mount target.  

```
aws efs delete-mount-target \
    --mount-target-id fsmt-f9a14450
```
This command produces no output.  
For more information, see [Creating mount targets](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [DeleteMountTarget](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/delete-mount-target.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Deletes the specified mount target. You are prompted for confirmation before the operation proceeds. To suppress the prompt use the `-Force` switch. Note that this operation forcibly breaks any mounts of the file system via the target - you may want to consider unmounting the file system before running this command, if feasible.**  

```
Remove-EFSMountTarget -MountTargetId fsmt-1a2b3c4d
```
+  For API details, see [DeleteMountTarget](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Deletes the specified mount target. You are prompted for confirmation before the operation proceeds. To suppress the prompt use the `-Force` switch. Note that this operation forcibly breaks any mounts of the file system via the target - you may want to consider unmounting the file system before running this command, if feasible.**  

```
Remove-EFSMountTarget -MountTargetId fsmt-1a2b3c4d
```
+  For API details, see [DeleteMountTarget](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DescribeFileSystems` with a CLI
<a name="efs_example_efs_DescribeFileSystems_section"></a>

The following code examples show how to use `DescribeFileSystems`.

------
#### [ CLI ]

**AWS CLI**  
**To describe a file system**  
The following `describe-file-systems` example describes the specified file system.  

```
aws efs describe-file-systems \
    --file-system-id fs-c7a0456e
```
Output:  

```
{
    "FileSystems": [
        {
            "OwnerId": "123456789012",
            "CreationToken": "console-d7f56c5f-e433-41ca-8307-9d9c0example",
            "FileSystemId": "fs-c7a0456e",
            "FileSystemArn": "arn:aws:elasticfilesystem:us-west-2:123456789012:file-system/fs-48499b4d",
            "CreationTime": 1595286880.0,
            "LifeCycleState": "available",
            "Name": "my-file-system",
            "NumberOfMountTargets": 3,
            "SizeInBytes": {
                "Value": 6144,
                "Timestamp": 1600991437.0,
                "ValueInIA": 0,
                "ValueInStandard": 6144
            },
            "PerformanceMode": "generalPurpose",
            "Encrypted": true,
            "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/a59b3472-e62c-42e4-adcf-30d92example",
            "ThroughputMode": "bursting",
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "my-file-system"
                }
            ]
        }
    ]
}
```
For more information, see [Managing Amazon EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/managing.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [DescribeFileSystems](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/describe-file-systems.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Returns the collection of all file systems owned by the caller's account in the region.**  

```
Get-EFSFileSystem
```
**Output:**  

```
CreationTime         : 5/26/2015 4:02:38 PM
CreationToken        : 1a2bff54-85e0-4747-bd95-7bc172c4f555
FileSystemId         : fs-1a2b3c4d
LifeCycleState       : available
Name                 :
NumberOfMountTargets : 0
OwnerId              : 123456789012
SizeInBytes          : Amazon.ElasticFileSystem.Model.FileSystemSize

CreationTime         : 5/26/2015 4:06:23 PM
CreationToken        : 2b4daa14-85e0-4747-bd95-7bc172c4f555
FileSystemId         : fs-4d3c2b1a
...
```
**Example 2: Returns the details of the specified file system.**  

```
Get-EFSFileSystem -FileSystemId fs-1a2b3c4d
```
**Example 3: Returns the details of a file system using the idempotency creation token that was specified at the time the file system was created.**  

```
Get-EFSFileSystem -CreationToken 1a2bff54-85e0-4747-bd95-7bc172c4f555
```
+  For API details, see [DescribeFileSystems](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Returns the collection of all file systems owned by the caller's account in the region.**  

```
Get-EFSFileSystem
```
**Output:**  

```
CreationTime         : 5/26/2015 4:02:38 PM
CreationToken        : 1a2bff54-85e0-4747-bd95-7bc172c4f555
FileSystemId         : fs-1a2b3c4d
LifeCycleState       : available
Name                 :
NumberOfMountTargets : 0
OwnerId              : 123456789012
SizeInBytes          : Amazon.ElasticFileSystem.Model.FileSystemSize

CreationTime         : 5/26/2015 4:06:23 PM
CreationToken        : 2b4daa14-85e0-4747-bd95-7bc172c4f555
FileSystemId         : fs-4d3c2b1a
...
```
**Example 2: Returns the details of the specified file system.**  

```
Get-EFSFileSystem -FileSystemId fs-1a2b3c4d
```
**Example 3: Returns the details of a file system using the idempotency creation token that was specified at the time the file system was created.**  

```
Get-EFSFileSystem -CreationToken 1a2bff54-85e0-4747-bd95-7bc172c4f555
```
+  For API details, see [DescribeFileSystems](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DescribeMountTargets` with a CLI
<a name="efs_example_efs_DescribeMountTargets_section"></a>

The following code examples show how to use `DescribeMountTargets`.

------
#### [ CLI ]

**AWS CLI**  
**To describe a mount target**  
The following `describe-mount-targets` example describes the specified mount target.  

```
aws efs describe-mount-targets \
    --mount-target-id fsmt-f9a14450
```
Output:  

```
{
    "MountTargets": [
        {
            "OwnerId": "123456789012",
            "MountTargetId": "fsmt-f9a14450",
            "FileSystemId": "fs-c7a0456e",
            "SubnetId": "subnet-02bf4c428bexample",
            "LifeCycleState": "creating",
            "IpAddress": "10.0.1.24",
            "NetworkInterfaceId": "eni-02d542216aexample",
            "AvailabilityZoneId": "use2-az2",
            "AvailabilityZoneName": "us-east-2b",
            "VpcId": "vpc-0123456789abcdef0"
        }
    ]
}
```
For more information, see [Creating mount targets](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [DescribeMountTargets](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/describe-mount-targets.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Returns the collection of mount targets associated with the specified file system.**  

```
Get-EFSMountTarget -FileSystemId fs-1a2b3c4d
```
**Output:**  

```
FileSystemId       : fs-1a2b3c4d
IpAddress          : 10.0.0.131
LifeCycleState     : available
MountTargetId      : fsmt-1a2b3c4d
NetworkInterfaceId : eni-1a2b3c4d
OwnerId            : 123456789012
SubnetId           : subnet-1a2b3c4d
```
+  For API details, see [DescribeMountTargets](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Returns the collection of mount targets associated with the specified file system.**  

```
Get-EFSMountTarget -FileSystemId fs-1a2b3c4d
```
**Output:**  

```
FileSystemId       : fs-1a2b3c4d
IpAddress          : 10.0.0.131
LifeCycleState     : available
MountTargetId      : fsmt-1a2b3c4d
NetworkInterfaceId : eni-1a2b3c4d
OwnerId            : 123456789012
SubnetId           : subnet-1a2b3c4d
```
+  For API details, see [DescribeMountTargets](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------

# Use `DescribeTags` with a CLI
<a name="efs_example_efs_DescribeTags_section"></a>

The following code examples show how to use `DescribeTags`.

------
#### [ CLI ]

**AWS CLI**  
**To describe the tags for a file system**  
The following `describe-tags` example describes the tags for the specified file system.  

```
aws efs describe-tags \
    --file-system-id fs-c7a0456e
```
Output:  

```
{
    "Tags": [
        {
            "Key": "Name",
            "Value": "my-file-system"
        },
        {
            "Key": "Department",
            "Value": "Business Intelligence"
        }
    ]
}
```
For more information, see [Managing file system tags](https://docs.aws.amazon.com/efs/latest/ug/manage-fs-tags.html) in the *Amazon Elastic File System User Guide*.  
+  For API details, see [DescribeTags](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/efs/describe-tags.html) in *AWS CLI Command Reference*. 

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**Example 1: Returns the collection of tags currently associated with the specified file system.**  

```
Get-EFSTag -FileSystemId fs-1a2b3c4d
```
**Output:**  

```
Key         Value
---         -----
Name        My File System
tagkey1     tagvalue1
tagkey2     tagvalue2
```
+  For API details, see [DescribeTags](https://docs.aws.amazon.com/powershell/v4/reference) in *AWS Tools for PowerShell Cmdlet Reference (V4)*. 

**Tools for PowerShell V5**  
**Example 1: Returns the collection of tags currently associated with the specified file system.**  

```
Get-EFSTag -FileSystemId fs-1a2b3c4d
```
**Output:**  

```
Key         Value
---         -----
Name        My File System
tagkey1     tagvalue1
tagkey2     tagvalue2
```
+  For API details, see [DescribeTags](https://docs.aws.amazon.com/powershell/v5/reference) in *AWS Tools for PowerShell Cmdlet Reference (V5)*. 

------