本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用適用於 Java 的開發套件設定 S3 on Outposts 的 S3 控制用戶端
下列範例使用 AWS SDK for Java 為 Amazon S3 on Outposts 設定 Amazon S3 控制用戶端。若要使用此範例,請以您自己的資訊取代每個
。user input
placeholder
import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3control.AWSS3Control; import com.amazonaws.services.s3control.AWSS3ControlClient; public AWSS3Control createS3ControlClient() { String accessKey =
AWSAccessKey
; String secretKey =SecretAccessKey
; BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKey, secretKey); return AWSS3ControlClient.builder().enableUseArnRegion() .withCredentials(new AWSStaticCredentialsProvider(awsCreds)) .build(); }