{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Amazon Web Services Simple Storage Service (AWS S3) Volumes","type":"basic","slug":"amazon-web-services-simple-storage-service-aws-s3-volumes","excerpt":"","body":"This page contains information on configuring a volume that is associated with an S3 bucket in Amazon Web Services' (AWS) cloud storage.\n\n## Authentication and authorization on the CGC\n\nCGC provides the option of connecting your Amazon Web Services S3 bucket (volume) to be able to read and write files to and from the CGC. After connection is established, your S3 bucket (volume) behaves like your external storage for the CGC. Authentication of the CGC is done through AWS Identity and Access Management (IAM) services, specifically using the [IAM user](#section-about-aws-iam-users) method. Authorization of the CGC, which defines the actions that can be done on your volume, is defined in a custom IAM policy that is attached to an IAM user.\n\n### About AWS IAM users\n\nAn AWS Identity and Access Management (IAM) User is an entity that you create to represent a person or service that uses it to interact with your AWS resources. For each IAM user you need to define one or more policies to determine what actions on which AWS resources and under what conditions that user can do. In order to connect your S3 bucket as a volume to the CGC, you will need to attach an appropriate policy provided by Seven Bridges to your IAM user and use _Access keys_ (_access key ID_ and _secret access key_) for authentication to make programmatic calls from the CGC to your AWS resources.\n\n### Connecting an S3 bucket to the CGC\n\nPrerequisites:\n\n* An [Amazon Web Service (AWS)](https://aws.amazon.com/) account.\n* One or more S3 buckets within the AWS account.\n\n**Procedure:**\n1. [Create a custom IAM policy](#section-create-a-custom-iam-policy)\n2. [Set up an IAM user](#section-set-up-an-iam-user)\n\n### Create a custom IAM policy\n\nThe policy should be attached to an IAM user to define permissions that the CGC will have when connecting with your AWS S3 bucket (volume). So, the first step is to create a custom IAM policy that you will attach to your IAM user later on. To create the policy, follow these steps:\n1. Go to the [AWS Management Console](https://console.aws.amazon.com).\n2. In the top menu select **Services** and then choose **IAM**.\n3. In the left navigation menu select **Policies**.\n4. Click **Create policy** and select the **JSON** tab.\n5. Copy and paste the following custom policy. *Make sure to select the right policy depending on whether you're mounting the volume in **Read-only** or **Read-write** mode*. Also, make sure to replace **&lt;BUCKET_NAME>** in the policy with the name of your S3 bucket, and either replace **&lt;ROOT>** with the subdirectory in the bucket to which you want to restrict access when browsing the mounted volume from the CGC, or simply exclude the **&lt;ROOT>** parameter and set `Resource` in the policy to  `arn:aws:s3:::<BUCKET_NAME>` if you want to make the entire content of the bucket available.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"Version\\\": \\\"2012-10-17\\\",\\n    \\\"Statement\\\": [\\n        {\\n            \\\"Sid\\\": \\\"GrantReadOnBuckets\\\",\\n            \\\"Action\\\": [\\n                \\\"s3:ListBucket\\\",\\n                \\\"s3:GetBucketCORS\\\",\\n                \\\"s3:GetBucketLocation\\\"\\n            ],\\n            \\\"Effect\\\": \\\"Allow\\\",\\n            \\\"Resource\\\": [\\n                \\\"arn:aws:s3:::<BUCKET_NAME>\\\"\\n            ]\\n        },\\n        {\\n            \\\"Sid\\\": \\\"GrantReadOnObjects\\\",\\n            \\\"Action\\\": [\\n                \\\"s3:GetObject\\\"\\n            ],\\n            \\\"Effect\\\": \\\"Allow\\\",\\n            \\\"Resource\\\": [\\n                \\\"arn:aws:s3:::<BUCKET_NAME>/<ROOT>/*\\\"\\n            ]\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Read-only\"\n    },\n    {\n      \"code\": \"{\\n    \\\"Version\\\": \\\"2012-10-17\\\",\\n    \\\"Statement\\\": [\\n        {\\n            \\\"Sid\\\": \\\"GrantReadOnBuckets\\\",\\n            \\\"Action\\\": [\\n                \\\"s3:ListBucket\\\",\\n                \\\"s3:GetBucketCORS\\\",\\n                \\\"s3:GetBucketLocation\\\"\\n            ],\\n            \\\"Effect\\\": \\\"Allow\\\",\\n            \\\"Resource\\\": [\\n                \\\"arn:aws:s3:::<BUCKET_NAME>\\\"\\n            ]\\n        },\\n        {\\n            \\\"Sid\\\": \\\"GrantReadOnObjects\\\",\\n            \\\"Action\\\": [\\n                \\\"s3:GetObject\\\"\\n            ],\\n            \\\"Effect\\\": \\\"Allow\\\",\\n            \\\"Resource\\\": [\\n                \\\"arn:aws:s3:::<BUCKET_NAME>/<ROOT>/*\\\"\\n            ]\\n        },\\n        {\\n            \\\"Sid\\\": \\\"GrantWriteOnObjects\\\",\\n            \\\"Action\\\": [\\n                \\\"s3:PutObject\\\",\\n                \\\"s3:GetObjectAcl\\\",\\n                \\\"s3:PutObjectAcl\\\",\\n                \\\"s3:AbortMultipartUpload\\\",\\n                \\\"s3:ListMultipartUploadParts\\\"\\n            ],\\n            \\\"Effect\\\": \\\"Allow\\\",\\n            \\\"Resource\\\": [\\n                \\\"arn:aws:s3:::<BUCKET_NAME>/<ROOT>/*\\\"\\n            ]\\n        },\\n        {\\n            \\\"Sid\\\": \\\"RequestReadOnCopySourceObjects\\\",\\n            \\\"Action\\\": [\\n                \\\"s3:GetObject\\\"\\n            ],\\n            \\\"Effect\\\": \\\"Allow\\\",\\n            \\\"Resource\\\": [\\n                \\\"arn:aws:s3:::cgc-main/*\\n            ]\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Read-write\"\n    }\n  ]\n}\n[/block]\n6. Click **Review policy** and enter a policy name, e.g. `sb-access-policy` (remember this policy name as you will need to attach it later to IAM user).\n7. (Optional) Enter the policy description.\n8. Click **Create policy** to finish process of policy creation.\n\nThe custom IAM policy you have created can be attached to the IAM user you will use to connect your AWS S3 bucket with the CGC.\n\n### Set up an IAM user \n\nFollow these steps to create an AWS IAM user that you will use to connect an S3 bucket (volume) to the CGC:\n1. Log in to the [AWS Management Console](https://console.aws.amazon.com).\n2. In the top menu select **Services** and then choose **IAM**.\n3. In the left navigation menu select **Users**, and then choose**Add user**.\n4. Enter the **User name** for the user you are creating.\n5. In the **Access type** section, select **Programmatic access**.\n6. Click **Next: Permissions**.\n7. In the **Set permissions** section select **Attach existing policies directly**.\n8. Use search bar to find and select the policy you created earlier (e.g. `sb-access-policy`)\n9. Click **Next: Tags**.\n10. (Optional) Add tags to the user. These are key-value pairs that contain additional information about the IAM user and are not necessary for the process of attaching a volume to the CGC.\n11. Click **Next: Review**. The user details screen is displayed. Check once again that all entered information is correct.\n12. Click **Create user**. You will see a message that the user is successfully created.\n13. On the confirmation screen, copy the provided **Access key ID** and **Secret access key** and use them for volume creation on the CGC.\n14. Click **Close**.\n\nWith the created IAM user you can connect your AWS S3 bucket as a volume to the CGC. As stated in step 13 above, the credentials you will need are:\n\n* **Access key ID** \n* **Secret access key**\n\nIf you forget your **Secret access key**, you can still create new Access keys:\n1. Click on the name of your IAM user in the list of all available users\n2. Click the **Security credentials** tab\n3. In the Access keys section click **Create access key**. Newly created **Access key ID** and **Secret access key** are displayed in the pop-up window. Use them for connecting your S3 bucket to the CGC.\n\n### Additional configuration\n\nThe IAM policy is usually sufficient to permit the CGC to access your S3 bucket. In certain situations, however, it may be necessary to set up additional configuration on the bucket itself. Read how to do this by [enabling cross-origin resource sharing (CORS)](https://docs.sevenbridges.com/docs/enabling-cross-origin-resource-sharing-cors).","updates":[],"order":4,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"578520cb5ae9c20e00bc2635","createdAt":"2016-07-12T16:54:35.891Z","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"CONNECT CLOUD STORAGE","slug":"connect-cloud-storage","order":28,"from_sync":false,"reference":false,"_id":"5785191af3a10c0e009b75b0","version":"55faf11ba62ba1170021a9aa","__v":0,"project":"55faf11ba62ba1170021a9a7","createdAt":"2016-07-12T16:21:46.337Z"},"parentDoc":null,"project":"55faf11ba62ba1170021a9a7","__v":3,"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77","59a555bccdbd85001bfb1442","5a2a81f688574d001e9934f5","5b080c8d7833b20003ddbb6f","5c222bed4bc358002f21459a","5c22412594a2a5005cc9e919","5c41ae1c33592700190a291e","5c8a525e2ba7b2003f9b153c","5cbf14d58c79c700ef2b502e","5db6f03a6e187c006f667fa4","5f894c7d3b0894006477ca01"],"_id":"55faf11ba62ba1170021a9aa","releaseDate":"2015-09-17T16:58:03.490Z","createdAt":"2015-09-17T16:58:03.490Z","project":"55faf11ba62ba1170021a9a7","__v":47},"githubsync":"","user":"5613e4f8fdd08f2b00437620"}

Amazon Web Services Simple Storage Service (AWS S3) Volumes


This page contains information on configuring a volume that is associated with an S3 bucket in Amazon Web Services' (AWS) cloud storage. ## Authentication and authorization on the CGC CGC provides the option of connecting your Amazon Web Services S3 bucket (volume) to be able to read and write files to and from the CGC. After connection is established, your S3 bucket (volume) behaves like your external storage for the CGC. Authentication of the CGC is done through AWS Identity and Access Management (IAM) services, specifically using the [IAM user](#section-about-aws-iam-users) method. Authorization of the CGC, which defines the actions that can be done on your volume, is defined in a custom IAM policy that is attached to an IAM user. ### About AWS IAM users An AWS Identity and Access Management (IAM) User is an entity that you create to represent a person or service that uses it to interact with your AWS resources. For each IAM user you need to define one or more policies to determine what actions on which AWS resources and under what conditions that user can do. In order to connect your S3 bucket as a volume to the CGC, you will need to attach an appropriate policy provided by Seven Bridges to your IAM user and use _Access keys_ (_access key ID_ and _secret access key_) for authentication to make programmatic calls from the CGC to your AWS resources. ### Connecting an S3 bucket to the CGC Prerequisites: * An [Amazon Web Service (AWS)](https://aws.amazon.com/) account. * One or more S3 buckets within the AWS account. **Procedure:** 1. [Create a custom IAM policy](#section-create-a-custom-iam-policy) 2. [Set up an IAM user](#section-set-up-an-iam-user) ### Create a custom IAM policy The policy should be attached to an IAM user to define permissions that the CGC will have when connecting with your AWS S3 bucket (volume). So, the first step is to create a custom IAM policy that you will attach to your IAM user later on. To create the policy, follow these steps: 1. Go to the [AWS Management Console](https://console.aws.amazon.com). 2. In the top menu select **Services** and then choose **IAM**. 3. In the left navigation menu select **Policies**. 4. Click **Create policy** and select the **JSON** tab. 5. Copy and paste the following custom policy. *Make sure to select the right policy depending on whether you're mounting the volume in **Read-only** or **Read-write** mode*. Also, make sure to replace **&lt;BUCKET_NAME>** in the policy with the name of your S3 bucket, and either replace **&lt;ROOT>** with the subdirectory in the bucket to which you want to restrict access when browsing the mounted volume from the CGC, or simply exclude the **&lt;ROOT>** parameter and set `Resource` in the policy to  `arn:aws:s3:::<BUCKET_NAME>` if you want to make the entire content of the bucket available. [block:code] { "codes": [ { "code": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"GrantReadOnBuckets\",\n \"Action\": [\n \"s3:ListBucket\",\n \"s3:GetBucketCORS\",\n \"s3:GetBucketLocation\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"arn:aws:s3:::<BUCKET_NAME>\"\n ]\n },\n {\n \"Sid\": \"GrantReadOnObjects\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"arn:aws:s3:::<BUCKET_NAME>/<ROOT>/*\"\n ]\n }\n ]\n}", "language": "json", "name": "Read-only" }, { "code": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"GrantReadOnBuckets\",\n \"Action\": [\n \"s3:ListBucket\",\n \"s3:GetBucketCORS\",\n \"s3:GetBucketLocation\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"arn:aws:s3:::<BUCKET_NAME>\"\n ]\n },\n {\n \"Sid\": \"GrantReadOnObjects\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"arn:aws:s3:::<BUCKET_NAME>/<ROOT>/*\"\n ]\n },\n {\n \"Sid\": \"GrantWriteOnObjects\",\n \"Action\": [\n \"s3:PutObject\",\n \"s3:GetObjectAcl\",\n \"s3:PutObjectAcl\",\n \"s3:AbortMultipartUpload\",\n \"s3:ListMultipartUploadParts\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"arn:aws:s3:::<BUCKET_NAME>/<ROOT>/*\"\n ]\n },\n {\n \"Sid\": \"RequestReadOnCopySourceObjects\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"arn:aws:s3:::cgc-main/*\n ]\n }\n ]\n}", "language": "json", "name": "Read-write" } ] } [/block] 6. Click **Review policy** and enter a policy name, e.g. `sb-access-policy` (remember this policy name as you will need to attach it later to IAM user). 7. (Optional) Enter the policy description. 8. Click **Create policy** to finish process of policy creation. The custom IAM policy you have created can be attached to the IAM user you will use to connect your AWS S3 bucket with the CGC. ### Set up an IAM user  Follow these steps to create an AWS IAM user that you will use to connect an S3 bucket (volume) to the CGC: 1. Log in to the [AWS Management Console](https://console.aws.amazon.com). 2. In the top menu select **Services** and then choose **IAM**. 3. In the left navigation menu select **Users**, and then choose**Add user**. 4. Enter the **User name** for the user you are creating. 5. In the **Access type** section, select **Programmatic access**. 6. Click **Next: Permissions**. 7. In the **Set permissions** section select **Attach existing policies directly**. 8. Use search bar to find and select the policy you created earlier (e.g. `sb-access-policy`) 9. Click **Next: Tags**. 10. (Optional) Add tags to the user. These are key-value pairs that contain additional information about the IAM user and are not necessary for the process of attaching a volume to the CGC. 11. Click **Next: Review**. The user details screen is displayed. Check once again that all entered information is correct. 12. Click **Create user**. You will see a message that the user is successfully created. 13. On the confirmation screen, copy the provided **Access key ID** and **Secret access key** and use them for volume creation on the CGC. 14. Click **Close**. With the created IAM user you can connect your AWS S3 bucket as a volume to the CGC. As stated in step 13 above, the credentials you will need are: * **Access key ID**  * **Secret access key** If you forget your **Secret access key**, you can still create new Access keys: 1. Click on the name of your IAM user in the list of all available users 2. Click the **Security credentials** tab 3. In the Access keys section click **Create access key**. Newly created **Access key ID** and **Secret access key** are displayed in the pop-up window. Use them for connecting your S3 bucket to the CGC. ### Additional configuration The IAM policy is usually sufficient to permit the CGC to access your S3 bucket. In certain situations, however, it may be necessary to set up additional configuration on the bucket itself. Read how to do this by [enabling cross-origin resource sharing (CORS)](https://docs.sevenbridges.com/docs/enabling-cross-origin-resource-sharing-cors).