How to use the @aws-cdk/aws-codebuild.ComputeType function in @aws-cdk/aws-codebuild

To help you get started, we’ve selected a few @aws-cdk/aws-codebuild 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 seagull-js / seagull / packages / deploy-aws / src / seagull_stack.ts View on Github external
private createProjectConfig(config: BuildStageConfig) {
    const allowedComputeTypeSizes = ['SMALL', 'MEDIUM', 'LARGE']
    const { build, env, install, postBuild, role } = config
    const buildImage = CB.LinuxBuildImage.UBUNTU_14_04_NODEJS_8_11_0
    const computeType = allowedComputeTypeSizes.includes(config.computeTypeSize)
      ? `BUILD_GENERAL1_${config.computeTypeSize}`
      : CB.ComputeType.Small
    const phases = { build, install, post_build: postBuild }

    return {
      buildSpec: {
        artifacts: config.outputArtifacts,
        env,
        phases,
        version: '0.2',
      },
      environment: { buildImage, computeType },
      environmentVariables: mapEnvironmentVariables(env.variables),
      role,
    } as CB.ProjectProps
  }