Skip to content

Commit

Permalink
redeploy stacks for cfn nag suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
mickychetta committed Nov 4, 2021
1 parent bf49345 commit c2a6043
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ import { App, Stack, RemovalPolicy } from "@aws-cdk/core";
import { BucketEncryption } from "@aws-cdk/aws-s3";
import { KinesisFirehoseToAnalyticsAndS3 } from "../lib";
import { generateIntegStackName } from '@aws-solutions-constructs/core';
import * as s3 from "@aws-cdk/aws-s3";
import * as defaults from '@aws-solutions-constructs/core';

const app = new App();

// Empty arguments
const stack = new Stack(app, generateIntegStackName(__filename));

const construct = new KinesisFirehoseToAnalyticsAndS3(stack, 'test-kinesisfirehose-analytics-s3', {
new KinesisFirehoseToAnalyticsAndS3(stack, 'test-kinesisfirehose-analytics-s3', {
kinesisAnalyticsProps: {
inputs: [{
inputSchema: {
Expand Down Expand Up @@ -64,11 +62,4 @@ const construct = new KinesisFirehoseToAnalyticsAndS3(stack, 'test-kinesisfireho
}
});

const s3Bucket = construct.s3Bucket as s3.Bucket;

defaults.addCfnSuppressRules(s3Bucket, [
{ id: 'W35',
reason: 'This S3 bucket is created for unit/ integration testing purposes only.' },
]);

app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
"DeletionPolicy": "Delete",
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
{
"id": "W35",
"reason": "This S3 bucket is created for unit/ integration testing purposes only."
}
]
}
}
},
"testkinesisfirehoseanalyticss3KinesisFirehoseToS3S3BucketPolicy55E9C081": {
"Type": "AWS::S3::BucketPolicy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
import { App, Stack, RemovalPolicy } from "@aws-cdk/core";
import { KinesisFirehoseToAnalyticsAndS3 } from "../lib";
import { generateIntegStackName } from '@aws-solutions-constructs/core';
import * as s3 from "@aws-cdk/aws-s3";
import * as defaults from '@aws-solutions-constructs/core';

const app = new App();

// Empty arguments
const stack = new Stack(app, generateIntegStackName(__filename));

new KinesisFirehoseToAnalyticsAndS3(stack, 'test-kinesisfirehose-analytics-s3', {
const construct = new KinesisFirehoseToAnalyticsAndS3(stack, 'test-kinesisfirehose-analytics-s3', {
kinesisAnalyticsProps: {
inputs: [{
inputSchema: {
Expand Down Expand Up @@ -55,4 +57,12 @@ new KinesisFirehoseToAnalyticsAndS3(stack, 'test-kinesisfirehose-analytics-s3',
},
logS3AccessLogs: false
});

const s3Bucket = construct.s3Bucket as s3.Bucket;

defaults.addCfnSuppressRules(s3Bucket, [
{ id: 'W35',
reason: 'This S3 bucket is created for unit/ integration testing purposes only.' },
]);

app.synth();

0 comments on commit c2a6043

Please sign in to comment.