Partner S3 File Operation
Overview
This document will describe how can a partner put or fetch files from s3 bucket folder assigned to the partner.
Folder Creation
On request we will create a folder with name “partner-<partner_name>” under “partner-file-feeds” s3 bucket and access keys to perform the operation and will be shared with concerned person from partner team.
File Operations
List Object
aws s3api list-objects-v2 --bucket arn:aws:s3:us-east-1:860645548597:accesspoint/partner-file-feeds-partner-<partner_name> --prefix partner-<partner_name>/out-from-usta --profile partner-<partner_name>
Get Object
aws s3api get-object --bucket arn:aws:s3:us-east-1:860645548597:accesspoint/partner-file-feeds-partner-<partner_name> --key partner-<partner_name>/out-from-usta/ChocolateChipCookie.png C:\aaa\ChocolateChipCookie-GET.png --profile partner-<partner_name>
Put Object
aws s3api put-object --bucket arn:aws:s3:us-east-1:860645548597:accesspoint/partner-file-feeds-partner-<partner_name> --key partner-<partner_name>/in-to-usta/ChocolateChipCookie.png --body C:\aaa\ChocolateChipCookie.png --profile partner-<partner_name>
Creating named profiles
You can configure profiles by using aws configure with the --profile option, or by manually adding entries to the config and credentials files.
Credentials profile
The following example shows a credentials
file with two profiles. The first [default] is used when you run a AWS CLI command with no profile. The second is used when you run a AWS CLI command with the --profile user1
parameter.
The credentials
file uses a different naming format than the AWS CLI config
file for named profiles. Do not use the word profile
when creating an entry in the credentials
file.
~/.aws/credentials
(Linux & Mac) or %USERPROFILE%\.aws\credentials
(Windows)
[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
[user1]
aws_access_key_id=AKIAI44QH8DHBEXAMPLE
aws_secret_access_key=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY
Config profile
Each profile can specify different credentials and can also specify different AWS Regions and output formats. When naming the profile in a config
file, include the prefix word "profile
".
The following example specifies Region and output information for the default
and user1
profiles.
~/.aws/config
(Linux & Mac) or %USERPROFILE%\.aws\config
(Windows)
[default]
region=us-west-2
output=json
[profile user1]
region=us-east-1
output=text