How to use the @aws-cdk/aws-codebuild.BuildEnvironmentVariableType.PLAINTEXT 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 fourTheorem / slic-starter / cicd / lib / module-pipeline.ts View on Github external
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]}`
      },
      TARGET_REGION: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: `${config.defaultRegions[stageName]}`
      },
      SLIC_STAGE: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: stageName
      },
      MODULE_NAME: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: moduleName
      },
      ...projectEnvironmentVars
    }
github fourTheorem / slic-starter / cicd / lib / module-pipeline.ts View on Github external
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]}`
      },
      TARGET_REGION: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: `${config.defaultRegions[stageName]}`
      },
      SLIC_STAGE: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: stageName
      },
      MODULE_NAME: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: moduleName
      },
      ...projectEnvironmentVars
    }

    const moduleBuildOutputArtifact = new Artifact()
    const moduleBuildAction = new CodeBuildAction({
      actionName: 'Build',
github fourTheorem / slic-starter / cicd / lib / projects / e2e-test-project.ts View on Github external
]
      })
    )

    super(scope, id, {
      projectName: `${props.stageName}E2ETest`,
      environment: {
        buildImage: LinuxBuildImage.STANDARD_2_0
      },
      environmentVariables: {
        SLIC_STAGE: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: props.stageName
        },
        CROSS_ACCOUNT_ID: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: `${config.accountIds[props.stageName]}`
        },
        MAILOSAUR_API_KEY: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: '/test/mailosaur/apiKey'
        },
        MAILOSAUR_SERVER_ID: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: '/test/mailosaur/serverId'
        }
      },
      buildSpec: BuildSpec.fromSourceFilename('e2e-tests/buildspec.yml'),
      role,
      ...rest
    })
  }
github fourTheorem / slic-starter / cicd / lib / projects / integration-test-project.ts View on Github external
actions: ['ssm:GetParameters'],
        resources: [
          `arn:aws:ssm:${config.region}:${
            config.accountIds.cicd
          }:parameter/test/*`
        ]
      })
    )
    super(scope, id, {
      projectName: `${props.stageName}IntegrationTest`,
      environment: {
        buildImage: LinuxBuildImage.STANDARD_2_0
      },
      environmentVariables: {
        SLIC_STAGE: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: props.stageName
        },
        CROSS_ACCOUNT_ID: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: `${config.accountIds[props.stageName]}`
        },
        MAILOSAUR_API_KEY: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: '/test/mailosaur/apiKey'
        },
        MAILOSAUR_SERVER_ID: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: '/test/mailosaur/serverId'
        }
      },
      buildSpec: BuildSpec.fromSourceFilename(
github fourTheorem / slic-starter / cicd / lib / projects / integration-test-project.ts View on Github external
}:parameter/test/*`
        ]
      })
    )
    super(scope, id, {
      projectName: `${props.stageName}IntegrationTest`,
      environment: {
        buildImage: LinuxBuildImage.STANDARD_2_0
      },
      environmentVariables: {
        SLIC_STAGE: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: props.stageName
        },
        CROSS_ACCOUNT_ID: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: `${config.accountIds[props.stageName]}`
        },
        MAILOSAUR_API_KEY: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: '/test/mailosaur/apiKey'
        },
        MAILOSAUR_SERVER_ID: {
          type: BuildEnvironmentVariableType.PARAMETER_STORE,
          value: '/test/mailosaur/serverId'
        }
      },
      buildSpec: BuildSpec.fromSourceFilename(
        'integration-tests/buildspec.yml'
      ),
      role,
      ...rest
github fourTheorem / slic-starter / cicd / lib / projects / project-environment.ts View on Github external
import config from '../../config'

import { BuildEnvironmentVariableType } from '@aws-cdk/aws-codebuild'

export const projectEnvironmentVars: any = {}

if (config.nsDomain) {
  projectEnvironmentVars.SLIC_NS_DOMAIN = {
    type: BuildEnvironmentVariableType.PLAINTEXT,
    value: config.nsDomain
  }
} else {
  projectEnvironmentVars.SITE_BUCKET_PREFIX = {
    type: BuildEnvironmentVariableType.PLAINTEXT,
    value: config.siteBucketPrefix
  }
}
github fourTheorem / slic-starter / cicd / lib / cicd-stack.ts View on Github external
pipelineRole
        })
      })
    })

    new SourceProject(this, 'sourceProject', {
      projectName: 'SLICPipelineSource',
      role: sourceCodeBuildRole,
      bucket: artifactsBucket,
      environmentVariables: {
        ARTIFACTS_BUCKET_NAME: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: artifactsBucket.bucketName
        },
        ARTIFACTS_BUCKET_ARN: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: artifactsBucket.bucketArn
        }
      }
    })

    new PipelineDashboard(this, 'pipeline-dashboard')
  }
}
github fourTheorem / slic-starter / cicd / lib / cicd-stack.ts View on Github external
moduleBuildProject,
          moduleDeployProject,
          moduleName,
          stageName,
          pipelineRole
        })
      })
    })

    new SourceProject(this, 'sourceProject', {
      projectName: 'SLICPipelineSource',
      role: sourceCodeBuildRole,
      bucket: artifactsBucket,
      environmentVariables: {
        ARTIFACTS_BUCKET_NAME: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: artifactsBucket.bucketName
        },
        ARTIFACTS_BUCKET_ARN: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: artifactsBucket.bucketArn
        }
      }
    })

    new PipelineDashboard(this, 'pipeline-dashboard')
  }
}
github fourTheorem / slic-starter / cicd / lib / projects / orchestrator-deploy-project.ts View on Github external
constructor(
    scope: Construct,
    id: string,
    props: OrchestratorDeployProjectProps
  ) {
    const { stageName, ...rest } = props
    super(scope, id, {
      projectName: `${props.stageName}DeployProject`,
      environmentVariables: {
        SLIC_STAGE: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: props.stageName
        },
        CROSS_ACCOUNT_ID: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: `${config.accountIds[props.stageName]}`
        },
        MODULE_NAMES: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: modules.moduleNames.join(' ')
        }
      },
      buildSpec: BuildSpec.fromObject({
        version: '0.2',
        phases: {
          build: {
            commands: ['bash ./build-scripts/orchestrator-stage-deploy.sh']
github fourTheorem / slic-starter / cicd / lib / projects / source-project.ts View on Github external
artifacts: {
          files: '**/*'
        }
      }),
      source: buildSource,
      environment: defaultEnvironment,
      artifacts,
      ...rest,
      environmentVariables: {
        ...rest.environmentVariables,
        DEPLOYMENT_STATE_BUCKET: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: props.bucket.bucketName
        },
        DEPLOYMENT_STATE_KEY: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: DEPLOYMENT_STATE_KEY
        }
      }
    })
  }
}