@infoxchange/make-it-so 2.1.0-internal-testing-add-api-construct.1 → 2.2.0

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 CHANGED
@@ -64,6 +64,23 @@ const site = new IxNextjsSite(stack, "Site", {
64
64
  });
65
65
  ```
66
66
 
67
+ ### CDK Construct - IxApi
68
+
69
+ Deploys an instance of API Gateway. IxApi extends [SST's Api](https://docs.sst.dev/constructs/Api) and takes the exact same props.
70
+
71
+ It will automatically create certificates and DNS records for a single domain that the API should deploy to. If the props `customDomain` is not set the first site domain provided by the IX deployment pipeline will be used as the domain. Explicitly setting `customDomain` to `undefined` will ensure no customDomain is used. Regardless of if a custom domain is set, the API Gateway will still be accessible via the 'api-id.execute-api.region.amazonaws.com' url.
72
+
73
+ ```typescript
74
+ import { IxApi } from "@infoxchange/make-it-so/cdk-constructs";
75
+
76
+ const site = new IxApi(stack, "api", {
77
+ // Included by default:
78
+ // customDomain: {
79
+ // domainName: ixDeployConfig.siteDomains[0],
80
+ // },
81
+ });
82
+ ```
83
+
67
84
  ### CDK Construct - IxElasticache
68
85
 
69
86
  Deploys an AWS Elasticache cluster, either the redis or the memcached flavour.
@@ -204,8 +221,12 @@ important that sst and aws lib version match those used in ix-deploy-support
204
221
 
205
222
  Honestly I've never seen Star Trek but I figured the name is appropriate since the goal of this library is to allow you, the user, to deploy applications by stating what you want and letting someone else handle the nitty gritty details of how to actually implement it.
206
223
 
207
- # Contributing
224
+ # Development and Contributing
208
225
 
209
226
  Changes to the main branch automatically trigger the CI to build and publish to npm. We do this with [semantic-release](https://semantic-release.gitbook.io/) which uses commit messages to determine what the new version number should be.
210
227
 
211
228
  Commit messages must be formatted in the [Conventional Commits](https://www.conventionalcommits.org) style to allow semantic-release to generate release notes based on the git history. To help with this the CLI tool for creating a commit with a valid commit message can be used via `npm run commit`.
229
+
230
+ If adding a new construct the easiest way to develop it maybe by building it in whatever app repo it is intended to be used in. When it appears to be working correctly it can be moved into make-it-so and the app can be updated to import that construct from make-it-so.
231
+
232
+ To test change a change in make-it-so create a branch starting with the prefix "internal-testing-". When pushed the CI will release a new package with a pre-release version. It'll look a little something like `2.1.3-internal-testing-name-of-feature.3`. A serverless app using make-it-so can be modified to use this package version and then deployed to a dev environment to test that the make-it-so changes are functioning correctly. Once a change has been merged into main and there are no serverless apps using the pre-release package any more it's a good idea to [delete that version](https://docs.npmjs.com/unpublishing-packages-from-the-registry#unpublishing-a-single-version-of-a-package) to keep the [npm package version history clean](https://www.npmjs.com/package/@infoxchange/make-it-so?activeTab=versions).
@@ -0,0 +1,13 @@
1
+ import { Construct } from "constructs";
2
+ type ConstructScope = ConstructorParameters<typeof Construct>[0];
3
+ type ConstructId = ConstructorParameters<typeof Construct>[1];
4
+ type Props = {
5
+ appName: string;
6
+ dataBuckets: string[];
7
+ };
8
+ export declare class IxQuicksightWorkspace extends Construct {
9
+ constructor(scope: ConstructScope, id: ConstructId, props: Props);
10
+ private createQuicksightWorkspace;
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=IxQuicksightWorkspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IxQuicksightWorkspace.d.ts","sourceRoot":"","sources":["../../src/cdk-constructs/IxQuicksightWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,KAAK,cAAc,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,KAAK,WAAW,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,qBAAa,qBAAsB,SAAQ,SAAS;gBACtC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK;IAKhE,OAAO,CAAC,yBAAyB;CAmBlC"}
@@ -0,0 +1,20 @@
1
+ import { Construct } from "constructs";
2
+ import { StringParameter } from "aws-cdk-lib/aws-ssm";
3
+ import { CustomResource } from "aws-cdk-lib";
4
+ export class IxQuicksightWorkspace extends Construct {
5
+ constructor(scope, id, props) {
6
+ super(scope, id);
7
+ this.createQuicksightWorkspace(scope, id, props);
8
+ }
9
+ createQuicksightWorkspace(scope, id, constructProps) {
10
+ const qsWorkspaceSetupLambdaArn = StringParameter.valueForStringParameter(scope, "/shared-services/quicksight-workspace/lambdaArn");
11
+ new CustomResource(scope, id + "-CustomResource", {
12
+ resourceType: "Custom::QuicksightWorkspace",
13
+ serviceToken: qsWorkspaceSetupLambdaArn,
14
+ properties: {
15
+ app_name: constructProps.appName,
16
+ data_buckets: constructProps.dataBuckets,
17
+ },
18
+ });
19
+ }
20
+ }
@@ -4,4 +4,5 @@ export * from "./IxDnsRecord.js";
4
4
  export * from "./IxNextjsSite.js";
5
5
  export * from "./IxElasticache.js";
6
6
  export * from "./IxApi.js";
7
+ export * from "./IxQuicksightWorkspace.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cdk-constructs/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cdk-constructs/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC"}
@@ -4,3 +4,4 @@ export * from "./IxDnsRecord.js";
4
4
  export * from "./IxNextjsSite.js";
5
5
  export * from "./IxElasticache.js";
6
6
  export * from "./IxApi.js";
7
+ export * from "./IxQuicksightWorkspace.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infoxchange/make-it-so",
3
- "version": "2.1.0-internal-testing-add-api-construct.1",
3
+ "version": "2.2.0",
4
4
  "description": "Makes deploying services to IX infra easy",
5
5
  "repository": "github:infoxchange/make-it-so",
6
6
  "type": "module",
@@ -0,0 +1,38 @@
1
+ import { Construct } from "constructs";
2
+ import { StringParameter } from "aws-cdk-lib/aws-ssm";
3
+ import { CustomResource } from "aws-cdk-lib";
4
+
5
+ type ConstructScope = ConstructorParameters<typeof Construct>[0];
6
+ type ConstructId = ConstructorParameters<typeof Construct>[1];
7
+
8
+ type Props = {
9
+ appName: string;
10
+ dataBuckets: string[];
11
+ };
12
+
13
+ export class IxQuicksightWorkspace extends Construct {
14
+ constructor(scope: ConstructScope, id: ConstructId, props: Props) {
15
+ super(scope, id);
16
+ this.createQuicksightWorkspace(scope, id, props);
17
+ }
18
+
19
+ private createQuicksightWorkspace(
20
+ scope: ConstructScope,
21
+ id: ConstructId,
22
+ constructProps: Props,
23
+ ): void {
24
+ const qsWorkspaceSetupLambdaArn = StringParameter.valueForStringParameter(
25
+ scope,
26
+ "/shared-services/quicksight-workspace/lambdaArn",
27
+ );
28
+
29
+ new CustomResource(scope, id + "-CustomResource", {
30
+ resourceType: "Custom::QuicksightWorkspace",
31
+ serviceToken: qsWorkspaceSetupLambdaArn,
32
+ properties: {
33
+ app_name: constructProps.appName,
34
+ data_buckets: constructProps.dataBuckets,
35
+ },
36
+ });
37
+ }
38
+ }
@@ -4,3 +4,4 @@ export * from "./IxDnsRecord.js";
4
4
  export * from "./IxNextjsSite.js";
5
5
  export * from "./IxElasticache.js";
6
6
  export * from "./IxApi.js";
7
+ export * from "./IxQuicksightWorkspace.js";