Skip to content

Commit 7a96bdc

Browse files
committed
docs: add an example of log retention
1 parent d2ad889 commit 7a96bdc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: packages/@aws-cdk/aws-appsync/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,17 @@ log data set to never expire. If you want to set a different expiration period,
342342
To obtain the GraphQL API's log group as a `logs.ILogGroup` use the `logGroup` property of the
343343
`GraphqlApi` construct.
344344

345+
```ts
346+
import * as logs from '@aws-cdk/aws-logs';
347+
348+
new GraphqlApi(this, 'api', {
349+
name: 'api',
350+
logConfig: {
351+
retention: logs.RetentionDays.ONE_WEEK,
352+
},
353+
});
354+
```
355+
345356
## Schema
346357

347358
Every GraphQL Api needs a schema to define the Api. CDK offers `appsync.Schema`

0 commit comments

Comments
 (0)