Skip to content

I want a code sample to test s3 upload using role, not access key. #5

@sangbinlee

Description

@sangbinlee

Summary

Since the application runs in the eks environment, we have been guided to use a role when authenticating.
I need s3 file upload sample code using role.

When uploading file to s3
Use a role, not an access key.

Basic example

// Upload a local file to Amazon S3
	S3AsyncClient s3Client = S3AsyncClient.crtCreate();
	PutObjectResponse putObjectResponse =
	      s3Client.putObject(req -> req.bucket(BUCKET_NAME)
	                                   .key(downloadFileName),
	                        AsyncRequestBody.fromFile(Paths.get(FILE_PATH)))
	              .join();

Motivation

You can do S3 FILE UPLOAD using a role.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions