forked from capillariesio/capillaries
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
78 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# S3 data access | ||
|
||
[Integration tests suite](./testing.md#integration-tests) contains tests that use data and config files stored in AWS S3. [k8s POC](../test/k8s/README.md) also uses S3 files. You have to perform some AWS setup steps to make S3 integration tests and k8s POC work. | ||
|
||
For demo purposes, Capillaries Docker-based and k8s POC test environments use user-based permissions (see below), which may not be the preferred way of controlling access in production AWS environment. Using role assumption approach is the recommended way. | ||
|
||
## Bucket capillaries-testbucket | ||
|
||
Create capillaries-testbucket (this name may be taken already, so you may be forced to use some other name). In `Amazon S3->Buckets->capillaries-testbucket->Permissions` tab, turn `Block all public access` on. | ||
|
||
Before running tests, make sure you have this environment variable is set: | ||
``` | ||
export CAPILLARIES_AWS_TESTBUCKET=capillaries-testbucket | ||
``` | ||
|
||
## IAM user UserAccessCapillariesTestbucket | ||
|
||
daemon/webapi/toolbelt running in our Docker/k8s tests will this IAM user credentials and access `capillaries-testbucket`. | ||
|
||
Create IAM user `UserAccessCapillariesTestbucket`. | ||
|
||
Create access key for it, save it to ~/UserAccessCapillariesTestbucket.rc: | ||
``` | ||
export AWS_ACCESS_KEY_ID=AK... | ||
export AWS_SECRET_ACCESS_KEY=... | ||
export AWS_DEFAULT_REGION=us-east-1 | ||
``` | ||
|
||
Now, everytime you have to run Capillaries test Docker setup or k8s POC, make sure you have those variables set: | ||
|
||
``` | ||
source ~/UserAccessCapillariesTestbucket.rc | ||
``` | ||
|
||
## Bucket permissions for UserAccessCapillariesTestbucket | ||
|
||
In `Amazon S3->Buckets->capillaries-testbucket->Permissions->Bucket policy` specify: | ||
|
||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": "arn:aws:iam::<your_aws_acount>:user/UserAccessCapillariesTestbucket" | ||
}, | ||
"Action": "s3:ListBucket", | ||
"Resource": "arn:aws:s3:::capillaries-testbucket" | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": "arn:aws:iam::<your_aws_acount>:user/UserAccessCapillariesTestbucket" | ||
}, | ||
"Action": [ | ||
"s3:DeleteObject", | ||
"s3:GetObject", | ||
"s3:PutObject" | ||
], | ||
"Resource": "arn:aws:s3:::capillaries-testbucket/*" | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters