UNPKG

typed-serverless

Version:

Helps you write a consistent Serverless Framework configuration in TypeScript

66 lines (65 loc) 3.38 kB
import { FnSub } from './types'; export declare type BuildArnParams<ResourceId> = { partition?: string; service?: string; region?: string; namespace?: string; type?: string; resourceId: ResourceId; path?: string; typeToResourceSeparator?: ':' | '/'; }; export declare type BuildArnParamsWithoutResourceId = Omit<BuildArnParams<string>, 'resourceId'>; /** * Build Lambda ARN as a clouformation string expression. * format "arn:aws:lambda:[[region]]:[[accountId]]:function:[[function]]" * https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html */ export declare function lambdaArn<ResourceId>(resourceId: ResourceId): BuildArnParams<ResourceId>; /** * Build Bucket ARN as a clouformation string expression. * bucket arn: "arn:aws:s3:::bucket_name" * bucket object arn: "arn:aws:s3:::bucket_name/key_name" * bucket path arn: "arn:aws:s3:::bucket_name/some/folder/*" * https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-arn-format.html */ export declare function bucketArn<ResourceId>(resourceId: ResourceId, path?: string): BuildArnParams<ResourceId>; /** * Build SNS ARN as a clouformation string expression. * format: "arn:aws:sns:[[region]]:[[accountId]]:[[topicName]]" * @link https://docs.aws.amazon.com/step-functions/latest/dg/sns-iam.html */ export declare function snsArn<ResourceId>(resourceId: ResourceId): BuildArnParams<ResourceId>; /** * Build EventBus ARN as a clouformation string expression. * format: "arn:aws:events:[[region]]:[[accountId]]:event-bus:[[queueName]]" * @link https://docs.aws.amazon.com/step-functions/latest/dg/eventbridge-iam.html */ export declare function eventBusArn<ResourceId>(resourceId: ResourceId): BuildArnParams<ResourceId>; /** * Build SQS ARN as a clouformation string expression. * format: "arn:aws:sqs:[[region]]:[[accountId]]:[[queueName]]" * @link https://docs.aws.amazon.com/step-functions/latest/dg/sqs-iam.html */ export declare function sqsArn<ResourceId>(resourceId: ResourceId): BuildArnParams<ResourceId>; /** * Build StepFunction ARN as a clouformation string expression. * format: "arn:aws:states:[[region]]:[[accountId]]:stateMachine:[[stateMachineName]]" * @link https://docs.aws.amazon.com/step-functions/latest/dg/stepfunctions-iam.html * @deprecated Prefer #arn - AWS Step Function automatically adds a name suffix, because of that this function will not be able to generate correct arn */ export declare function stepFunctionArn<ResourceId>(resourceId: ResourceId): BuildArnParams<ResourceId>; /** * Build Alarm ARN as a clouformation string expression. * format: "arn:aws:cloudwatch:[[region]]:[[accountId]]:alarm:[[alarmName]]" * @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html */ export declare function alarmArn<ResourceId>(resourceId: ResourceId): BuildArnParams<ResourceId>; /** * Build an ARN as a clouformation string expression. * format: "arn:aws:[[service]]:[[region]]:[[type]]:[[id]][[path]]" * type and path are optional * @example "arn:aws:states:eu-west-1:stateMachine:MyStateMachineName" * https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html */ export declare function buildArnFnSub<ResourceId>({ partition, service, region, namespace, type, resourceId, path, typeToResourceSeparator, }: BuildArnParams<ResourceId>): FnSub;