Amazon ECS resource discovery with Patterns

  • Rversion finale: Australia
  • Mis à jour 12 mars 2026
  • 7 minutes de lecture
  • The ServiceNow Discovery application uses the Amazon AWS - ECS pattern to find resources managed by the Amazon Elastic Container Service (Amazon ECS). This includes resources that are run on the Fargate launch type. Discovering some of these resources may require updating to the latest version of the Discovery and Service Mapping Patterns application from the ServiceNow Store.

    Amazon ECS is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers. AWS Fargate is a compute engine for Amazon ECS that enables AWS customers to run containers without having to manage servers or clusters.

    Discovery uses the Amazon AWS - ECS pattern to run horizontal discovery.

    Starting with Discovery and Service Mapping Patterns version 1.18.0, the Amazon AWS - ECS pattern supports the discovery of Amazon Elastic Container Registry (Amazon ECR) images. For more information on container scanning, see Scan container images.

    Request apps on the Store

    Visit the ServiceNow Store to view all the available apps, and for information about submitting requests to the store. For cumulative release notes information for all released apps, see the ServiceNow Store version history release notes.

    Prerequisites

    Create AWS credentials with ECS resources viewing privileges
    In the AWS console, create AWS credentials with privileges to view ECS resources. For more information, see: https://docs.aws.amazon.com/en_pv/AmazonECS/latest/userguide/get-set-up-for-amazon-ecs.html.
    Remarque :
    The API requests use AWS Signature Version 4 to authenticate. When the correct credentials are provided, authentication is done internally for the Cloud API Call pattern steps.
    Create AWS cloud credential records or use temporary credentials
    In the ServiceNow AI Platform, create AWS credential records. You can also use a temporary credential generated by the AWS Security Token Service (AWS STS) for IAM roles. For more information, see Cloud credentials
    Create AWS cloud service accounts
    • In the ServiceNow AI Platform, create AWS cloud service accounts using permanent or temporary AWS credentials. For more information, see Setting up AWS service accounts.
    • In the Cloud Service Account record, select Discover Datacenters to find AWS Datacenters (LDCs) for the configured AWS cloud service account.
    Schedule an AWS discovery
    In the ServiceNow AI Platform, schedule either a full AWS pattern discovery or only an ECS pattern discovery.
    Verify configuration of VM Object record to find the resource Tags
    To enable the pattern to find the resource Tags, the parent ECS table (VM Object) must have a related entry for the cmdb_key_value table:
    1. In the ServiceNow AI Platform navigation bar, navigate to All > Configuration > Identification/Reconciliation, and select CI Identifiers.
    2. Search for and open the VM Object record.
    3. Select the Related Entries tab and make sure it’s configured as shown in the VM Object Related Entry figure. If it isn’t, specify a new related entry: In the Related Entries related list, select New, fill out the form, and then select Submit.
      Figure 1. VM Object Related Entry

      Related entry configuration

    Verify the REST API Permissions

    Download the Cloud Discovery patterns spreadsheet so you can grant user permissions required for running the Discovery patterns. In addition to permissions, the spreadsheet also includes useful information such as pattern names, types, CI Classes, and links to vendor documentation. New patterns are available quarterly, so check periodically to be sure you have the latest version of the spreadsheet.

    Remarque :
    You can test the AWS REST APIs using Postman API platform. For more information, see the How to test AWS REST API using POSTMAN [KB0782183] article in the Now Support Knowledge Base.

    Data collected by Discovery during horizontal discovery

    Discovery populates the data in the CMDB when running the Amazon AWS - ECS pattern.

    Tableau 1. AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster]
    Field Description
    Object ID [object_id] The Amazon Resource Name (ARN) that identifies the cluster.
    Name [name] A user-generated string used to identify the cluster.
    Registered Container Instances Count [registered_container_instances_count] The number of container instances registered to the cluster. The status of these container instances can be either ACTIVE or DRAINING.
    Tableau 2. AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition]
    Field Description
    Object ID [object_id] The full ARN of the task definition.
    Name [name] The name of the family to which this task definition is registered.
    Revision [revision] The revision of the task in a particular family. This is the version number of the task definition in a family.
    Network Mode [network_mode] The Docker networking mode to use for the containers in the task. Valid values: None, bridge, awsvpc, host.
    CPU [cpu] The number of CPU units used by the task.
    Memory [memory] The amount of memory, in mebibyte (MiB), used by the task.
    Tableau 3. AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task]
    Field Description
    Object ID [object_id] The ARN that identifies the task.
    Name [name] A user-generated string used to identify the task.
    Launch Type [launch_type] The launch type on which the task runs.
    Operational status [operation_status] The health status of the task, determined by the health of the essential containers in it.
    CPU [cpu] The number of CPU units used by the task, as stated in the task definition.
    Memory [memory] The amount of memory, in MiB, used by the task, as stated in the task definition.
    Tableau 4. AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service]
    Field Description
    Object ID [object_id] The ARN that identifies the service.
    Name [name] The name of the service.
    Launch Type [launch_type] The launch type on which the service runs.
    Scheduling Strategy [scheduling_strategy] The scheduling strategy to use for the service.
    Tableau 5. Docker Container [cmdb_ci_docker_container]
    Field Description
    Container id [container_id] The ARN of the container.
    Name [name] The name of the container.
    Status [status] The last-known status of the container.
    Operational status [operational_status] The health status of the container.
    CPU [cpu] The number of CPU units set for the container.
    Memory [memory] The hard limit of memory, in MiB, set for the container.
    Tableau 6. Virtual Machine Instance [cmdb_ci_vm_instance]
    Field Description
    Object ID [object_id] The ARN that identifies the virtual machine (VM) instance.
    Remarque :
    Complete Virtual Machine Instance information is discovered in a different EC2 cloud pattern. In Amazon ECS resource discovery, only the object_id is parsed to aid with the unique identification of the CI.
    Tableau 7. Key Value [cmdb_key_value]
    Field Description
    Key [key] The Tag key.
    Value [value] The Tag value.
    Tableau 8. Docker Image [cmdb_ci_docker_image]
    Field Description
    Name [name] Name of the Docker image.
    Image Digest [image_digest] Unique identifier for the Docker image.
    Image ID [image_id] 12-character length unique identifier for the Docker image.
    Tableau 9. Container Repository [cmdb_ci_container_repository]
    Field Description
    Name [name] Fully qualified name of the repository containing the Docker image.
    Tableau 10. Container Repository Entry [cmdb_ci_container_repository_entry]
    Field Description
    Name [name] The Docker image tag.
    Category [category] Fully qualified name of the repository containing the Docker image.

    On the Dependency Views map, you can see all discovered resources in your organization that are managed by Amazon ECS, and the relationships between them.

    In this example, the AWS Cloud ECS Cluster CI is hosted on an AWS Datacenter. It runs two AWS Cloud ECS Tasks and two AWS Cloud ECS Services, and uses three Docker Containers.

    Figure 2. Dependency Views sample map

    CIs and connections on a Dependency Views map

    CI relationships

    These relationships are created to support Amazon ECS resource discovery.

    CI Relationship CI
    AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster] Uses::Used by Virtual Machine Instance [cmdb_ci_vm_instance]
    AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster] Runs::Runs on AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service]
    AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster] Runs::Runs on AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task]
    AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster] Hosted on::Hosts AWS datacenters
    AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster] Extends from Virtual Machine Object [cmdb_ci_vm_object]
    AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service] Uses::Used by AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition]
    AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service] Hosted on::Hosts AWS Datacenters
    AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service] Runs on::Runs AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster]
    AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service] Extends from Virtual Machine Object [cmdb_ci_vm_object]
    AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task] Runs on::Runs Virtual Machine Instance [cmdb_ci_vm_instance]
    AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task] Runs on::Runs Docker Container [cmdb_ci_docker_container]
    AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task] Uses::Used by AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition]
    AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task] Hosted on::Hosts AWS Datacenters
    AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task] Runs on::Runs AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster]
    AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task] Extends from Virtual Machine Object [cmdb_ci_vm_object]
    AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition] Used by::Uses AWS Cloud ECS Service [cmdb_ci_cloud_ecs_service]
    AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition] Used by::Uses AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task]
    AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition] Hosted on::Hosts AWS Datacenters
    AWS Cloud ECS TaskDefinition [cmdb_ci_cloud_ecs_task_definition] Extends from Virtual Machine Object [cmdb_ci_vm_object]
    Container Repository [cmdb_ci_container_repository] Hosted on::Hosts AWS Datacenter [cmdb_ci_aws_datacenter]
    Container Repository Entry [cmdb_ci_container_repository_entry] Hosted on::Hosts Container Repository [cmdb_ci_container_repository]
    Docker Container [cmdb_ci_docker_container] Hosted on::Hosts AWS Datacenters
    Docker Container [cmdb_ci_docker_container] Runs::Runs on AWS Cloud ECS Task [cmdb_ci_cloud_ecs_task]
    Docker Container [cmdb_ci_docker_container] Used by::Uses AWS Cloud ECS Cluster [cmdb_ci_cloud_ecs_cluster]
    Docker Image [cmdb_ci_docker_image] Provisioned From::Provisioned Container Repository Entry [cmdb_ci_container_repository_entry]
    Docker Image [cmdb_ci_docker_image] Instantiates::Instantiated by Docker Container [cmdb_ci_docker_container]