@cloud-copilot/iam-simulate
Version:
Simulate evaluation of AWS IAM policies
34 lines • 873 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResourceRequestImpl = void 0;
class ResourceRequestImpl {
rawValue;
accountIdString;
constructor(rawValue, accountIdString) {
this.rawValue = rawValue;
this.accountIdString = accountIdString;
}
partition() {
return this.value().split(':').at(1);
}
service() {
return this.value().split(':').at(2);
}
region() {
return this.value().split(':').at(3);
}
account() {
return this.value().split(':').at(4);
}
resource() {
return this.value().split(':').slice(5).join(':');
}
value() {
return this.rawValue;
}
accountId() {
return this.accountIdString;
}
}
exports.ResourceRequestImpl = ResourceRequestImpl;
//# sourceMappingURL=requestResource.js.map