This is a Traefik middleware plugin which pushes data to and pulls data from Amazon Web Services (AWS) for a Traefik instance running in Amazon Elastic Container Service (ECS).
traefik.yml:
providers:
ecs:
exposedByDefault: false
experimental:
plugins:
aws:
moduleName: github.com/bluecatengineering/traefik-aws-plugin
version: v0.2.0
Example labels for a given router:
```text
"traefik.enable" : "true"
"traefik.http.routers.my-router.service" : "noop@internal"
"traefik.http.routers.my-router.rule" : "Host(`aws.myhostexample.io`)"
"traefik.http.routers.my-router.middlewares" : "my-aws"
To store objects in a local directory, use the following labels (example):
"traefik.http.middlewares.my-aws.plugin.aws.type" : "local"
"traefik.http.middlewares.my-aws.plugin.aws.directory" : "aws-local-directory"
GET
, PUT
and POST
are supported.
POST
will append a UUID to the path. There is a Location
header in the response.
To store objects in Amazon Simple Storage Service (S3), use the following labels (example):
"traefik.http.middlewares.my-aws.plugin.aws.service" : "s3"
"traefik.http.middlewares.my-aws.plugin.aws.bucket" : "my-bucket"
"traefik.http.middlewares.my-aws.plugin.aws.region" : "us-west-2"
"traefik.http.middlewares.my-aws.plugin.aws.prefix" : "/prefix"
}
Note that prefix
must include the leading slash.
PUT and GET are supported.
If you make a POST request, a UUID will be generated and the object will be created in the same manner as a PUT request. A Location
header is sent back in the response.
When forwarding the request to S3, the plugin sets the following headers:
Host
Authorization
with the AWS API request signature; the ECS task IAM role credentials are used to sign the requestdate
, if not definedX-Amz-Content-Sha256
X-Amz-Date
x-amz-security-token
Amazon DynamoDB support is pending.
To develop traefik-aws-plugin
in a local workspace:
- Install go
- Install golangci-lint