-
Notifications
You must be signed in to change notification settings - Fork 765
Add docs for AWS Cloudmap and Nameformat name resolution components #4694
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
jmenziessmith
wants to merge
5
commits into
dapr:v1.16
Choose a base branch
from
jmenziessmith:v1.16
base: v1.16
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.
+216
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6863c54
Add docs for AWS Cloudmap name resolution
jmenziessmith d94ab4e
Add docs for Nameformat name resolution
jmenziessmith eb43738
Apply suggestions from code review
jmenziessmith 096e1b4
Merge branch 'dapr:v1.16' into v1.16
jmenziessmith 7963e25
Updates from PR
jmenziessmith 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
157 changes: 157 additions & 0 deletions
157
...t/en/reference/components-reference/supported-name-resolution/nr-awscloudmap.md
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,157 @@ | ||
--- | ||
type: docs | ||
title: "AWS Cloudmap" | ||
linkTitle: "AWS Cloudmap" | ||
description: Detailed information on the AWS Cloudmap name resolution component | ||
--- | ||
|
||
|
||
This component uses [AWS Cloud Map](https://aws.amazon.com/cloud-map/) for service discovery in Dapr. It supports both HTTP and DNS namespaces, allowing services to discover and connect to other services using AWS Cloud Map's service discovery capabilities. | ||
|
||
## Configuration format | ||
|
||
Name resolution is configured via the [Dapr Configuration]({{< ref configuration-overview.md >}}). | ||
|
||
Within the configuration YAML, set the `spec.nameResolution.component` property to `"aws.cloudmap"`, then pass configuration options in the `spec.nameResolution.configuration` dictionary. | ||
|
||
```yaml | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: appconfig | ||
spec: | ||
nameResolution: | ||
component: "aws.cloudmap" | ||
version: "v1" | ||
configuration: | ||
# Required: AWS CloudMap namespace configuration (one of these is required) | ||
namespaceName: "my-namespace" # The name of your CloudMap namespace | ||
# namespaceId: "ns-xxxxxx" # Alternative: Use namespace ID instead of name | ||
|
||
# Optional: AWS authentication (choose one authentication method) | ||
# Option 1: Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY | ||
# Option 2: IAM roles for Amazon EKS | ||
# Option 3: Explicit credentials (not recommended for production) | ||
accessKey: "****" | ||
secretKey: "****" | ||
sessionToken: "****" # Optional | ||
|
||
# Optional: AWS region and endpoint configuration | ||
region: "us-west-2" | ||
endpoint: "http://localhost:4566" # Optional: Custom endpoint for testing | ||
|
||
# Optional: Dapr configuration | ||
defaultDaprPort: 50002 # Default port for Dapr sidecar if not specified in instance attributes | ||
``` | ||
|
||
## Specification | ||
|
||
### AWS authentication | ||
|
||
The component supports multiple authentication methods: | ||
|
||
1. Environment Variables: | ||
- AWS_ACCESS_KEY_ID | ||
- AWS_SECRET_ACCESS_KEY | ||
- AWS_SESSION_TOKEN (optional) | ||
|
||
2. IAM Roles: | ||
- When running on AWS (EKS, EC2, etc.), the component can use IAM roles | ||
|
||
3. Explicit Credentials: | ||
- Provided in the component metadata (not recommended for production) | ||
|
||
### Required permissions | ||
|
||
The AWS credentials must have the following permissions: | ||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"servicediscovery:DiscoverInstances", | ||
"servicediscovery:GetNamespace", | ||
"servicediscovery:ListNamespaces" | ||
], | ||
"Resource": "*" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Spec configuration fields | ||
|
||
| Field | Required | Type | Default | Description | | ||
|-----------------|-------------------------------------|--------|---------|-------------| | ||
| namespaceName | One of namespaceName or namespaceId | string | "" | The name of your AWS CloudMap namespace | | ||
| namespaceId | One of namespaceName or namespaceId | string | "" | The ID of your AWS CloudMap namespace | | ||
| region | N | string | "" | AWS region. If not provided, will be determined from environment or instance metadata | | ||
| endpoint | N | string | "" | Custom endpoint for AWS CloudMap API. Useful for testing with LocalStack | | ||
| defaultDaprPort | N | number | 3500 | Default port for Dapr sidecar if not specified in instance attributes | | ||
|
||
### Service registration | ||
|
||
To use this name resolver, your services must be registered in AWS CloudMap. When registering instances, ensure they have the following attributes: | ||
|
||
1. Required: One of these address attributes: | ||
- `AWS_INSTANCE_IPV4`: IPv4 address of the instance | ||
- `AWS_INSTANCE_IPV6`: IPv6 address of the instance | ||
- `AWS_INSTANCE_CNAME`: Hostname of the instance | ||
|
||
2. Optional: Dapr sidecar port attribute: | ||
- `DAPR_PORT`: The port that the Dapr sidecar is listening on | ||
- If not specified, the component will use the `defaultDaprPort` from configuration (defaults to 3500) | ||
|
||
The resolver will only return healthy instances (those with `HEALTHY` status) to ensure reliable service communication. | ||
|
||
Example instance attributes: | ||
```json | ||
{ | ||
"AWS_INSTANCE_IPV4": "10.0.0.1", | ||
"DAPR_PORT": "50002" | ||
} | ||
``` | ||
|
||
|
||
## Example Usage | ||
|
||
Name resolution is configured via the [Dapr Configuration]({{< ref configuration-overview.md >}}). Here are some examples of its usage. | ||
|
||
### Minimal Configuration | ||
|
||
```yaml | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: appconfig | ||
spec: | ||
nameResolution: | ||
component: "aws.cloudmap" | ||
configuration: | ||
namespaceName: "mynamespace.dev" | ||
defaultDaprPort: 50002 | ||
``` | ||
|
||
### Local Development with LocalStack | ||
|
||
```yaml | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: appconfig | ||
spec: | ||
nameResolution: | ||
component: "aws.cloudmap" | ||
configuration: | ||
namespaceName: "my-namespace" | ||
region: "us-east-1" | ||
endpoint: "http://localhost:4566" | ||
accessKey: "test" | ||
secretKey: "test" | ||
``` | ||
|
||
### Related Links | ||
- [Service invocation building block]({{< ref service-invocation >}}) | ||
- [AWS Cloudmap documentation](https://aws.amazon.com/cloud-map/) |
49 changes: 49 additions & 0 deletions
49
...nt/en/reference/components-reference/supported-name-resolution/nr-nameformat.md
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,49 @@ | ||
--- | ||
type: docs | ||
title: "Nameformat" | ||
linkTitle: "NameFormat" | ||
description: Detailed information on the NameFormat name resolution component | ||
--- | ||
|
||
|
||
The Name Format name resolver provides a flexible way to resolve service names using a configurable format string with placeholders. This is useful in scenarios where you want to map service names to predictable DNS names following a specific pattern. | ||
|
||
Consider using this name resolver if there is no specific name resolver available for your service registry, but your service registry can expose services via internal DNS names using predictable naming conventions. | ||
|
||
## Configuration Format | ||
|
||
Name resolution is configured via the [Dapr Configuration]({{< ref configuration-overview.md >}}). | ||
|
||
Within the configuration YAML, set the `spec.nameResolution.component` property to `"nameformat"`, then pass configuration options in the `spec.nameResolution.configuration` dictionary. | ||
|
||
```yaml | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: appconfig | ||
spec: | ||
nameResolution: | ||
component: "nameformat" | ||
configuration: | ||
format: "service-{appid}.default.svc.cluster.local" # Replace with your desired format pattern | ||
``` | ||
|
||
## Spec configuration fields | ||
|
||
| Field | Required | Details | Example | | ||
|---------|----------|---------|---------| | ||
| format | Y | The format string to use for name resolution. Must contain the `{appid}` placeholder which is replaced with the actual service name. | `"service-{appid}.default.svc.cluster.local"` | | ||
|
||
## Examples | ||
|
||
When configured with `format: "service-{appid}.default.svc.cluster.local"`, the resolver transforms service names as follows: | ||
|
||
- Service ID "myapp" → "service-myapp.default.svc.cluster.local" | ||
- Service ID "frontend" → "service-frontend.default.svc.cluster.local" | ||
|
||
|
||
## Notes | ||
|
||
- Empty service IDs are not allowed and results in an error. | ||
- The format string must be provided in the configuration | ||
- The format string must contain at least one `{appid}` placeholder |
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,5 @@ | ||
- component: CloudMap | ||
link: nr-awscloudmap | ||
state: Alpha | ||
version: v1 | ||
since: "1.16" |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name resolution is configured via the [Dapr Configuration]({{< ref configuration-overview.md >}}).
Within the configuration YAML, set the
spec.nameResolution.component
property to"nameformat"
, then pass configuration options in thespec.nameResolution.configuration
dictionary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated