CloudFormationManager.prototype.getCloudFormationClient = function()

in pipeline/local_modules/cloudformation/cloudformation_manager.js [57:73]


CloudFormationManager.prototype.getCloudFormationClient = function () {
    var self = this;
    if (self.cloudFormation != null) {
        return Promise.resolve(self.cloudFormation);
    }
    if (self.cnfRoleARN == null) {
        self.cloudFormation = new AWS.CloudFormation();
        return Promise.resolve(self.cloudFormation);
    }
    return assumeRole(self.cnfRoleARN)
        .then(awsCredentials => {
            self.cloudFormation = new AWS.CloudFormation({
                credentials: awsCredentials
            });
            return Promise.resolve(self.cloudFormation);
        });
}