How to use the @aws-cdk/aws-codepipeline-actions.S3SourceAction function in @aws-cdk/aws-codepipeline-actions

To help you get started, we’ve selected a few @aws-cdk/aws-codepipeline-actions 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 fourTheorem / slic-starter / cicd / lib / module-pipeline.ts View on Github external
moduleBuildProject,
      moduleDeployProject,
      pipelineRole,
      ...rest
    } = props

    super(scope, id, {
      pipelineName: `${moduleName}_${stageName}_pipeline`,
      artifactBucket: artifactsBucket,
      role: pipelineRole,
      ...rest
    })

    const sourceOutputArtifact = new Artifact()

    const sourceAction = new S3SourceAction({
      bucket: artifactsBucket,
      bucketKey: `${stageName}_module_pipelines/module_source/${moduleName}.zip`,
      output: sourceOutputArtifact,
      trigger: S3Trigger.EVENTS, // Use EVENTS instead of POLL to avoid triggering. We won't set up CloudTrail for S3.
      actionName: `${moduleName}_src`,
      role: pipelineRole
    })

    this.addStage({
      stageName: 'Source',
      actions: [sourceAction]
    })
    const environmentVars = {
      CROSS_ACCOUNT_ID: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: `${config.accountIds[stageName]}`
github fourTheorem / slic-starter / cicd / lib / orchestrator-pipeline.ts View on Github external
assumedBy: new ServicePrincipal('codebuild.amazonaws.com')
      }
    )
    orchestratorCodeBuildRole.addToPolicy(
      new PolicyStatement({
        actions: [
          'codepipeline:GetPipelineExecution',
          'codepipeline:StartPipelineExecution'
        ],
        resources: ['*']
      })
    )

    const sourceOutputArtifact = new Artifact()

    const sourceAction = new S3SourceAction({
      bucket: artifactsBucket,
      bucketKey: SLIC_PIPELINE_SOURCE_ARTIFACT,
      output: sourceOutputArtifact,
      trigger: S3Trigger.POLL,
      actionName: 'SLICSource'
    })

    this.addStage({
      stageName: 'Source',
      actions: [sourceAction]
    })

    this.addDeployStage(
      StageName.stg,
      orchestratorCodeBuildRole,
      sourceOutputArtifact