{"action":"created","issue":{"url":"https://api.github.com/repos/codenize-tools/roadworker/issues/65","repository_url":"https://api.github.com/repos/codenize-tools/roadworker","labels_url":"https://api.github.com/repos/codenize-tools/roadworker/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/codenize-tools/roadworker/issues/65/comments","events_url":"https://api.github.com/repos/codenize-tools/roadworker/issues/65/events","html_url":"https://github.com/codenize-tools/roadworker/pull/65","id":299478337,"number":65,"title":"Optionally accept hosted zone ID in DSL","user":{"login":"kaorimatz","id":1951519,"avatar_url":"https://avatars3.githubusercontent.com/u/1951519?v=4","gravatar_id":"","url":"https://api.github.com/users/kaorimatz","html_url":"https://github.com/kaorimatz","followers_url":"https://api.github.com/users/kaorimatz/followers","following_url":"https://api.github.com/users/kaorimatz/following{/other_user}","gists_url":"https://api.github.com/users/kaorimatz/gists{/gist_id}","starred_url":"https://api.github.com/users/kaorimatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaorimatz/subscriptions","organizations_url":"https://api.github.com/users/kaorimatz/orgs","repos_url":"https://api.github.com/users/kaorimatz/repos","events_url":"https://api.github.com/users/kaorimatz/events{/privacy}","received_events_url":"https://api.github.com/users/kaorimatz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-22T19:30:16Z","updated_at":"2018-02-28T06:46:16Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/codenize-tools/roadworker/pulls/65","html_url":"https://github.com/codenize-tools/roadworker/pull/65","diff_url":"https://github.com/codenize-tools/roadworker/pull/65.diff","patch_url":"https://github.com/codenize-tools/roadworker/pull/65.patch"},"body":"When we give the following change\r\n\r\n```patch\r\n hosted_zone \"example.com.\" do\r\n   vpc \"us-east-1\", \"vpc-xxxxxxxx\"\r\n+  vpc \"us-east-1\", \"vpc-yyyyyyyy\"\r\n end\r\n```\r\n\r\nroadworker tries to recreate the hosted zone.\r\n\r\n```\r\n$ roadwork --apply --dry-run --force\r\nApply `Routefile` to Route53 (dry-run)\r\nCreate Hostedzone #<struct Aws::Route53::Types::VPC vpc_region=\"us-east-1\", vpc_id=\"vpc-xxxxxxxx\">: example.com (dry-run)\r\nAssociate #<struct Aws::Route53::Types::VPC vpc_region=\"us-east-1\", vpc_id=\"vpc-yyyyyyyy\">: example.com (dry-run)\r\nDelete Hostedzone: example.com. (dry-run)\r\nNo change\r\n```\r\n\r\nThis destructive behavior seems to have been introduced by https://github.com/codenize-tools/roadworker/pull/54 for dealing with the case where we have multiple private hosted zones with the same name.\r\n\r\nBy applying this patch, it simply associates the VPC to the existing hosted zone.\r\n\r\n```\r\n$ roadwork --apply --dry-run\r\nApply `Routefile` to Route53 (dry-run)\r\nAssociate #<struct Aws::Route53::Types::VPC vpc_region=\"us-east-1\", vpc_id=\"vpc-yyyyyyyy\">: example.com. (dry-run)\r\nNo change\r\n```\r\n\r\nThis patch will make DSL optionally accept a hosted zone ID for addressing the issue described in https://github.com/codenize-tools/roadworker/pull/54.\r\n\r\n```patch\r\n hosted_zone \"example.com.\", \"ZXXXXXXXXXXXXX\" do\r\n   vpc \"us-east-1\", \"vpc-xxxxxxxx\"\r\n end\r\n\r\n hosted_zone \"example.com.\", \"ZYYYYYYYYYYYYY\" do\r\n   vpc \"us-east-1\", \"vpc-yyyyyyyy\"\r\n+  rrset \"a.example.com.\", \"CNAME\" do\r\n+    resource_records \"b.example.com.\"\r\n+  end\r\n end\r\n```\r\n\r\n```\r\n$ roadwork --apply --dry-run\r\nApply `Routefile` to Route53 (dry-run)\r\nCreate ResourceRecordSet: a.example.com CNAME (dry-run)\r\nNo change\r\n```"},"comment":{"url":"https://api.github.com/repos/codenize-tools/roadworker/issues/comments/369138488","html_url":"https://github.com/codenize-tools/roadworker/pull/65#issuecomment-369138488","issue_url":"https://api.github.com/repos/codenize-tools/roadworker/issues/65","id":369138488,"user":{"login":"winebarrel","id":117768,"avatar_url":"https://avatars1.githubusercontent.com/u/117768?v=4","gravatar_id":"","url":"https://api.github.com/users/winebarrel","html_url":"https://github.com/winebarrel","followers_url":"https://api.github.com/users/winebarrel/followers","following_url":"https://api.github.com/users/winebarrel/following{/other_user}","gists_url":"https://api.github.com/users/winebarrel/gists{/gist_id}","starred_url":"https://api.github.com/users/winebarrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winebarrel/subscriptions","organizations_url":"https://api.github.com/users/winebarrel/orgs","repos_url":"https://api.github.com/users/winebarrel/repos","events_url":"https://api.github.com/users/winebarrel/events{/privacy}","received_events_url":"https://api.github.com/users/winebarrel/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T06:46:16Z","updated_at":"2018-02-28T06:46:16Z","author_association":"COLLABORATOR","body":"Thank you!"}}
{"actor":{"display_login":"winebarrel"}}