Skip to main content

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

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.
  2. 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.
  3. In the left navigation pane, choose Buckets.
  4. Choose Create bucket.
  5. Under General configuration, view the AWS Region where your bucket will be created.
  6. Under Bucket type, choose General purpose.
  7. For Bucket name, enter a name for your bucket.
  8. Under Object Ownership, choose: ACLs disabled
  9. Under Block Public Access settings for this bucket, choose all four Block Public Access settings.
  10. Default encryption, choose Amazon S3 managed key (SSE-S3)
  11. 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

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.
  2. In the left navigation pane, choose Buckets.
  3. 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.
  4. Choose the Permissions tab.
  5. Under Bucket policy, choose Edit. The Edit bucket policy page appears.
  6. On the Edit bucket policy page, edit the JSON in the Policy section.
  7. Paste the policy above.
  8. Choose Save changes, which returns you to the Permissions tab.

Using the AWS CLI

  1. Parepare the bucket policy in the file named policy.json
  2. 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