Skip to content

Risk: Service discovery between webapp/service in AWS #29

@matthew-a-carr

Description

@matthew-a-carr

Overview

The webapp needs to be able to talk to the service and currently this is done by using a private hosted zone within the VPC that both are deployed in.

We map the IP addresses of the webapp and API to DNS entries for each environment:

  • Webapp: webapp.${env}.beacons.local
  • service: service.${env}.becons.local

With the current configuration, the webapp will be able to communication with the service using the DNS label above as route 53 will manage the resolving of the DNS to an IP address that resolves to an instance of the service within the VPC.

Issue

Whilst making an update to the name of the dns resource I encountered an issue with not being able to deploy the update as the steps that Terraform needed to do were:

  1. Delete the existing DNS hosted zone
  2. Create the new one DNS hosted zone
  3. Register the new services

Terraform failed on the first step, see the pipeline as it was unable to de-register the existing ECS tasks that were linked to the existing DNS hosted zone. There is an outstanding GitHub issue for this exact issue with Terraform but unfortunately no proper solution in place currently.

Workaround

The workaround to resolve this is to:

  • Manually stop the ECS tasks that are running
  • Re-deploy the Terraform configuration which will remove the DNS hosted zone (without the services registered)
  • Create the new DNS hosted zone and register the new tasks that are re-created by Terraform

Potential Impact

The impact of this is high as it requires a manual intervention to stop the tasks and re-run the deployment (~ 1 minute to go through) and some down time in stopping the tasks.

The likelihood of it happening should be low as we do not expect to make changes to the dns zone resource often.

Alternatives

  • Network traffic between the webapp and the service goes over the internet, i.e: a request is made outside of the AWS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions