constructor()

in src/cdknag.ts [36:52]


  constructor(scope: cdk.Construct, id: string, props: BucketProps = {}) {
    super(scope, id);
    this.bucket = new s3.Bucket(this, id, {
      encryption: s3.BucketEncryption.S3_MANAGED,
      accessControl: s3.BucketAccessControl.LOG_DELIVERY_WRITE,
      serverAccessLogsPrefix: props.serverAccessLogsPrefix ?? 'access-log-',
      blockPublicAccess: {
        blockPublicAcls: true,
        blockPublicPolicy: true,
        ignorePublicAcls: true,
        restrictPublicBuckets: true,
      },
    });
    Suppress.bucket(this.bucket, [
      { id: 'AwsSolutions-S1', reason: 'implicitly set current bucket as the acces log bucket' },
    ]);
  }