Sometime we require to upload our Jenkins builds to S3 using the mentioned steps we can upload any required artifact from Jenkins to S3 bucket.
Requirement
- Server with jenkins installed
- Creation of S3 Bucket over AWS
- Creating appropriate S3 Bucket over AWS
- S3 Pubisher plugin
https://jenkins.io/doc/pipeline/steps/s3/ - AWS access key and secret key with appropriate permission
over S3 bucket to upload files
Next create on the option create bucket :-

Give appropriate bucket name as per the rules choose required region keep clicking next and choosing required options like versioning at final stage it will show whatever option we have chosen and then click on the create bucket option

Once the bucket is created we can see under our S3 Bucket here we have crate bucket with name devops81-builds refer below SS.
Install S3 publisher plugin
- Go to Manage Jenkins >> Manage plugins and select Available tab. Find “S3 Plugin” and install it.
https://jenkins.io/doc/pipeline/steps/s3 - Once Plugin successfully installed it should show as below
Adding S3 Profile under jenkins
Once S3 Publisher is installed properly we require to setup Amazon s3 profile to setup Amazon S3 profiles go to Manage jenkins >> Configure System >> Amazon S3 Proiles click on ADD to add S3 Profile give require details Profile name , access key , secret access key of the account using which we will upload the artifact over S3.

Configuring Jenkins Build to Publish artifacts
Once we are done with setting up Amazon S3 Profile we can now go to our jenkins builds and under post build action we can choose the option Publish artifacts to S3 Bucket as shown below.
Enter the values appropriately under publish artifacts to S3 Bucket values like (S3 Profile , Files to upload,Destination bucket , Bucket region) refer below for values used for this example.

Once publish artifacts to S3 Bucket setting is done under post build action now we are good to upload our build artifacts to mentioned S3 Bucket.Next we can execute the build and if the build is success it will upload the mentioned artifacts to the S3 buckets below is the log out of successful upload of artifacts to S3 bucket.
Once the build is successful we can go to our S3 bucket and can see our artifact got uploaded under it.