How to use the cloudform-types.AppSync.DataSource function in cloudform-types

To help you get started, we’ve selected a few cloudform-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public noneDataSource() {
    return new AppSync.DataSource({
      ApiId: Fn.GetAtt(ResourceConstants.RESOURCES.GraphQLAPILogicalID, 'ApiId'),
      Name: 'NONE',
      Type: 'NONE',
    });
  }
github aws-amplify / amplify-cli / packages / graphql-function-transformer / src / FunctionTransformer.ts View on Github external
datasource = (name: string, region: string): any => {
    return new AppSync.DataSource({
      ApiId: Fn.Ref(ResourceConstants.PARAMETERS.AppSyncApiId),
      Name: FunctionResourceIDs.FunctionDataSourceID(name, region),
      Type: 'AWS_LAMBDA',
      ServiceRoleArn: Fn.GetAtt(FunctionResourceIDs.FunctionIAMRoleID(name, region), 'Arn'),
      LambdaConfig: {
        LambdaFunctionArn: lambdaArnResource(name, region),
      },
    }).dependsOn(FunctionResourceIDs.FunctionIAMRoleID(name, region));
  };
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / resources.ts View on Github external
public makeDynamoDBDataSource(tableId: string, iamRoleLogicalID: string, typeName: string, isSyncEnabled: boolean = false) {
    return new AppSync.DataSource({
      ApiId: Fn.GetAtt(ResourceConstants.RESOURCES.GraphQLAPILogicalID, 'ApiId'),
      Name: tableId,
      Type: 'AMAZON_DYNAMODB',
      ServiceRoleArn: Fn.GetAtt(iamRoleLogicalID, 'Arn'),
      DynamoDBConfig: {
        AwsRegion: Refs.Region,
        TableName: this.dynamoDBTableName(typeName),
        ...(isSyncEnabled && {
          DeltaSyncConfig: SyncUtils.syncDataSourceConfig(),
          Versioned: true,
        }),
      },
    }).dependsOn([iamRoleLogicalID]);
  }
github aws-amplify / amplify-cli / packages / graphql-http-transformer / src / resources.ts View on Github external
public makeHttpDataSource(baseURL: string) {
    return new AppSync.DataSource({
      ApiId: Fn.GetAtt(ResourceConstants.RESOURCES.GraphQLAPILogicalID, 'ApiId'),
      Name: HttpResourceIDs.HttpDataSourceID(baseURL),
      Type: 'HTTP',
      HttpConfig: {
        Endpoint: this.replaceEnv(baseURL),
      },
    });
  }
github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public noneDataSource() {
        return new AppSync.DataSource({
            ApiId: Fn.GetAtt(ResourceConstants.RESOURCES.GraphQLAPILogicalID, 'ApiId'),
            Name: 'NONE',
            Type: 'NONE'
        })
    }