-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.d.ts
104 lines (88 loc) · 3.17 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
export interface PackageMetadata {
name: string;
version: string;
}
export interface ApiOptions {
regions: string[];
deploymentBucket: string,
sourceDirectory: string,
description: string,
}
export interface ContentOptions {
bucket: string;
contentDirectory: string;
}
export interface PublishLambdaOptions {
zipFileName: string;
bucket: string;
autoHandleCompileOfSourceDirectory: boolean;
}
export interface PublishZipOptions {
zipFileName: string;
sourceDirectory: string;
}
export interface StackConfiguration {
changeSetName: string;
stackName: string;
automaticallyProtectStack?: boolean;
tags?: Record<string, string>;
}
export interface StackSetConfiguration {
changeSetName: string;
stackSetName: string;
regions: string[];
tags?: Record<string, string>;
}
export interface OrganizationalStackSetConfiguration {
changeSetName: string;
stackSetName: string;
tags?: Record<string, string>;
}
export interface StageDeploymentOptions {
stage: string;
functionName: string;
deploymentBucketName: string;
deploymentKeyName: string;
}
export interface RegexOption {
explicit?: string,
regex?: RegExp,
value: string | number
}
export interface WebsiteDeploymentOptions {
cacheControlRegexMap?: RegexOption[];
contentTypeMappingOverride?: object;
}
export class AwsArchitect {
constructor(packageMetadata: PackageMetadata, apiOptions: ApiOptions, contentOptions: ContentOptions);
publishZipArchive(options: PublishZipOptions): Promise<object>;
/* CloudFormation */
// CloudFormation related handlers:
validateTemplate(stackTemplate: object): Promise<object>;
deployTemplate(stackTemplate: object, stackConfiguration: StackConfiguration, parameters: object): Promise<object>;
deployStackSetTemplate(stackTemplate: object, stackSetConfiguration: StackSetConfiguration, parameters: object): Promise<object>;
configureStackSetForAwsOrganization(stackTemplate: object, stackSetConfiguration: OrganizationalStackSetConfiguration, parameters: object): Promise<object>;
/* ****** */
/* API Gateway */
// Support for API Gateway stages
deployStagePromise(stage: string, lambdaVersion: string): Promise<object>;
removeStagePromise(stage: string, functionName: string): Promise<object>;
publishAndDeployStagePromise(options: StageDeploymentOptions): Promise<object>;
/* ****** */
/* Lambda Functions */
// Package a lambda and push it to S3 for deployment
publishLambdaArtifactPromise(options: PublishLambdaOptions): Promise<object>;
// Clean up Lambda functions versions that aren't being used
cleanupPreviousFunctionVersions(functionName: string, forceRemovalOfAliases: string): Promise<object>;
// Deploy a new version of a lambda function alias
deployLambdaFunctionVersion(options: StageDeploymentOptions): Promise<object>;
// Run your lambda microservice locally
run(port: number, logger: Function): Promise<object>;
/* ****** */
/* S3 Websites using CloudFront */
// Deploy a new version of a website to S3
publishWebsite(version: string, options: WebsiteDeploymentOptions): Promise<object>;
// Delete a version of the website from S3
deleteWebsiteVersion(version: string): Promise<object>;
/* ****** */
}