specifying-aws-credentials.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ### AWS credentials
  2. AWS credentials can be provided on a per-source basis via the standard AWS credentials provider chain:
  3. 1. Statically provided as part of the `WITH` block in source declaration. These credentials will be
  4. written to disk in plain text as well as being easily exposed via introspection commands and so
  5. this technique is only recommended for experimentation and development.
  6. 2. Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`,
  7. [`AWS_WEB_IDENTITY_TOKEN_FILE`][web-identity], and [many more][env-vars].
  8. 3. `credential_process` command in the AWS config file, by default located at `~/.aws/config`.
  9. 4. AWS credentials file and profile files. By default located at `~/.aws/config` and
  10. `~/.aws/credentials`, respectively.
  11. 5. The [IAM instance profile][instance-profile] provided by the Instance Metadata Service. This
  12. will only work if running on an EC2 instance with an instance profile.
  13. *Changed in v0.10.0:* Materialize supports the standard AWS credentials provider
  14. chain as described above. Previously Materialize had support for only an
  15. unspecified subset of the standard credentials provider chain.
  16. #### AWS credentials `WITH` options
  17. Static credentials can be configured by the following `WITH` options:
  18. Field | Value type | Description
  19. ----- | ---------- | -----------
  20. `access_key_id` | `text` | A valid [access key ID][access] for the AWS resource.
  21. `secret_access_key` | `text` | A valid [secret access key][access] for the AWS resource.
  22. `token` (optional) | `text` | The session token associated with the credentials, if the credentials are temporary
  23. Alternatively, you can specify a [named config profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) to assume. This named profile must exist within the AWS `credentials` or `config` file.
  24. Field | Value type | Description
  25. -----|------------|------------
  26. `profile` | `text` | An AWS config profile to assume. *New in v0.20.0.*
  27. The following `WITH` options can be set with either static credentials, a profile, or alone depending on the environment for credentials.
  28. Field | Value type | Description
  29. ------|-----------|------------
  30. `role_arn` | `text` | An IAM role to assume. *New in v0.20.0.*
  31. `region` | `text` | The region to use for all AWS requests.
  32. Credentials fetched from a container or instance profile expire on a fixed
  33. schedule. Materialize will attempt to refresh the credentials automatically
  34. before they expire, but the source will become inoperable if the refresh
  35. operation fails.
  36. [web-identity]: https://docs.rs/aws-config/latest/aws_config/web_identity_token/index.html
  37. [env-vars]: https://docs.aws.amazon.com/sdkref/latest/guide/environment-variables.html
  38. [access]: https://docs.aws.amazon.com/streams/latest/dev/controlling-access.html
  39. [instance-profile]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html