title: How to publish kubernetes LoadBalancer Ingress URL to aws route53
body: <p>Today when I launch an app using kubernetes over aws it exposes a publicly visible LoadBalancer Ingress URL, however to link that to my domain to make the app accessible to the public, I need to manually go into the aws route53 console in a browser on every launch.  Can I update the aws route53 Resource Type A to match the latest Kubernetes LoadBalancer Ingress URL from the command line ?</p>
  
  <p>Kubernetes over gcloud shares this challenge of having to either predefine a Static IP which is used in launch config or manually do a browser based domain linkage post launch.  On aws I was hoping I could use something similar to this from the command line </p>
  
  <pre><code>aws route53domains update-domain-nameservers   ???
  </code></pre>
  
  <p>__ OR __ can I predefine an aws kubernetes LoadBalancer Ingress similar to doing a predefined Static IP when over gcloud ?</p>
  
  <p>to show the deployed app's LoadBalancer Ingress URL issue</p>
  
  <pre><code>kubectl describe svc
  </code></pre>
  
  <p>... output</p>
  
  <pre><code>Name:           aaa-deployment-407
  Namespace:      ruptureofthemundaneplane
  Labels:         app=bbb
              pod-template-hash=4076262206
  Selector:       app=bbb,pod-template-hash=4076262206
  Type:           LoadBalancer
  IP:         10.0.51.82
  LoadBalancer Ingress:   a244bodhisattva79c17cf7-61619.us-east-1.elb.amazonaws.com
  Port:           port-1  80/TCP
  NodePort:       port-1  32547/TCP
  Endpoints:      10.201.0.3:80
  Port:           port-2  443/TCP
  NodePort:       port-2  31248/TCP
  Endpoints:      10.201.0.3:443
  Session Affinity:   None
  No events.
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Getting error trying new command line technique (hat tip to @error2007s comment) ... issue this</p>
  
  <pre><code>aws route53 list-hosted-zones
  </code></pre>
  
  <p>... outputs</p>
  
  <pre><code>{
      "HostedZones": [
          {
              "ResourceRecordSetCount": 6, 
              "CallerReference": "2D58A764-1FAC-DEB4-8AC7-AD37E74B94E6", 
              "Config": {
                  "PrivateZone": false
              }, 
              "Id": "/hostedzone/Z3II3949ZDMDXV", 
              "Name": "chainsawhaircut.com."
          }
      ]
  }
  </code></pre>
  
  <p>Important bit used below :  hostedzone  Z3II3949ZDMDXV</p>
  
  <p>now I craft following <a href="http://docs.aws.amazon.com/Route53/latest/APIReference/CreateAliasRRSAPI.html" rel="noreferrer">using this Doc</a>  <a href="http://docs.aws.amazon.com/cli/latest/reference/route53/change-resource-record-sets.html" rel="noreferrer">(and this Doc as well)</a> as file /change-resource-record-sets.json (NOTE I can successfully change Type A using a similar cli call ... however I need to change Type A with an Alias Target of LoadBalancer Ingress URL)</p>
  
  <pre><code>{
      "Comment": "Update record to reflect new IP address of fresh deploy",
      "Changes": [{
          "Action": "UPSERT",
          "ResourceRecordSet": {
              "Name": "chainsawhaircut.com.",
              "Type": "A",
              "TTL": 60,
              "AliasTarget": {
                  "HostedZoneId": "Z3II3949ZDMDXV",
                  "DNSName": "a244bodhisattva79c17cf7-61619.us-east-1.elb.amazonaws.com",
                  "EvaluateTargetHealth": false
              }
          }
      }]
  }
  </code></pre>
  
  <p>on command line I then issue</p>
  
  <p>aws route53 change-resource-record-sets --hosted-zone-id Z3II3949ZDMDXV --change-batch file:///change-resource-record-sets.json</p>
  
  <p>which give this error message</p>
  
  <pre><code>An error occurred (InvalidInput) when calling the ChangeResourceRecordSets operation: Invalid request
  </code></pre>
  
  <p>Any insights ?</p>