@fy-stack/storage-construct 0.0.139 → 0.0.140

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.
@@ -2,7 +2,6 @@ import { Attachable, CDNResource, Grantable } from '@fy-stack/types';
2
2
  import * as cdk from 'aws-cdk-lib';
3
3
  import * as iam from 'aws-cdk-lib/aws-iam';
4
4
  import * as s3 from 'aws-cdk-lib/aws-s3';
5
- import * as dynamo from 'aws-cdk-lib/aws-dynamodb';
6
5
  import { Construct } from 'constructs';
7
6
  import type { StorageConstructProps } from './types';
8
7
  /**
@@ -11,7 +10,6 @@ import type { StorageConstructProps } from './types';
11
10
  */
12
11
  export declare class StorageConstruct extends Construct implements Attachable, Grantable, CDNResource {
13
12
  bucket: s3.IBucket;
14
- table: dynamo.Table | undefined;
15
13
  constructor(scope: Construct, id: string, props: StorageConstructProps);
16
14
  cloudfront(path: string): {
17
15
  [x: string]: cdk.aws_cloudfront.BehaviorOptions;
@@ -20,7 +18,6 @@ export declare class StorageConstruct extends Construct implements Attachable, G
20
18
  attachable(): {
21
19
  name: string;
22
20
  arn: string;
23
- logTable: string;
24
21
  };
25
22
  grantable(grant: iam.IGrantable): void;
26
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"storage-construct.d.ts","sourceRoot":"","sources":["../../src/lib/storage-construct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAGnC,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;GAGG;AACH,qBAAa,gBACX,SAAQ,SACR,YAAW,UAAU,EAAE,SAAS,EAAE,WAAW;IAEtC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;gBAE3B,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;IAsCtE,UAAU,CAAC,IAAI,EAAE,MAAM;;;IAiBvB,gBAAgB,CAAC,cAAc,EAAE,MAAM;IAoBvC,UAAU;;;;;IAQV,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU;CAWhC"}
1
+ {"version":3,"file":"storage-construct.d.ts","sourceRoot":"","sources":["../../src/lib/storage-construct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAGnC,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;GAGG;AACH,qBAAa,gBACX,SAAQ,SACR,YAAW,UAAU,EAAE,SAAS,EAAE,WAAW;IAEtC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC;gBAEd,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;IAiBtE,UAAU,CAAC,IAAI,EAAE,MAAM;;;IAiBvB,gBAAgB,CAAC,cAAc,EAAE,MAAM;IAoBvC,UAAU;;;;IAOV,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU;CAShC"}
@@ -7,7 +7,6 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
7
7
  const cloudfront = tslib_1.__importStar(require("aws-cdk-lib/aws-cloudfront"));
8
8
  const iam = tslib_1.__importStar(require("aws-cdk-lib/aws-iam"));
9
9
  const s3 = tslib_1.__importStar(require("aws-cdk-lib/aws-s3"));
10
- const dynamo = tslib_1.__importStar(require("aws-cdk-lib/aws-dynamodb"));
11
10
  const constructs_1 = require("constructs");
12
11
  const storage_cdn_stack_1 = require("./storage-cdn-stack");
13
12
  /**
@@ -16,36 +15,15 @@ const storage_cdn_stack_1 = require("./storage-cdn-stack");
16
15
  */
17
16
  class StorageConstruct extends constructs_1.Construct {
18
17
  bucket;
19
- table;
20
18
  constructor(scope, id, props) {
21
19
  super(scope, id);
22
20
  const bucketProps = {
23
21
  blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
24
- cors: [
25
- {
26
- allowedOrigins: ['*'],
27
- allowedMethods: [
28
- s3.HttpMethods.GET,
29
- s3.HttpMethods.PUT,
30
- s3.HttpMethods.DELETE,
31
- ],
32
- allowedHeaders: ["*"],
33
- exposedHeaders: ["ETag"]
34
- },
35
- ],
36
22
  };
37
23
  Object.assign(bucketProps, props.retainOnDelete
38
24
  ? { removalPolicy: cdk.RemovalPolicy.RETAIN }
39
25
  : { removalPolicy: cdk.RemovalPolicy.DESTROY, autoDeleteObjects: true });
40
26
  this.bucket = new s3.Bucket(this, 'Bucket', bucketProps);
41
- if (props.logTable) {
42
- this.table = new dynamo.Table(this, 'LogTable', {
43
- partitionKey: {
44
- name: 'key',
45
- type: dynamo.AttributeType.STRING,
46
- },
47
- });
48
- }
49
27
  }
50
28
  cloudfront(path) {
51
29
  const storageOriginStack = new storage_cdn_stack_1.StorageCdnStack(this, 'StorageCDNStack', {
@@ -82,7 +60,6 @@ class StorageConstruct extends constructs_1.Construct {
82
60
  return {
83
61
  name: this.bucket.bucketName,
84
62
  arn: this.bucket.bucketArn,
85
- logTable: this.table?.tableName ?? '',
86
63
  };
87
64
  }
88
65
  grantable(grant) {
@@ -91,8 +68,6 @@ class StorageConstruct extends constructs_1.Construct {
91
68
  actions: ['s3:*'],
92
69
  resources: [`${this.bucket.bucketArn}/*`],
93
70
  }));
94
- if (this.table)
95
- this.table.grantFullAccess(grant);
96
71
  }
97
72
  }
98
73
  exports.StorageConstruct = StorageConstruct;
@@ -5,7 +5,6 @@ import { NestedStackProps } from 'aws-cdk-lib';
5
5
  export interface StorageConstructProps {
6
6
  /** Retain bucket when stack is deleted */
7
7
  retainOnDelete?: boolean;
8
- logTable?: boolean;
9
8
  }
10
9
  /**
11
10
  * Interface representing the properties required for configuring a storage stack in CDK.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@fy-stack/storage-construct",
3
- "version": "0.0.139",
3
+ "version": "0.0.140",
4
4
  "repository": "https://github.com/festusyuma/fy-stack",
5
5
  "dependencies": {
6
- "@fy-stack/types": "0.0.139",
6
+ "@fy-stack/types": "0.0.140",
7
7
  "tslib": "^2.3.0"
8
8
  },
9
9
  "peerDependencies": {