Skip to content

Commit

Permalink
fix(apigateway): dataTraceEnabled does not default to false (#17906)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
otaviomacedo authored Dec 9, 2021
1 parent 919605a commit cc3bb1f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export class Stage extends Resource implements IStage {
cacheDataEncrypted: options.cacheDataEncrypted,
cacheTtlInSeconds: options.cacheTtl && options.cacheTtl.toSeconds(),
cachingEnabled: options.cachingEnabled,
dataTraceEnabled: options.dataTraceEnabled,
dataTraceEnabled: options.dataTraceEnabled ?? false,
loggingLevel: options.loggingLevel,
metricsEnabled: options.metricsEnabled,
throttlingBurstLimit: options.throttlingBurstLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
},
{
"CachingEnabled": true,
"DataTraceEnabled": false,
"HttpMethod": "GET",
"ResourcePath": "/~1api~1appliances"
}
Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-apigateway/test/stage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ describe('stage', () => {
expect(stack).toHaveResource('AWS::ApiGateway::Stage', {
MethodSettings: [
{
DataTraceEnabled: false,
HttpMethod: '*',
LoggingLevel: 'INFO',
ResourcePath: '/*',
Expand Down Expand Up @@ -119,12 +120,14 @@ describe('stage', () => {
expect(stack).toHaveResource('AWS::ApiGateway::Stage', {
MethodSettings: [
{
DataTraceEnabled: false,
HttpMethod: '*',
LoggingLevel: 'INFO',
ResourcePath: '/*',
ThrottlingRateLimit: 12,
},
{
DataTraceEnabled: false,
HttpMethod: 'GET',
LoggingLevel: 'ERROR',
ResourcePath: '/~1goo~1bar',
Expand Down Expand Up @@ -207,6 +210,7 @@ describe('stage', () => {
CacheClusterSize: '0.5',
MethodSettings: [
{
DataTraceEnabled: false,
CachingEnabled: true,
HttpMethod: '*',
ResourcePath: '/*',
Expand Down

0 comments on commit cc3bb1f

Please sign in to comment.