Skip to content

Commit cc3bb1f

Browse files
authoredDec 9, 2021
fix(apigateway): dataTraceEnabled does not default to false (#17906)
The recommendation from AWS is to not use this feature in production. So `false` is a sensible default. Fixes #17578. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 919605a commit cc3bb1f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed
 

‎packages/@aws-cdk/aws-apigateway/lib/stage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export class Stage extends Resource implements IStage {
316316
cacheDataEncrypted: options.cacheDataEncrypted,
317317
cacheTtlInSeconds: options.cacheTtl && options.cacheTtl.toSeconds(),
318318
cachingEnabled: options.cachingEnabled,
319-
dataTraceEnabled: options.dataTraceEnabled,
319+
dataTraceEnabled: options.dataTraceEnabled ?? false,
320320
loggingLevel: options.loggingLevel,
321321
metricsEnabled: options.metricsEnabled,
322322
throttlingBurstLimit: options.throttlingBurstLimit,

‎packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
},
9696
{
9797
"CachingEnabled": true,
98+
"DataTraceEnabled": false,
9899
"HttpMethod": "GET",
99100
"ResourcePath": "/~1api~1appliances"
100101
}

‎packages/@aws-cdk/aws-apigateway/test/stage.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ describe('stage', () => {
8787
expect(stack).toHaveResource('AWS::ApiGateway::Stage', {
8888
MethodSettings: [
8989
{
90+
DataTraceEnabled: false,
9091
HttpMethod: '*',
9192
LoggingLevel: 'INFO',
9293
ResourcePath: '/*',
@@ -119,12 +120,14 @@ describe('stage', () => {
119120
expect(stack).toHaveResource('AWS::ApiGateway::Stage', {
120121
MethodSettings: [
121122
{
123+
DataTraceEnabled: false,
122124
HttpMethod: '*',
123125
LoggingLevel: 'INFO',
124126
ResourcePath: '/*',
125127
ThrottlingRateLimit: 12,
126128
},
127129
{
130+
DataTraceEnabled: false,
128131
HttpMethod: 'GET',
129132
LoggingLevel: 'ERROR',
130133
ResourcePath: '/~1goo~1bar',
@@ -207,6 +210,7 @@ describe('stage', () => {
207210
CacheClusterSize: '0.5',
208211
MethodSettings: [
209212
{
213+
DataTraceEnabled: false,
210214
CachingEnabled: true,
211215
HttpMethod: '*',
212216
ResourcePath: '/*',

0 commit comments

Comments
 (0)
Please sign in to comment.