-
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
Stabilize AWS AppSync module #6836
Comments
/**
* Configuration for API Key authorization in AppSync
*/
export interface ApiKeyConfig extends AuthMode {
/**
* Unique description of the API key
*/
readonly apiKeyDesc: string;
/**
* The time from creation time after which the API key expires, using RFC3339 representation.
* It must be a minimum of 1 day and a maximum of 365 days from date of creation.
* Rounded down to the nearest hour.
* @default - 7 days from creation time
*/
readonly expires?: string;
} Unclear if Duration.days(365).toIsoString()
EDIT: Though attempting to pass in Workaround: const dateXDaysInFuture = (days: number) => {
const now = new Date()
now.setHours(0, 0, 0, 0)
now.setDate(now.getDate() + days)
return now.toISOString()
} |
EDIT: See also: Implementation of an AppSync import { Construct } from '@aws-cdk/core'
import { BaseDataSource } from '@aws-cdk/aws-appsync'
import { BaseDataSourceProps } from '@aws-cdk/aws-appsync/lib/graphqlapi'
/**
* An AppSync datasource backed by nothing
*
* @see https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-appsync.BaseDataSource.html
* @see https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-appsync.BaseDataSourceProps.html
* @see https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-local-resolvers.html
*/
export class NoneDataSource extends BaseDataSource {
constructor(scope: Construct, id: string, props: NoneDataSourceProps) {
super(scope, id, props, {
type: 'NONE',
})
}
}
/**
* Properties for an AppSync NoneDataSource
*/
export interface NoneDataSourceProps extends BaseDataSourceProps {
readonly serviceRole?: undefined
} Usage: new NoneDataSource(this, 'NoneDataSource', {
api: graphqlApi,
name: 'noneDataSource',
description: 'There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.',
}) |
Workaround: const apiKeyDesc = 'Bar'
const api = new GraphQLApi(this, 'FooApi', {
// ..snip..
additionalAuthorizationModes: [
{
apiKeyDesc,
// ..snip..
},
// ..snip..
})
const cfnApiKey = myapi.node.findChild(`${apiKeyDesc}ApiKey`) as CfnApiKey
new CfnOutput(this, 'RemoteControlApiPublicApiKey', {
value: cfnApiKey.attrApiKey,
}) |
@0xdevalias these are all good things to add to the list. Feel free to make new issues for each one and just link to them from here. We will use this as a staging area to work these out as we develop the constructs. |
The extra effort in filling out issue templates/jumping through those hoops tends to be far more than just adding a comment to an existing thread. |
Agreed. I'm okay with using this thread to propose new additions. Separate issues are ideal for tracking implementation and this issue can serve as a checklist that anyone can look at to see what's still in progress. I'll work on adding these. |
EDIT: disregard this bit. Wasn't watching/recompiling my typescript so it was using the old value.. The notes about passing in different date types to
|
@0xdevalias @MrArnoldPalmer added these all to the issue list to keep track of which ones are completed. also marked 🚀 when they are complete. |
@BryanPan342 i see code first schema definition in the list at the top, but nothing about improving the current diff'ing. Personally I don't need the code first schema, but a usable diff would be invaluable. |
@0xdevalias apologies i only read the edit section so i didnt see that part of the comment! ill add it to the issue list and make an issue for it |
Has this been put on hold - I can see that the project board is now closed? I'm keen to submit a few PRs with regards to the |
Is this missing a data source for a lambda alias? |
Add AWS_LAMBDA for AppySync authorization mode is a big one too. |
By the way I am using https://prisma-appsync.vercel.app/ (CDK integration demo here) and it is really really cool for creating an AppSync API out of my postgres database schema with TypeScript. It is a bit rough around the edges though and I hope integrating a solution like this in the future could be a little smoother, requiring less boilerplate. |
Change stability and maturity of `@aws-cdk/aws-appsync` constructs to stable. Fixes: #6836
Change stability and maturity of `@aws-cdk/aws-appsync` constructs to stable. Fixes: #6836 ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Add your +1 👍 to help us prioritize high-level constructs for this service
Overview:
AWS AppSync simplifies application development by letting you create a flexible API to securely access, manipulate, and combine data from one or more data sources. AppSync is a managed service that uses GraphQL to make it easy for applications to get exactly the data they need.
With AppSync, you can build scalable applications, including those requiring real-time updates, on a range of data sources such as NoSQL data stores, relational databases, HTTP APIs, and your custom data sources with AWS Lambda. For mobile and web apps, AppSync additionally provides local data access when devices go offline, and data synchronization with customizable conflict resolution, when they are back online.
AWS Docs
Maturity: Experimental
See the AWS Construct Library Module Lifecycle doc for more information about maturity levels.
Implementation:
See the CDK API Reference for more implementation details.
Base Level Implementation
Higher Level Implementation moved to external libraries
Code-first schema definition approach (issue: [aws-appsync] code-first schema generation #9305)mapping templates (see rfc)Issue list:
expires
prop in apiKeyConfig (pr: fix(appsync): strongly typeexpires
prop in apiKeyConfig #9122)finer grain schema diff (issue: [aws-appsync] schema diff doesn't provide fine grain information #9306)The text was updated successfully, but these errors were encountered: