Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzo degli endpoint dual-stack S3 su Outposts
Gli endpoint dual-stack S3 on Outposts supportano le richieste ai bucket S3 on Outposts su e. IPv6 IPv4 In questa sezione viene descritto come utilizzare gli endpoint dual-stack S3 su Outposts.
Argomenti
Endpoint dual-stack S3 su Outposts
Quando effettui una richiesta a un endpoint dual-stack, l'URL del bucket S3 on Outposts si risolve in un indirizzo or. IPv6 IPv4 Per ulteriori informazioni sull'accesso a un bucket IPv6 over di S3 on Outposts, consulta. Effettuare richieste a S3 su Outposts over IPv6
Per accedere a un bucket S3 su Outposts tramite un endpoint dual-stack, usare un nome di endpoint in stile percorso. S3 su Outposts supporta solo i nomi di endpoint dual-stack regionali, il che significa che è necessario specificare la Regione come parte del nome.
Per un endpoint dual-stack in stile path, usa la seguente convenzione di denominazione FIPs :
s3-outposts-fips.
region
.api.aws
Gli endpoint dual-stack non FIPS usano la seguente convenzione di denominazione:
s3-outposts.
region
.api.aws
Nota
I nomi degli endpoint in stile hosting virtuale non sono supportati in S3 su Outposts.
Utilizzo di endpoint dual-stack provenienti da AWS CLI
Questa sezione fornisce esempi di AWS CLI comandi utilizzati per effettuare richieste a un endpoint dual-stack. Per istruzioni sulla configurazione di, vedere. AWS CLIGuida introduttiva all'utilizzo di AWS CLI and SDK for Java
Imposta il valore use_dualstack_endpoint
di configurazione su un profilo nel tuo AWS Config file per indirizzare tutte le richieste Amazon S3 effettuate dai s3api
AWS CLI comandi s3
and all'endpoint dual-stack per la regione specificata. true
La Regione va specificata nel file di configurazione o in un comando tramite l'opzione --region
.
Quando si utilizzano endpoint dual-stack con, è supportato solo lo stile di indirizzamento. AWS CLIpath
Lo stile di indirizzamento, impostato nel file di configurazione, determina se il nome del bucket si trova nel nome host o nell'URL. Per ulteriori informazioni, consulta s3outposts nella Guida per l'utente di AWS CLI .
Per utilizzare un endpoint dual-stack tramite AWS CLI, utilizza il --endpoint-url
parametro con l'endpoint o per qualsiasi comando. http://s3.dualstack.
region
.amazonaws.com.rproxy.govskope.cahttps://s3-outposts-fips.
region
.api.awss3control
s3outposts
Per esempio:
$
aws s3control list-regional-buckets --endpoint-url https://s3-outposts.region
.api.aws
Utilizzo di S3 sugli endpoint dual-stack Outposts da AWS SDKs
Questa sezione fornisce esempi di come accedere a un endpoint dual-stack utilizzando. AWS SDKs
AWS SDK for Java 2.x Esempio di endpoint Dual-Stack con
Negli esempi seguenti viene mostrato come usare le classi S3ControlClient
e S3OutpostsClient
per abilitare gli endpoint dual-stack durante la creazione di un client S3 su Outposts tramite AWS SDK for Java 2.x. Per istruzioni su come creare e testare un esempio Java funzionante per Amazon S3 su Outposts, consulta Guida introduttiva all'utilizzo di AWS CLI and SDK for Java.
Esempio - Creare una classe S3ControlClient
con gli endpoint dual-stack abilitati
import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; import software.amazon.awssdk.services.s3control.model.ListRegionalBucketsRequest; import software.amazon.awssdk.services.s3control.model.ListRegionalBucketsResponse; import software.amazon.awssdk.services.s3control.model.S3ControlException; public class DualStackEndpointsExample1 { public static void main(String[] args) { Region clientRegion = Region.of("
us-east-1
"); String accountId = "111122223333
"; String navyId = "9876543210
"; try { // Create an S3ControlClient with dual-stack endpoints enabled. S3ControlClient s3ControlClient = S3ControlClient.builder() .region(clientRegion) .dualstackEnabled(true) .build(); ListRegionalBucketsRequest listRegionalBucketsRequest = ListRegionalBucketsRequest.builder() .accountId(accountId) .outpostId(navyId) .build(); ListRegionalBucketsResponse listBuckets = s3ControlClient.listRegionalBuckets(listRegionalBucketsRequest); System.out.printf("ListRegionalBuckets Response: %s%n", listBuckets.toString()); } catch (AmazonServiceException e) { // The call was transmitted successfully, but Amazon S3 on Outposts couldn't process // it, so it returned an error response. e.printStackTrace(); } catch (S3ControlException e) { // Unknown exceptions will be thrown as an instance of this type. e.printStackTrace(); } catch (SdkClientException e) { // Amazon S3 on Outposts couldn't be contacted for a response, or the client // couldn't parse the response from Amazon S3 on Outposts. e.printStackTrace(); } } }
Esempio - Creare una classe S3OutpostsClient
con gli endpoint dual-stack abilitati
import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3outposts.S3OutpostsClient; import software.amazon.awssdk.services.s3outposts.model.ListEndpointsRequest; import software.amazon.awssdk.services.s3outposts.model.ListEndpointsResponse; import software.amazon.awssdk.services.s3outposts.model.S3OutpostsException; public class DualStackEndpointsExample2 { public static void main(String[] args) { Region clientRegion = Region.of("
us-east-1
"); try { // Create an S3OutpostsClient with dual-stack endpoints enabled. S3OutpostsClient s3OutpostsClient = S3OutpostsClient.builder() .region(clientRegion) .dualstackEnabled(true) .build(); ListEndpointsRequest listEndpointsRequest = ListEndpointsRequest.builder().build(); ListEndpointsResponse listEndpoints = s3OutpostsClient.listEndpoints(listEndpointsRequest); System.out.printf("ListEndpoints Response: %s%n", listEndpoints.toString()); } catch (AmazonServiceException e) { // The call was transmitted successfully, but Amazon S3 on Outposts couldn't process // it, so it returned an error response. e.printStackTrace(); } catch (S3OutpostsException e) { // Unknown exceptions will be thrown as an instance of this type. e.printStackTrace(); } catch (SdkClientException e) { // Amazon S3 on Outposts couldn't be contacted for a response, or the client // couldn't parse the response from Amazon S3 on Outposts. e.printStackTrace(); } } }
Se utilizzi Windows, potresti dover impostare la AWS SDK for Java 2.x seguente proprietà della macchina virtuale Java (JVM):
java.net.preferIPv6Addresses=true