constructor()

in cdk/lib/pipeline-stack.ts [35:74]


  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const sourceArtifact = new codepipeline.Artifact();
    const cloudAssemblyArtifact = new codepipeline.Artifact();

    const repo = codecommit.Repository.fromRepositoryName(
      this, 
      'ImportedRepo',
      'iot-workshop-for-pet-tracking-and-geofencing');

    const pipeline = new CdkPipeline(this, 'Pipeline', {
      crossAccountKeys: false,
      pipelineName: 'PetTrackerPipeline',
      cloudAssemblyArtifact,

      sourceAction: new codepipeline_actions.CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository: repo,
        branch: 'develop',
        output: sourceArtifact,
      }),

      synthAction: SimpleSynthAction.standardNpmSynth({
        sourceArtifact,
        cloudAssemblyArtifact,

        subdirectory: 'cdk',
        buildCommand: 'cd lib/position-lambda && npm install && cd ../../ && npm install && npm run build',
        synthCommand: 'npx cdk synth PetTrackerPipelineStack'
      }),
    });

    pipeline.addApplicationStage(new PetTrackerApplication(this, 'Stg', {
      env: {
        account: props?.env?.account,
        region: props?.env?.region
      }
    }));
  }