Skip to content

Commit 47ed092

Browse files
authored
Document all AWS credential environment variables (#1171)
1 parent 7c3689d commit 47ed092

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

cmd/zz_gen_cmd_dnshelp.go

+2
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,9 @@ func displayDNSHelp(name string) error {
14501450
ew.writeln(`Credentials:`)
14511451
ew.writeln(` - "AWS_ACCESS_KEY_ID": Managed by the AWS client ('AWS_ACCESS_KEY_ID_FILE' is not supported)`)
14521452
ew.writeln(` - "AWS_HOSTED_ZONE_ID": Override the hosted zone ID`)
1453+
ew.writeln(` - "AWS_PROFILE": Managed by the AWS client ('AWS_PROFILE_FILE' is not supported)`)
14531454
ew.writeln(` - "AWS_REGION": Managed by the AWS client ('AWS_REGION_FILE' is not supported)`)
1455+
ew.writeln(` - "AWS_SDK_LOAD_CONFIG": Retrieve the region from the CLI config file ('AWS_SDK_LOAD_CONFIG_FILE' is not supported)`)
14541456
ew.writeln(` - "AWS_SECRET_ACCESS_KEY": Managed by the AWS client ('AWS_SECRET_ACCESS_KEY_FILE' is not supported)`)
14551457
ew.writeln()
14561458

docs/content/dns/zz_gen_route53.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ _Please contribute by adding a CLI example._
3131
|-----------------------|-------------|
3232
| `AWS_ACCESS_KEY_ID` | Managed by the AWS client (`AWS_ACCESS_KEY_ID_FILE` is not supported) |
3333
| `AWS_HOSTED_ZONE_ID` | Override the hosted zone ID |
34+
| `AWS_PROFILE` | Managed by the AWS client (`AWS_PROFILE_FILE` is not supported) |
3435
| `AWS_REGION` | Managed by the AWS client (`AWS_REGION_FILE` is not supported) |
36+
| `AWS_SDK_LOAD_CONFIG` | Retrieve the region from the CLI config file (`AWS_SDK_LOAD_CONFIG_FILE` is not supported) |
3537
| `AWS_SECRET_ACCESS_KEY` | Managed by the AWS client (`AWS_SECRET_ACCESS_KEY_FILE` is not supported) |
3638

3739
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.
@@ -54,16 +56,22 @@ More information [here](/lego/dns/#configuration-and-credentials).
5456

5557
AWS Credentials are automatically detected in the following locations and prioritized in the following order:
5658

57-
1. Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, [`AWS_SESSION_TOKEN`]
58-
2. Shared credentials file (defaults to `~/.aws/credentials`)
59+
1. Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, [`AWS_SESSION_TOKEN`]
60+
2. Shared credentials file (defaults to `~/.aws/credentials`, profiles can be specified using `AWS_PROFILE`)
5961
3. Amazon EC2 IAM role
6062

63+
The AWS Region is automatically detected in the following locations and prioritized in the following order:
64+
65+
1. Environment variables: `AWS_REGION`
66+
2. Shared configuration file if `AWS_SDK_LOAD_CONFIG` is set (defaults to `~/.aws/config`, profiles can be specified using `AWS_PROFILE`)
67+
6168
If `AWS_HOSTED_ZONE_ID` is not set, Lego tries to determine the correct public hosted zone via the FQDN.
6269

6370
See also:
6471

6572
- [sessions](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html)
66-
- [Setting AWS Credentials](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html#setup-credentials-setting)
73+
- [Setting AWS Credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials)
74+
- [Setting AWS Region](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-the-region)
6775

6876
## Policy
6977

providers/dns/route53/route53.toml

+11-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,22 @@ Additional = '''
1111
1212
AWS Credentials are automatically detected in the following locations and prioritized in the following order:
1313
14-
1. Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, [`AWS_SESSION_TOKEN`]
15-
2. Shared credentials file (defaults to `~/.aws/credentials`)
14+
1. Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, [`AWS_SESSION_TOKEN`]
15+
2. Shared credentials file (defaults to `~/.aws/credentials`, profiles can be specified using `AWS_PROFILE`)
1616
3. Amazon EC2 IAM role
1717
18+
The AWS Region is automatically detected in the following locations and prioritized in the following order:
19+
20+
1. Environment variables: `AWS_REGION`
21+
2. Shared configuration file if `AWS_SDK_LOAD_CONFIG` is set (defaults to `~/.aws/config`, profiles can be specified using `AWS_PROFILE`)
22+
1823
If `AWS_HOSTED_ZONE_ID` is not set, Lego tries to determine the correct public hosted zone via the FQDN.
1924
2025
See also:
2126
2227
- [sessions](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html)
23-
- [Setting AWS Credentials](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html#setup-credentials-setting)
28+
- [Setting AWS Credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials)
29+
- [Setting AWS Region](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-the-region)
2430
2531
## Policy
2632
@@ -61,6 +67,8 @@ The following AWS IAM policy document describes the permissions required for leg
6167
AWS_SECRET_ACCESS_KEY = "Managed by the AWS client (`AWS_SECRET_ACCESS_KEY_FILE` is not supported)"
6268
AWS_REGION = "Managed by the AWS client (`AWS_REGION_FILE` is not supported)"
6369
AWS_HOSTED_ZONE_ID = "Override the hosted zone ID"
70+
AWS_PROFILE = "Managed by the AWS client (`AWS_PROFILE_FILE` is not supported)"
71+
AWS_SDK_LOAD_CONFIG = "Retrieve the region from the CLI config file (`AWS_SDK_LOAD_CONFIG_FILE` is not supported)"
6472
[Configuration.Additional]
6573
AWS_MAX_RETRIES = "The number of maximum returns the service will use to make an individual API request"
6674
AWS_POLLING_INTERVAL = "Time between DNS propagation check"

0 commit comments

Comments
 (0)