aws-architect 6.7.80 → 6.7.82

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.
Files changed (2) hide show
  1. package/README.md +41 -81
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,75 +1,38 @@
1
1
  # AWS Architect
2
2
 
3
- A hardened orchestrator for deploying Lambda microservices and S3 backed websites to AWS, using best practices, and an SDK that handles every possible edge case.
3
+ A hardened orchestrator for deploying Lambda microservices and S3 backed websites to AWS, using best practices, and an SDK that handles every possible edge case, with a focus on **safety**.
4
4
 
5
5
  This is an open source project managed by the [Authress Engineering team](https://authress.io).
6
-
7
- [![Authress Engineering](https://img.shields.io/static/v1?label=Authress+Engineering&message=AWS%20Architect&color=%23FBAF0B&logo=androidauto&logoColor=%23FBAF0B)](https://authress.io) [![npm version](https://badge.fury.io/js/aws-architect.svg)](https://badge.fury.io/js/aws-architect)
8
6
 
9
- ## Usage
10
- ### Creating a microservice: `init`
11
- This will also configure your aws account to allow your build system to automatically deploy to AWS. Run locally
12
-
13
- * Create git repository and clone locally
14
- * `npm install aws-architect -g`
15
- * `aws-architect init`
16
- * `npm install`
17
- * Update:
18
- * `package.json`: package name, the package name is used to name your resources
19
- * `make.js`: Deployment bucket, Resource, and DNS name parameters which are used for CF deployment
20
-
21
- #### API Sample
22
- Using `openapi-factory` we can create a declarative api to run inside the lambda function.
23
-
24
- ```javascript
25
- let aws = require('aws-sdk');
26
- let Api = require('openapi-factory');
27
- let api = new Api();
28
- module.exports = api;
29
-
30
- api.get('/sample', (request) => {
31
- return { statusCode: 200, body: { value: 1} };
32
- });
33
- ```
34
-
35
- ##### Lambda with no API sample
36
- Additionally, `openapi-factory` is not required, and executing the lambda handler directly can be done as well.
37
-
38
- ```javascript
39
- exports.handler = (event, context, callback) => {
40
- console.log(`event: ${JSON.stringify(event, null, 2)}`);
41
- console.log(`context: ${JSON.stringify(context, null, 2)}`);
42
- callback(null, {Event: event, Context: context});
43
- };
44
- ```
45
- ##### Set a custom authorizer
46
- In some cases authorization is necessary. Cognito is always an option, but for more fine grained control, your lambda can double as an authorizer.
7
+ <p align="center">
8
+ <a href="https://authress.io" alt="Authress Engineering">
9
+ <img src="https://img.shields.io/static/v1?label=Authress+Engineering&message=OpenAPI%20Explorer&color=%23FBAF0B&logo=androidauto&logoColor=%23FBAF0B"></a>
10
+ <a href="./LICENSE" alt="apache 2.0 license">
11
+ <img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"></a>
12
+ <a href="https://badge.fury.io/js/aws-architect" alt="npm version">
13
+ <img src="https://badge.fury.io/js/aws-architect.svg"></a>
14
+ <a href="https://authress.io/community" alt="npm version">
15
+ <img src="https://img.shields.io/badge/community-Discord-purple.svg"></a>
16
+ </p>
17
+
18
+ ## Features
19
+
20
+ * Standardized CF template to deploy microservice to Lambda, API Gateway, Route 53, etc..
21
+ * Standardized CF template for S3 bucket hosting for a website
22
+ * Default configuration to automatically handle the creation of pull request deployments to test infrastructure before production
23
+ * Working templated sample and make.js file to run locally and CI build.
24
+ * Lambda/API Gateway setup for seamless integration.
25
+ * Automatic creation of AWS resources when using including:
26
+ * Lambda functions
27
+ * API Gateway resources
28
+ * Environments for managing resources in AWS
29
+ * S3 Buckets and directories
30
+ * S3 static website hosting
31
+ * Developer testing platform, to run lambdas and static content as a local express Node.js service, to test locally. Integrates with [OpenAPI-Factory](https://github.com/Authress-Engineering/openapi-factory.js#readme)
47
32
 
48
- ```javascript
49
- api.SetAuthorizer(event => {
50
- return {
51
- principalId: 'computed-authorized-principal-id',
52
- policyDocument: {
53
- Version: '2012-10-17',
54
- Statement: [
55
- {
56
- Action: 'execute-api:Invoke',
57
- Effect: 'Deny',
58
- Resource: event.methodArn //'arn:aws:execute-api:*:*:*'
59
- }
60
- ]
61
- },
62
- context: {
63
- "stringKey": "string-val",
64
- "numberKey": 123,
65
- "booleanKey": true
66
- }
67
- };
68
- });
69
- ```
33
+ ## Usage
70
34
 
71
35
  ### Library Functions
72
- #### AwsArchitect class functions
73
36
 
74
37
  ```javascript
75
38
  let packageMetadataFile = path.join(__dirname, 'package.json');
@@ -134,7 +97,7 @@ run(port, logger) {...}
134
97
 
135
98
  ```
136
99
 
137
- #### S3 Website Deployment
100
+ ### Example: S3 Website Deployment
138
101
  AWS Architect has the ability to set up and configure an S3 bucket for static website hosting. It provides a mechanism as well to deploy your content files directly to S3.
139
102
  Specify `bucket` in the configuration options for `contentOptions`, and configure the `PublishWebsite` function in the make.js file.
140
103
 
@@ -148,8 +111,7 @@ Specify `bucket` in the configuration options for `contentOptions`, and configur
148
111
  .catch((failure) => console.log(`Failed copying stage to production ${failure} - ${JSON.stringify(failure, null, 2)}`));
149
112
  ```
150
113
 
151
- ##### Website publish options
152
- Publishing the website has an `options` object which defaults to:
114
+ Configuration Options: Publishing the website has an `options` object which defaults to:
153
115
  ```js
154
116
  {
155
117
  // provide overrides for paths to change bucket cache control policy, default 600 seconds,
@@ -160,22 +122,20 @@ Publishing the website has an `options` object which defaults to:
160
122
  ]
161
123
  }
162
124
  ```
163
- ## Built-in functionality
164
125
 
165
- * Standardize CF template to deploy microservice to Lambda, API Gateway, Route 53, etc..
166
- * Standardize CF template for S3 bucket hosting for a website
167
- * Default configuration to automatically handle the creation of pull request deployments to test infrastructure before production
168
- * Working templated sample and make.js file to run locally and CI build.
169
- * Lambda/API Gateway setup for seamless integration.
170
- * Automatic creation of AWS resources when using including:
171
- * Lambda functions
172
- * API Gateway resources
173
- * Environments for managing resources in AWS
174
- * S3 Buckets and directories
175
- * S3 static website hosting
176
- * Developer testing platform, to run lambdas and static content as a local express Node.js service, to test locally.
126
+ ### CLI: Creating a microservice: `init`
127
+ This will also configure your aws account to allow your build system to automatically deploy to AWS. Run locally
128
+
129
+ * Create git repository and clone locally
130
+ * `npm install aws-architect -g`
131
+ * `aws-architect init`
132
+ * `npm install`
133
+ * Update:
134
+ * `package.json`: package name, the package name is used to name your resources
135
+ * `make.js`: Deployment bucket, Resource, and DNS name parameters which are used for CF deployment
136
+
177
137
 
178
- ### Service Configuration
138
+ ## Built-in SAM and CFN templates:
179
139
  See [template service documentation](./bin/template/README.md) for how individual parts of the service are configured.
180
140
 
181
141
  ## Also
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-architect",
3
- "version": "6.7.80",
3
+ "version": "6.7.82",
4
4
  "description": "AWS Architect is a node based tool to configure and deploy AWS-based microservices.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",