assertIamRoleServiceCode
assertIamRoleServiceCode(
value: unknown,
fieldName: string,
ownerName: string,
): IamRoleServiceCodeValidates that a resolved value is an allowed IAM role service code and returns it narrowed.
Remarks
Fail-fast validator for the serviceCode segment of an IAM role name: it rejects any value outside iamRoleServiceCodes (all lowercase) rather than coercing it. Prefer referencing the codes directly (for example iamRoleServiceCodes.s3); use this helper when the code is a computed value that must be validated at runtime.
Parameters
value(unknown) — Resolved service code, already un-wrapped from anyInput/Output.fieldName(string) — Consumer-facing argument path used in error messages (for exampleargs.serviceCode).ownerName(string) — Component name used in error messages.
Returns
IamRoleServiceCode— The validated service code narrowed to IamRoleServiceCode.