Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Commit

Permalink
Get the first part of the DNS name for an A record
Browse files Browse the repository at this point in the history
  • Loading branch information
javierros committed Nov 8, 2017
1 parent cd4559d commit 65c71e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Service_Discovery_Using_DNS.template
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"group" : "root"
},
"/usr/local/bin/ecssd_agent": {
"source" : "https://github.com/awslabs/service-discovery-ecs-dns/releases/download/1.4/ecssd_agent",
"source" : "https://github.com/awslabs/service-discovery-ecs-dns/releases/download/1.5/ecssd_agent",
"mode" : "000755",
"owner" : "root",
"group" : "root"
Expand Down
2 changes: 1 addition & 1 deletion Service_Discovery_Using_DNS_cwlogging.template
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
},

"/usr/local/bin/ecssd_agent": {
"source" : "https://github.com/awslabs/service-discovery-ecs-dns/releases/download/1.4/ecssd_agent",
"source" : "https://github.com/awslabs/service-discovery-ecs-dns/releases/download/1.5/ecssd_agent",
"mode" : "000755",
"owner" : "root",
"group" : "root"
Expand Down
4 changes: 2 additions & 2 deletions ecssd_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func createARecord(hostName string, localIP string) error {
{
Action: aws.String(route53.ChangeActionCreate),
ResourceRecordSet: &route53.ResourceRecordSet{
Name: aws.String(hostName),
Name: aws.String(strings.Split(hostName, ".")[0]),
// It creates an A record with the IP of the host running the agent
Type: aws.String(route53.RRTypeA),
ResourceRecords: []*route53.ResourceRecord{
Expand Down Expand Up @@ -243,7 +243,7 @@ func removeARecord(hostName string) error {
paramsList := &route53.ListResourceRecordSetsInput{
HostedZoneId: aws.String(configuration.HostedZoneId), // Required
MaxItems: aws.String("1"),
StartRecordName: aws.String(hostName),
StartRecordName: aws.String(strings.Split(hostName, ".")[0]),
StartRecordType: aws.String(route53.RRTypeA),
}
resp, err := r53.ListResourceRecordSets(paramsList)
Expand Down

0 comments on commit 65c71e8

Please sign in to comment.