https://github.com/rgl/go-aws-route53-usage-example
This is an example Go application that lists all the DNS Zones hosted in AWS Route 53
https://github.com/rgl/go-aws-route53-usage-example
aws-route53 example go
Last synced: about 1 year ago
JSON representation
This is an example Go application that lists all the DNS Zones hosted in AWS Route 53
- Host: GitHub
- URL: https://github.com/rgl/go-aws-route53-usage-example
- Owner: rgl
- Created: 2024-04-26T09:46:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T09:47:02.000Z (almost 2 years ago)
- Last Synced: 2024-12-31T11:06:02.514Z (over 1 year ago)
- Topics: aws-route53, example, go
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
This is an example Go application that lists all the DNS Zones hosted in [AWS Route 53](https://aws.amazon.com/route53/).
# Usage (on a Ubuntu Desktop)
Install the dependencies:
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
* [Go](https://go.dev/dl/).
Set the AWS Account credentials using SSO:
```bash
# set the environment variables to use a specific profile.
# e.g. use the pattern ---
export AWS_PROFILE=example-dev-AdministratorAccess-123456
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_DEFAULT_REGION
# set the account credentials.
# see https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html#sso-configure-profile-token-auto-sso
aws configure sso
# dump the configured profile and sso-session.
cat ~/.aws/config
# show the user, user amazon resource name (arn), and the account id, of the
# profile set in the AWS_PROFILE environment variable.
aws sts get-caller-identity
```
Or, set the AWS Account credentials using an Access Key:
```bash
# set the account credentials.
# NB get these from your aws account iam console.
# see Managing access keys (console) at
# https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey
export AWS_ACCESS_KEY_ID='TODO'
export AWS_SECRET_ACCESS_KEY='TODO'
unset AWS_PROFILE
# set the default region.
export AWS_DEFAULT_REGION='eu-west-1'
# show the user, user amazon resource name (arn), and the account id.
aws sts get-caller-identity
```
Build:
```bash
go build
```
Use:
```bash
./go-aws-route53-usage-example
```
You should see something like:
```
zone=abc.example.com. nameservers=ns-1529.awsdns-63.org,ns-773.awsdns-32.net,ns-1797.awsdns-32.co.uk,ns-48.awsdns-06.com
```