Skip to content

Commit f7f9762

Browse files
Extend firehose retries by default, and correct IAM Policy definition for region
1 parent 156dd46 commit f7f9762

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

cloudformation/full/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ aws cloudformation deploy \
6868
| Parameter | Default | Description |
6969
|-----------|---------|-------------|
7070
| `CreateGlobalResources` | `true` | Create IAM roles. Set to `false` for secondary regions. |
71+
| `FirehoseRetryDurationSeconds` | `3600` | How long (seconds) Firehose retries delivery before writing failed records to the S3 backup bucket. Max `7200`; `0` disables retries. |
7172

7273
### Feature Toggles
7374

cloudformation/full/better-stack-full.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ Metadata:
1414
default: Deployment Options
1515
Parameters:
1616
- CreateGlobalResources
17+
- FirehoseRetryDurationSeconds
1718
- Label:
1819
default: Features
1920
Parameters:
2021
- EnableTagEnrichment
2122
- EnableCloudTrail
2223
- EnableXRayTransactionSearch
24+
ParameterLabels:
25+
FirehoseRetryDurationSeconds:
26+
default: Firehose retry duration (seconds)
2327

2428
Parameters:
2529
ClusterId:
@@ -72,6 +76,16 @@ Parameters:
7276
- 'true'
7377
- 'false'
7478

79+
FirehoseRetryDurationSeconds:
80+
Type: Number
81+
Description: >-
82+
How long (in seconds) Firehose keeps retrying delivery to Better Stack
83+
before sending failed records to the S3 backup bucket. Default is 3600
84+
(60 minutes). Maximum is 7200 (2 hours); set to 0 to disable retries.
85+
Default: 3600
86+
MinValue: 0
87+
MaxValue: 7200
88+
7589
Conditions:
7690
ShouldCreateGlobalResources: !Equals [!Ref CreateGlobalResources, 'true']
7791
TagEnrichmentEnabled: !Equals [!Ref EnableTagEnrichment, 'true']
@@ -182,7 +196,10 @@ Resources:
182196
Action: sts:AssumeRole
183197
Condition:
184198
StringLike:
185-
aws:SourceArn: !Sub 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:*'
199+
# Role is global (created once), so allow CloudWatch Logs from any region
200+
# in this account. Pinning ${AWS::Region} here freezes to the first-deployed
201+
# region and breaks log subscriptions in every other region. See T-18856.
202+
aws:SourceArn: !Sub 'arn:aws:logs:*:${AWS::AccountId}:*'
186203
Policies:
187204
- PolicyName: FirehoseWritePermissions
188205
PolicyDocument:
@@ -601,7 +618,7 @@ Resources:
601618
SizeInMBs: 1
602619
IntervalInSeconds: 60
603620
RetryOptions:
604-
DurationInSeconds: 300
621+
DurationInSeconds: !Ref FirehoseRetryDurationSeconds
605622
S3BackupMode: FailedDataOnly
606623
S3Configuration:
607624
RoleARN: !If
@@ -661,7 +678,7 @@ Resources:
661678
SizeInMBs: 1
662679
IntervalInSeconds: 60
663680
RetryOptions:
664-
DurationInSeconds: 300
681+
DurationInSeconds: !Ref FirehoseRetryDurationSeconds
665682
S3BackupMode: FailedDataOnly
666683
S3Configuration:
667684
RoleARN: !If

0 commit comments

Comments
 (0)