A service discovery for AWS ECS based on Route53 and AWS LAMBDA
This Lambda function is doing the service discovery for an ECS Cluster.
The project id which prefixes the parameter in the parameter store.
We use our go-aws and the System Manager Parameter Store to inject environment variables in Lambda functions.
This is Route 53 hosted zone to be used for constructing the discovery entries (e.g. tortuga.local
).
The Route 53 id of the hosted zone.
The name of the ECS cluster that should be discoverd.
We use various policies for the execution.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"arn:aws:logs:*:*:*"
]
},
{
"Effect": "Allow",
"Action": [
"ecs:*"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"ec2:*"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"route53:*",
"servicediscovery:*"
],
"Resource": "*"
}
]
}