@inizioevoke/evosynth 1.8.1 → 2.0.1

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.
@@ -1,7 +1,7 @@
1
1
  import { RemovalPolicy, PhysicalName, Aws } from "aws-cdk-lib";
2
2
  import { Construct } from 'constructs';
3
3
  import { IProject } from "aws-cdk-lib/aws-codebuild";
4
- import { Artifact, Pipeline } from "aws-cdk-lib/aws-codepipeline";
4
+ import { Artifact, Pipeline, PipelineType } from "aws-cdk-lib/aws-codepipeline";
5
5
  import { CodeBuildAction, CodeStarConnectionsSourceAction } from "aws-cdk-lib/aws-codepipeline-actions";
6
6
  import { Bucket } from 'aws-cdk-lib/aws-s3';
7
7
  import { StringParameter } from 'aws-cdk-lib/aws-ssm';
@@ -45,7 +45,8 @@ export class CodePipelineProject extends Construct {
45
45
 
46
46
  this.pipeline = new Pipeline(this, 'CodePipelineProject', {
47
47
  pipelineName: props.pipelineName,
48
- artifactBucket: this.s3Bucket
48
+ artifactBucket: this.s3Bucket,
49
+ pipelineType: PipelineType.V2
49
50
  });
50
51
 
51
52
  tagResource(this.pipeline, props.tags);
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Environment } from "aws-cdk-lib";
2
2
 
3
- export * from './lib/tags.ts';
3
+ export * from './lib/tags.js';
4
+ export * from './cli/index.js';
4
5
 
5
6
  interface GetEnvParams {
6
7
  account?: number | string;
@@ -17,18 +17,7 @@ import { CloudFrontWebAcl } from '../../constructs/waf.js';
17
17
  import { domainAsId } from '../../lib/utils.js';
18
18
  import { addEvoStackTags } from '../../lib/tags.ts';
19
19
  import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
20
- import type { BasicAuthCredentials, CspHeaders } from '../../types.d.ts';
21
-
22
-
23
- type AWSManagedResponseHeadersPolicy =
24
- 'CORS_ALLOW_ALL_ORIGINS' |
25
- 'CORS_ALLOW_ALL_ORIGINS_AND_SECURITY_HEADERS' |
26
- 'CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT' |
27
- 'CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT_AND_SECURITY_HEADERS' |
28
- 'SECURITY_HEADERS';
29
-
30
- type UUID = `${string}-${string}-${string}-${string}-${string}`;
31
- type CloudFrontFunctionEventType = keyof typeof FunctionEventType;
20
+ import type { BasicAuthCredentials, CspHeaders, CloudFrontFunctionEventType, UUID, AWSManagedResponseHeadersPolicy } from '../../types.d.ts';
32
21
 
33
22
  export interface WebGlobalStackProps {
34
23
  envType: 'NOT_PROD' | 'PROD';
@@ -38,8 +27,8 @@ export interface WebGlobalStackProps {
38
27
  domainName: string;
39
28
  basicAuth?: string | BasicAuthCredentials | SsmStringParameter;
40
29
  cloudfrontFunction?: {
41
- eventType: CloudFrontFunctionEventType[];
42
30
  code: string;
31
+ eventType: CloudFrontFunctionEventType[];
43
32
  }
44
33
  redirects?: CloudFrontFunctionRedirects;
45
34
  redirectsCsvPath?: string;
@@ -139,6 +128,7 @@ export class WebGlobalStack extends Stack {
139
128
  });
140
129
  }
141
130
  }
131
+ // TODO: Figure out why the the policy is not getting updated in the CloudFront behavior
142
132
  this.responseHeadersPolicy = responseHeadersPolicy;
143
133
 
144
134
  const defaultBehavior: BehaviorOptions = {
package/src/types.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+
2
+ import { FunctionEventType } from 'aws-cdk-lib/aws-cloudfront';
3
+
1
4
  export type DeepPartial<T> = T extends object ? {
2
5
  [P in keyof T]?: DeepPartial<T[P]>;
3
6
  } : T;
@@ -6,6 +9,11 @@ export type WithRequiredProperty<Type, Key extends keyof Type> = Omit<Type, Key>
6
9
  [Property in Key]-?: Type[Property];
7
10
  };
8
11
 
12
+ export type UUID = `${string}-${string}-${string}-${string}-${string}`; // & { readonly __brand: unique symbol };
13
+
14
+ export type EvosynthTagKey = 'Account' | 'Brand' | (string & {});
15
+ export type CloudFrontFunctionEventType = keyof typeof FunctionEventType;
16
+
9
17
  export interface ResourceProps {
10
18
  destroy?: boolean;
11
19
  tags?: Record<string, string>;
@@ -18,4 +26,11 @@ export interface BasicAuthCredentials {
18
26
 
19
27
  export type CspDirective = 'connect-src' | 'default-src' | 'font-src' | 'frame-src' | 'img-src' | 'media-src' | 'object-src' | 'script-src' | 'style-src';
20
28
  export type CspDirectiveValue = "'self'" | "'none'" | "'unsafe-inline'" | "https:";
21
- export type CspHeaders = Partial<Record<CspDirective, CspDirectiveValue[] | string[]>>;
29
+ export type CspHeaders = Partial<Record<CspDirective, CspDirectiveValue[] | string[]>>;
30
+
31
+ export type AWSManagedResponseHeadersPolicy =
32
+ 'CORS_ALLOW_ALL_ORIGINS' |
33
+ 'CORS_ALLOW_ALL_ORIGINS_AND_SECURITY_HEADERS' |
34
+ 'CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT' |
35
+ 'CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT_AND_SECURITY_HEADERS' |
36
+ 'SECURITY_HEADERS';