aws-architect 6.7.80 → 6.7.83

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 +45 -81
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,75 +1,42 @@
1
+ <p align="center">
2
+ <img height="300px" src="https://authress.io/static/images/media-banner.png" alt="Authress media banner">
3
+ </p>
4
+
1
5
  # AWS Architect
2
6
 
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.
7
+ 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
8
 
5
9
  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
-
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
10
 
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.
11
+ <p align="center">
12
+ <a href="https://authress.io" alt="Authress Engineering">
13
+ <img src="https://img.shields.io/static/v1?label=Authress+Engineering&message=OpenAPI%20Explorer&color=%23FBAF0B&logo=androidauto&logoColor=%23FBAF0B"></a>
14
+ <a href="./LICENSE" alt="apache 2.0 license">
15
+ <img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"></a>
16
+ <a href="https://badge.fury.io/js/aws-architect" alt="npm version">
17
+ <img src="https://badge.fury.io/js/aws-architect.svg"></a>
18
+ <a href="https://authress.io/community" alt="npm version">
19
+ <img src="https://img.shields.io/badge/community-Discord-purple.svg"></a>
20
+ </p>
21
+
22
+ ## Features
23
+
24
+ * Standardized CF template to deploy microservice to Lambda, API Gateway, Route 53, etc..
25
+ * Standardized CF template for S3 bucket hosting for a website
26
+ * Default configuration to automatically handle the creation of pull request deployments to test infrastructure before production
27
+ * Working templated sample and make.js file to run locally and CI build.
28
+ * Lambda/API Gateway setup for seamless integration.
29
+ * Automatic creation of AWS resources when using including:
30
+ * Lambda functions
31
+ * API Gateway resources
32
+ * Environments for managing resources in AWS
33
+ * S3 Buckets and directories
34
+ * S3 static website hosting
35
+ * 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
36
 
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
- ```
37
+ ## Usage
70
38
 
71
39
  ### Library Functions
72
- #### AwsArchitect class functions
73
40
 
74
41
  ```javascript
75
42
  let packageMetadataFile = path.join(__dirname, 'package.json');
@@ -134,7 +101,7 @@ run(port, logger) {...}
134
101
 
135
102
  ```
136
103
 
137
- #### S3 Website Deployment
104
+ ### Example: S3 Website Deployment
138
105
  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
106
  Specify `bucket` in the configuration options for `contentOptions`, and configure the `PublishWebsite` function in the make.js file.
140
107
 
@@ -148,8 +115,7 @@ Specify `bucket` in the configuration options for `contentOptions`, and configur
148
115
  .catch((failure) => console.log(`Failed copying stage to production ${failure} - ${JSON.stringify(failure, null, 2)}`));
149
116
  ```
150
117
 
151
- ##### Website publish options
152
- Publishing the website has an `options` object which defaults to:
118
+ Configuration Options: Publishing the website has an `options` object which defaults to:
153
119
  ```js
154
120
  {
155
121
  // provide overrides for paths to change bucket cache control policy, default 600 seconds,
@@ -160,22 +126,20 @@ Publishing the website has an `options` object which defaults to:
160
126
  ]
161
127
  }
162
128
  ```
163
- ## Built-in functionality
164
129
 
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.
130
+ ### CLI: Creating a microservice: `init`
131
+ This will also configure your aws account to allow your build system to automatically deploy to AWS. Run locally
132
+
133
+ * Create git repository and clone locally
134
+ * `npm install aws-architect -g`
135
+ * `aws-architect init`
136
+ * `npm install`
137
+ * Update:
138
+ * `package.json`: package name, the package name is used to name your resources
139
+ * `make.js`: Deployment bucket, Resource, and DNS name parameters which are used for CF deployment
140
+
177
141
 
178
- ### Service Configuration
142
+ ## Built-in SAM and CFN templates:
179
143
  See [template service documentation](./bin/template/README.md) for how individual parts of the service are configured.
180
144
 
181
145
  ## 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.83",
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",