Skip to content

Instantly share code, notes, and snippets.

View JelsB's full-sized avatar

Jels Boulangier JelsB

View GitHub Profile
export class OriginStack extends Stack {
// ...
const param = new ssm.StringParameter(this, 'my-ssm-param', {
parameterName: 'param-name',
description: 'description of this param',
stringValue: this.myParamValue as string
})
}
export class PipelineStack extends Stack {
// ...
const synthAction = SimpleSynthAction.standardNpmSynth({
// ...
environment: {
buildImage: LinuxBuildImage.STANDARD_4_0, // needs to be explict to use latest version when using environment field
privileged: true,
environmentVariables: {
DOCKER_HOST: {
export class SSMParameterReader extends AwsCustomResource {
constructor(scope: Construct, name: string, props: SSMParameterReaderProps) {
const { parameterName, region } = props
const ssmAwsSdkCall: AwsSdkCall = {
service: 'SSM',
action: 'getParameter',
parameters: {
Name: parameterName
},
export class PipelineStack extends Stack {
// ...
const applicationCode = new Artifact('application')
const synthAction = SimpleSynthAction.standardNpmSynth({
// ...
buildCommand: 'npm run build',
subdirectory: 'infrastructure',
additionalArtifacts: [
export class PipelineStack extends Stack {
// ...
const preProdApp = new WebServiceStage(this, 'Pre-Prod')
const preProdStage = pipeline.addApplicationStage(preProdApp)
const serviceUrl = pipeline.stackOutput(preProdApp.urlOutput)
preProdStage.addActions(new pipelines.ShellScriptAction({
actionName: 'IntegrationTests',
runOrder: preProdStage.nextSequentialRunOrder(),
const stringValue = ssm.StringParameter.fromStringParameterAttributes(this, 'my-ssm-param-value', {
parameterName: 'param-name',
// 'version' can be specified but is optional.
}).stringValue
export class VpcStack extends Stack {
// ...
public get availabilityZones(): string[] {
return ['eu-west-1a', 'eu-west-1b', 'eu-west-1c']
}
}
export class PipelineStack extends Stack {
// ...
const synthAction = SimpleSynthAction.standardNpmSynth({
// ...
buildCommand: 'npm run build',
subdirectory: 'infrastructure'
})
export class TargetStage extends Stage {
// ...
// Create SSM reader
const mySSMreader = new SSMParameterReader(this, 'reader-name', {
parameterName: 'param-name',
region: '<region-of-the-origin-stage>'
})
{
"scripts": {
"build": "npx tsc && mvn -B -f ../code/pom.xml package",
}
}