Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sns): adding support for firehose subscription protocol #15764

Merged
merged 168 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
8627c08
adding firehose subscription support
david-doyle-as24 Jul 26, 2021
c7cc346
removing firehose from package.json
david-doyle-as24 Jul 26, 2021
a8ba85d
Merge branch 'master' into adding-firehose-support
david-doyle-as24 Jul 26, 2021
8348cfe
adding documentation
david-doyle-as24 Jul 29, 2021
08f1647
Merge branch 'master' into adding-firehose-support
david-doyle-as24 Jul 29, 2021
5eb7c1b
fixing typo
david-doyle-as24 Jul 30, 2021
25568c3
Merge branch 'master' into adding-firehose-support
david-doyle-as24 Jul 30, 2021
5199c25
feat(Route53): add support for RemovalPolicy in CrossAccountZoneDeleg…
ayush987goyal Jul 30, 2021
1fcbaaa
fix(elbv2): unresolved listener priority throws error (#15804)
spg Jul 30, 2021
6808fb5
test(aws-lambda-go): remove hard coded references in tests to @aws-cd…
corymhall Jul 30, 2021
08843e3
fix(ec2): volumename doesn't set name of volume (#15832)
peterwoodworth Jul 30, 2021
e0ad6ce
feat(cloudfront): use TLS_V1_2_2021 SecurityPolicy as default version…
SvenKirschbaum Jul 30, 2021
a4b05fb
docs: remove BREAKING CHANGES requirement for feature flags (#15839)
njlynch Jul 30, 2021
1961e11
feat(kinesisfirehose): add support for backing up source records to S…
madeline-k Jul 30, 2021
90bb458
feat(servicecatalog): add CloudFormation Parameter constraint (#15770)
arcrank Jul 30, 2021
3dd9347
fix(pipelines): Prepare stage doesn't have AUTO_EXPAND capability (#1…
otaviomacedo Aug 1, 2021
6061ad0
chore(assertions): rename TemplateAssertions to Template (#15823)
Aug 1, 2021
d6bd259
feat(s3-deployment): control object access (#15730)
sormy Aug 2, 2021
5ea9c8b
fix(chatbot): ARN validation in fromSlackChannelConfigurationArn fail…
jumic Aug 2, 2021
33a75bf
chore(lambda): lambda insights incorrectly accesses non-exported file…
otaviomacedo Aug 3, 2021
a0fe2a8
chore(assertions): migrate more modules to use assertions (#15857)
Aug 3, 2021
202fe78
chore: switch cfn only modules to assertions (#15869)
Aug 3, 2021
9d71a12
chore: temporarily transfer @skinny85 module ownership (#15872)
BenChaimberg Aug 3, 2021
9004bb1
fix(s3): notifications are broken in some regions (#15884)
otaviomacedo Aug 4, 2021
1ffb015
feat(cfnspec): cloudformation spec v39.8.0 (#15885)
aws-cdk-automation Aug 4, 2021
d431894
chore(assert): set only lower bound of the jest dependency (#15887)
otaviomacedo Aug 4, 2021
4975593
feat(kinesisfirehose): supports Kinesis data stream source for delive…
BenChaimberg Aug 4, 2021
71f1ba4
chore(docs): update doc strings in DestinationS3BackupProps (#15896)
madeline-k Aug 5, 2021
26947bb
chore(release): 1.117.0
Aug 5, 2021
d6319e7
Update CHANGELOG.md
otaviomacedo Aug 5, 2021
3c675e1
Update CHANGELOG.md
otaviomacedo Aug 5, 2021
58697d6
Update CHANGELOG.md
otaviomacedo Aug 5, 2021
b5a6080
Update CHANGELOG.md
otaviomacedo Aug 5, 2021
abe81a7
chore: add kaizen3031593 to mergify
Aug 5, 2021
3ee446a
test(aws-lambda-python): remove hard-coded references to @aws-cdk/aws…
njlynch Aug 6, 2021
3d1b5a8
chore(assertions): explicit feature flags to produce a consistent tem…
otaviomacedo Aug 6, 2021
35a024c
docs(appmesh): comprehensive App Mesh readme review (#15877)
Seiya6329 Aug 6, 2021
b845e75
docs(ecs): Add missing word ("permission") in comment (#15889)
jordan-brough Aug 6, 2021
0208d15
chore(deps): bump actions/setup-node from 2.3.0 to 2.4.0 (#15942)
dependabot[bot] Aug 9, 2021
0dda976
chore(sam): explicit feature flags to produce a consistent template d…
madeline-k Aug 9, 2021
5cbad9b
chore(servicecatalogappregistry): explicit feature flags to produce a…
madeline-k Aug 9, 2021
fe01679
chore(glue, ivs, msk, servicecatalog): explicit feature flags to prod…
madeline-k Aug 9, 2021
e050d6a
fix(ec2): "clientVpnEndoint" => "clientVpnEndpoint" (#14902)
cokia Aug 10, 2021
18c2fe7
feat(pipelines): add `synthCodeBuildDefaults` (#15627)
hoegertn Aug 10, 2021
a05e73a
feat(aws-elbv2): ALB target group routing algorithms (#15622)
nohack Aug 10, 2021
f17a42a
docs(cognito): describe addDependency for identity provider and app c…
jumic Aug 10, 2021
12c2801
feat(cognito): add support for token revocation in UserPoolClient (#1…
jumic Aug 10, 2021
8071d47
chore(release): 1.118.0
Aug 10, 2021
02df3c3
fix(core): asset bundling fails for non-existent user (#15313)
Aug 11, 2021
d6f42db
feat(cfnspec): cloudformation spec v39.9.0 (#15987)
aws-cdk-automation Aug 11, 2021
9610854
docs: improve documentation on the use of "env" with context lookups …
max-allan-surevine Aug 11, 2021
996d246
docs(codepipeline): explain how cross-account CodeCommit works (#15988)
rix0rrr Aug 11, 2021
0ac8baf
chore(scripts): safety script incorrectly checks `peerDependencies` (…
rix0rrr Aug 11, 2021
e2cd51c
test(aws-lambda-python): remove hard-coded references to @aws-cdk/aws…
njlynch Aug 11, 2021
c4051d7
chore(aws-apigatewayv2): docs spelling correction (#15962)
brianhubbell Aug 11, 2021
a48ed33
chore(apigatewayv2): fix typo in README (#15950)
bitoku Aug 11, 2021
4c9b053
chore(ec2): explicit feature flags to produce a consistent template d…
madeline-k Aug 11, 2021
cfd333a
chore(pipelines): improve CodeBuildStep.project error message (#15977)
blimmer Aug 12, 2021
3b374d5
fix(assert): matchTemplate with superset fails when additional param…
Aug 12, 2021
cc9a17a
feat(aws-apigateway): import existing usage plan (#15771)
jumic Aug 12, 2021
3686eea
fix(pipelines): repos with dashes cannot be used as additionalInputs …
rix0rrr Aug 12, 2021
f29f4d5
chore(lambda-python): strip out deprecated symbols (#15958)
Wurstnase Aug 12, 2021
5fb6364
chore(core): tell which stack is exceeding max resource count (#16019)
rix0rrr Aug 12, 2021
84836f9
feat(apigatewayv2): http api - domain url for a stage (#15973)
samtwil Aug 12, 2021
b121653
fix(s3-deployment): BucketDeployment doesn't validate that distributi…
SvenKirschbaum Aug 13, 2021
c7654bd
docs(ecs): Fix ecs readme markdown (#16018)
clarencetw Aug 13, 2021
9ed8af0
fix(ec2): opaque error when insufficient NAT EIPs are configured (#16…
RomainMuller Aug 13, 2021
693cf23
fix(events): cross-account event targets that have a Role are broken …
rix0rrr Aug 13, 2021
26b811f
chore(ecs): allow selecting Bottlerocket via `machineImage` (#16038)
rix0rrr Aug 13, 2021
f839bd7
chore(cdk-release): track and bump separate alpha version (#16043)
njlynch Aug 13, 2021
05a6617
feat(assets): exclude "cdk.out" from docker assets (#16034)
jogold Aug 15, 2021
95376e0
chore(release): 1.119.0
Aug 17, 2021
bc4c0bf
chore: remove duplicated closed issues in changelog
BenChaimberg Aug 17, 2021
0251976
add comcalvi to mergigy
comcalvi Aug 17, 2021
1fa1d99
chore(deps): bump tar from 4.4.13 to 4.4.16 (#15991)
dependabot[bot] Aug 18, 2021
f690d13
chore(deps-dev): bump jszip from 3.6.0 to 3.7.0 (#15990)
dependabot[bot] Aug 18, 2021
df20ffa
fix(appsync): addSubscription only allows for field type (#16097)
BryanPan342 Aug 18, 2021
9ada96d
chore(deps): bump tar from 6.1.0 to 6.1.8 (#16109)
BenChaimberg Aug 18, 2021
305e232
feat(cfnspec): cloudformation spec v39.10.0 (#16114)
aws-cdk-automation Aug 18, 2021
110e34d
fix(cli): 'deploy' and 'diff' silently does nothing when given unknow…
kaizencc Aug 18, 2021
d5df2b4
feat(aws-stepfunctions): add support to heartbeat error inside catch …
diegotry Aug 18, 2021
8af0042
transfered ownership of autoscaling to @comcalvi (#16119)
comcalvi Aug 18, 2021
7be414f
revert(cli): 'deploy' and 'diff' silently does nothing when given unk…
kaizencc Aug 19, 2021
9eeb8fe
fix(cli): Python init template does not work in directory with '-' (#…
Pearcekieser Aug 19, 2021
a520f28
feat(s3-deployment): exclude and include filters (#16054)
davidtucker Aug 19, 2021
5df6fa4
fix(cli): unknown command pytest in build container fails integration…
BenChaimberg Aug 19, 2021
302e62a
docs(apigateway): @see tag doesn't work with the @deprecated tag in d…
mprencipe Aug 19, 2021
0dd6f83
docs(ecs): Fix ecs readme sample (#16058)
clarencetw Aug 19, 2021
73693d8
docs(eks): change serviceAccount variable name (#16090)
Aug 19, 2021
e4edbad
chore: added links to the relevant aws cdk workshop tutorials in samp…
damogallagher Aug 19, 2021
94ad895
chore(eks): bad indent in kubectl apply handler (#16106)
chauncey-garrett Aug 20, 2021
679b1a8
chore(appsync): Correct VTL for aurora Serverless (#15874)
liuqiaowei512 Aug 20, 2021
6918312
fix: KubectlHandler - insecure kubeconfig warning (#16063)
mrsiejas Aug 20, 2021
dca8c01
fix(cfnspec): changes to resource-level documentation not supported (…
BenChaimberg Aug 23, 2021
f7e22cc
fix(ses): drop spam rule appears in the incorrect order (#16146)
otaviomacedo Aug 23, 2021
4118739
docs(cloudfront): fix CacheHeaderBehavior.behavior docstring (#16067)
njlynch Aug 23, 2021
1a508c3
feat(cfnspec): cloudformation spec v40.0.0 (#16183)
aws-cdk-automation Aug 23, 2021
58d2a65
feat(ecs): add support for Bottlerocket on ARM64 (#15454)
otterley Aug 23, 2021
ad17dd9
docs(pipelines): should use 'lookup' tag instead of 'deploy' tag (#15…
rix0rrr Aug 24, 2021
a505893
fix: (aws-ec2): fix vpc endpoint incorrect issue in China region (#16…
readybuilderone Aug 24, 2021
4d621d2
chore: `publishInParallel=false` with tokens produces useless error m…
rix0rrr Aug 24, 2021
0da1df4
fix(apigatewayv2): http api - disallow empty string as domain name (#…
samtwil Aug 24, 2021
3364f98
feat(lambda): nodejs14.x supports inline code (#16131)
gkaskonas Aug 24, 2021
2047fca
feat(cognito): user pools - device tracking (#16055)
emilrowland Aug 24, 2021
6e6acc8
feat(assertions): queries and assertions against the Outputs and Mapp…
Aug 24, 2021
3ee2ec2
chore(cli): Add node 10 deprecation warning (#16205)
madeline-k Aug 24, 2021
3369bc6
fix(sqs): unable to import a FIFO queue when the queue ARN is a token…
jumic Aug 24, 2021
28cee85
fix(ssm): StringParameter.fromStringParameterAttributes cannot accept…
jumic Aug 24, 2021
c47f288
feat(docdb): cluster - deletion protection (#15216)
cjihrig Aug 24, 2021
7ba828f
fix(resourcegroups): ResourceGroup not using TagType.STANDARD, causes…
madeline-k Aug 24, 2021
154dbf4
chore(integ): node check breaks cli integ tests (#16216)
iliapolo Aug 24, 2021
29f49ae
feat(cloudwatch): add support for cross-account alarms (#16007)
kaizencc Aug 25, 2021
4daad67
revert: temporarily transfer @skinny85 module ownership (#16206)
BenChaimberg Aug 25, 2021
da01d0f
fix(s3): bucket is not emptied before update when the name changes (#…
otaviomacedo Aug 25, 2021
2df6783
chore(integ): fix regression suite failures (#16226)
iliapolo Aug 25, 2021
5ec9576
feat(codecommit): make Repository a source for CodeStar Notifications…
badfun Aug 25, 2021
d551049
feat(rds): support 's3export' for Postgres database instances (#16124)
kaizencc Aug 25, 2021
7a0f11e
chore(release): 1.120.0
Aug 26, 2021
81372df
Update CHANGELOG.md
Aug 26, 2021
1aa42cb
Apply suggestions from code review
Aug 26, 2021
df1dcf0
Update CHANGELOG.md
Aug 26, 2021
ebe4a2a
fix(apigatewayv2): api mapping key with two hyphens is disallowed (#1…
readybuilderone Aug 26, 2021
668534e
chore(rds): add new versions of MariaDB, MySQL and SQL Server engines…
wuhkuh Aug 26, 2021
4d46349
feat(ecs-patterns): add capacity provider strategies to queue process…
tandfy Aug 26, 2021
542d325
fix(docs): unnecessary log group in Step Functions state machine x-ra…
benhawley7 Aug 26, 2021
b3ac7d2
feat(ec2): add m6i instances (#16081)
robertd Aug 26, 2021
0065318
feat(ecs-patterns): Allow configuration of SSL policy for listeners c…
ABevier Aug 26, 2021
5bd4aca
feat(aws-cloudfront-origins): add custom headers to S3Origin (#16161)
robertd Aug 27, 2021
e83d13f
feat(cfnspec): cloudformation spec v40.1.0 (#16254)
aws-cdk-automation Aug 27, 2021
326ebd0
feat(assertions): 'not' matcher (#16240)
Aug 27, 2021
8b975c3
feat(synthetics): add Python runtime and latest Nodejs runtime (#16069)
kaizencc Aug 27, 2021
26e1907
fix(elasticloadbalancingv2): target group health check does not valid…
mprencipe Aug 27, 2021
86b571a
feat(ecs): add support for Fargate PV1.4 ephemeral storage (#15440)
otterley Aug 27, 2021
f30466b
chore: migrate a few modules from nodeunit-shim to jest (#16258)
Aug 28, 2021
e8f9e6c
feat(core): normalize line endings in asset hash calculation (#16276)
jogold Aug 30, 2021
fb7cf73
chore: upgrade jsii packages (#16184)
BenChaimberg Aug 30, 2021
e384a23
chore: upgrade jsii version (#16285)
iliapolo Aug 30, 2021
ad2b167
chore: assign AppMesh issues to Seiya6329 (#16248)
skinny85 Aug 30, 2021
f804d63
fix(aws-rds): fromDatabaseInstanceAttributes incorrectly stringifies …
comcalvi Aug 31, 2021
4217f58
feat(route53resolver): DNS Firewall (#15031)
jogold Aug 31, 2021
090edfb
feat(cli): support `--no-rollback` flag (#16293)
rix0rrr Aug 31, 2021
2a52d4a
chore: migrate some modules from nodeunit to jest (#16295)
Aug 31, 2021
7172ee2
chore(cdk-release): support separate alpha Changelog (#16182)
njlynch Aug 31, 2021
7420e33
fix(core): inconsistent analytics string across operating systems (#1…
Aug 31, 2021
d7ba92d
feat(stepfunctions-tasks): support allocation strategies in EMR Creat…
johsbk Aug 31, 2021
79c5adf
chore(release): 1.121.0
Sep 1, 2021
6d00c85
Update CHANGELOG.md
Sep 1, 2021
a69ff4c
Update CHANGELOG.md
Sep 1, 2021
05aca34
Apply suggestions from code review
Sep 1, 2021
4eb1378
chore(resolve-version): export the alphaVersion (#16321)
madeline-k Sep 1, 2021
aa82bed
chore(yarn-cling): rename test packages to real package names (#16325)
njlynch Sep 1, 2021
2755d87
feat(ecs-service-extensions): Subscribe Extension (#16049)
upparekh Sep 1, 2021
92308e6
docs(aws-ecr-assets): Correct un-closed parenthetical expression (#16…
douglasnaphas Sep 1, 2021
868ec96
docs(pipelines): Fix documentation regarding rolePolicyStatements of …
markusl Sep 1, 2021
169d492
fix(core): allow asset bundling when selinux is enabled (#15742)
maafk Sep 2, 2021
e605123
feat(cli): hotswap deployments (#15748)
skinny85 Sep 2, 2021
bef3a6e
feat(stepfunctions-tasks): await the eval so async ops can be passed …
3p3r Sep 2, 2021
9044e6a
feat(ec2): rename SubnetTypes to improve clarity with EC2 conventions…
njlynch Sep 3, 2021
831019d
feat(kms): support fromLookup in KMS key to get key by alias name (#1…
jumic Sep 3, 2021
665d038
feat(lambda): python 3.9 runtime (#16366)
michaelbrewer Sep 3, 2021
a076d24
feat(aws-ec2): Allow ApplyCloudformationInitOptions to set additional…
maafk Sep 3, 2021
ffbdcd1
feat(ec2): vpc endpoint for aws keyspaces (#16306)
dchenbec Sep 3, 2021
098c014
feat(elasticloadbalancingv2): ALPN policy support for NLB listener (#…
project0 Sep 3, 2021
77d5b75
fix(apigatewayv2): some methods of the `defaultStage` are not availab…
Sep 3, 2021
290bce3
fix(stepfunctions-tasks): Athena StartQueryExecution includes QueryEx…
LukvonStrom Sep 3, 2021
e33d8c6
making requested PR changes
david-doyle-as24 Sep 7, 2021
b5a1258
Merge branch 'master' into adding-firehose-support
david-doyle-as24 Sep 7, 2021
7d928a6
Merge branch 'master' into adding-firehose-support
mergify[bot] Sep 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/@aws-cdk/aws-sns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ topic.addSubscription(new subs.LambdaSubscription(fn, {
}));
```

### Example of Firehose Subscription
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ (Nit) This is okay, if we're going to leave this implementation as the basics only. I'd greatly prefer we document it as part of a FirehoseSubscription in the aws-sns-subscriptions README instead though.


```typescript
import { Subscription, SubscriptionProtocol, Topic } from '@aws-cdk/aws-sns';
import { DeliveryStream } from '@aws-cdk/aws-kinesisfirehose';
const topic = new Topic(stack, 'Topic');
const stream = new DeliveryStream(stack, 'DeliveryStream', ...)
new Subscription(stack, 'Subscription', {
endpoint: stream.deliveryStreamArn,
protocol: SubscriptionProtocol.FIREHOSE,
subscriptionRoleArn: "SAMPLE_ARN", //role with permissions to send messages to a firehose delivery stream
})
```

## DLQ setup for SNS Subscription

CDK can attach provided Queue as DLQ for your SNS subscription.
Expand Down
19 changes: 18 additions & 1 deletion packages/@aws-cdk/aws-sns/lib/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ export interface SubscriptionOptions {
* @default - No dead letter queue enabled.
*/
readonly deadLetterQueue?: IQueue;

/**
* Arn of role allowing access to firehose delivery stream.
* Required for a firehose subscription protocol.
* @default - No subscription role is provided
*/
readonly subscriptionRoleArn?: string;
}
/**
* Properties for creating a new subscription
Expand Down Expand Up @@ -103,6 +110,10 @@ export class Subscription extends Resource {
}
}

if (props.protocol === SubscriptionProtocol.FIREHOSE && !props.subscriptionRoleArn) {
throw new Error('Subscription role arn is required field for subscriptions with a firehose protocol.');
}

this.deadLetterQueue = this.buildDeadLetterQueue(props);

new CfnSubscription(this, 'Resource', {
Expand All @@ -113,6 +124,7 @@ export class Subscription extends Resource {
filterPolicy: this.filterPolicy,
region: props.region,
redrivePolicy: this.buildDeadLetterConfig(this.deadLetterQueue),
subscriptionRoleArn: props.subscriptionRoleArn,
});

}
Expand Down Expand Up @@ -189,5 +201,10 @@ export enum SubscriptionProtocol {
/**
* Notifications trigger a Lambda function.
*/
LAMBDA = 'lambda'
LAMBDA = 'lambda',

/**
* Notifications put records into a firehose delivery stream.
*/
FIREHOSE = 'firehose'
}
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-sns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/aws-s3": "0.0.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/aws-s3": "0.0.0",
"@types/jest": "^26.0.24",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
Expand All @@ -86,8 +86,8 @@
"pkglint": "0.0.0"
},
"dependencies": {
"@aws-cdk/aws-codestarnotifications": "0.0.0",
"@aws-cdk/aws-cloudwatch": "0.0.0",
"@aws-cdk/aws-codestarnotifications": "0.0.0",
"@aws-cdk/aws-events": "0.0.0",
"@aws-cdk/aws-iam": "0.0.0",
"@aws-cdk/aws-kms": "0.0.0",
Expand All @@ -97,8 +97,8 @@
},
"homepage": "https://github.com/aws/aws-cdk",
"peerDependencies": {
"@aws-cdk/aws-codestarnotifications": "0.0.0",
"@aws-cdk/aws-cloudwatch": "0.0.0",
"@aws-cdk/aws-codestarnotifications": "0.0.0",
"@aws-cdk/aws-events": "0.0.0",
"@aws-cdk/aws-iam": "0.0.0",
"@aws-cdk/aws-kms": "0.0.0",
Expand Down
15 changes: 14 additions & 1 deletion packages/@aws-cdk/aws-sns/test/subscription.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe('Subscription', () => {

});

test('throws with raw delivery for protocol other than http, https or sqs', () => {
test('throws with raw delivery for lambda protocol', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why did you make this change? While the text more accurately describes the specifics of the test, they lose the intent behind the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@njlynch , the choice was between changing the name to "protocol other than http, https, sqs, or firehose" (since firehose supports raw delivery) or changing it to "lambda protocol", which has the advantage of being more accurate. As it is, the test name is misleading - it doesn't cover email or sms which also don't support raw delivery. Better just to name it more transparently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. If Firehose supports raw delivery, then it looks like this check needs to be updated:

if (props.rawMessageDelivery && ['http', 'https', 'sqs'].indexOf(props.protocol) < 0) {
throw new Error('Raw message delivery can only be enabled for HTTP/S and SQS subscriptions.');
}

You're accurate the test name is now more accurate, but it points out the inadequacy of it. Could you swap it to use a test.each and enumerate the protocols that should throw?

// GIVEN
const stack = new cdk.Stack();
const topic = new sns.Topic(stack, 'Topic');
Expand Down Expand Up @@ -232,4 +232,17 @@ describe('Subscription', () => {
})).toThrow(/\(120\) must not exceed 100/);

});

test('throws an error when subscription role arn is not entered with firehose subscription protocol', () => {
// GIVEN
const stack = new cdk.Stack();
const topic = new sns.Topic(stack, 'Topic');

//THEN
expect(() => new sns.Subscription(stack, 'Subscription', {
endpoint: 'endpoint',
protocol: sns.SubscriptionProtocol.FIREHOSE,
topic,
})).toThrow(/Subscription role arn is required field for subscriptions with a firehose protocol./);
});
});