Skip to content

Commit

Permalink
docs(core): add information for s3 compatible providers (#28925)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
Cammisuli authored Nov 15, 2024
1 parent 1b7cd9b commit 2c05925
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,33 @@ Regardless of how you manage your AWS authentication, you need to configure your
| **Property** | **Description** |
| ----------------- | --------------------------------------------------------------------------------- |
| **region** | The id of the AWS region to use |
| **bucket** | The name of the AWS bucket to use |
| **bucket** | The name of the S3 bucket to use |
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |

#### S3 Compatible Providers

To use `@nx/powerpack-s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc..), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.

Below is an example on how to connect to MinIO:

```jsonc {% fileName="nx.json" %}
{
"s3": {
"region": "us-east-1",
"bucket": "my-bucket",
"endpoint": "https://play.min.io",
"forcePathStyle": true,
"accessKeyId": "abc1234",
"secretAccessKey": "4321cba"
}
}
```

| **Property** | **Description** |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **region** | The id of the S3 compatible storage region to use |
| **bucket** | The name of the S3 compatible storage bucket to use |
| **forcePathStyle** | Changes the way artifacts are uploaded. Usually used for S3 compatible providers (MinIO, LocalStack, etc) |
| **endpoint** | The custom endpoint to upload artifacts to. If endpoint is not defined, the default AWS endpoint is used |
| **accessKeyId** | AWS Access Key ID (optional if `AWS_ACCESS_KEY_ID` is set in the environment) |
| **secretAccessKey** | AWS secret access key (optional if `AWS_SECRET_ACCESS_KEY` is set in the environment) |
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,26 @@
"properties": {
"region": {
"type": "string",
"description": "The AWS region the bucket is located in",
"x-prompt": "Which AWS region is the bucket located in?"
"description": "The AWS region the bucket is located in"
},
"accessKeyId": {
"type": "string",
"description": "The AWS Access Key ID to use to access the S3 Bucket, alternatively set the AWS_ACCESS_KEY_ID environment variable"
},
"secretAccessKey": {
"type": "string",
"description": "The AWS Secret Access Key to use to access the S3 Bucket, alternatively set the AWS_SECRET_ACCESS_KEY environment variable"
},
"bucket": {
"type": "string",
"description": "The the name of the S3 Bucket to store the Nx Cache in",
"x-prompt": "What is the name of the S3 Bucket to store the Nx Cache in?"
"description": "The the name of the S3 Bucket to store the Nx Cache in"
},
"forcePathStyle": {
"type": "boolean",
"description": "Set to true to use path style URLs for S3 objects"
}
},
"required": ["region", "bucket"],
"required": [],
"presets": []
},
"description": "Initialize the S3 Cache",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,33 @@ Regardless of how you manage your AWS authentication, you need to configure your
| **Property** | **Description** |
| ----------------- | --------------------------------------------------------------------------------- |
| **region** | The id of the AWS region to use |
| **bucket** | The name of the AWS bucket to use |
| **bucket** | The name of the S3 bucket to use |
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |

#### S3 Compatible Providers

To use `@nx/powerpack-s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc..), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.

Below is an example on how to connect to MinIO:

```jsonc {% fileName="nx.json" %}
{
"s3": {
"region": "us-east-1",
"bucket": "my-bucket",
"endpoint": "https://play.min.io",
"forcePathStyle": true,
"accessKeyId": "abc1234",
"secretAccessKey": "4321cba"
}
}
```

| **Property** | **Description** |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **region** | The id of the S3 compatible storage region to use |
| **bucket** | The name of the S3 compatible storage bucket to use |
| **forcePathStyle** | Changes the way artifacts are uploaded. Usually used for S3 compatible providers (MinIO, LocalStack, etc) |
| **endpoint** | The custom endpoint to upload artifacts to. If endpoint is not defined, the default AWS endpoint is used |
| **accessKeyId** | AWS Access Key ID (optional if `AWS_ACCESS_KEY_ID` is set in the environment) |
| **secretAccessKey** | AWS secret access key (optional if `AWS_SECRET_ACCESS_KEY` is set in the environment) |

0 comments on commit 2c05925

Please sign in to comment.