text: const { AwsCdkTypeScriptApp, DevEnvironmentDockerImage, Gitpod } = require('projen');
  
  const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN';
  
  const project = new AwsCdkTypeScriptApp({
    cdkVersion: '1.82.0',
    name: 'eks-cicd-codebuild',
    cdkDependencies: [
      '@aws-cdk/aws-ec2',
      '@aws-cdk/aws-ecr',
      '@aws-cdk/aws-eks',
      '@aws-cdk/aws-iam',
      '@aws-cdk/aws-codebuild',
      '@aws-cdk/aws-codecommit',
      '@aws-cdk/aws-events-targets',
    ],
    depsUpgradeOptions: {
      ignoreProjen: false,
      workflowOptions: {
        labels: ['auto-approve', 'auto-merge'],
        secret: AUTOMATION_TOKEN,
      },
    },
    autoApproveOptions: {
      secret: 'GITHUB_TOKEN',
      allowedUsernames: ['pahud'],
    },
    defaultReleaseBranch: 'main',
  });
  
  project.package.addField('resolutions', {
    'pac-resolver': '^5.0.0',
    'set-value': '^4.0.1',
    'ansi-regex': '^5.0.1',
  });
  
  
  const gitpodPrebuild = project.addTask('gitpod:prebuild', {
    description: 'Prebuild setup for Gitpod',
  });
  // install and compile only, do not test or package.
  gitpodPrebuild.exec('yarn install --frozen-lockfile --check-files');
  gitpodPrebuild.exec('npx projen compile');
  
  let gitpod = new Gitpod(project, {
    dockerImage: DevEnvironmentDockerImage.fromImage('public.ecr.aws/pahudnet/gitpod-workspace:latest'),
    prebuilds: {
      addCheck: true,
      addBadge: true,
      addLabel: true,
      branches: true,
      pullRequests: true,
      pullRequestsFromForks: true,
    },
  });
  
  gitpod.addCustomTask({
    init: 'yarn gitpod:prebuild',
    // always upgrade after init
    command: 'npx projen upgrade',
  });
  
  gitpod.addVscodeExtensions(
    'dbaeumer.vscode-eslint',
    'ms-azuretools.vscode-docker',
    'AmazonWebServices.aws-toolkit-vscode',
  );
  
  const common_exclude = ['cdk.out', 'cdk.context.json', 'dockerAssets.d', 'yarn-error.log'];
  project.npmignore.exclude('images', ...common_exclude);
  project.gitignore.exclude(...common_exclude);
  
  
  project.synth();
  