agent/taskresource/ssmsecret/ssmsecret.go
func (secret *SSMSecretResource) retrieveSSMSecretValues(region string, names []string, iamCredentials credentials.IAMRoleCredentials, wg *sync.WaitGroup, errorEvents chan error) {
	defer wg.Done()

	ssmClient := secret.ssmClientCreator.NewSSMClient(region, iamCredentials)
	seelog.Infof("ssm secret resource: retrieving resource for secrets %v in region [%s] in task: [%s]", names, region, secret.taskARN)
	secValueMap, err := ssm.GetSecretsFromSSM(names, ssmClient)
	if err != nil {
		errorEvents <- fmt.Errorf("fetching secret data from SSM Parameter Store in %s: %v", region, err)
		return
	}

	secret.lock.Lock()
	defer secret.lock.Unlock()

	// put secret value in secretData
	for secretName, secretValue := range secValueMap {
		secretKey := secretName + "_" + region
		secret.secretData[secretKey] = secretValue
	}
}
func (secret *SSMSecretResource) retrieveSSMSecretValues(region string, names []string, iamCredentials credentials.IAMRoleCredentials, wg *sync.WaitGroup, errorEvents chan error) {
	defer wg.Done()

	ssmClient := secret.ssmClientCreator.NewSSMClient(region, iamCredentials)
	seelog.Infof("ssm secret resource: retrieving resource for secrets %v in region [%s] in task: [%s]", names, region, secret.taskARN)
	secValueMap, err := ssm.GetSecretsFromSSM(names, ssmClient)
	if err != nil {
		errorEvents <- fmt.Errorf("fetching secret data from SSM Parameter Store in %s: %v", region, err)
		return
	}

	secret.lock.Lock()
	defer secret.lock.Unlock()

	// put secret value in secretData
	for secretName, secretValue := range secValueMap {
		secretKey := secretName + "_" + region
		secret.secretData[secretKey] = secretValue
	}
}
func ( secret * SSMSecretResource ) retrieveSSMSecretValues ( region string , names [ ] string , iamCredentials credentials . IAMRoleCredentials , wg * sync . WaitGroup , errorEvents chan error ) { defer wg . Done ( ) ssmClient := secret . ssmClientCreator . NewSSMClient ( region , iamCredentials ) seelog . Infof ( " " , names , region , secret . taskARN ) secValueMap , err := ssm . GetSecretsFromSSM ( names , ssmClient ) if err != nil { errorEvents <- fmt . Errorf ( " " , region , err ) return } secret . lock . Lock ( ) defer secret . lock . Unlock ( ) // put secret value in secretData for secretName , secretValue := range secValueMap { secretKey := secretName + " " + region secret . secretData [ secretKey ] = secretValue } }
// retrieveSSMSecretValues retrieves secret values from SSM parameter store and caches them into memory
retrieveSSMSecretValues retrieves secret values from SSM parameter store and caches them into memory