diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md b/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md index bb5e1f619..a783eef8c 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md @@ -70,6 +70,11 @@ The above example uses secrets as plain strings. It is recommended to use a secr When running the Dapr sidecar (daprd) with your application on EKS (AWS Kubernetes), if you're using a node/pod that has already been attached to an IAM policy defining access to AWS resources, you **must not** provide AWS access-key, secret-key, and tokens in the definition of the component spec you're using. {{% /alert %}} + +### S3 Bucket Creation +{{< tabs "Minio" "Localstack" "AWS" >}} + +{{% codetab %}} ### Using with Minio [Minio](https://min.io/) is a service that exposes local storage as S3-compatible block storage, and it's a popular alternative to S3 especially in development environments. You can use the S3 binding with Minio too, with some configuration tweaks: @@ -78,6 +83,70 @@ When running the Dapr sidecar (daprd) with your application on EKS (AWS Kubernet 3. The value for `region` is not important; you can set it to `us-east-1`. 4. Depending on your environment, you may need to set `disableSSL` to `true` if you're connecting to Minio using a non-secure connection (using the `http://` protocol). If you are using a secure connection (`https://` protocol) but with a self-signed certificate, you may need to set `insecureSSL` to `true`. +{{% /codetab %}} + +{{% codetab %}} +For local development, the [localstack project](https://github.com/localstack/localstack) is used to integrate AWS S3. Follow [these instructions](https://github.com/localstack/localstack#running) to run localstack. + +To run localstack locally from the command line using Docker, use a `docker-compose.yaml` similar to the following: + +```yaml +version: "3.8" + +services: + localstack: + container_name: "cont-aws-s3" + image: localstack/localstack:1.4.0 + ports: + - "127.0.0.1:4566:4566" + environment: + - DEBUG=1 + - DOCKER_HOST=unix:///var/run/docker.sock + volumes: + - "/init-aws.sh:/etc/localstack/init/ready.d/init-aws.sh" # init hook + - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack" + - "/var/run/docker.sock:/var/run/docker.sock" +``` + +To able to use the S3 component, the bucket to be used needs to existing prior to use, so the example above uses a [LocalStack Initialization Hook](https://docs.localstack.cloud/references/init-hooks/) Hook to setup the bucket. + +In order to use localstack with your S3 binding, you need to provide the `endpoint` configuration in the component metadata. The `endpoint` is unnecessary when running against production AWS. + + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: aws-s3 + namespace: default +spec: + type: bindings.aws.s3 + version: v1 + metadata: + - name: bucket + value: conformance-test-docker + - name: endpoint + value: "http://localhost:4566" + - name: accessKey + value: "my-access" + - name: secretKey + value: "my-secret" + - name: region + value: "us-east-1" +``` + +{{% /codetab %}} + +{{% codetab %}} + +To able to use the S3 component, the bucket to be used needs to existing prior to use, [Follow](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) + +{{% /codetab %}} + + + +{{< /tabs >}} + ## Binding support This component supports **output binding** with the following operations: diff --git a/daprdocs/data/components/bindings/aws.yaml b/daprdocs/data/components/bindings/aws.yaml index 50b5a3607..e75089445 100644 --- a/daprdocs/data/components/bindings/aws.yaml +++ b/daprdocs/data/components/bindings/aws.yaml @@ -8,7 +8,7 @@ output: true - component: AWS S3 link: s3 - state: Alpha + state: Stable version: v1 since: "1.0" features: