aws-architect 6.7.66 → 6.7.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/index.d.ts +25 -3
- package/index.js +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,6 +112,14 @@ publishAndDeployStagePromise(options) {
|
|
|
112
112
|
// options.deploymentKeyName
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
// Deploy just a new version of a lambda function
|
|
116
|
+
deployLambdaFunctionVersion(options) {
|
|
117
|
+
// options.stage
|
|
118
|
+
// options.functionName
|
|
119
|
+
// options.deploymentBucketName
|
|
120
|
+
// options.deploymentKeyName
|
|
121
|
+
}
|
|
122
|
+
|
|
115
123
|
// Removes a deployed stage, to be used on pull-request created stages (API gateway has a limit fo 5 stages)
|
|
116
124
|
removeStagePromise(stage) {...}
|
|
117
125
|
|
package/index.d.ts
CHANGED
|
@@ -64,19 +64,41 @@ interface WebsiteDeploymentOptions {
|
|
|
64
64
|
|
|
65
65
|
declare class AwsArchitect {
|
|
66
66
|
constructor(packageMetadata: PackageMetadata, apiOptions: ApiOptions, contentOptions: ContentOptions);
|
|
67
|
+
|
|
67
68
|
publishZipArchive(options: PublishZipOptions): Promise<object>;
|
|
68
|
-
|
|
69
|
+
|
|
70
|
+
/* CloudFormation */
|
|
71
|
+
// CloudFormation related handlers:
|
|
69
72
|
validateTemplate(stackTemplate: object): Promise<object>;
|
|
70
73
|
deployTemplate(stackTemplate: object, stackConfiguration: StackConfiguration, parameters: object): Promise<object>;
|
|
71
74
|
deployStackSetTemplate(stackTemplate: object, stackSetConfiguration: StackSetConfiguration, parameters: object): Promise<object>;
|
|
72
75
|
configureStackSetForAwsOrganization(stackTemplate: object, stackSetConfiguration: OrganizationalStackSetConfiguration, parameters: object): Promise<object>;
|
|
76
|
+
/* ****** */
|
|
77
|
+
|
|
78
|
+
/* API Gateway */
|
|
79
|
+
// Support for API Gateway stages
|
|
73
80
|
deployStagePromise(stage: string, lambdaVersion: string): Promise<object>;
|
|
74
81
|
removeStagePromise(stage: string, functionName: string): Promise<object>;
|
|
75
|
-
cleanupPreviousFunctionVersions(functionName: string, forceRemovalOfAliases: string): Promise<object>;
|
|
76
82
|
publishAndDeployStagePromise(options: StageDeploymentOptions): Promise<object>;
|
|
83
|
+
/* ****** */
|
|
84
|
+
|
|
85
|
+
/* Lambda Functions */
|
|
86
|
+
// Package a lambda and push it to S3 for deployment
|
|
87
|
+
publishLambdaArtifactPromise(options: PublishLambdaOptions): Promise<object>;
|
|
88
|
+
// Clean up Lambda functions versions that aren't being used
|
|
89
|
+
cleanupPreviousFunctionVersions(functionName: string, forceRemovalOfAliases: string): Promise<object>;
|
|
90
|
+
// Deploy a new version of a lambda function alias
|
|
91
|
+
deployLambdaFunctionVersion(options: StageDeploymentOptions): Promise<object>;
|
|
92
|
+
// Run your lambda microservice locally
|
|
93
|
+
run(port: number, logger: Function): Promise<object>;
|
|
94
|
+
/* ****** */
|
|
95
|
+
|
|
96
|
+
/* S3 Websites using CloudFront */
|
|
97
|
+
// Deploy a new version of a website to S3
|
|
77
98
|
publishWebsite(version: string, options: WebsiteDeploymentOptions): Promise<object>;
|
|
99
|
+
// Delete a version of the website from S3
|
|
78
100
|
deleteWebsiteVersion(version: string): Promise<object>;
|
|
79
|
-
|
|
101
|
+
/* ****** */
|
|
80
102
|
}
|
|
81
103
|
|
|
82
104
|
export = AwsArchitect;
|
package/index.js
CHANGED
|
@@ -195,6 +195,31 @@ AwsArchitect.prototype.removeStagePromise = AwsArchitect.prototype.RemoveStagePr
|
|
|
195
195
|
return { title: 'Successfully deleted stage', stage: stageName, details: result };
|
|
196
196
|
};
|
|
197
197
|
|
|
198
|
+
AwsArchitect.prototype.deployLambdaFunctionVersion = async function(options = {}) {
|
|
199
|
+
let stage = options.stage;
|
|
200
|
+
let stageName = getStageName(stage);
|
|
201
|
+
let functionName = options.functionName;
|
|
202
|
+
let bucket = options.deploymentBucketName || this.deploymentBucket;
|
|
203
|
+
let deploymentKey = options.deploymentKeyName;
|
|
204
|
+
if (!stage) { throw new Error('Deployment stage is not defined.'); }
|
|
205
|
+
|
|
206
|
+
try {
|
|
207
|
+
const lambda = await this.LambdaManager.PublishNewVersion(functionName, bucket, deploymentKey);
|
|
208
|
+
const lambdaArn = lambda.FunctionArn;
|
|
209
|
+
const lambdaVersion = lambda.Version;
|
|
210
|
+
await this.LambdaManager.SetAlias(functionName, stageName, lambdaVersion);
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
LambdaResult: {
|
|
214
|
+
LambdaFunctionArn: lambdaArn,
|
|
215
|
+
LambdaVersion: lambdaVersion
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
} catch (failure) {
|
|
219
|
+
throw { Error: 'Failed to create and deploy updates.', Details: failure };
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
|
|
198
223
|
AwsArchitect.prototype.publishAndDeployStagePromise = AwsArchitect.prototype.PublishAndDeployStagePromise = async function(options = {}) {
|
|
199
224
|
let stage = options.stage;
|
|
200
225
|
let stageName = getStageName(stage);
|