community.aws icon indicating copy to clipboard operation
community.aws copied to clipboard

Implement service discovery service from AWS Cloud Map

Open slaterx opened this issue 2 years ago • 3 comments

Summary

I am trying to implement an ecs_service deployment where the availability is defined by endpoints defined in AWS Cloud Map API (https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html). Currently, ecs_service has a capability to use existing Cloud Maps defined externally, but I could not find how to create a new service discovery service using Ansible. The best I could do was create a route53 entry with multivalue, but that does not give me the ARN necessary to register instances later.

That could be delivered either inside ecs_service itself (and same with ec2_instance) where we define state: present or via a new component (presumably service_discovery)

Issue Type

Feature Idea

Component Name

ecs_service, ec2_instance, service_discovery

Additional Information

Inside ecs_service or ec2_instance

- name: defining service
  ecs_service:
    name: "my_ecs_service"
(...)
    service_registries:
      - name: my_ecs_service_namespace
        state: present
        namespace_id: namespace_uid 
        container_name: my_ecs_service
        container_port: 3000

As a new service

- name: creating new service discovery registry
  service_discovery:
    name: "my_ecs_service_registry"
    state: present
    namespace_id: namespace_uid 
    dns_records:
      - name: _my_ecs_service_namespace_record
        ttl: 10
        type: SRV
        routing_policy: MULTIVALUE

Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

slaterx avatar Mar 08 '22 07:03 slaterx