UNPKG

@softchef/cdk-iot-device-management

Version:

IoT device management is composed of things, thing types, thing groups, jobs, files API services. The constructs can be used independently, that are based on full-managed service to create an API Gateway & Lambda function.

20 lines (19 loc) 1.12 kB
import { CredentialsProviderError } from "@aws-sdk/property-provider"; export var fromWebToken = function (init) { return function () { var roleArn = init.roleArn, roleSessionName = init.roleSessionName, webIdentityToken = init.webIdentityToken, providerId = init.providerId, policyArns = init.policyArns, policy = init.policy, durationSeconds = init.durationSeconds, roleAssumerWithWebIdentity = init.roleAssumerWithWebIdentity; if (!roleAssumerWithWebIdentity) { throw new CredentialsProviderError("Role Arn '" + roleArn + "' needs to be assumed with web identity," + " but no role assumption callback was provided.", false); } return roleAssumerWithWebIdentity({ RoleArn: roleArn, RoleSessionName: roleSessionName !== null && roleSessionName !== void 0 ? roleSessionName : "aws-sdk-js-session-" + Date.now(), WebIdentityToken: webIdentityToken, ProviderId: providerId, PolicyArns: policyArns, Policy: policy, DurationSeconds: durationSeconds, }); }; };