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 { CustomResource } from '@aws-cdk/core';
    import * as logs from '@aws-cdk/aws-logs';
    import * as iam from '@aws-cdk/aws-iam';
    import * as cr from '@aws-cdk/custom-resources';
    
    const onEvent = new lambda.Function(this, 'MyHandler', { /* ... */ });
    
    const myRole = new iam.Role(this, 'MyRole', { /* ... */ });
    
    const myProvider = new cr.Provider(this, 'MyProvider', {
      onEventHandler: onEvent,
      isCompleteHandler: isComplete,        // optional async "waiter"
      logRetention: logs.RetentionDays.ONE_DAY,   // default is INFINITE
      role: myRole, // must be assumable by the `lambda.amazonaws.com` service principal
    });
    
    new CustomResource(this, 'Resource1', { serviceToken: myProvider.serviceToken });
    new CustomResource(this, 'Resource2', { serviceToken: myProvider.serviceToken });
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as iam from '@aws-cdk/aws-iam';
    import * as logs from '@aws-cdk/aws-logs';
    import * as cdk from '@aws-cdk/core';
    import * as custom_resources from '@aws-cdk/custom-resources';
    
    declare const awsCustomResourcePolicy: custom_resources.AwsCustomResourcePolicy;
    declare const parameters: any;
    declare const physicalResourceId: custom_resources.PhysicalResourceId;
    declare const role: iam.Role;
    
    const awsCustomResource = new custom_resources.AwsCustomResource(this, 'MyAwsCustomResource', {
      policy: awsCustomResourcePolicy,
    
      // the properties below are optional
      functionName: 'functionName',
      installLatestAwsSdk: false,
      logRetention: logs.RetentionDays.ONE_DAY,
      onCreate: {
        action: 'action',
        service: 'service',
    
        // the properties below are optional
        apiVersion: 'apiVersion',
        assumedRoleArn: 'assumedRoleArn',
        ignoreErrorCodesMatching: 'ignoreErrorCodesMatching',
        outputPath: 'outputPath',
        outputPaths: ['outputPaths'],
        parameters: parameters,
        physicalResourceId: physicalResourceId,
        region: 'region',
      },
      onDelete: {
        action: 'action',
        service: 'service',
    
        // the properties below are optional
        apiVersion: 'apiVersion',
        assumedRoleArn: 'assumedRoleArn',
        ignoreErrorCodesMatching: 'ignoreErrorCodesMatching',
        outputPath: 'outputPath',
        outputPaths: ['outputPaths'],
        parameters: parameters,
        physicalResourceId: physicalResourceId,
        region: 'region',
      },
      onUpdate: {
        action: 'action',
        service: 'service',
    
        // the properties below are optional
        apiVersion: 'apiVersion',
        assumedRoleArn: 'assumedRoleArn',
        ignoreErrorCodesMatching: 'ignoreErrorCodesMatching',
        outputPath: 'outputPath',
        outputPaths: ['outputPaths'],
        parameters: parameters,
        physicalResourceId: physicalResourceId,
        region: 'region',
      },
      resourceType: 'resourceType',
      role: role,
      timeout: cdk.Duration.minutes(30),
    });
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as custom_resources from '@aws-cdk/custom-resources';
    
    const awsCustomResourcePolicy = custom_resources.AwsCustomResourcePolicy.fromSdkCalls({
      resources: ['resources'],
    });
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as custom_resources from '@aws-cdk/custom-resources';
    
    const physicalResourceIdReference = new custom_resources.PhysicalResourceIdReference();
    
    Docs
    0
  • const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', {
      codeDirectory: `${__dirname}/my-handler`,
      runtime: CustomResourceProviderRuntime.NODEJS_12_X,
      policyStatements: [
        {
          Effect: 'Allow',
          Action: 's3:PutObject*',
          Resource: '*',
        }
      ],
    });
    
    Docs
    0
  • const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', {
      codeDirectory: `${__dirname}/my-handler`,
      runtime: CustomResourceProviderRuntime.NODEJS_12_X,
    });
    
    const roleArn = provider.roleArn;
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples