Skip to content

ecswhoami: A Go package to do a task metadata lookup from inside AWS ECS

License

Notifications You must be signed in to change notification settings

mhemmings/ecswhoami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ecswhoami

Test GoDoc

A Go package to do a task metadata lookup from inside AWS Elastic Container Service.

Lookup() calls the ECS_CONTAINER_METADATA_URI as defined in https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v3.html, and returns the response.

Usage:

package main

import (
	"log"

	"github.com/mhemmings/ecswhoami"
)

func main() {
	meta, err := ecswhoami.Lookup()
	if err != nil {
		log.Fatal(err)
	}

	log.Println("Name:", meta.Name)
	log.Println("Image ID:", meta.ImageID)
	// ... etc
}

About

ecswhoami: A Go package to do a task metadata lookup from inside AWS ECS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages