diff --git a/src/aws/types.d.ts b/src/aws/types.d.ts new file mode 100644 index 0000000..d0fd08d --- /dev/null +++ b/src/aws/types.d.ts @@ -0,0 +1,16 @@ +type AccountId = `${number}`; +type Region = `${string}-${string}-${number}`; + +type Arn< + S extends string, + R extends Region | "", + T extends string +> = `arn:aws:${S}:${R}:${AccountId}:${T}`; + +type RegionalArn = Arn; +type GlobalArn = Arn; + +type RuleArn = RegionalArn<"events", `rule/${string}/${string}`>; +type RoleArn = GlobalArn<"iam", `role/${string}`>; +type SqsArn = RegionalArn<"sqs", string>; +type LambdaArn = RegionalArn<"lambda", `function:${string}`>;