diff --git a/packages/amplify-graphql-api-construct/.jsii b/packages/amplify-graphql-api-construct/.jsii index 7321b8cf8c..4647851492 100644 --- a/packages/amplify-graphql-api-construct/.jsii +++ b/packages/amplify-graphql-api-construct/.jsii @@ -3972,7 +3972,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 868 + "line": 875 }, "name": "AddFunctionProps", "properties": [ @@ -3985,7 +3985,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 872 + "line": 879 }, "name": "dataSource", "type": { @@ -4001,7 +4001,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 877 + "line": 884 }, "name": "name", "type": { @@ -4018,7 +4018,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 912 + "line": 919 }, "name": "code", "optional": true, @@ -4036,7 +4036,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 884 + "line": 891 }, "name": "description", "optional": true, @@ -4054,7 +4054,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 891 + "line": 898 }, "name": "requestMappingTemplate", "optional": true, @@ -4072,7 +4072,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 898 + "line": 905 }, "name": "responseMappingTemplate", "optional": true, @@ -4090,7 +4090,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 905 + "line": 912 }, "name": "runtime", "optional": true, @@ -4433,7 +4433,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 286 + "line": 288 }, "name": "addDynamoDbDataSource", "parameters": [ @@ -4482,7 +4482,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 298 + "line": 300 }, "name": "addElasticsearchDataSource", "parameters": [ @@ -4529,7 +4529,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 308 + "line": 310 }, "name": "addEventBridgeDataSource", "parameters": [ @@ -4576,7 +4576,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 390 + "line": 392 }, "name": "addFunction", "parameters": [ @@ -4611,7 +4611,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 319 + "line": 321 }, "name": "addHttpDataSource", "parameters": [ @@ -4659,7 +4659,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 330 + "line": 332 }, "name": "addLambdaDataSource", "parameters": [ @@ -4707,7 +4707,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 341 + "line": 343 }, "name": "addNoneDataSource", "parameters": [ @@ -4746,7 +4746,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 352 + "line": 354 }, "name": "addOpenSearchDataSource", "parameters": [ @@ -4794,7 +4794,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 365 + "line": 367 }, "name": "addRdsDataSource", "parameters": [ @@ -4861,7 +4861,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 381 + "line": 383 }, "name": "addResolver", "parameters": [ @@ -5020,7 +5020,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 771 + "line": 778 }, "name": "AmplifyGraphqlApiCfnResources", "properties": [ @@ -5033,7 +5033,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 825 + "line": 832 }, "name": "additionalCfnResources", "type": { @@ -5054,7 +5054,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 810 + "line": 817 }, "name": "amplifyDynamoDbTables", "type": { @@ -5075,7 +5075,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 800 + "line": 807 }, "name": "cfnDataSources", "type": { @@ -5096,7 +5096,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 795 + "line": 802 }, "name": "cfnFunctionConfigurations", "type": { @@ -5117,7 +5117,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 820 + "line": 827 }, "name": "cfnFunctions", "type": { @@ -5138,7 +5138,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 775 + "line": 782 }, "name": "cfnGraphqlApi", "type": { @@ -5154,7 +5154,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 780 + "line": 787 }, "name": "cfnGraphqlSchema", "type": { @@ -5170,7 +5170,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 790 + "line": 797 }, "name": "cfnResolvers", "type": { @@ -5191,7 +5191,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 815 + "line": 822 }, "name": "cfnRoles", "type": { @@ -5212,7 +5212,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 805 + "line": 812 }, "name": "cfnTables", "type": { @@ -5233,7 +5233,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 785 + "line": 792 }, "name": "cfnApiKey", "optional": true, @@ -5256,7 +5256,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 688 + "line": 689 }, "name": "AmplifyGraphqlApiProps", "properties": [ @@ -5270,7 +5270,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 705 + "line": 706 }, "name": "authorizationModes", "type": { @@ -5287,7 +5287,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 693 + "line": 694 }, "name": "definition", "type": { @@ -5304,7 +5304,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 699 + "line": 700 }, "name": "apiName", "optional": true, @@ -5323,7 +5323,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 720 + "line": 721 }, "name": "conflictResolution", "optional": true, @@ -5341,7 +5341,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 764 + "line": 765 }, "name": "dataStoreConfiguration", "optional": true, @@ -5361,7 +5361,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 713 + "line": 714 }, "name": "functionNameMap", "optional": true, @@ -5384,7 +5384,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 735 + "line": 736 }, "name": "functionSlots", "optional": true, @@ -5409,6 +5409,23 @@ } } }, + { + "abstract": true, + "docs": { + "stability": "stable", + "summary": "Specifies the logging configuration when writing GraphQL operations and tracing to Amazon CloudWatch for an AWS AppSync GraphQL API, refer to https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnGraphQLApi.LogConfigProperty.html." + }, + "immutable": true, + "locationInModule": { + "filename": "src/types.ts", + "line": 771 + }, + "name": "logConfig", + "optional": true, + "type": { + "fqn": "aws-cdk-lib.aws_appsync.LogConfig" + } + }, { "abstract": true, "docs": { @@ -5419,7 +5436,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 758 + "line": 759 }, "name": "outputStorageStrategy", "optional": true, @@ -5436,7 +5453,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 747 + "line": 748 }, "name": "predictionsBucket", "optional": true, @@ -5454,7 +5471,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 729 + "line": 730 }, "name": "stackMappings", "optional": true, @@ -5480,7 +5497,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 742 + "line": 743 }, "name": "transformerPlugins", "optional": true, @@ -5502,7 +5519,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 753 + "line": 754 }, "name": "translationBehavior", "optional": true, @@ -5525,7 +5542,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 832 + "line": 839 }, "name": "AmplifyGraphqlApiResources", "properties": [ @@ -5538,7 +5555,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 856 + "line": 863 }, "name": "cfnResources", "type": { @@ -5554,7 +5571,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 851 + "line": 858 }, "name": "functions", "type": { @@ -5575,7 +5592,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 836 + "line": 843 }, "name": "graphqlApi", "type": { @@ -5591,7 +5608,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 861 + "line": 868 }, "name": "nestedStacks", "type": { @@ -5612,7 +5629,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 846 + "line": 853 }, "name": "roles", "type": { @@ -5633,7 +5650,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 841 + "line": 848 }, "name": "tables", "type": { @@ -5863,7 +5880,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 141 + "line": 142 }, "name": "ApiKeyAuthorizationConfig", "properties": [ @@ -5876,7 +5893,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 150 + "line": 151 }, "name": "expires", "type": { @@ -5892,7 +5909,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 145 + "line": 146 }, "name": "description", "optional": true, @@ -5915,7 +5932,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 173 + "line": 174 }, "name": "AuthorizationModes", "properties": [ @@ -5929,7 +5946,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 221 + "line": 222 }, "name": "adminRoles", "optional": true, @@ -5952,7 +5969,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 209 + "line": 210 }, "name": "apiKeyConfig", "optional": true, @@ -5969,7 +5986,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 177 + "line": 178 }, "name": "defaultAuthorizationMode", "optional": true, @@ -5987,7 +6004,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 185 + "line": 186 }, "name": "iamConfig", "optional": true, @@ -6005,7 +6022,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 191 + "line": 192 }, "name": "identityPoolConfig", "optional": true, @@ -6023,7 +6040,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 215 + "line": 216 }, "name": "lambdaConfig", "optional": true, @@ -6041,7 +6058,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 203 + "line": 204 }, "name": "oidcConfig", "optional": true, @@ -6059,7 +6076,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 197 + "line": 198 }, "name": "userPoolConfig", "optional": true, @@ -6084,7 +6101,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 242 + "line": 243 }, "name": "AutomergeConflictResolutionStrategy", "properties": [ @@ -6098,7 +6115,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 247 + "line": 248 }, "name": "handlerType", "type": { @@ -6123,7 +6140,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 290 + "line": 291 }, "name": "ConflictResolution", "symbolId": "src/types:ConflictResolution" @@ -6139,7 +6156,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 232 + "line": 233 }, "name": "ConflictResolutionStrategyBase", "properties": [ @@ -6152,7 +6169,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 236 + "line": 237 }, "name": "detectionType", "type": { @@ -6176,7 +6193,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 264 + "line": 265 }, "name": "CustomConflictResolutionStrategy", "properties": [ @@ -6189,7 +6206,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 275 + "line": 276 }, "name": "conflictHandler", "type": { @@ -6206,7 +6223,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 270 + "line": 271 }, "name": "handlerType", "type": { @@ -6294,7 +6311,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 295 + "line": 296 }, "name": "DataStoreConfiguration", "properties": [ @@ -6307,7 +6324,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 304 + "line": 305 }, "name": "models", "optional": true, @@ -6342,7 +6359,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 299 + "line": 300 }, "name": "project", "optional": true, @@ -6424,7 +6441,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 326 + "line": 327 }, "name": "FunctionSlotBase", "properties": [ @@ -6437,7 +6454,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 330 + "line": 331 }, "name": "fieldName", "type": { @@ -6453,7 +6470,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 341 + "line": 342 }, "name": "function", "type": { @@ -6470,7 +6487,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 336 + "line": 337 }, "name": "slotIndex", "type": { @@ -6492,7 +6509,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 311 + "line": 312 }, "name": "FunctionSlotOverride", "properties": [ @@ -6506,7 +6523,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 315 + "line": 316 }, "name": "requestMappingTemplate", "optional": true, @@ -6524,7 +6541,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 320 + "line": 321 }, "name": "responseMappingTemplate", "optional": true, @@ -6546,7 +6563,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 27 + "line": 28 }, "name": "IAMAuthorizationConfig", "properties": [ @@ -6561,7 +6578,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 61 + "line": 62 }, "name": "allowListedRoles", "optional": true, @@ -6593,7 +6610,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 43 + "line": 44 }, "name": "authenticatedUserRole", "optional": true, @@ -6614,7 +6631,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 70 + "line": 71 }, "name": "enableIamAuthorizationMode", "optional": true, @@ -6633,7 +6650,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 35 + "line": 36 }, "name": "identityPoolId", "optional": true, @@ -6651,7 +6668,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 51 + "line": 52 }, "name": "unauthenticatedUserRole", "optional": true, @@ -6672,7 +6689,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 622 + "line": 623 }, "name": "IAmplifyGraphqlDefinition", "properties": [ @@ -6687,7 +6704,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 647 + "line": 648 }, "name": "dataSourceStrategies", "type": { @@ -6721,7 +6738,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 633 + "line": 634 }, "name": "functionSlots", "type": { @@ -6755,7 +6772,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 627 + "line": 628 }, "name": "schema", "type": { @@ -6772,7 +6789,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 653 + "line": 654 }, "name": "customSqlDataSourceStrategies", "optional": true, @@ -6796,7 +6813,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 641 + "line": 642 }, "name": "referencedLambdaFunctions", "optional": true, @@ -6822,7 +6839,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 659 + "line": 660 }, "name": "IBackendOutputEntry", "properties": [ @@ -6835,7 +6852,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 668 + "line": 669 }, "name": "payload", "type": { @@ -6856,7 +6873,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 663 + "line": 664 }, "name": "version", "type": { @@ -6876,7 +6893,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 674 + "line": 675 }, "methods": [ { @@ -6887,7 +6904,7 @@ }, "locationInModule": { "filename": "src/types.ts", - "line": 681 + "line": 682 }, "name": "addBackendOutputEntry", "parameters": [ @@ -6926,7 +6943,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 77 + "line": 78 }, "name": "IdentityPoolAuthorizationConfig", "properties": [ @@ -6939,7 +6956,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 87 + "line": 88 }, "name": "authenticatedUserRole", "type": { @@ -6956,7 +6973,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 82 + "line": 83 }, "name": "identityPoolId", "type": { @@ -6972,7 +6989,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 92 + "line": 93 }, "name": "unauthenticatedUserRole", "type": { @@ -6993,7 +7010,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 156 + "line": 157 }, "name": "LambdaAuthorizationConfig", "properties": [ @@ -7006,7 +7023,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 160 + "line": 161 }, "name": "function", "type": { @@ -7022,7 +7039,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 165 + "line": 166 }, "name": "ttl", "type": { @@ -7046,7 +7063,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 347 + "line": 348 }, "name": "MutationFunctionSlot", "properties": [ @@ -7060,7 +7077,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 357 + "line": 358 }, "name": "slotName", "type": { @@ -7076,7 +7093,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 351 + "line": 352 }, "name": "typeName", "type": { @@ -7097,7 +7114,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 108 + "line": 109 }, "name": "OIDCAuthorizationConfig", "properties": [ @@ -7110,7 +7127,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 117 + "line": 118 }, "name": "oidcIssuerUrl", "type": { @@ -7126,7 +7143,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 112 + "line": 113 }, "name": "oidcProviderName", "type": { @@ -7143,7 +7160,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 129 + "line": 130 }, "name": "tokenExpiryFromAuth", "type": { @@ -7160,7 +7177,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 135 + "line": 136 }, "name": "tokenExpiryFromIssue", "type": { @@ -7177,7 +7194,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 123 + "line": 124 }, "name": "clientId", "optional": true, @@ -7202,7 +7219,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 253 + "line": 254 }, "name": "OptimisticConflictResolutionStrategy", "properties": [ @@ -7216,7 +7233,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 258 + "line": 259 }, "name": "handlerType", "type": { @@ -7237,7 +7254,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 504 + "line": 505 }, "name": "PartialTranslationBehavior", "properties": [ @@ -7252,7 +7269,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 596 + "line": 597 }, "name": "allowDestructiveGraphqlSchemaUpdates", "optional": true, @@ -7270,7 +7287,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 516 + "line": 517 }, "name": "disableResolverDeduping", "optional": true, @@ -7292,7 +7309,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 561 + "line": 562 }, "name": "enableAutoIndexQueryNames", "optional": true, @@ -7311,7 +7328,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 576 + "line": 577 }, "name": "enableSearchNodeToNodeEncryption", "optional": true, @@ -7329,7 +7346,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 582 + "line": 583 }, "name": "enableTransformerCfnOutputs", "optional": true, @@ -7347,7 +7364,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 541 + "line": 542 }, "name": "populateOwnerFieldForStaticGroupAuth", "optional": true, @@ -7366,7 +7383,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 606 + "line": 607 }, "name": "replaceTableUponGsiUpdate", "optional": true, @@ -7384,7 +7401,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 567 + "line": 568 }, "name": "respectPrimaryKeyAttributesOnConnectionField", "optional": true, @@ -7402,7 +7419,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 522 + "line": 523 }, "name": "sandboxModeEnabled", "optional": true, @@ -7423,7 +7440,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 554 + "line": 555 }, "name": "secondaryKeyAsGSI", "optional": true, @@ -7444,7 +7461,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 509 + "line": 510 }, "name": "shouldDeepMergeDirectiveConfigDefaults", "optional": true, @@ -7462,7 +7479,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 535 + "line": 536 }, "name": "subscriptionsInheritPrimaryAuth", "optional": true, @@ -7481,7 +7498,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 548 + "line": 549 }, "name": "suppressApiKeyGeneration", "optional": true, @@ -7499,7 +7516,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 529 + "line": 530 }, "name": "useSubUsernameForDefaultIdentityClaim", "optional": true, @@ -7609,7 +7626,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 363 + "line": 364 }, "name": "QueryFunctionSlot", "properties": [ @@ -7623,7 +7640,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 373 + "line": 374 }, "name": "slotName", "type": { @@ -7639,7 +7656,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 367 + "line": 368 }, "name": "typeName", "type": { @@ -8415,7 +8432,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 379 + "line": 380 }, "name": "SubscriptionFunctionSlot", "properties": [ @@ -8429,7 +8446,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 389 + "line": 390 }, "name": "slotName", "type": { @@ -8445,7 +8462,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 383 + "line": 384 }, "name": "typeName", "type": { @@ -8518,7 +8535,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 403 + "line": 404 }, "name": "TranslationBehavior", "properties": [ @@ -8533,7 +8550,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 488 + "line": 489 }, "name": "allowDestructiveGraphqlSchemaUpdates", "type": { @@ -8550,7 +8567,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 415 + "line": 416 }, "name": "disableResolverDeduping", "type": { @@ -8571,7 +8588,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 460 + "line": 461 }, "name": "enableAutoIndexQueryNames", "type": { @@ -8586,7 +8603,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 468 + "line": 469 }, "name": "enableSearchNodeToNodeEncryption", "type": { @@ -8603,7 +8620,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 474 + "line": 475 }, "name": "enableTransformerCfnOutputs", "type": { @@ -8620,7 +8637,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 440 + "line": 441 }, "name": "populateOwnerFieldForStaticGroupAuth", "type": { @@ -8638,7 +8655,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 498 + "line": 499 }, "name": "replaceTableUponGsiUpdate", "type": { @@ -8655,7 +8672,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 466 + "line": 467 }, "name": "respectPrimaryKeyAttributesOnConnectionField", "type": { @@ -8672,7 +8689,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 421 + "line": 422 }, "name": "sandboxModeEnabled", "type": { @@ -8692,7 +8709,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 453 + "line": 454 }, "name": "secondaryKeyAsGSI", "type": { @@ -8712,7 +8729,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 408 + "line": 409 }, "name": "shouldDeepMergeDirectiveConfigDefaults", "type": { @@ -8729,7 +8746,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 434 + "line": 435 }, "name": "subscriptionsInheritPrimaryAuth", "type": { @@ -8747,7 +8764,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 447 + "line": 448 }, "name": "suppressApiKeyGeneration", "type": { @@ -8764,7 +8781,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 428 + "line": 429 }, "name": "useSubUsernameForDefaultIdentityClaim", "type": { @@ -8785,7 +8802,7 @@ "kind": "interface", "locationInModule": { "filename": "src/types.ts", - "line": 98 + "line": 99 }, "name": "UserPoolAuthorizationConfig", "properties": [ @@ -8798,7 +8815,7 @@ "immutable": true, "locationInModule": { "filename": "src/types.ts", - "line": 102 + "line": 103 }, "name": "userPool", "type": { @@ -8887,5 +8904,5 @@ } }, "version": "1.12.0", - "fingerprint": "WQe8bESYXwkHuayA70K/y1utQFCo4AT58swUXMJSDuc=" + "fingerprint": "0oNfqC1hkK9FOOeR/FhViGjvHWZe6qLk3nZqeDZFt9c=" } \ No newline at end of file diff --git a/packages/amplify-graphql-api-construct/API.md b/packages/amplify-graphql-api-construct/API.md index 6973808384..f7e2be2aeb 100644 --- a/packages/amplify-graphql-api-construct/API.md +++ b/packages/amplify-graphql-api-construct/API.md @@ -40,6 +40,7 @@ import { IServerlessCluster } from 'aws-cdk-lib/aws-rds'; import { ITable } from 'aws-cdk-lib/aws-dynamodb'; import { IUserPool } from 'aws-cdk-lib/aws-cognito'; import { LambdaDataSource } from 'aws-cdk-lib/aws-appsync'; +import { LogConfig } from 'aws-cdk-lib/aws-appsync'; import { MappingTemplate } from 'aws-cdk-lib/aws-appsync'; import { NestedStack } from 'aws-cdk-lib'; import { NoneDataSource } from 'aws-cdk-lib/aws-appsync'; @@ -130,6 +131,7 @@ export interface AmplifyGraphqlApiProps { readonly definition: IAmplifyGraphqlDefinition; readonly functionNameMap?: Record; readonly functionSlots?: FunctionSlot[]; + readonly logConfig?: LogConfig; readonly outputStorageStrategy?: IBackendOutputStorageStrategy; readonly predictionsBucket?: IBucket; readonly stackMappings?: Record; diff --git a/packages/amplify-graphql-api-construct/src/__tests__/__functional__/log-config.test.ts b/packages/amplify-graphql-api-construct/src/__tests__/__functional__/log-config.test.ts new file mode 100644 index 0000000000..20c4c913d9 --- /dev/null +++ b/packages/amplify-graphql-api-construct/src/__tests__/__functional__/log-config.test.ts @@ -0,0 +1,75 @@ +import * as cdk from 'aws-cdk-lib'; +import { Stack } from 'aws-cdk-lib'; +import { FieldLogLevel } from 'aws-cdk-lib/aws-appsync'; +import { CfnGraphQLApi } from 'aws-cdk-lib/aws-appsync'; +import { IRole } from 'aws-cdk-lib/aws-iam'; +import { AmplifyGraphqlApi } from '../../amplify-graphql-api'; +import { AmplifyGraphqlDefinition } from '../../amplify-graphql-definition'; + +const logConfigWithoutRole = { + fieldLogLevel: FieldLogLevel.ALL, + excludeVerboseContent: true, +}; + +const logConfigWithRole = { + role: { + roleArn: 'arn:aws:iam::123456789012:role/MyRole', + roleName: 'MyRole', + } as IRole, + fieldLogLevel: FieldLogLevel.ALL, + excludeVerboseContent: true, +}; + +describe('log config', () => { + it('should create a log config with all properties even if we do not pass in a role', () => { + const stack = new Stack(); + + const api = new AmplifyGraphqlApi(stack, 'api', { + apiName: 'MyApi', + definition: AmplifyGraphqlDefinition.fromString(` + type Query { + dummy: String + } + `), + authorizationModes: { + defaultAuthorizationMode: 'API_KEY', + apiKeyConfig: { expires: cdk.Duration.days(7) }, + }, + logConfig: logConfigWithoutRole, + }); + + const createdLogConfig = api.resources.cfnResources.cfnGraphqlApi.logConfig as CfnGraphQLApi.LogConfigProperty; + + console.log('createdLogConfig', createdLogConfig); + + expect(createdLogConfig).toBeDefined(); + expect(createdLogConfig.cloudWatchLogsRoleArn).toBeDefined(); + expect(createdLogConfig.fieldLogLevel).toEqual(logConfigWithoutRole.fieldLogLevel); + expect(createdLogConfig.excludeVerboseContent).toEqual(logConfigWithoutRole.excludeVerboseContent); + }); + + it('should create a log config with the a role passed in', () => { + const stack = new Stack(); + + const api = new AmplifyGraphqlApi(stack, 'api', { + apiName: 'MyApi', + definition: AmplifyGraphqlDefinition.fromString(` + type Query { + dummy: String + } + `), + authorizationModes: { + defaultAuthorizationMode: 'API_KEY', + apiKeyConfig: { expires: cdk.Duration.days(7) }, + }, + logConfig: logConfigWithRole, + }); + + const createdLogConfig = api.resources.cfnResources.cfnGraphqlApi.logConfig as CfnGraphQLApi.LogConfigProperty; + + expect(createdLogConfig).toBeDefined(); + expect(createdLogConfig.cloudWatchLogsRoleArn).toEqual(logConfigWithRole.role.roleArn); + expect(createdLogConfig.fieldLogLevel).toEqual(logConfigWithRole.fieldLogLevel); + expect(createdLogConfig.excludeVerboseContent).toEqual(logConfigWithRole.excludeVerboseContent); + }); +}); diff --git a/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts b/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts index 946ebed301..b2121cba89 100644 --- a/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts +++ b/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts @@ -152,6 +152,7 @@ export class AmplifyGraphqlApi extends Construct { functionNameMap, outputStorageStrategy, dataStoreConfiguration, + logConfig, } = props; if (conflictResolution && dataStoreConfiguration) { @@ -220,6 +221,7 @@ export class AmplifyGraphqlApi extends Construct { rdsLayerMapping: undefined, rdsSnsTopicMapping: undefined, ...getDataSourceStrategiesProvider(definition), + logConfig, }; executeTransform(executeTransformConfig); diff --git a/packages/amplify-graphql-api-construct/src/types.ts b/packages/amplify-graphql-api-construct/src/types.ts index d1085c115b..db64093ef0 100644 --- a/packages/amplify-graphql-api-construct/src/types.ts +++ b/packages/amplify-graphql-api-construct/src/types.ts @@ -11,6 +11,7 @@ import { BaseDataSource, Code, FunctionRuntime, + LogConfig, } from 'aws-cdk-lib/aws-appsync'; import { CfnTable, ITable } from 'aws-cdk-lib/aws-dynamodb'; import { IRole, CfnRole } from 'aws-cdk-lib/aws-iam'; @@ -762,6 +763,12 @@ export interface AmplifyGraphqlApiProps { * For more information, refer to https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/ */ readonly dataStoreConfiguration?: DataStoreConfiguration; + + /** + * Specifies the logging configuration when writing GraphQL operations and tracing to Amazon CloudWatch for an AWS AppSync + * GraphQL API, refer to https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.CfnGraphQLApi.LogConfigProperty.html + */ + readonly logConfig?: LogConfig; } /** diff --git a/packages/amplify-graphql-transformer-core/API.md b/packages/amplify-graphql-transformer-core/API.md index 36a9607632..982ab3ef50 100644 --- a/packages/amplify-graphql-transformer-core/API.md +++ b/packages/amplify-graphql-transformer-core/API.md @@ -324,7 +324,7 @@ export class GraphQLTransform { // Warning: (ae-forgotten-export) The symbol "GraphQLApi" needs to be exported by the entry point index.d.ts // // (undocumented) - protected generateGraphQlApi(stackManager: StackManagerProvider, assetProvider: AssetProvider, synthParameters: SynthParameters, output: TransformerOutput, transformParameters: TransformParameters): GraphQLApi; + protected generateGraphQlApi(stackManager: StackManagerProvider, assetProvider: AssetProvider, synthParameters: SynthParameters, output: TransformerOutput, transformParameters: TransformParameters, logConfig?: LogConfig): GraphQLApi; // (undocumented) getLogs(): TransformerLog[]; // (undocumented) @@ -332,7 +332,7 @@ export class GraphQLTransform { // Warning: (ae-forgotten-export) The symbol "TransformOption" needs to be exported by the entry point index.d.ts // // (undocumented) - transform({ assetProvider, dataSourceStrategies, nestedStackProvider, parameterProvider, rdsLayerMapping, rdsSnsTopicMapping, schema, scope, sqlDirectiveDataSourceStrategies, synthParameters, }: TransformOption): void; + transform({ assetProvider, dataSourceStrategies, nestedStackProvider, parameterProvider, rdsLayerMapping, rdsSnsTopicMapping, schema, scope, sqlDirectiveDataSourceStrategies, synthParameters, logConfig, }: TransformOption): void; } // @public (undocumented) diff --git a/packages/amplify-graphql-transformer-core/src/graphql-api.ts b/packages/amplify-graphql-transformer-core/src/graphql-api.ts index 8bfccaf867..cd3dd8984b 100644 --- a/packages/amplify-graphql-transformer-core/src/graphql-api.ts +++ b/packages/amplify-graphql-transformer-core/src/graphql-api.ts @@ -289,22 +289,24 @@ export class GraphQLApi extends GraphqlApiBase implements GraphQLAPIProvider { } private setupLogConfig(config?: LogConfig) { - if (!config) { - return undefined; - } - const role = new Role(this, 'ApiLogsRole', { - assumedBy: new ServicePrincipal('appsync.amazonaws.com'), - managedPolicies: [ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSAppSyncPushToCloudWatchLogs')], - }); - setResourceName(role, { name: 'ApiLogsRole', setOnDefaultChild: true }); + if (!config) return undefined; return { - cloudWatchLogsRoleArn: role.roleArn, + cloudWatchLogsRoleArn: config.role?.roleArn ?? this.createApiLogsRole().roleArn, excludeVerboseContent: config.excludeVerboseContent, fieldLogLevel: config.fieldLogLevel, }; } + private createApiLogsRole(): Role { + const role = new Role(this, 'ApiLogsRole', { + assumedBy: new ServicePrincipal('appsync.amazonaws.com'), + managedPolicies: [ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSAppSyncPushToCloudWatchLogs')], + }); + setResourceName(role, { name: 'ApiLogsRole', setOnDefaultChild: true }); + return role; + } + private setupOpenIdConnectConfig(config?: OpenIdConnectConfig) { if (!config) { return undefined; diff --git a/packages/amplify-graphql-transformer-core/src/transformation/transform.ts b/packages/amplify-graphql-transformer-core/src/transformation/transform.ts index 0e4fdd93de..c579947bd4 100644 --- a/packages/amplify-graphql-transformer-core/src/transformation/transform.ts +++ b/packages/amplify-graphql-transformer-core/src/transformation/transform.ts @@ -16,7 +16,7 @@ import type { RDSLayerMappingProvider, RDSSNSTopicMappingProvider, } from '@aws-amplify/graphql-transformer-interfaces'; -import { AuthorizationMode, AuthorizationType } from 'aws-cdk-lib/aws-appsync'; +import { AuthorizationMode, AuthorizationType, LogConfig } from 'aws-cdk-lib/aws-appsync'; import { Aws, CfnOutput, Fn, Stack } from 'aws-cdk-lib'; import { EnumTypeDefinitionNode, @@ -95,6 +95,7 @@ export interface TransformOption extends DataSourceStrategiesProvider, RDSLayerM assetProvider: AssetProvider; synthParameters: SynthParameters; schema: string; + logConfig?: LogConfig; } export type StackMapping = { [resourceId: string]: string }; @@ -195,6 +196,7 @@ export class GraphQLTransform { scope, sqlDirectiveDataSourceStrategies, synthParameters, + logConfig, }: TransformOption): void { this.seenTransformations = {}; const parsedDocument = parse(schema); @@ -213,6 +215,7 @@ export class GraphQLTransform { stackMapping: this.stackMappingOverrides, synthParameters, transformParameters: this.transformParameters, + logConfig, }); const validDirectiveNameMap = this.transformers.reduce( (acc: any, t: TransformerPluginProvider) => ({ ...acc, [t.directive.name.value]: true }), @@ -306,6 +309,7 @@ export class GraphQLTransform { context.synthParameters, output, context.transformParameters, + context.logConfig, ); // generate resolvers @@ -345,6 +349,7 @@ export class GraphQLTransform { synthParameters: SynthParameters, output: TransformerOutput, transformParameters: TransformParameters, + logConfig?: LogConfig, ): GraphQLApi { // Todo: Move this to its own transformer plugin to support modifying the API // Like setting the auth mode and enabling logging and such @@ -365,6 +370,7 @@ export class GraphQLTransform { environmentName: env, disableResolverDeduping: this.transformParameters.disableResolverDeduping, assetProvider, + logConfig, }); const authModes = [authorizationConfig.defaultAuthorization, ...(authorizationConfig.additionalAuthorizationModes || [])].map( (mode) => mode?.authorizationType, diff --git a/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts b/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts index dcc03024e5..232741f78a 100644 --- a/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts +++ b/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts @@ -22,6 +22,7 @@ import { } from '@aws-amplify/graphql-transformer-interfaces'; import { DocumentNode } from 'graphql'; import { Construct } from 'constructs'; +import { LogConfig } from 'aws-cdk-lib/aws-appsync'; import { ResolverConfig } from '../config/transformer-config'; import { TransformerDataSourceManager } from './datasource'; import { TransformerOutput } from './output'; @@ -65,6 +66,7 @@ export interface TransformerContextConstructorOptions stackMapping: Record; synthParameters: SynthParameters; transformParameters: TransformParameters; + logConfig?: LogConfig; } export class TransformerContext implements TransformerContextProvider { @@ -104,6 +106,8 @@ export class TransformerContext implements TransformerContextProvider { public readonly inputDocument: DocumentNode; + public readonly logConfig?: LogConfig; + constructor(options: TransformerContextConstructorOptions) { const { assetProvider, @@ -120,6 +124,7 @@ export class TransformerContext implements TransformerContextProvider { stackMapping, synthParameters, transformParameters, + logConfig, } = options; this.authConfig = authConfig; this.sqlDirectiveDataSourceStrategies = sqlDirectiveDataSourceStrategies ?? []; @@ -138,6 +143,7 @@ export class TransformerContext implements TransformerContextProvider { this.assetProvider = assetProvider; this.synthParameters = synthParameters; this.transformParameters = transformParameters; + this.logConfig = logConfig; } /** diff --git a/packages/amplify-graphql-transformer/API.md b/packages/amplify-graphql-transformer/API.md index 01a514a4ef..f96d06345b 100644 --- a/packages/amplify-graphql-transformer/API.md +++ b/packages/amplify-graphql-transformer/API.md @@ -10,6 +10,7 @@ import { Construct } from 'constructs'; import type { DataSourceStrategiesProvider } from '@aws-amplify/graphql-transformer-interfaces'; import { GraphQLTransform } from '@aws-amplify/graphql-transformer-core'; import { IFunction } from 'aws-cdk-lib/aws-lambda'; +import { LogConfig } from 'aws-cdk-lib/aws-appsync'; import { NestedStackProvider } from '@aws-amplify/graphql-transformer-interfaces'; import type { RDSLayerMappingProvider } from '@aws-amplify/graphql-transformer-interfaces'; import type { RDSSNSTopicMappingProvider } from '@aws-amplify/graphql-transformer-interfaces'; @@ -39,6 +40,7 @@ export type ExecuteTransformConfig = TransformConfig & DataSourceStrategiesProvi parameterProvider?: TransformParameterProvider; assetProvider: AssetProvider; synthParameters: SynthParameters; + logConfig?: LogConfig; }; // @public (undocumented) diff --git a/packages/amplify-graphql-transformer/src/graphql-transformer.ts b/packages/amplify-graphql-transformer/src/graphql-transformer.ts index 9c00780974..eace2f75da 100644 --- a/packages/amplify-graphql-transformer/src/graphql-transformer.ts +++ b/packages/amplify-graphql-transformer/src/graphql-transformer.ts @@ -35,6 +35,7 @@ import { Construct } from 'constructs'; import { IFunction } from 'aws-cdk-lib/aws-lambda'; import { GenerationTransformer } from '@aws-amplify/graphql-generation-transformer'; import { ConversationTransformer } from '@aws-amplify/graphql-conversation-transformer'; +import { LogConfig } from 'aws-cdk-lib/aws-appsync'; /** * Arguments passed into a TransformerFactory @@ -121,6 +122,7 @@ export type ExecuteTransformConfig = TransformConfig & parameterProvider?: TransformParameterProvider; assetProvider: AssetProvider; synthParameters: SynthParameters; + logConfig?: LogConfig; }; /** @@ -164,6 +166,7 @@ export const executeTransform = (config: ExecuteTransformConfig): void => { scope, sqlDirectiveDataSourceStrategies, synthParameters, + logConfig, } = config; const printLog = printTransformerLog ?? defaultPrintTransformerLog; @@ -180,6 +183,7 @@ export const executeTransform = (config: ExecuteTransformConfig): void => { scope, sqlDirectiveDataSourceStrategies, synthParameters, + logConfig, }); } finally { transform.getLogs().forEach(printLog);