discovery-common-aws


License

License

Categories

Categories

AWS Container PaaS Providers
GroupId

GroupId

social.midas
ArtifactId

ArtifactId

discovery-common-aws_2.12
Last Version

Last Version

0.4.4
Release Date

Release Date

Type

Type

jar
Description

Description

discovery-common-aws
discovery-common-aws
Project URL

Project URL

https://github.com/Midas-Technologies-AG/service-discovery
Project Organization

Project Organization

Midas Technologies AG
Source Code Management

Source Code Management

https://github.com/Midas-Technologies-AG/service-discovery/tree/master

Download discovery-common-aws_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/social.midas/discovery-common-aws_2.12/ -->
<dependency>
    <groupId>social.midas</groupId>
    <artifactId>discovery-common-aws_2.12</artifactId>
    <version>0.4.4</version>
</dependency>
// https://jarcasting.com/artifacts/social.midas/discovery-common-aws_2.12/
implementation 'social.midas:discovery-common-aws_2.12:0.4.4'
// https://jarcasting.com/artifacts/social.midas/discovery-common-aws_2.12/
implementation ("social.midas:discovery-common-aws_2.12:0.4.4")
'social.midas:discovery-common-aws_2.12:jar:0.4.4'
<dependency org="social.midas" name="discovery-common-aws_2.12" rev="0.4.4">
  <artifact name="discovery-common-aws_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='social.midas', module='discovery-common-aws_2.12', version='0.4.4')
)
libraryDependencies += "social.midas" % "discovery-common-aws_2.12" % "0.4.4"
[social.midas/discovery-common-aws_2.12 "0.4.4"]

Dependencies

compile (13)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.8
social.midas : discovery-common_2.12 jar 0.4.4
com.typesafe : config jar 1.3.3
org.apache.logging.log4j : log4j-core jar 2.11.1
org.apache.logging.log4j : log4j-api jar 2.11.1
org.apache.logging.log4j : log4j-api-scala_2.12 jar 11.0
org.typelevel : cats-effect_2.12 jar 1.2.0
io.circe : circe-generic_2.12 jar 0.11.1
org.apache.logging.log4j : log4j-slf4j-impl jar 2.11.1
software.amazon.awssdk : aws-core jar 2.4.1
software.amazon.awssdk : core jar 2.4.1
software.amazon.awssdk : regions jar 2.4.1
software.amazon.awssdk : utils jar 2.4.1

provided (1)

Group / Artifact Type Version
com.sksamuel.scapegoat : scalac-scapegoat-plugin_2.12 jar 1.3.8

test (8)

Group / Artifact Type Version
io.circe : circe-literal_2.12 jar 0.11.1
io.circe : circe-parser_2.12 jar 0.11.1
com.novocode : junit-interface jar 0.11
org.scala-lang.modules : scala-java8-compat_2.12 jar 0.9.0
org.scalacheck : scalacheck_2.12 jar 1.14.0
org.specs2 : specs2-core_2.12 jar 4.4.1
org.specs2 : specs2-junit_2.12 jar 4.4.1
org.specs2 : specs2-scalacheck_2.12 jar 4.4.1

Project Modules

There are no modules declared in this project.

Maven Central

fifi - A Service Discovery Library

Well, the title says it all: this library is about service discovery in general. At the moment it only supports discovering IP addresses for AWS EC2 and ECS, but expect this to expand in the near future.

Discovery statement are GraphQL queries which can be defined in your configuration file. Here is an example to fetch the private IP addresses of all your EC2 instances:

query {
    ec2Instances {
        privateIpAddress
    }
}

There are filters on almost every level. See the EC2 and ECS schema doctest.

Use extractors (e.g. the Ip4Extractor) to get back the bits that interest you from the query. Define both in your configuration file like this:

discovery.aws.region = "eu-central-1"
discovery.extractors = [ "social.midas.discovery.common.Ip4Extractor$" ]
discovery.query = """
query {
  ecsClusters {
    tasks {
      containerInstance {
        ec2Instance {
          privateIpAddress
        }
      }
    }
  }
}
"""

Then you can simply use discoverFromConfig (doc) to get back all IP addresses of your ECS machines.

Library Structure

The library is split into several parts:

  • discovery-common -- common functionality and main interface (doc),
  • discovery-common-aws -- functionality specific for AWS (doc),
  • discovery-aws-ec2 -- defines the EC2 schema (doc),
  • discovery-aws-ecs -- defines the ECS schema (doc).

As ECS runs on EC2 you currently get the whole package by depending on discovery-aws-ecs. The schemata get discovered automatically when they are in the classpath.

social.midas

m1d4s.tech

Versions

Version
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.5
0.3.4
0.3.2