Sono disponibili altri esempi per SDK AWS nel repository GitHub della documentazione degli esempi per SDK AWS
Utilizzare CreateFileSystem con una CLI
Gli esempi di codice seguenti mostrano come utilizzare CreateFileSystem.
- CLI
-
- AWS CLI
-
Creare un file system crittografato
L’esempio
create-file-systemseguente crea un file system crittografato utilizzando la chiave gestita dal cliente (CMK) predefinita. Aggiunge anche il tagName=my-file-system.aws efs create-file-system \ --performance-modegeneralPurpose\ --throughput-modebursting\ --encrypted \ --tagsKey=Name,Value=my-file-systemOutput:
{ "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" } ] }Per ulteriori informazioni, consulta Creazione di file system Amazon EFS nella Guida per l’utente di Amazon Elastic File System.
-
Per informazioni dettagliate sull’API, consulta CreateFileSystem
in AWS CLI Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: crea un nuovo file system vuoto. Il token utilizzato per garantire la creazione dell’idempotenza verrà generato automaticamente e sarà accessibile dal membro
CreationTokendell’oggetto restituito.New-EFSFileSystemOutput:
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.FileSystemSizeEsempio 2: crea un nuovo file system vuoto utilizzando un token personalizzato per garantire una creazione basata sull’idempotenza.
New-EFSFileSystem -CreationToken "MyUniqueToken"-
Per informazioni dettagliate sull’API, consulta CreateFileSystem nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V4).
-
- Strumenti per PowerShell V5
-
Esempio 1: crea un nuovo file system vuoto. Il token utilizzato per garantire la creazione dell’idempotenza verrà generato automaticamente e sarà accessibile dal membro
CreationTokendell’oggetto restituito.New-EFSFileSystemOutput:
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.FileSystemSizeEsempio 2: crea un nuovo file system vuoto utilizzando un token personalizzato per garantire una creazione basata sull’idempotenza.
New-EFSFileSystem -CreationToken "MyUniqueToken"-
Per informazioni dettagliate sull’API, consulta CreateFileSystem nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V5).
-