-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make AppSync and MappingTemplate L2-constructs work with CodePipeline deployments #8052
Comments
Is this covered by aws/aws-cdk-rfcs#49? I can't deploy using CI/CD at the moment because of missing assets support 😞 |
It looks like CloudFormations already has support for using s3 locations: resolver docs and schema docs. Seems like the most minimal solution would be to offer a Both would be all would be strings as that's what the CloudFormation @asterikx what do you think? I know this was a little different with the proposed solution. |
@BryanPan342 Thanks for you response.
I don't completely understand. Could you maybe sketch your solution? My idea was that the CDK would take care of uploading the referenced schema/resolver files to S3 and use the corresponding S3 locations (strings) as input parameters to the synthesized CFN template during deployment. Very similar to how Since const api = new appsync.GraphQLApi(this, 'GraphQLApi', {
name: `GraphQLApi`,
schemaDefinition: appsync.SchemaDefinition.fromAsset('./schema.graphql'),
});
someDataSource.createQueryResolver({
field: 'getHello',
requestTemplate: appsync.MappingTemplate.fromAsset('./resolvers/getHello-request-mapping-template.vtl'),
responseTemplate: appsync.MappingTemplate.fromAsset('./resolvers/getHello-response-mapping-template.vtl'),
}); |
Ah I see. The feature you are suggesting is for CDK to upload assets with AppSync and route the S3 location into the CloudFormation definition. I'm going to investigate this further, but what's the issue of using something like this for const api = new appsync.GraphQLApi(this, 'GraphQLApi', {
name: `GraphQLApi`,
schemaDefinitionFile: path.join(__dirname, 'schema.graphql'),
}); |
Yes.
True, this was a conceptual misunderstanding from my side. Indeed aws-cdk/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts Lines 357 to 363 in 9867555
I thought Also, |
@asterikx this is a really good point that we have also talked about. For now, we thought that it would be okay not to have s3 asset publishing because we haven't gotten an issue raised about size yet. And even if I dont quite understand this part.
I'm not an expert on |
With the current implementation, there are no assets. Sorry for the confusion, I was hypothesizing here. If we were to support I'm fine with closing this for now. There might be more critical issues at this time. |
Ah I see. I think this discussion would be great to keep open. I think if we could change the issue name/message to reflect our discussion that would be fantastic! |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Deploy an AppSync API with a schema definition file and resolver mapping templates in a CodePipeline using CloudFormation actions.
Use Case
I want to deploy an AppSync API in a CodePipeline and I don't want to inline the schema into the CDK code because I want to generate model classes from it.
Currently, the schema definition must be provided either as a string or as an asset (not yet supported by CloudFormations actions).
It is not possible to provide S3-locations without redefining the current L2-construct.
CDK source code:
aws-cdk/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts
Lines 236 to 243 in bf0113b
Proposed Solution
Provide S3-locations of the schema definition file and any resolver mapping templates to the synthesized template using CloudFormation parameters, similar to CfnParametersCode (see example here).
Since the number of mapping templates can be very high, a solution that requires only one parameter representing the S3-folder containing the mapping templates would be useful.
Creating an AppSync API and mapping templates could look like:
Other
Related question on Gitter.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: