public static void main()

in src/main/java/com/amazonaws/s3/accesspoints/PutObject_Demo_StandaloneUser.java [19:38]


	public static void main(String[] args) {

		String awsProfile = args[0];
		String bucket = args[1];
		String key = args[2];
		String regionString = args[3];

		ProfileCredentialsProvider pcv = ProfileCredentialsProvider.builder().profileName(awsProfile).build();
	
		S3Client s3 = S3Client.builder().region(AWSUtil.getRegion(regionString)).credentialsProvider(pcv).build();

		// Put Object
		try {
			s3.putObject(PutObjectRequest.builder().bucket(bucket).key(key).build(),
					RequestBody.fromByteBuffer(getRandomByteBuffer(10_000)));
		} catch (AwsServiceException | SdkClientException | IOException e) {
			e.printStackTrace();
		}

	}