MCPcopy
hub / github.com/serverless/serverless / request

Method request

packages/serverless/lib/plugins/aws/provider.js:3311–3330  ·  view source on GitHub ↗

* Execute an AWS request by calling the AWS SDK * @param {string} service - Service name * @param {string} method - Method name * @param {Object} params - Parameters * @param {Object} [options] - Options to modify the request behavior * @prop [options.useCache] - Utilize cache to retr

(service, method, params, options)

Source from the content-addressed store, hash-verified

3309 * @prop [options.region] - Specify when to request to different region
3310 */
3311 async request(service, method, params, options) {
3312 // TODO: Determine calling module and log that
3313 const requestOptions = _.isObject(options) ? options : {}
3314 const shouldCache = _.get(requestOptions, 'useCache', false)
3315 // Copy is required as the credentials may be modified during the request
3316 const credentials = await this.getCredentials()
3317 const serviceOptions = {
3318 name: service,
3319 params: {
3320 ...credentials,
3321 region: _.get(requestOptions, 'region', this.getRegion()),
3322 isS3TransferAccelerationEnabled: this.isS3TransferAccelerationEnabled(),
3323 },
3324 }
3325 return (shouldCache ? awsRequest.memoized : awsRequest)(
3326 serviceOptions,
3327 method,
3328 params,
3329 )
3330 }
3331
3332 /**
3333 * Fetch credentials directly or using a profile from serverless yml configuration or from the

Callers 15

getStackResourcesMethod · 0.95
makeLambdaRequestMethod · 0.80
listDeploymentsMethod · 0.80
getFunctionsMethod · 0.80
invokeMethod · 0.80
getLogStreamsMethod · 0.80
showLogsMethod · 0.80

Calls 4

getCredentialsMethod · 0.95
getRegionMethod · 0.95
getMethod · 0.45

Tested by 1

requestFunction · 0.64