Authorizing CoinAPI Access to Your AWS S3 Bucket
Ensuring secure and efficient data exchange between CoinAPI and your AWS S3 bucket is crucial for leveraging the full potential of financial data analysis. This guide walks you through the process of authorizing CoinAPI to access your AWS S3 bucket.
Prerequisites
Before proceeding, ensure you have:
- An active AWS account with sufficient administrative access.
Step 1: Creating a Bucket for Data Exchange
First, you need to create a AWS S3 Bucket that will be used to receive data from the CoinAPI.
Using the S3 console
- Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.
- In the navigation bar on the top of the page, choose the name of the currently displayed AWS Region. Next, choose the Region in which you want to create a bucket.
- In the left navigation pane, choose Buckets.
- Choose Create bucket.
- Under General configuration, view the AWS Region where your bucket will be created.
- Under Bucket type, choose General purpose.
- For Bucket name, enter a name for your bucket.
- Under Object Ownership, choose: ACLs disabled
- Under Block Public Access settings for this bucket, choose all four Block Public Access settings.
- Default encryption, choose Amazon S3 managed key (SSE-S3)
- Choose Create bucket.
Using the AWS CLI
aws s3 create-bucket --bucket YOUR-COINAPI-DATA-DEMARCATION-BUCKET --region AWS-REGION
Step 2: Define AWS S3 Bucket Policy to allow CoinAPI access
Below is the policy which you need to attach to the bucket, please replace the YOUR-COINAPI-DATA-DEMARCATION-BUCKET
with actuall bucket name.
{
"Version":"2012-10-17",
"Id":"DelegateS3AccessToCoinAPI",
"Statement":[
{
"Sid":"DelegateS3Access",
"Effect":"Allow",
"Principal":{
"AWS":[
"arn:aws:iam::430218079390:user/coinapi-s3",
"arn:aws:iam::917437866088:user/ct-s3-demarc-uploader"
],
"CanonicalUser":[
"533777d313250734526631df4b685cfe6003c72ea4a4061f6914c29b5d0d5aa1",
"9e484efe16906b4470d8d6be30d38a76408d22fcefe7a738a50d679aa8e90d70"
]
},
"Action":[
"s3:PutObject*",
"s3:Get*",
"s3:DeleteObject*",
"s3:List*",
"s3:AbortMultipartUpload"
],
"Resource":[
"arn:aws:s3:::YOUR-COINAPI-DATA-DEMARCATION-BUCKET",
"arn:aws:s3:::YOUR-COINAPI-DATA-DEMARCATION-BUCKET/*"
]
}
]
}
Using the S3 Console
- Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.
- In the left navigation pane, choose Buckets.
- In the Buckets list, choose the name of the bucket that you want to create a bucket policy for or whose bucket policy you want to edit.
- Choose the Permissions tab.
- Under Bucket policy, choose Edit. The Edit bucket policy page appears.
- On the Edit bucket policy page, edit the JSON in the Policy section.
- Paste the policy above.
- Choose Save changes, which returns you to the Permissions tab.
Using the AWS CLI
- Parepare the bucket policy in the file named
policy.json
- Execute the command below to set the bucket policy on the bucket.
aws s3 put-bucket-policy --bucket YOUR-COINAPI-DATA-DEMARCATION-BUCKET --policy file://policy.json
Was this section helpful?