• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

Route 53 Policy to Change Records

June 14, 2019

Here’s the IAM policy you’ll need to change Route 53 DNS records. Substitute with your own hosted zone id.

{
   "Statement":[{
      "Effect":"Allow",
      "Action":["route53:ChangeResourceRecordSets"],
      "Resource":"arn:aws:route53:::hostedzone/*HOSTEDZONEID*"
      }
   ],
   "Statement":[{
      "Effect":"Allow",
      "Action":["route53:GetChange"],
      "Resource":"arn:aws:route53:::change/*"
      }
   ]
}

{ "Statement":[{ "Effect":"Allow", "Action":["route53:ChangeResourceRecordSets"], "Resource":"arn:aws:route53:::hostedzone/*HOSTEDZONEID*" } ], "Statement":[{ "Effect":"Allow", "Action":["route53:GetChange"], "Resource":"arn:aws:route53:::change/*" } ] }

Add to policy to a user.

Filed Under: Cloud Tagged With: aws, change, dns, iam, policy, records, route 53

Change DNS Records in Route 53 via CLI

June 14, 2019

How to change DNS records in Route 53 via AWS CLI.

  • Assuming AWS CLI is already configured
  • Uses Route53 change-resource-record-sets to update DNS records
  • Substitute with your own hosted-zone-id
  • Uses JSON files containing record sets
  • See JSON file examples below
cd /path/to/scripts/
# the command to switch to the elb
aws route53 change-resource-record-sets --hosted-zone-id xxxxxxxxxxxxxx --change-batch file://elb.json
# the command to switch to standard site
aws route53 change-resource-record-sets --hosted-zone-id xxxxxxxxxxxxxx --change-batch file://live.json

cd /path/to/scripts/ # the command to switch to the elb aws route53 change-resource-record-sets --hosted-zone-id xxxxxxxxxxxxxx --change-batch file://elb.json # the command to switch to standard site aws route53 change-resource-record-sets --hosted-zone-id xxxxxxxxxxxxxx --change-batch file://live.json

elb.json = points to AWS ELB (elastic load balancer)

{
   "Comment": "back to elb",
   "Changes": [
      {
         "Action": "UPSERT",
         "ResourceRecordSet": {
            "Name": "yourdomain.com",
            "Type": "A",
            "AliasTarget": {
               "HostedZoneId": "xxxxxxxxxxxxxx",
               "EvaluateTargetHealth": false,
               "DNSName": "xxxxxxxxxxxxx.us-east-1.elb.amazonaws.com."
            }
         }
      }
   ]
}

{ "Comment": "back to elb", "Changes": [ { "Action": "UPSERT", "ResourceRecordSet": { "Name": "yourdomain.com", "Type": "A", "AliasTarget": { "HostedZoneId": "xxxxxxxxxxxxxx", "EvaluateTargetHealth": false, "DNSName": "xxxxxxxxxxxxx.us-east-1.elb.amazonaws.com." } } } ] }

live.json = points to your standard site. Value is your IP Address.

{
   "Comment": "back to live",
   "Changes": [
      {
         "Action": "UPSERT",
         "ResourceRecordSet": {
            "Name": "yourdomain.com",
            "Type": "A",
            "TTL": 60,
            "ResourceRecords": [
               {
                  "Value": "xxx.xxx.xxx.xxx"
               }
            ]
         }
      }
   ]
}

{ "Comment": "back to live", "Changes": [ { "Action": "UPSERT", "ResourceRecordSet": { "Name": "yourdomain.com", "Type": "A", "TTL": 60, "ResourceRecords": [ { "Value": "xxx.xxx.xxx.xxx" } ] } } ] }

Filed Under: Cloud Tagged With: change, cli, dns, domains, elb, json, records, route 53

GCP List Snapshots

June 13, 2019

Here are several examples how to display GCP snapshots using Google SDK (CLI – command line interface).

# list snapshots
gcloud compute snapshots list \
--project my-project \
--filter="name~'my-server-boot'"
# limit 10
gcloud compute snapshots list \
--project my-project \
--filter="name~'my-server-boot'" \
--limit 10
# reverse order
gcloud compute snapshots list \
--project my-project \
--filter="name~'my-server-boot'" \
--limit 10 \
--sort-by="~name"
# display uri
gcloud compute snapshots list \
--project my-project \
--filter="name~'my-server-boot'" \
--limit 10 \
--sort-by="~name" \
--uri

# list snapshots gcloud compute snapshots list \ --project my-project \ --filter="name~'my-server-boot'" # limit 10 gcloud compute snapshots list \ --project my-project \ --filter="name~'my-server-boot'" \ --limit 10 # reverse order gcloud compute snapshots list \ --project my-project \ --filter="name~'my-server-boot'" \ --limit 10 \ --sort-by="~name" # display uri gcloud compute snapshots list \ --project my-project \ --filter="name~'my-server-boot'" \ --limit 10 \ --sort-by="~name" \ --uri

Filed Under: Cloud Tagged With: cli, gcp, sdk, snapshots

Crontab File

June 12, 2019

How to load crontab from file.

crontab /path/to/file.txt

crontab /path/to/file.txt

Save crontab to a file.

crontab -l > /path/to/file.txt

crontab -l > /path/to/file.txt

Filed Under: Linux Tagged With: crontab, file, load, write

Get-Hotfix

June 11, 2019

What patches were installed on Windows Server. Run the command below in Powershell as Administrator.

get-hotfix

get-hotfix

You can also see it from the Control Panel > Program > Programs and Features > Installed Updates.

Filed Under: Cloud Tagged With: get-hotfix, patches, server, windows

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 117
  • Go to page 118
  • Go to page 119
  • Go to page 120
  • Go to page 121
  • Interim pages omitted …
  • Go to page 200
  • Go to Next Page »
  • Home
  • About
  • Search

Copyright © 2023