// NewEC2Client creates an instance of ec2Client object. func NewEC2Client(params *config.CliParams) EC2Client { client := ec2.New(session.New(params.Config)) client.Handlers.Build.PushBackNamed(clients.CustomUserAgentHandler()) return &ec2Client{ client: client, } }
// Initialize initializes all the fields of the cloudFormationClient object. func (c *cloudformationClient) Initialize(params *config.CliParams) { cfnClient := cloudformation.New(params.Config) cfnClient.Handlers.Build.PushBackNamed(clients.CustomUserAgentHandler()) c.client = cfnClient c.cliParams = params c.sleeper = &utils.TimeSleeper{} }
func (c *ecsClient) Initialize(params *config.CliParams) { client := ecs.New(params.Config) client.Handlers.Build.PushBackNamed(clients.CustomUserAgentHandler()) c.client = client c.params = params }