-
Notifications
You must be signed in to change notification settings - Fork 122
docs(router): AWS Sigv4 #7235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ardatan
wants to merge
5
commits into
hmac-signature
Choose a base branch
from
aws-sigv4-router
base: hmac-signature
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
docs(router): AWS Sigv4 #7235
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a79d7f7
docs(router): AWS Sigv4
ardatan ccd9f96
Update packages/web/docs/src/content/router/configuration/aws_sig_v4.mdx
ardatan f2e4fe3
Update packages/web/docs/src/content/router/configuration/aws_sig_v4.mdx
ardatan 49a1093
Update packages/web/docs/src/content/router/security/subgraph-auth.mdx
ardatan b4e1530
Prettier
ardatan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
packages/web/docs/src/content/router/configuration/aws_sig_v4.mdx
This file contains hidden or 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,97 @@ | ||
| --- | ||
| title: 'aws_sig_v4' | ||
| --- | ||
|
|
||
| # aws_sig_v4 | ||
|
|
||
| The `aws_sig_v4` configuration enables you to sign outgoing requests to AWS-hosted subgraphs using | ||
| AWS Signature Version 4. This ensures secure communication between the Hive Router and your AWS | ||
| services by authenticating requests with AWS credentials. | ||
|
|
||
| For practical examples and common scenarios, check out | ||
| **[Subgraph Auth](../security/subgraph-auth)**. | ||
|
|
||
| ## Configuration Structure | ||
|
|
||
| The `aws_sig_v4` configuration object allows you to define signing options globally for all | ||
| subgraphs or individually for specific subgraphs. | ||
|
|
||
| ```yaml | ||
| aws_sig_v4: | ||
| # Signing configuration applied to all subgraphs. | ||
| all: | ||
| # Signing options... | ||
| subgraphs: | ||
| products: | ||
| # Signing options for the 'products' subgraph... | ||
| users: | ||
| # Signing options for the 'users' subgraph... | ||
| ``` | ||
|
|
||
| ### Options: | ||
|
|
||
| You can provide `hardcoded` or `default_chain` credentials for signing requests, not both. | ||
|
|
||
| #### `hardcoded` | ||
|
|
||
| - **Type:** `object` | ||
|
|
||
| Use hard-coded AWS credentials to sign all outgoing subgraph requests. This accepts the following | ||
| fields: | ||
|
|
||
| - `access_key_id`: **(string, required)** Your AWS Access Key ID. | ||
| - `secret_access_key`: **(string, required)** Your AWS Secret Access Key. | ||
| - `region`: **(string, required)** The AWS region where your subgraphs are hosted. | ||
| - `service_name`: **(string, required)** The AWS service name (e.g., `lambda`, `s3`, etc.). | ||
|
|
||
| ```yaml | ||
| aws_sig_v4: | ||
| all: | ||
| hardcoded: | ||
| access_key_id: AKIAIOSFODNN7EXAMPLE | ||
| secret_access_key: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' | ||
| region: us-east-1 | ||
| service_name: lambda | ||
| ``` | ||
|
|
||
| #### `default_chain` | ||
|
|
||
| - **Type:** `object` | ||
|
|
||
| Use the Default Chain Authentication method to sign outgoing subgraph requests. Hive Router will | ||
| automatically look for AWS credentials in the following order: | ||
|
|
||
| 1. Environment Variables: `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` | ||
| 2. Credential File: `~/.aws/credentials` | ||
| 3. IAM Roles: For EC2 instances and ECS tasks | ||
| 4. AssumeRole: Via STS AssumeRole operations | ||
| 5. WebIdentity: For Kubernetes service accounts mostly configured via `AWS_WEB_IDENTITY_TOKEN_FILE` | ||
| environment variable | ||
| 6. SSO: AWS SSO credentials | ||
|
|
||
| This configuration accepts the following fields: | ||
|
|
||
| - `profile_name`: **(string, optional)** The AWS CLI profile name to use from the shared credentials | ||
| file. | ||
| [Learn more](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#ec2-instance-profile) | ||
| - `region`: **(string, required)** The AWS region where your subgraphs are hosted. | ||
| [Learn more](https://docs.aws.amazon.com/general/latest/gr/rande.html) | ||
| - `service_name`: **(string, required)** The AWS service name (e.g., `lambda`, `s3`, etc.). | ||
| [Learn more](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) | ||
| - `assume_role`: **(object, optional)** Configuration for assuming a role via STS. Contains: | ||
| - `role_arn`: **(string, required)** The ARN of the role to assume. | ||
| - `session_name`: **(string, required)** An identifier for the assumed role session. | ||
|
|
||
| [See AWS official documentation to learn more about Assume Role IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html). | ||
|
|
||
| ```yaml | ||
| aws_sig_v4: | ||
| all: | ||
| default_chain: | ||
| profile_name: 'my-test-profile' | ||
| region: 'us-east-1' | ||
| service_name: 'lambda' | ||
| assume_role: | ||
| role_arn: 'test-arn' | ||
| session_name: 'test-session' | ||
| ``` | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.