How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import * as es from '@aws-cdk/aws-elasticsearch';
    
    const user = new iam.User(this, 'User');
    const domain = new es.Domain(this, 'Domain', {
      version: es.ElasticsearchVersion.V7_1,
      removalPolicy: RemovalPolicy.DESTROY,
      fineGrainedAccessControl: { masterUserArn: user.userArn },
      encryptionAtRest: { enabled: true },
      nodeToNodeEncryption: true,
      enforceHttps: true,
    });
    
    declare const api: appsync.GraphqlApi;
    const ds = api.addElasticsearchDataSource('ds', domain);
    
    ds.createResolver({
      typeName: 'Query',
      fieldName: 'getTests',
      requestMappingTemplate: appsync.MappingTemplate.fromString(JSON.stringify({
        version: '2017-02-28',
        operation: 'GET',
        path: '/id/post/_search',
        params: {
          headers: {},
          queryString: {},
          body: { from: 0, size: 50 },
        },
      })),
      responseMappingTemplate: appsync.MappingTemplate.fromString(`[
        #foreach($entry in $context.result.hits.hits)
        #if( $velocityCount > 1 ) , #end
        $utils.toJson($entry.get("_source"))
        #end
      ]`),
    });
    
    Docs
  • // create a pipeline
    import * as codecommit from '@aws-cdk/aws-codecommit';
    
    const pipeline = new codepipeline.Pipeline(this, 'Pipeline');
    
    // add a stage
    const sourceStage = pipeline.addStage({ stageName: 'Source' });
    
    // add a source action to the stage
    declare const repo: codecommit.Repository;
    declare const sourceArtifact: codepipeline.Artifact;
    sourceStage.addAction(new codepipeline_actions.CodeCommitSourceAction({
    actionName: 'Source',
    output: sourceArtifact,
    repository: repo,
    }));
    
    // ... add more stages
    
    Docs
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as cx_api from '@aws-cdk/cx-api';
    
    declare const cloudAssemblyBuilder: cx_api.CloudAssemblyBuilder;
    const cloudAssemblyBuilder = new cx_api.CloudAssemblyBuilder(/* all optional props */ 'outdir', /* all optional props */ {
      assetOutdir: 'assetOutdir',
      parentBuilder: cloudAssemblyBuilder,
    });
    
    Docs
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as cx_api from '@aws-cdk/cx-api';
    
    declare const cloudAssemblyBuilder: cx_api.CloudAssemblyBuilder;
    
    const cloudAssemblyBuilder = new cx_api.CloudAssemblyBuilder(/* all optional props */ 'outdir', /* all optional props */ {
      assetOutdir: 'assetOutdir',
      parentBuilder: cloudAssemblyBuilder,
    });
    
    Docs
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as apigateway from '@aws-cdk/aws-apigateway';
    import * as lambda_event_sources from '@aws-cdk/aws-lambda-event-sources';
    
    declare const authorizer: apigateway.Authorizer;
    declare const model: apigateway.Model;
    declare const requestValidator: apigateway.RequestValidator;
    const apiEventSource = new lambda_event_sources.ApiEventSource('method', 'path', /* all optional props */ {
      apiKeyRequired: false,
      authorizationScopes: ['authorizationScopes'],
      authorizationType: apigateway.AuthorizationType.NONE,
      authorizer: authorizer,
      methodResponses: [{
        statusCode: 'statusCode',
    
        // the properties below are optional
        responseModels: {
          responseModelsKey: model,
        },
        responseParameters: {
          responseParametersKey: false,
        },
      }],
      operationName: 'operationName',
      requestModels: {
        requestModelsKey: model,
      },
      requestParameters: {
        requestParametersKey: false,
      },
      requestValidator: requestValidator,
      requestValidatorOptions: {
        requestValidatorName: 'requestValidatorName',
        validateRequestBody: false,
        validateRequestParameters: false,
      },
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples