initial aws types
This commit is contained in:
16
src/aws/types.d.ts
vendored
Normal file
16
src/aws/types.d.ts
vendored
Normal file
@@ -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<S extends string, T extends string> = Arn<S, Region, T>;
|
||||||
|
type GlobalArn<S extends string, T extends string> = Arn<S, "", T>;
|
||||||
|
|
||||||
|
type RuleArn = RegionalArn<"events", `rule/${string}/${string}`>;
|
||||||
|
type RoleArn = GlobalArn<"iam", `role/${string}`>;
|
||||||
|
type SqsArn = RegionalArn<"sqs", string>;
|
||||||
|
type LambdaArn = RegionalArn<"lambda", `function:${string}`>;
|
||||||
Reference in New Issue
Block a user