How to use the @aws-cdk/core.App function in @aws-cdk/core

To help you get started, we’ve selected a few @aws-cdk/core 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 josephluck / internote / ui / deploy / index.ts View on Github external
//   {
  //     url: bucket.bucketWebsiteUrl,
  //     private: true,
  //     pathPatterns: {
  //       "_next/*": {
  //         ttl: 86400
  //       },
  //       "static/*": {
  //         ttl: 86400
  //       }
  //     }
  //   }
  // ];
}

const app = new cdk.App();
buildMyStack(app, "internote-ui", {});
app.synth();
github aws / aws-cdk / packages / @aws-cdk / custom-resources / example / index.ts View on Github external
const resource = new DemoResource(this, 'DemoResource', {
            message: 'CustomResource says hello',
        });

        // Bucket with an invalid name will fail the deployment and cause a rollback
        const bucket = new s3.BucketResource(this, 'FailingBucket', {
            bucketName: 'hello!@#$^'
        });

        // Make sure the rollback gets triggered only after the custom resource has been fully created.
        bucket.addDependency(resource);
    }
}

const app = new App(process.argv);

new SucceedingStack(app, 'SucceedingStack');
new FailCreationStack(app, 'FailCreationStack');
new FailAfterCreatingStack(app, 'FailAfterCreatingStack');

process.stdout.write(app.run());
github deepalert / deepalert / test / workflow / bin / stack.ts View on Github external
},
    });

    table.grantReadWriteData(testInspector);
    table.grantReadWriteData(testEmitter);
    props.deepalert.findingQueue.grantSendMessages(testInspector);
    props.deepalert.attributeQueue.grantSendMessages(testInspector);
  }
}

const deepalertStackName =
  process.env.DEEPALERT_TEST_STACK_NAME || "DeepAlertTestStack";
const workflowStackName =
  process.env.DEEPALERT_WORKFLOW_STACK_NAME || "DeepAlertTestWorkflowStack";

const app = new cdk.App();
const deepalert = new DeepAlertStack(app, deepalertStackName, {
  stackName: deepalertStackName,
  apiKeyPath: "./apikey.json",
  inspectDelay: cdk.Duration.seconds(1),
  reviewDelay: cdk.Duration.seconds(5),
  logLevel: "DEBUG",
});
new WorkflowStack(app, workflowStackName, {
  deepalert: deepalert,
  stackName: workflowStackName,
});
github aws / aws-cdk / packages / decdk / bin / decdk.ts View on Github external
async function main() {
  const args = require('yargs')
    .usage('$0 ', 'Hydrate a deconstruct file', (yargs: any) => {
      yargs.positional('filename', { type: 'string', required: true });
    })
    .parse();

  const templateFile = args.filename;
  const template = await readTemplate(templateFile);
  const stackName = stackNameFromFileName(templateFile);
  const typeSystem = await loadTypeSystem();

  const app = new cdk.App();
  new DeclarativeStack(app, stackName, { template, typeSystem });
  app.synth();
}
github nathanpeck / greeter-cdk / index.js View on Github external
port: 80,
      targets: [greeterService]
    });

    this.internalDNS = new cdk.CfnOutput(this, 'InternalDNS', {
      exportName: 'greeter-app-internal',
      value: internalLB.loadBalancerDnsName
    });
    this.externalDNS = new cdk.CfnOutput(this, 'ExternalDNS', {
      exportName: 'greeter-app-external',
      value: externalLB.loadBalancerDnsName
    });
  }
}

const app = new cdk.App();
const greeting = new GreetingStack(app, 'greeting-stack');

app.synth();
github cloudcomponents / cdk-components / examples / codepipeline-slack-approval-example / bin / codepipeline-slack-approval.ts View on Github external
#!/usr/bin/env node
import { App } from '@aws-cdk/core';
import { config } from 'dotenv';

import { CodepipelineSlackApprovalStack } from '../lib/codepipeline-slack-approval-stack';

config();

const app = new App();

new CodepipelineSlackApprovalStack(app, 'CodepipelineSlackApprovalStack', {
    env: {
        region: process.env.CDK_DEFAULT_REGION,
        account: process.env.CDK_DEFAULT_ACCOUNT,
    },
});
github cloudcomponents / cdk-components / examples / static-website-example / bin / static-website.ts View on Github external
#!/usr/bin/env node
import { App } from '@aws-cdk/core';
import { StaticWebsiteStack } from '../lib/static-website-stack';

const app = new App();
new StaticWebsiteStack(app, 'StaticWebsiteStack', {
    env: {
        region: process.env.CDK_DEFAULT_REGION,
        account: process.env.CDK_DEFAULT_ACCOUNT,
    },
});
github cloudcomponents / cdk-components / examples / github-webhook-example / bin / github-webhook.ts View on Github external
#!/usr/bin/env node
import { App } from '@aws-cdk/core';
import { config } from 'dotenv';

import { GithubWebhookStack } from '../lib/github-webhook-stack';

config();

const app = new App();

new GithubWebhookStack(app, 'GithubWebhookStack', {
    env: {
        region: process.env.CDK_DEFAULT_REGION,
        account: process.env.CDK_DEFAULT_ACCOUNT,
    },
});