github.com/in4it/ecs-deploy@v0.0.42-0.20240508120354-ed77ff16df25/provider/ecs/init_test.go (about)

     1  package ecs
     2  
     3  import (
     4  	"github.com/in4it/ecs-deploy/util"
     5  	"github.com/juju/loggo"
     6  )
     7  
     8  var accountId *string
     9  
    10  const noAWSMsg = "AWS Credentials not found - test skipped"
    11  
    12  func init() {
    13  	// set logging to debug
    14  	if util.GetEnv("DEBUG", "") == "true" {
    15  		loggo.ConfigureLoggers(`<root>=DEBUG`)
    16  	}
    17  	// check AWS access first
    18  	iam := IAM{}
    19  	err := iam.GetAccountId()
    20  	if err != nil {
    21  		return
    22  	}
    23  	accountId = &iam.AccountId
    24  }