code: function applyCredentialsARNs(spec, context) {
    // Retrieve values for integration credentials
    const credentials = _.reduce(spec.paths, (r1, endpointSpecs, resourcePath) => {
      const r2 = _.reduce(endpointSpecs, (r2, endpointSpec, method) => {
        if (endpointSpec['x-amazon-apigateway-integration'].credentials && r2.indexOf(endpointSpec['x-amazon-apigateway-integration'].credentials) === -1) {
          r2.push(endpointSpec['x-amazon-apigateway-integration'].credentials);
        }
        return r2;
      }, []);
      return _.concat(r1, r2);
    }, []);
  
    // Retrieve ARN for each credential
    return Promise.map(credentials, credential => {
      // The @myrmex/iam plugin can help to convert an indentifier into an ARN
      // If @myrmex/iam is not installed, the correct ARN has to be provided
      return plugin.myrmex.call('iam:retrieveRoleArn', credential, context, credential)
      .then(arn => {
        return { identifier: credential, arn };
      });
    })
    .then(credentialsMap => {
      // Replace names by ARNs in the spec
      _.forEach(spec.paths, endpointSpecs => {
        _.forEach(endpointSpecs, endpointSpec => {
          if (endpointSpec['x-amazon-apigateway-integration'].credentials) {
            endpointSpec['x-amazon-apigateway-integration'].credentials = _.find(credentialsMap, o => {
              return o.identifier === endpointSpec['x-amazon-apigateway-integration'].credentials; }
            ).arn;
          }
        });
      });
      return spec;
    });
  }
docs: Replace role references in an Swagger/OpenAPI spec by their ARN
  @param  {Object} spec - an Swagger/OpenAPI specification that will be imported in AWS
  @return {Object} - the altered specification