Fork me on GitHub
#aws
<
2016-06-08
>
podviaznikov03:06:56

Did anyone try to programmatically create record set pointing to the alias (s3) using amazonica? I have following function:

(defn configure-dns [zone-id domain]
  (let [resource-record-set
        {:name (str domain ".")
         :type "A"
         ;:ttl 60
         :alias-target
         {
          ;http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
          :hosted-zone-id "Z3AQBSTGFYJSTF"
          :evaluate-target-health false
          :DNSName ""
          }
         :resource-records [{:value "val"}]}
        changes [{:action "CREATE"
                  :resource-record-set resource-record-set}]
        batch {:changes changes}
        request {:hosted-zone-id zone-id
                 :change-batch batch}]
    (route53/change-resource-record-sets request)))
Calling this function gives not super helpful to me error:
errorCode: "InvalidInput"
    errorMessage: "Invalid request"
       errorType: #object[com.amazonaws.AmazonServiceException$ErrorType 0x4d30c096 "Client"]
       requestId: "cae553f0-2d27-11e6-b7d4-a968b96dda55"
       retryable: true
     serviceName: "AmazonRoute53"
      statusCode: 400
All other calls: create hosted zone, create bucket - work for me so far

podviaznikov05:06:00

found a problem. I shouldn’t specify :resource-records [{:value "val"}]}