Skip to content

Commit 7e8239b

Browse files
feat(appsync): add the grant method to the imported GraphqlApi (#29086)
### Issue Closes #23031. ### Reason for this change The `grantXx` methods are implemented in the `GraphqlApi` class, but it could not be used with an imported graphql api. ### Description of changes Moved the implementation of the `grantXx` method from the `GraphqlApi` class to the `GraphqlApiBase` class." ### Description of how you validated changes I've added both unit and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 19d75d6 commit 7e8239b

15 files changed

+2251
-114
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-grant-imported-api.js.snapshot/GraphqlGrantImportedApiIntegDefaultTestDeployAssertE072C285.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-grant-imported-api.js.snapshot/GraphqlGrantImportedApiIntegDefaultTestDeployAssertE072C285.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-grant-imported-api.js.snapshot/aws-appsync-integ.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"Resources": {
3+
"PoolD3F588B8": {
4+
"Type": "AWS::Cognito::UserPool",
5+
"Properties": {
6+
"AccountRecoverySetting": {
7+
"RecoveryMechanisms": [
8+
{
9+
"Name": "verified_phone_number",
10+
"Priority": 1
11+
},
12+
{
13+
"Name": "verified_email",
14+
"Priority": 2
15+
}
16+
]
17+
},
18+
"AdminCreateUserConfig": {
19+
"AllowAdminCreateUserOnly": true
20+
},
21+
"EmailVerificationMessage": "The verification code to your new account is {####}",
22+
"EmailVerificationSubject": "Verify your new account",
23+
"SmsVerificationMessage": "The verification code to your new account is {####}",
24+
"UserPoolName": "myPool",
25+
"VerificationMessageTemplate": {
26+
"DefaultEmailOption": "CONFIRM_WITH_CODE",
27+
"EmailMessage": "The verification code to your new account is {####}",
28+
"EmailSubject": "Verify your new account",
29+
"SmsMessage": "The verification code to your new account is {####}"
30+
}
31+
},
32+
"UpdateReplacePolicy": "Delete",
33+
"DeletionPolicy": "Delete"
34+
},
35+
"ApiF70053CD": {
36+
"Type": "AWS::AppSync::GraphQLApi",
37+
"Properties": {
38+
"AdditionalAuthenticationProviders": [
39+
{
40+
"AuthenticationType": "AWS_IAM"
41+
}
42+
],
43+
"AuthenticationType": "AMAZON_COGNITO_USER_POOLS",
44+
"Name": "Integ_Test_IAM",
45+
"UserPoolConfig": {
46+
"AwsRegion": {
47+
"Ref": "AWS::Region"
48+
},
49+
"DefaultAction": "ALLOW",
50+
"UserPoolId": {
51+
"Ref": "PoolD3F588B8"
52+
}
53+
}
54+
}
55+
},
56+
"ApiSchema510EECD7": {
57+
"Type": "AWS::AppSync::GraphQLSchema",
58+
"Properties": {
59+
"ApiId": {
60+
"Fn::GetAtt": [
61+
"ApiF70053CD",
62+
"ApiId"
63+
]
64+
},
65+
"Definition": "type test @aws_iam {\n id: String!\n version: String!\n}\n\ntype Query {\n getTest(id: String!): test\n getTests: [ test! ]\n @aws_iam \n}\n\ninput TestInput {\n version: String!\n}\n\ntype Mutation {\n addTest(input: TestInput!): test\n @aws_iam\n}\n"
66+
}
67+
}
68+
},
69+
"Outputs": {
70+
"ExportsOutputFnGetAttApiF70053CDApiIdF185726B": {
71+
"Value": {
72+
"Fn::GetAtt": [
73+
"ApiF70053CD",
74+
"ApiId"
75+
]
76+
},
77+
"Export": {
78+
"Name": "aws-appsync-integ:ExportsOutputFnGetAttApiF70053CDApiIdF185726B"
79+
}
80+
}
81+
},
82+
"Parameters": {
83+
"BootstrapVersion": {
84+
"Type": "AWS::SSM::Parameter::Value<String>",
85+
"Default": "/cdk-bootstrap/hnb659fds/version",
86+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
87+
}
88+
},
89+
"Rules": {
90+
"CheckBootstrapVersion": {
91+
"Assertions": [
92+
{
93+
"Assert": {
94+
"Fn::Not": [
95+
{
96+
"Fn::Contains": [
97+
[
98+
"1",
99+
"2",
100+
"3",
101+
"4",
102+
"5"
103+
],
104+
{
105+
"Ref": "BootstrapVersion"
106+
}
107+
]
108+
}
109+
]
110+
},
111+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
112+
}
113+
]
114+
}
115+
}
116+
}

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-grant-imported-api.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-grant-imported-api.js.snapshot/imported-stack.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)