-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
I am creating an Appsync API, and want to disable query introspection. This is useful for trimming the security surface-area of (any, but in this case, Appsync) GraphQL api.
(We can debate the pros/cons of doing this, but since the service exposes the switch in the UI, let's assume there's good reason for it)
Said property is in the UI (see screenshot below) and also surfaced in the AWS SDK
However, it is not available in CF or CDK, so I need to use an explicit property override to set it via the CDK.
Additionally, I had to figure this out via trial and error - there is no help that I could find online.
import * as appsync from '@aws-cdk/aws-appsync-alpha' // 2.54.0-alpha.0
import * as aps from 'aws-cdk-lib/aws-appsync' // 2.114.1
const api = new appsync.GraphqlApi(this, 'Api', {...})
const cfnApi = api.node.defaultChild as aps.CfnGraphQLApi
cfnApi.addPropertyOverride('IntrospectionConfig', 'DISABLED') // <-- Hackery
Expected Behavior
The L1 or L2 constructs should expose said property directly
Current Behavior
Need to use a property override to set the property. This does have the desired effect, ie the UI changes accordingly
Reproduction Steps
Code shown above
Possible Solution
Expose said property
Additional Information/Context
Perhaps this is actually a CloudFormation bug, not specifically CDK
CDK CLI Version
2.110.0 (build c6471f2)
Framework Version
cdk/lib = 2.114.1, @aws-cdk/aws-appsync-alpha = 2.54.0-alpha.0
Node.js Version
v18.18.2
OS
Mac, 14.2 (23C64)
Language
TypeScript
Language Version
5.3.3
Other information
No response