1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Replace Jekyll highlight tags with fenced code blocks (#1412)

* Replace Jekyll highlight tags with fenced code blocks

Replace Jekyll highlight tags with fenced code blocks.
Canonicalize javascript to js.
Correct highlighting languages.
Add highlighting to code blocks.
Remove leading $ from bash blocks.
Remove empty lines at start and end of code blocks.
Stripped trailing whitespace.

* Fix language of code highlighting
This commit is contained in:
Julius Rickert
2022-02-17 18:22:31 +01:00
committed by GitHub
parent 40bc39533f
commit 20dad35167
103 changed files with 631 additions and 585 deletions

View File

@@ -8,7 +8,7 @@ jsId: ROUTE53
## Configuration
You can specify the API credentials in the credentials json file:
{% highlight json %}
```json
{
"r53_main": {
"KeyId": "your-aws-key",
@@ -17,34 +17,34 @@ You can specify the API credentials in the credentials json file:
"DelegationSet" : "optional-delegation-set-id"
}
}
{% endhighlight %}
```
You can also use environment variables, but this is discouraged, unless your environment provides them already.
```
$ export AWS_ACCESS_KEY_ID=XXXXXXXXX
$ export AWS_SECRET_ACCESS_KEY=YYYYYYYYY
$ export AWS_SESSION_TOKEN=ZZZZZZZZ
```bash
export AWS_ACCESS_KEY_ID=XXXXXXXXX
export AWS_SECRET_ACCESS_KEY=YYYYYYYYY
export AWS_SESSION_TOKEN=ZZZZZZZZ
```
{% highlight json %}
```json
{
"r53_main": {
"KeyId": "$AWS_ACCESS_KEY_ID",
"SecretKey": "$AWS_SECRET_ACCESS_KEY"
}
}
{% endhighlight %}
```
Alternatively if you want to used [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) you need to export the following variable
```
$ export AWS_PROFILE=ZZZZZZZZ
```bash
export AWS_PROFILE=ZZZZZZZZ
```
Ensure you have a minimal creds.json file with the DNS Provider specified, otherwise versions above 3.8.0 will fail. So, for:
```
```js
var R53_MAIN = NewDnsProvider('r53_main', 'ROUTE53');
```
@@ -64,21 +64,21 @@ This provider does not recognize any special metadata fields unique to route 53.
## Usage
Example Javascript:
{% highlight js %}
```js
var REG_NONE = NewRegistrar('none', 'NONE');
var R53 = NewDnsProvider('r53_main', 'ROUTE53');
D('example.tld', REG_NONE, DnsProvider(R53),
A('test','1.2.3.4')
);
{% endhighlight %}
```
## Activation
DNSControl depends on a standard [AWS access key](https://aws.amazon.com/developers/access-keys/) with permission to list, create and update hosted zones. If you do not have the permissions required you will receive the following error message `Check your credentials, your not authorized to perform actions on Route 53 AWS Service`.
You can apply the `AmazonRoute53FullAccess` policy however this includes access to many other areas of AWS. The minimum permissions required are as follows:
{% highlight json %}
```json
{
"Version": "2012-10-17",
"Statement": [
@@ -96,7 +96,7 @@ You can apply the `AmazonRoute53FullAccess` policy however this includes access
}
]
}
{% endhighlight %}
```
If Route53 is also your registrar, you will need `route53domains:UpdateDomainNameservers` and `route53domains:GetDomainDetail` as well and possibly others.
@@ -106,8 +106,8 @@ If a domain does not exist in your Route53 account, DNSControl will *not* automa
## Delegation Sets
Creation of new delegation sets are not supported by this code. However, if you have a delegation set already created, ala:
```
$ aws route53 create-reusable-delegation-set --caller-reference "foo"
```bash
aws route53 create-reusable-delegation-set --caller-reference "foo"
{
"Location": "https://route53.amazonaws.com/2013-04-01/delegationset/12312312123",
"DelegationSet": {
@@ -138,7 +138,7 @@ but not as a DnsProvider. The situation is described in
In this situation you will see a message like:
```
```text
----- Registrar: r53_main
Error getting corrections: AccessDeniedException: User: arn:aws:iam::868399730840:user/dnscontrol is not authorized to perform: route53domains:GetDomainDetail
status code: 400, request id: 48b534a1-7902-11e7-afa6-a3fffd2ce139
@@ -181,8 +181,8 @@ More info is available in
### Creds key mismatch
```
$ dnscontrol preview
```bash
dnscontrol preview
Creating r53 dns provider: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
```
@@ -192,8 +192,8 @@ that the string `r53_main` is specified in `NewDnsProvider('r53_main', 'ROUTE53'
### Invalid KeyId
```
$ dnscontrol preview
```bash
dnscontrol preview
Creating r53_main dns provider: InvalidClientTokenId: The security token included in the request is invalid.
status code: 403, request id: 8c006a24-e7df-11e7-9162-01963394e1df
```
@@ -202,8 +202,8 @@ This means the KeyId is unknown to AWS.
### Invalid SecretKey
```
$ dnscontrol preview
```bash
dnscontrol preview
Creating r53_main dns provider: SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
status code: 403, request id: 9171d89a-e7df-11e7-8586-cbea3ea4e710
```
@@ -212,8 +212,8 @@ This means the SecretKey is incorrect. It may be a quoting issue.
### Incomplete Signature
```
$ ./dnscontrol preview
```bash
dnscontrol preview
IncompleteSignature: 'ABCDEFGHIJKLMNOPQRST/20200118/us-east-1/route53/aws4_request' not a valid key=value pair (missing equal-sign) in Authorization header: 'AWS4-HMAC-SHA256 Credential= ABCDEFGHIJKLMNOPQRST/20200118/us-east-1/route53/aws4_request, SignedHeaders=host;x-amz-date, Signature=571c0b13205669a338f0fb9f351dc03c7016c8737c738081bc885c68378ad877'.
status code: 403, request id: 12a34b5c-d678-9e01-f2gh-3456i7jk89lm
```