From 30466e7d79896a55f3f44804529ba60ae932b0bd Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Thu, 13 Nov 2025 14:48:26 -0500 Subject: [PATCH 01/19] wip --- .projen/deps.json | 4 ++ .projen/tasks.json | 4 +- .projenrc.js | 1 + package.json | 1 + .../aws-image-builder/builder.ts | 37 ++++++++----------- yarn.lock | 7 ++++ 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 1a6ca6d4..26027218 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -1,5 +1,9 @@ { "dependencies": [ + { + "name": "@aws-cdk/aws-imagebuilder-alpha", + "type": "build" + }, { "name": "@aws-sdk/client-cloudformation", "type": "build" diff --git a/.projen/tasks.json b/.projen/tasks.json index c0ebeb13..8f8e75d4 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -693,13 +693,13 @@ }, "steps": [ { - "exec": "npx npm-check-updates@18 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@aws-sdk/client-cloudformation,@aws-sdk/client-codebuild,@aws-sdk/client-ec2,@aws-sdk/client-ecr,@aws-sdk/client-imagebuilder,@aws-sdk/client-lambda,@aws-sdk/client-secrets-manager,@aws-sdk/client-sfn,@aws-sdk/client-sns,@aws-sdk/client-ssm,@octokit/auth-app,@octokit/core,@octokit/request-error,@octokit/rest,@types/aws-lambda,@types/jest,@types/semver,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,jsii-diff,jsii-pacmak,projen,semver,ts-jest,ts-node" + "exec": "npx npm-check-updates@18 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@aws-cdk/aws-imagebuilder-alpha,@aws-sdk/client-cloudformation,@aws-sdk/client-codebuild,@aws-sdk/client-ec2,@aws-sdk/client-ecr,@aws-sdk/client-imagebuilder,@aws-sdk/client-lambda,@aws-sdk/client-secrets-manager,@aws-sdk/client-sfn,@aws-sdk/client-sns,@aws-sdk/client-ssm,@octokit/auth-app,@octokit/core,@octokit/request-error,@octokit/rest,@types/aws-lambda,@types/jest,@types/semver,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,jsii-diff,jsii-pacmak,projen,semver,ts-jest,ts-node" }, { "exec": "yarn install --check-files" }, { - "exec": "yarn upgrade @aws-sdk/client-cloudformation @aws-sdk/client-codebuild @aws-sdk/client-ec2 @aws-sdk/client-ecr @aws-sdk/client-imagebuilder @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-sfn @aws-sdk/client-sns @aws-sdk/client-ssm @octokit/auth-app @octokit/core @octokit/request-error @octokit/rest @stylistic/eslint-plugin @sveltejs/vite-plugin-svelte @tsconfig/svelte @types/aws-lambda @types/jest @types/node @types/semver @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk bootstrap commit-and-tag-version esbuild eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-svelte eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii projen sass semver svelte-check svelte-preprocess svelte ts-jest ts-node typescript vite-plugin-singlefile vite aws-cdk-lib constructs" + "exec": "yarn upgrade @aws-cdk/aws-imagebuilder-alpha @aws-sdk/client-cloudformation @aws-sdk/client-codebuild @aws-sdk/client-ec2 @aws-sdk/client-ecr @aws-sdk/client-imagebuilder @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-sfn @aws-sdk/client-sns @aws-sdk/client-ssm @octokit/auth-app @octokit/core @octokit/request-error @octokit/rest @stylistic/eslint-plugin @sveltejs/vite-plugin-svelte @tsconfig/svelte @types/aws-lambda @types/jest @types/node @types/semver @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk bootstrap commit-and-tag-version esbuild eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-svelte eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii projen sass semver svelte-check svelte-preprocess svelte ts-jest ts-node typescript vite-plugin-singlefile vite aws-cdk-lib constructs" }, { "exec": "npx projen" diff --git a/.projenrc.js b/.projenrc.js index 7fe4c4e2..15d65fd4 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -19,6 +19,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ '@octokit/auth-app', '@octokit/request-error', '@octokit/rest', + '@aws-cdk/aws-imagebuilder-alpha', '@aws-sdk/client-cloudformation', '@aws-sdk/client-codebuild', '@aws-sdk/client-ec2', diff --git a/package.json b/package.json index 542efb7d..ea6a934b 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "organization": false }, "devDependencies": { + "@aws-cdk/aws-imagebuilder-alpha": "^2.224.0-alpha.0", "@aws-sdk/client-cloudformation": "^3.927.0", "@aws-sdk/client-codebuild": "^3.927.0", "@aws-sdk/client-ec2": "^3.927.0", diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index 3e401561..9fe47c09 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -1,3 +1,4 @@ +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import * as cdk from 'aws-cdk-lib'; import { Annotations, @@ -27,7 +28,7 @@ import { DeleteResourcesProps } from './delete-resources.lambda'; import { FilterFailedBuildsFunction } from './filter-failed-builds-function'; import { generateBuildWorkflowWithDockerSetupCommands } from './workflow'; import { Architecture, Os, RunnerAmi, RunnerImage, RunnerVersion } from '../../providers'; -import { singletonLogGroup, singletonLambda, SingletonLogType } from '../../utils'; +import { singletonLambda, singletonLogGroup, SingletonLogType } from '../../utils'; import { BuildImageFunction } from '../build-image-function'; import { RunnerImageBuilderBase, RunnerImageBuilderProps, uniqueImageBuilderName } from '../common'; @@ -318,7 +319,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { private readonly rebuildInterval: cdk.Duration; private readonly boundComponents: ImageBuilderComponent[] = []; private readonly instanceType: ec2.InstanceType; - private infrastructure: imagebuilder.CfnInfrastructureConfiguration | undefined; + private infrastructure: imagebuilder2.InfrastructureConfiguration | undefined; private readonly role: iam.Role; private readonly fastLaunchOptions?: FastLaunchOptions; public readonly storageSize?: cdk.Size; @@ -539,7 +540,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { }); } - protected createInfrastructure(managedPolicies: iam.IManagedPolicy[]): imagebuilder.CfnInfrastructureConfiguration { + protected createInfrastructure(managedPolicies: iam.IManagedPolicy[]): imagebuilder2.InfrastructureConfiguration { if (this.infrastructure) { return this.infrastructure; } @@ -552,31 +553,23 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { component.grantAssetsRead(this.role); } - this.infrastructure = new imagebuilder.CfnInfrastructureConfiguration(this, 'Infrastructure', { - name: uniqueImageBuilderName(this), + this.infrastructure = new imagebuilder2.InfrastructureConfiguration(this, 'Infrastructure', { // description: this.description, - subnetId: this.vpc?.selectSubnets(this.subnetSelection).subnetIds[0], - securityGroupIds: this.securityGroups?.map(sg => sg.securityGroupId), - instanceTypes: [this.instanceType.toString()], - instanceMetadataOptions: { - httpTokens: 'required', - // Container builds require a minimum of two hops. - httpPutResponseHopLimit: 2, - }, - instanceProfileName: new iam.CfnInstanceProfile(this, 'Instance Profile', { - roles: [ - this.role.roleName, - ], - }).ref, + subnetSelection: this.subnetSelection, + securityGroups: this.securityGroups, + instanceTypes: [this.instanceType], + httpTokens: imagebuilder2.HttpTokens.REQUIRED, + httpPutResponseHopLimit: 2, // Container builds require a minimum of two hops. + role: this.role, }); return this.infrastructure; } - protected createImage(infra: imagebuilder.CfnInfrastructureConfiguration, dist: imagebuilder.CfnDistributionConfiguration, log: logs.LogGroup, + protected createImage(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder.CfnDistributionConfiguration, log: logs.LogGroup, imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImage { const image = new imagebuilder.CfnImage(this, this.amiOrContainerId('Image', imageRecipeArn, containerRecipeArn), { - infrastructureConfigurationArn: infra.attrArn, + infrastructureConfigurationArn: infra.infrastructureConfigurationArn, distributionConfigurationArn: dist.attrArn, imageRecipeArn, containerRecipeArn, @@ -607,7 +600,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { throw new Error('Either imageRecipeArn or containerRecipeArn must be defined'); } - protected createPipeline(infra: imagebuilder.CfnInfrastructureConfiguration, dist: imagebuilder.CfnDistributionConfiguration, log: logs.LogGroup, + protected createPipeline(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder.CfnDistributionConfiguration, log: logs.LogGroup, imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImagePipeline { // set schedule let scheduleOptions: imagebuilder.CfnImagePipeline.ScheduleProperty | undefined; @@ -637,7 +630,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { const pipeline = new imagebuilder.CfnImagePipeline(this, this.amiOrContainerId('Pipeline', imageRecipeArn, containerRecipeArn), { name: uniqueImageBuilderName(this), // description: this.description, - infrastructureConfigurationArn: infra.attrArn, + infrastructureConfigurationArn: infra.infrastructureConfigurationArn, distributionConfigurationArn: dist.attrArn, imageRecipeArn, containerRecipeArn, diff --git a/yarn.lock b/yarn.lock index 2207d4fa..51e1eaea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,6 +28,13 @@ resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== +"@aws-cdk/aws-imagebuilder-alpha@^2.224.0-alpha.0": + version "2.224.0-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.224.0-alpha.0.tgz#84f76d3c89a88f7a6a9bb81293b246482e0f19da" + integrity sha512-ImW63cadwY9zmoYHAPBuGt+xBXXxdpmFkjtXqVTPTxPocHL2zztq6cbAzBy5Lv1DtvmJwHrE8UzAx4VY1gP8lA== + dependencies: + yaml "1.10.2" + "@aws-cdk/cloud-assembly-schema@^36.0.5": version "36.3.0" resolved "https://registry.yarnpkg.com/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-36.3.0.tgz#17aeb389cbbff72f2b8d5b3b25d8d21d6ec3f0ef" From 20cf40e08891e21f724d5b0be53030db5d10acc4 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Thu, 13 Nov 2025 15:17:43 -0500 Subject: [PATCH 02/19] =?UTF-8?q?=F0=9F=A4=B7=F0=9F=8F=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .projen/deps.json | 10 +++---- .projen/tasks.json | 4 +-- .projenrc.js | 6 ++-- package.json | 7 +++-- yarn.lock | 69 +++++++++++++++++++++++----------------------- 5 files changed, 49 insertions(+), 47 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 26027218..41d0f4dd 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -1,9 +1,5 @@ { "dependencies": [ - { - "name": "@aws-cdk/aws-imagebuilder-alpha", - "type": "build" - }, { "name": "@aws-sdk/client-cloudformation", "type": "build" @@ -222,9 +218,13 @@ "version": "^5", "type": "build" }, + { + "name": "@aws-cdk/aws-imagebuilder-alpha", + "type": "peer" + }, { "name": "aws-cdk-lib", - "version": "^2.155.0", + "version": "^2.196.0", "type": "peer" }, { diff --git a/.projen/tasks.json b/.projen/tasks.json index 8f8e75d4..8cbceddd 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -693,13 +693,13 @@ }, "steps": [ { - "exec": "npx npm-check-updates@18 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@aws-cdk/aws-imagebuilder-alpha,@aws-sdk/client-cloudformation,@aws-sdk/client-codebuild,@aws-sdk/client-ec2,@aws-sdk/client-ecr,@aws-sdk/client-imagebuilder,@aws-sdk/client-lambda,@aws-sdk/client-secrets-manager,@aws-sdk/client-sfn,@aws-sdk/client-sns,@aws-sdk/client-ssm,@octokit/auth-app,@octokit/core,@octokit/request-error,@octokit/rest,@types/aws-lambda,@types/jest,@types/semver,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,jsii-diff,jsii-pacmak,projen,semver,ts-jest,ts-node" + "exec": "npx npm-check-updates@18 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@aws-sdk/client-cloudformation,@aws-sdk/client-codebuild,@aws-sdk/client-ec2,@aws-sdk/client-ecr,@aws-sdk/client-imagebuilder,@aws-sdk/client-lambda,@aws-sdk/client-secrets-manager,@aws-sdk/client-sfn,@aws-sdk/client-sns,@aws-sdk/client-ssm,@octokit/auth-app,@octokit/core,@octokit/request-error,@octokit/rest,@types/aws-lambda,@types/jest,@types/semver,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,jsii-diff,jsii-pacmak,projen,semver,ts-jest,ts-node,@aws-cdk/aws-imagebuilder-alpha" }, { "exec": "yarn install --check-files" }, { - "exec": "yarn upgrade @aws-cdk/aws-imagebuilder-alpha @aws-sdk/client-cloudformation @aws-sdk/client-codebuild @aws-sdk/client-ec2 @aws-sdk/client-ecr @aws-sdk/client-imagebuilder @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-sfn @aws-sdk/client-sns @aws-sdk/client-ssm @octokit/auth-app @octokit/core @octokit/request-error @octokit/rest @stylistic/eslint-plugin @sveltejs/vite-plugin-svelte @tsconfig/svelte @types/aws-lambda @types/jest @types/node @types/semver @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk bootstrap commit-and-tag-version esbuild eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-svelte eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii projen sass semver svelte-check svelte-preprocess svelte ts-jest ts-node typescript vite-plugin-singlefile vite aws-cdk-lib constructs" + "exec": "yarn upgrade @aws-sdk/client-cloudformation @aws-sdk/client-codebuild @aws-sdk/client-ec2 @aws-sdk/client-ecr @aws-sdk/client-imagebuilder @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-sfn @aws-sdk/client-sns @aws-sdk/client-ssm @octokit/auth-app @octokit/core @octokit/request-error @octokit/rest @stylistic/eslint-plugin @sveltejs/vite-plugin-svelte @tsconfig/svelte @types/aws-lambda @types/jest @types/node @types/semver @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk bootstrap commit-and-tag-version esbuild eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-svelte eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii projen sass semver svelte-check svelte-preprocess svelte ts-jest ts-node typescript vite-plugin-singlefile vite @aws-cdk/aws-imagebuilder-alpha aws-cdk-lib constructs" }, { "exec": "npx projen" diff --git a/.projenrc.js b/.projenrc.js index 15d65fd4..68f1074d 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amir Szekely', authorAddress: 'amir@cloudsnorkel.com', stability: Stability.EXPERIMENTAL, - cdkVersion: '2.155.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput + cdkVersion: '2.196.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.196.0 for imagebuilder L2 compatibility defaultReleaseBranch: 'main', name: '@cloudsnorkel/cdk-github-runners', repositoryUrl: 'https://github.com/CloudSnorkel/cdk-github-runners.git', @@ -19,7 +19,6 @@ const project = new awscdk.AwsCdkConstructLibrary({ '@octokit/auth-app', '@octokit/request-error', '@octokit/rest', - '@aws-cdk/aws-imagebuilder-alpha', '@aws-sdk/client-cloudformation', '@aws-sdk/client-codebuild', '@aws-sdk/client-ec2', @@ -47,6 +46,9 @@ const project = new awscdk.AwsCdkConstructLibrary({ ], deps: [ ], + peerDeps: [ + '@aws-cdk/aws-imagebuilder-alpha', + ], jsiiVersion: '5.8.x', typescriptVersion: '5.6.x', lambdaOptions: { runtime: awscdk.LambdaRuntime.NODEJS_22_X }, diff --git a/package.json b/package.json index ea6a934b..1b5905f1 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "organization": false }, "devDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "^2.224.0-alpha.0", + "@aws-cdk/aws-imagebuilder-alpha": "2.224.0-alpha.0", "@aws-sdk/client-cloudformation": "^3.927.0", "@aws-sdk/client-codebuild": "^3.927.0", "@aws-sdk/client-ec2": "^3.927.0", @@ -97,7 +97,7 @@ "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", - "aws-cdk-lib": "2.155.0", + "aws-cdk-lib": "2.196.0", "bootstrap": "^5.2.0", "commit-and-tag-version": "^12", "constructs": "10.0.5", @@ -126,7 +126,8 @@ "vite-plugin-singlefile": "^2" }, "peerDependencies": { - "aws-cdk-lib": "^2.155.0", + "@aws-cdk/aws-imagebuilder-alpha": "^2.224.0-alpha.0", + "aws-cdk-lib": "^2.196.0", "constructs": "^10.0.5" }, "keywords": [ diff --git a/yarn.lock b/yarn.lock index 51e1eaea..d47039f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13,35 +13,30 @@ "@csstools/css-tokenizer" "^3.0.3" lru-cache "^10.4.3" -"@aws-cdk/asset-awscli-v1@^2.2.202": - version "2.2.257" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.257.tgz#2c5bd5d3eba3463c6b4be6f40d96e45ab4d12ef5" - integrity sha512-8F3CfFWbaN1kgMpzCvqpLO948lEOvD5t++AGUnPNjNLPTkbdi1v8gY85HvrkXHvKkKjHrlo8u+twGmQb6le4FA== +"@aws-cdk/asset-awscli-v1@2.2.236": + version "2.2.236" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.236.tgz#623311a61c9bc8c4571d000235b7efdba09f9168" + integrity sha512-BjqQVGYsVuS4VXdrezDapSd6P7soEdWJoXl1S8X7l0uLtVX9WvpmCylZKOJDrJblK5MNe1Vq9wUI91LBzzOi8A== -"@aws-cdk/asset-kubectl-v20@^2.1.2": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-kubectl-v20/-/asset-kubectl-v20-2.1.4.tgz#5b76656f651a192e8d28766a5bdf04c444905363" - integrity sha512-Ps2MkmjYgMyflagqQ4dgTElc7Vwpqj8spw8dQVFiSeaaMPsuDSNsPax3/HjuDuwqsmLdaCZc6umlxYLpL0kYDA== - -"@aws-cdk/asset-node-proxy-agent-v6@^2.0.3": +"@aws-cdk/asset-node-proxy-agent-v6@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== -"@aws-cdk/aws-imagebuilder-alpha@^2.224.0-alpha.0": +"@aws-cdk/aws-imagebuilder-alpha@2.224.0-alpha.0": version "2.224.0-alpha.0" resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.224.0-alpha.0.tgz#84f76d3c89a88f7a6a9bb81293b246482e0f19da" integrity sha512-ImW63cadwY9zmoYHAPBuGt+xBXXxdpmFkjtXqVTPTxPocHL2zztq6cbAzBy5Lv1DtvmJwHrE8UzAx4VY1gP8lA== dependencies: yaml "1.10.2" -"@aws-cdk/cloud-assembly-schema@^36.0.5": - version "36.3.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-36.3.0.tgz#17aeb389cbbff72f2b8d5b3b25d8d21d6ec3f0ef" - integrity sha512-mLSYgcMFTNCXrGAD7xob95p9s47/7WwEWUJiexxM46H2GxiijhlhLQJs31AS5uRRP6Cx1DLEu4qayKAUOOVGrw== +"@aws-cdk/cloud-assembly-schema@^41.2.0": + version "41.2.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-41.2.0.tgz#c1ef513e1cc0528dbc05948ae39d5631306af423" + integrity sha512-JaulVS6z9y5+u4jNmoWbHZRs9uGOnmn/ktXygNWKNu1k6lF3ad4so3s18eRu15XCbUIomxN9WPYT6Ehh7hzONw== dependencies: - jsonschema "^1.4.1" - semver "^7.6.3" + jsonschema "~1.4.1" + semver "^7.7.1" "@aws-crypto/crc32@5.2.0": version "5.2.0" @@ -3280,25 +3275,24 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.155.0: - version "2.155.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.155.0.tgz#73abc753bf5dc9b5abe7e71aff254b386786a455" - integrity sha512-QGzDhLldBXsyOUmhgtZ98PiOUS2g1Mb5MO08FiOvQn3+KSyJjQdq0GoyxtDpCNGLaWmIfcyrtB9aDhod38fl9g== +aws-cdk-lib@2.196.0: + version "2.196.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.196.0.tgz#fd442256ecb0b31e77a1599a78c4d8c8132f881e" + integrity sha512-CAy0ahDpUHuYArP0vhDrOZ9OUSyRAznCcKcbETJOPr438QZUCyv+tRVgk8VP5lFW1JuV9sNzIvxdZcsNVSCF7g== dependencies: - "@aws-cdk/asset-awscli-v1" "^2.2.202" - "@aws-cdk/asset-kubectl-v20" "^2.1.2" - "@aws-cdk/asset-node-proxy-agent-v6" "^2.0.3" - "@aws-cdk/cloud-assembly-schema" "^36.0.5" + "@aws-cdk/asset-awscli-v1" "2.2.236" + "@aws-cdk/asset-node-proxy-agent-v6" "^2.1.0" + "@aws-cdk/cloud-assembly-schema" "^41.2.0" "@balena/dockerignore" "^1.0.2" case "1.6.3" - fs-extra "^11.2.0" - ignore "^5.3.1" - jsonschema "^1.4.1" + fs-extra "^11.3.0" + ignore "^5.3.2" + jsonschema "^1.5.0" mime-types "^2.1.35" minimatch "^3.1.2" punycode "^2.3.1" - semver "^7.6.2" - table "^6.8.2" + semver "^7.7.2" + table "^6.9.0" yaml "1.10.2" aws-cdk@^2: @@ -4739,7 +4733,7 @@ fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^11.2.0: +fs-extra@^11.3.0: version "11.3.2" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.2.tgz#c838aeddc6f4a8c74dd15f85e11fe5511bfe02a4" integrity sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A== @@ -5077,7 +5071,7 @@ iconv-lite@0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -ignore@^5.2.0, ignore@^5.3.1: +ignore@^5.2.0, ignore@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== @@ -6056,11 +6050,16 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -jsonschema@^1.4.1: +jsonschema@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.5.0.tgz#f6aceb1ab9123563dd901d05f81f9d4883d3b7d8" integrity sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw== +jsonschema@~1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" + integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ== + jsonwebtoken@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" @@ -7210,7 +7209,7 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.3.4, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2, semver@^7.6.3, semver@^7.7.2, semver@^7.7.3: +semver@^7.0.0, semver@^7.3.4, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2, semver@^7.7.1, semver@^7.7.2, semver@^7.7.3: version "7.7.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== @@ -7650,7 +7649,7 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^6.8.2: +table@^6.9.0: version "6.9.0" resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" integrity sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A== From d31a13ee801ce2090ad5d6fc944b0ed65d7addc6 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Thu, 13 Nov 2025 15:23:31 -0500 Subject: [PATCH 03/19] jsii big mad --- .projen/deps.json | 2 +- .projenrc.js | 2 +- package.json | 4 ++-- yarn.lock | 36 ++++++++++++++++++------------------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 41d0f4dd..616398f7 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -224,7 +224,7 @@ }, { "name": "aws-cdk-lib", - "version": "^2.196.0", + "version": "^2.224.0", "type": "peer" }, { diff --git a/.projenrc.js b/.projenrc.js index 68f1074d..0862ece4 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amir Szekely', authorAddress: 'amir@cloudsnorkel.com', stability: Stability.EXPERIMENTAL, - cdkVersion: '2.196.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.196.0 for imagebuilder L2 compatibility + cdkVersion: '2.224.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.224.0 for imagebuilder defaultReleaseBranch: 'main', name: '@cloudsnorkel/cdk-github-runners', repositoryUrl: 'https://github.com/CloudSnorkel/cdk-github-runners.git', diff --git a/package.json b/package.json index 1b5905f1..55ddb09b 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", - "aws-cdk-lib": "2.196.0", + "aws-cdk-lib": "2.224.0", "bootstrap": "^5.2.0", "commit-and-tag-version": "^12", "constructs": "10.0.5", @@ -127,7 +127,7 @@ }, "peerDependencies": { "@aws-cdk/aws-imagebuilder-alpha": "^2.224.0-alpha.0", - "aws-cdk-lib": "^2.196.0", + "aws-cdk-lib": "^2.224.0", "constructs": "^10.0.5" }, "keywords": [ diff --git a/yarn.lock b/yarn.lock index d47039f6..c7cbd76e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13,10 +13,10 @@ "@csstools/css-tokenizer" "^3.0.3" lru-cache "^10.4.3" -"@aws-cdk/asset-awscli-v1@2.2.236": - version "2.2.236" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.236.tgz#623311a61c9bc8c4571d000235b7efdba09f9168" - integrity sha512-BjqQVGYsVuS4VXdrezDapSd6P7soEdWJoXl1S8X7l0uLtVX9WvpmCylZKOJDrJblK5MNe1Vq9wUI91LBzzOi8A== +"@aws-cdk/asset-awscli-v1@2.2.242": + version "2.2.242" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.242.tgz#235cb25b6d1ad26975b0095c0d6ee84309adae5c" + integrity sha512-4c1bAy2ISzcdKXYS1k4HYZsNrgiwbiDzj36ybwFVxEWZXVAP0dimQTCaB9fxu7sWzEjw3d+eaw6Fon+QTfTIpQ== "@aws-cdk/asset-node-proxy-agent-v6@^2.1.0": version "2.1.0" @@ -30,13 +30,13 @@ dependencies: yaml "1.10.2" -"@aws-cdk/cloud-assembly-schema@^41.2.0": - version "41.2.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-41.2.0.tgz#c1ef513e1cc0528dbc05948ae39d5631306af423" - integrity sha512-JaulVS6z9y5+u4jNmoWbHZRs9uGOnmn/ktXygNWKNu1k6lF3ad4so3s18eRu15XCbUIomxN9WPYT6Ehh7hzONw== +"@aws-cdk/cloud-assembly-schema@^48.6.0": + version "48.18.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-48.18.0.tgz#88c569150a5a6944d51e8cec9883008c02da43fb" + integrity sha512-KJHmkji59QboUIytK/imIY/ajt/r7OOXdyvZz25e0jssreyyxx9HUswZpcB0BM/9ZkVI7IdzYlotWe6opXdapg== dependencies: jsonschema "~1.4.1" - semver "^7.7.1" + semver "^7.7.2" "@aws-crypto/crc32@5.2.0": version "5.2.0" @@ -3275,17 +3275,17 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.196.0: - version "2.196.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.196.0.tgz#fd442256ecb0b31e77a1599a78c4d8c8132f881e" - integrity sha512-CAy0ahDpUHuYArP0vhDrOZ9OUSyRAznCcKcbETJOPr438QZUCyv+tRVgk8VP5lFW1JuV9sNzIvxdZcsNVSCF7g== +aws-cdk-lib@2.224.0: + version "2.224.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.224.0.tgz#8e62b31826b23e3796b01735397d2ab44f97d5ed" + integrity sha512-WWc9/LOhSd+QsN2ecfy67BfYBv8B5HQOze+nufNo48Z1TrHqkSJS74JzMN592nPztzjYHjVkcjCuXLJpSzwRig== dependencies: - "@aws-cdk/asset-awscli-v1" "2.2.236" + "@aws-cdk/asset-awscli-v1" "2.2.242" "@aws-cdk/asset-node-proxy-agent-v6" "^2.1.0" - "@aws-cdk/cloud-assembly-schema" "^41.2.0" + "@aws-cdk/cloud-assembly-schema" "^48.6.0" "@balena/dockerignore" "^1.0.2" case "1.6.3" - fs-extra "^11.3.0" + fs-extra "^11.3.1" ignore "^5.3.2" jsonschema "^1.5.0" mime-types "^2.1.35" @@ -4733,7 +4733,7 @@ fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^11.3.0: +fs-extra@^11.3.1: version "11.3.2" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.2.tgz#c838aeddc6f4a8c74dd15f85e11fe5511bfe02a4" integrity sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A== @@ -7209,7 +7209,7 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.3.4, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2, semver@^7.7.1, semver@^7.7.2, semver@^7.7.3: +semver@^7.0.0, semver@^7.3.4, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2, semver@^7.7.2, semver@^7.7.3: version "7.7.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== From a52c53a11a6905aa8443d6e50a66f7f0031d3b3b Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Thu, 13 Nov 2025 18:38:05 -0500 Subject: [PATCH 04/19] need vpc --- .../aws-image-builder/builder.ts | 3 +- .../github-runners-test.assets.json | 66 +++-- .../github-runners-test.template.json | 264 ++++++------------ 3 files changed, 130 insertions(+), 203 deletions(-) diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index 9fe47c09..48fc5991 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -555,6 +555,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { this.infrastructure = new imagebuilder2.InfrastructureConfiguration(this, 'Infrastructure', { // description: this.description, + vpc: this.vpc, subnetSelection: this.subnetSelection, securityGroups: this.securityGroups, instanceTypes: [this.instanceType], @@ -971,7 +972,7 @@ export class AwsImageBuilderFailedBuildNotifier implements cdk.IAspect { const builder = node as AwsImageBuilderRunnerImageBuilder; const infraNode = builder.node.tryFindChild('Infrastructure'); if (infraNode) { - const infra = infraNode as imagebuilder.CfnInfrastructureConfiguration; + const infra = infraNode.node.defaultChild as imagebuilder.CfnInfrastructureConfiguration; infra.snsTopicArn = this.topic.topicArn; } else { cdk.Annotations.of(builder).addWarning('Unused builder cannot get notifications of failed builds'); diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index 15ff3cb2..541beba0 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -1,13 +1,14 @@ { - "version": "36.3.0", + "version": "48.0.0", "files": { "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68": { + "displayName": "CodeBuild Image Builder/Component 7 Custom-Undefined Asset 0", "source": { "path": "asset.64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", "packaging": "file" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-ddf90974": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -15,12 +16,13 @@ } }, "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0": { + "displayName": "build-image-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", "source": { "path": "asset.2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-022085c0": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -28,12 +30,13 @@ } }, "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701": { + "displayName": "aws-image-builder-versioner-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", "source": { "path": "asset.5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-7230a3ad": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -41,12 +44,13 @@ } }, "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a": { + "displayName": "aws-image-builder-delete-resources-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", "source": { "path": "asset.b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-d6a52ecd": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -54,12 +58,13 @@ } }, "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c": { + "displayName": "AMI Root Device Reader-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", "source": { "path": "asset.88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-d9353ac7": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -67,12 +72,13 @@ } }, "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9": { + "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 0", "source": { "path": "asset.2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", "packaging": "file" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-07fa966c": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -80,38 +86,41 @@ } }, "914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18": { + "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 1", "source": { "path": "asset.914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh", "packaging": "file" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-652b9b07": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "97f30e67419a1676a2215492723e5add1aa491caf0cbe2dd878fc4fab0468cd4": { + "8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d": { + "displayName": "AWS679f53fac002430cb0da5b7982bd2287/Code", "source": { - "path": "asset.97f30e67419a1676a2215492723e5add1aa491caf0cbe2dd878fc4fab0468cd4", + "path": "asset.8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-df44eca8": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "97f30e67419a1676a2215492723e5add1aa491caf0cbe2dd878fc4fab0468cd4.zip", + "objectKey": "8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea": { + "displayName": "update-lambda-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", "source": { "path": "asset.aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-01742b58": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -119,12 +128,13 @@ } }, "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2": { + "displayName": "runners/token-retriever/Code", "source": { "path": "asset.2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-e26bf12f": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -132,12 +142,13 @@ } }, "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb": { + "displayName": "runners/delete-runner/Code", "source": { "path": "asset.27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-f69630e5": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -145,12 +156,13 @@ } }, "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364": { + "displayName": "runners/Idle Reaper/Code", "source": { "path": "asset.27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-4a8838bc": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -158,12 +170,13 @@ } }, "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56": { + "displayName": "runners/Webhook Handler/webhook-handler/Code", "source": { "path": "asset.12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-3229b282": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -171,12 +184,13 @@ } }, "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18": { + "displayName": "runners/Webhook Redelivery/Lambda/Code", "source": { "path": "asset.43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-4bd461a4": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -184,12 +198,13 @@ } }, "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5": { + "displayName": "runners/setup/Code", "source": { "path": "asset.77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-34f23b64": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -197,12 +212,13 @@ } }, "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9": { + "displayName": "runners/status/Code", "source": { "path": "asset.b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-b1fd60d6": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" @@ -210,27 +226,29 @@ } }, "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122": { + "displayName": "runners/Image Builder Builds Filter/Code", "source": { "path": "asset.f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.lambda", "packaging": "zip" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-017eb7bb": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", "objectKey": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "21a15c2307cf0403390e6f90234d2d793005f9759b2ca4479e43fb79a620c427": { + "68ddaa8c9b8113295cde2753eb945792fadb736c2b82a66fc4fa646ae0da3b08": { + "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region": { + "current_account-current_region-d39a09a9": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "21a15c2307cf0403390e6f90234d2d793005f9759b2ca4479e43fb79a620c427.json", + "objectKey": "68ddaa8c9b8113295cde2753eb945792fadb736c2b82a66fc4fa646ae0da3b08.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 33c65199..ae07bb0f 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2699,7 +2699,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "WindowsImageBuilderInstanceProfileBFCCEC08": { + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE": { "Type": "AWS::IAM::InstanceProfile", "Properties": { "Roles": [ @@ -2709,7 +2709,7 @@ ] } }, - "WindowsImageBuilderInfrastructureFF99A30B": { + "WindowsImageBuilderInfrastructure14D24F2C": { "Type": "AWS::ImageBuilder::InfrastructureConfiguration", "Properties": { "InstanceMetadataOptions": { @@ -2717,12 +2717,12 @@ "HttpTokens": "required" }, "InstanceProfileName": { - "Ref": "WindowsImageBuilderInstanceProfileBFCCEC08" + "Ref": "WindowsImageBuilderInfrastructureInstanceProfile253C95CE" }, "InstanceTypes": [ "m6i.large" ], - "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", + "Name": "github-runners-test-windowsimagebuilder-infrastructure-17f3ac1c", "SecurityGroupIds": [ { "Fn::GetAtt": [ @@ -2759,7 +2759,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "WindowsImageBuilderInfrastructureFF99A30B", + "WindowsImageBuilderInfrastructure14D24F2C", "Arn" ] }, @@ -2770,7 +2770,8 @@ }, "DependsOn": [ "WindowsImageBuilderDockerLogE660E23E", - "WindowsImageBuilderInfrastructureFF99A30B" + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", + "WindowsImageBuilderInfrastructure14D24F2C" ], "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" @@ -2925,7 +2926,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "WindowsImageBuilderInfrastructureFF99A30B", + "WindowsImageBuilderInfrastructure14D24F2C", "Arn" ] }, @@ -2941,7 +2942,8 @@ }, "DependsOn": [ "WindowsImageBuilderDockerLogE660E23E", - "WindowsImageBuilderInfrastructureFF99A30B" + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", + "WindowsImageBuilderInfrastructure14D24F2C" ] }, "AMILinuxBuilderSGEDC86329": { @@ -4043,7 +4045,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "AMILinuxBuilderInstanceProfile3CA638BE": { + "AMILinuxBuilderInfrastructureInstanceProfileB423D304": { "Type": "AWS::IAM::InstanceProfile", "Properties": { "Roles": [ @@ -4053,7 +4055,7 @@ ] } }, - "AMILinuxBuilderInfrastructure6FCD154A": { + "AMILinuxBuilderInfrastructure069F0561": { "Type": "AWS::ImageBuilder::InfrastructureConfiguration", "Properties": { "InstanceMetadataOptions": { @@ -4061,12 +4063,12 @@ "HttpTokens": "required" }, "InstanceProfileName": { - "Ref": "AMILinuxBuilderInstanceProfile3CA638BE" + "Ref": "AMILinuxBuilderInfrastructureInstanceProfileB423D304" }, "InstanceTypes": [ "m6i.large" ], - "Name": "github-runners-test-AMILinuxBuilder-67243E6D", + "Name": "github-runners-test-amilinuxbuilder-infrastructure-52c63716", "SecurityGroupIds": [ { "Fn::GetAtt": [ @@ -4103,7 +4105,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxBuilderInfrastructure6FCD154A", + "AMILinuxBuilderInfrastructure069F0561", "Arn" ] }, @@ -4114,7 +4116,8 @@ }, "DependsOn": [ "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderInfrastructure6FCD154A" + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561" ], "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" @@ -4139,7 +4142,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxBuilderInfrastructure6FCD154A", + "AMILinuxBuilderInfrastructure069F0561", "Arn" ] }, @@ -4155,7 +4158,8 @@ }, "DependsOn": [ "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderInfrastructure6FCD154A" + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561" ] }, "AMILinuxBuilderImageCleanerF1745EF6": { @@ -7509,7 +7513,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "AMILinuxarm64BuilderInstanceProfileCE3B6B09": { + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7": { "Type": "AWS::IAM::InstanceProfile", "Properties": { "Roles": [ @@ -7519,7 +7523,7 @@ ] } }, - "AMILinuxarm64BuilderInfrastructure80FA16D6": { + "AMILinuxarm64BuilderInfrastructureA97EB3DD": { "Type": "AWS::ImageBuilder::InfrastructureConfiguration", "Properties": { "InstanceMetadataOptions": { @@ -7527,12 +7531,12 @@ "HttpTokens": "required" }, "InstanceProfileName": { - "Ref": "AMILinuxarm64BuilderInstanceProfileCE3B6B09" + "Ref": "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7" }, "InstanceTypes": [ "m6g.large" ], - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", + "Name": "github-runners-test-amilinuxarm64builder-infrastructure-4dd30f96", "SecurityGroupIds": [ { "Fn::GetAtt": [ @@ -7569,7 +7573,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderInfrastructure80FA16D6", + "AMILinuxarm64BuilderInfrastructureA97EB3DD", "Arn" ] }, @@ -7580,7 +7584,8 @@ }, "DependsOn": [ "AMILinuxarm64BuilderAmiLog84A9D94A", - "AMILinuxarm64BuilderInfrastructure80FA16D6" + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD" ], "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" @@ -7605,7 +7610,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderInfrastructure80FA16D6", + "AMILinuxarm64BuilderInfrastructureA97EB3DD", "Arn" ] }, @@ -7621,7 +7626,8 @@ }, "DependsOn": [ "AMILinuxarm64BuilderAmiLog84A9D94A", - "AMILinuxarm64BuilderInfrastructure80FA16D6" + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD" ] }, "AMILinuxarm64BuilderImageCleanerA5DDFE7A": { @@ -8841,7 +8847,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "WindowsEC2BuilderInstanceProfileA8DBA763": { + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA": { "Type": "AWS::IAM::InstanceProfile", "Properties": { "Roles": [ @@ -8851,7 +8857,7 @@ ] } }, - "WindowsEC2BuilderInfrastructure757D4FD7": { + "WindowsEC2BuilderInfrastructure4289B6D2": { "Type": "AWS::ImageBuilder::InfrastructureConfiguration", "Properties": { "InstanceMetadataOptions": { @@ -8859,12 +8865,12 @@ "HttpTokens": "required" }, "InstanceProfileName": { - "Ref": "WindowsEC2BuilderInstanceProfileA8DBA763" + "Ref": "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA" }, "InstanceTypes": [ "m6i.large" ], - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", + "Name": "github-runners-test-windowsec2builder-infrastructure-8e08e175", "SecurityGroupIds": [ { "Fn::GetAtt": [ @@ -8901,7 +8907,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderInfrastructure757D4FD7", + "WindowsEC2BuilderInfrastructure4289B6D2", "Arn" ] }, @@ -8912,7 +8918,8 @@ }, "DependsOn": [ "WindowsEC2BuilderAmiLog126E54B2", - "WindowsEC2BuilderInfrastructure757D4FD7" + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2" ], "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" @@ -8937,7 +8944,7 @@ }, "InfrastructureConfigurationArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderInfrastructure757D4FD7", + "WindowsEC2BuilderInfrastructure4289B6D2", "Arn" ] }, @@ -8953,7 +8960,8 @@ }, "DependsOn": [ "WindowsEC2BuilderAmiLog126E54B2", - "WindowsEC2BuilderInfrastructure757D4FD7" + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2" ] }, "WindowsEC2BuilderImageCleanerEF537850": { @@ -13602,7 +13610,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "97f30e67419a1676a2215492723e5add1aa491caf0cbe2dd878fc4fab0468cd4.zip" + "S3Key": "8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d.zip" }, "Handler": "index.handler", "LoggingConfig": { @@ -13616,15 +13624,7 @@ "Arn" ] }, - "Runtime": { - "Fn::FindInMap": [ - "LatestNodeRuntimeMap", - { - "Ref": "AWS::Region" - }, - "value" - ] - }, + "Runtime": "nodejs22.x", "Timeout": 120 }, "DependsOn": [ @@ -15659,8 +15659,8 @@ "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E", "AMILinuxBuilderComponent9EnvironmentVariablesVersion008D0039", "AMILinuxBuilderImageCleanerF1745EF6", - "AMILinuxBuilderInfrastructure6FCD154A", - "AMILinuxBuilderInstanceProfile3CA638BE", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561", "AMILinuxBuilderLaunchtemplateA29452C4", "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", @@ -15902,8 +15902,8 @@ "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E", "AMILinuxBuilderComponent9EnvironmentVariablesVersion008D0039", "AMILinuxBuilderImageCleanerF1745EF6", - "AMILinuxBuilderInfrastructure6FCD154A", - "AMILinuxBuilderInstanceProfile3CA638BE", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561", "AMILinuxBuilderLaunchtemplateA29452C4", "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", @@ -16108,8 +16108,8 @@ "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent99728C6D", "AMILinuxarm64BuilderComponent9EnvironmentVariablesVersion30CC0910", "AMILinuxarm64BuilderImageCleanerA5DDFE7A", - "AMILinuxarm64BuilderInfrastructure80FA16D6", - "AMILinuxarm64BuilderInstanceProfileCE3B6B09", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD", "AMILinuxarm64BuilderLaunchtemplate8F5EFF44", "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD", "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", @@ -16314,8 +16314,8 @@ "WindowsEC2BuilderComponent9EnvironmentVariablesComponentF10003FD", "WindowsEC2BuilderComponent9EnvironmentVariablesVersionCE6A1762", "WindowsEC2BuilderImageCleanerEF537850", - "WindowsEC2BuilderInfrastructure757D4FD7", - "WindowsEC2BuilderInstanceProfileA8DBA763", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2", "WindowsEC2BuilderLaunchtemplate0A66E9C2", "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7", "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", @@ -19191,6 +19191,20 @@ "Principal": "*" } }, + "runnersWebhookHandlerwebhookhandlerinvokefunction76559985": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + "InvokedViaFunctionUrl": true, + "Principal": "*" + } + }, "runnersWebhookRedeliveryLambdaServiceRole464CDD30": { "Type": "AWS::IAM::Role", "Properties": { @@ -19381,7 +19395,8 @@ { "Action": [ "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret" + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" ], "Effect": "Allow", "Resource": { @@ -19401,7 +19416,8 @@ { "Action": [ "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret" + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" ], "Effect": "Allow", "Resource": { @@ -19411,7 +19427,8 @@ { "Action": [ "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret" + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" ], "Effect": "Allow", "Resource": { @@ -19431,7 +19448,8 @@ { "Action": [ "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret" + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" ], "Effect": "Allow", "Resource": { @@ -19529,6 +19547,20 @@ "Principal": "*" } }, + "runnerssetupinvokefunctionC1E3C6E6": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + }, + "InvokedViaFunctionUrl": true, + "Principal": "*" + } + }, "runnersstatusServiceRole71A1ADB6": { "Type": "AWS::IAM::Role", "Properties": { @@ -21641,130 +21673,6 @@ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" } }, - "Mappings": { - "LatestNodeRuntimeMap": { - "af-south-1": { - "value": "nodejs20.x" - }, - "ap-east-1": { - "value": "nodejs20.x" - }, - "ap-northeast-1": { - "value": "nodejs20.x" - }, - "ap-northeast-2": { - "value": "nodejs20.x" - }, - "ap-northeast-3": { - "value": "nodejs20.x" - }, - "ap-south-1": { - "value": "nodejs20.x" - }, - "ap-south-2": { - "value": "nodejs20.x" - }, - "ap-southeast-1": { - "value": "nodejs20.x" - }, - "ap-southeast-2": { - "value": "nodejs20.x" - }, - "ap-southeast-3": { - "value": "nodejs20.x" - }, - "ap-southeast-4": { - "value": "nodejs20.x" - }, - "ap-southeast-5": { - "value": "nodejs20.x" - }, - "ap-southeast-7": { - "value": "nodejs20.x" - }, - "ca-central-1": { - "value": "nodejs20.x" - }, - "ca-west-1": { - "value": "nodejs20.x" - }, - "cn-north-1": { - "value": "nodejs18.x" - }, - "cn-northwest-1": { - "value": "nodejs18.x" - }, - "eu-central-1": { - "value": "nodejs20.x" - }, - "eu-central-2": { - "value": "nodejs20.x" - }, - "eu-isoe-west-1": { - "value": "nodejs18.x" - }, - "eu-north-1": { - "value": "nodejs20.x" - }, - "eu-south-1": { - "value": "nodejs20.x" - }, - "eu-south-2": { - "value": "nodejs20.x" - }, - "eu-west-1": { - "value": "nodejs20.x" - }, - "eu-west-2": { - "value": "nodejs20.x" - }, - "eu-west-3": { - "value": "nodejs20.x" - }, - "il-central-1": { - "value": "nodejs20.x" - }, - "me-central-1": { - "value": "nodejs20.x" - }, - "me-south-1": { - "value": "nodejs20.x" - }, - "mx-central-1": { - "value": "nodejs20.x" - }, - "sa-east-1": { - "value": "nodejs20.x" - }, - "us-east-1": { - "value": "nodejs20.x" - }, - "us-east-2": { - "value": "nodejs20.x" - }, - "us-gov-east-1": { - "value": "nodejs18.x" - }, - "us-gov-west-1": { - "value": "nodejs18.x" - }, - "us-iso-east-1": { - "value": "nodejs18.x" - }, - "us-iso-west-1": { - "value": "nodejs18.x" - }, - "us-isob-east-1": { - "value": "nodejs18.x" - }, - "us-west-1": { - "value": "nodejs20.x" - }, - "us-west-2": { - "value": "nodejs20.x" - } - } - }, "Outputs": { "runnersstatuscommand4A30F0F5": { "Value": { From 8095f736bf88683f6cd0687defb27e8099c9541b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 23:44:27 +0000 Subject: [PATCH 05/19] chore: self mutation Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- API.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/API.md b/API.md index 9ce49060..9740671f 100644 --- a/API.md +++ b/API.md @@ -3814,7 +3814,7 @@ Check whether the given construct is a Resource. | **Name** | **Type** | **Description** | | --- | --- | --- | | node | constructs.Node | The tree node. | -| env | aws-cdk-lib.ResourceEnvironment | The environment this resource belongs to. | +| env | aws-cdk-lib.interfaces.ResourceEnvironment | The environment this resource belongs to. | | stack | aws-cdk-lib.Stack | The stack in which this resource is defined. | | arn | string | Component ARN. | | platform | string | Supported platform for the component. | @@ -3843,16 +3843,17 @@ The tree node. public readonly env: ResourceEnvironment; ``` -- *Type:* aws-cdk-lib.ResourceEnvironment +- *Type:* aws-cdk-lib.interfaces.ResourceEnvironment The environment this resource belongs to. -For resources that are created and managed by the CDK -(generally, those created by creating new class instances like Role, Bucket, etc.), -this is always the same as the environment of the stack they belong to; -however, for imported resources -(those obtained from static methods like fromRoleArn, fromBucketName, etc.), -that might be different than the stack they were imported into. +For resources that are created and managed in a Stack (those created by +creating new class instances like `new Role()`, `new Bucket()`, etc.), this +is always the same as the environment of the stack they belong to. + +For referenced resources (those obtained from referencing methods like +`Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be +different than the stack they were imported into. --- From e97214e96547867f2a5233f4b4cba47c51b6a4c2 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Sat, 22 Nov 2025 11:22:34 -0500 Subject: [PATCH 06/19] component L2 --- .projen/deps.json | 2 +- .projenrc.js | 2 +- package.json | 6 +- .../aws-image-builder/builder.ts | 37 +- .../deprecated/linux-components.ts | 17 +- .../deprecated/windows-components.ts | 15 +- src/image-builders/components.ts | 7 +- .../github-runners-test.assets.json | 14 +- .../github-runners-test.template.json | 2589 ++--------------- yarn.lock | 16 +- 10 files changed, 352 insertions(+), 2353 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 616398f7..0f544bc7 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -224,7 +224,7 @@ }, { "name": "aws-cdk-lib", - "version": "^2.224.0", + "version": "^2.227.0", "type": "peer" }, { diff --git a/.projenrc.js b/.projenrc.js index 0862ece4..66188c7e 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amir Szekely', authorAddress: 'amir@cloudsnorkel.com', stability: Stability.EXPERIMENTAL, - cdkVersion: '2.224.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.224.0 for imagebuilder + cdkVersion: '2.227.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.227.0 for imagebuilder defaultReleaseBranch: 'main', name: '@cloudsnorkel/cdk-github-runners', repositoryUrl: 'https://github.com/CloudSnorkel/cdk-github-runners.git', diff --git a/package.json b/package.json index 55ddb09b..042097f0 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "organization": false }, "devDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "2.224.0-alpha.0", + "@aws-cdk/aws-imagebuilder-alpha": "2.227.0-alpha.0", "@aws-sdk/client-cloudformation": "^3.927.0", "@aws-sdk/client-codebuild": "^3.927.0", "@aws-sdk/client-ec2": "^3.927.0", @@ -97,7 +97,7 @@ "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", - "aws-cdk-lib": "2.224.0", + "aws-cdk-lib": "2.227.0", "bootstrap": "^5.2.0", "commit-and-tag-version": "^12", "constructs": "10.0.5", @@ -127,7 +127,7 @@ }, "peerDependencies": { "@aws-cdk/aws-imagebuilder-alpha": "^2.224.0-alpha.0", - "aws-cdk-lib": "^2.224.0", + "aws-cdk-lib": "^2.227.0", "constructs": "^10.0.5" }, "keywords": [ diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index 48fc5991..a476019b 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -114,7 +114,7 @@ export interface ImageBuilderComponentProperties { /** * Component platform. Must match the builder platform. */ - readonly platform: 'Linux' | 'Windows'; + readonly platform: imagebuilder2.Platform; /** * Component display name. @@ -174,7 +174,7 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { /** * Supported platform for the component. */ - public readonly platform: 'Windows' | 'Linux'; + public readonly platform: imagebuilder2.Platform; private readonly assets: s3_assets.Asset[] = []; @@ -182,6 +182,8 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { super(scope, id); this.platform = props.platform; + const execAction = props.platform === imagebuilder2.Platform.LINUX ? + imagebuilder2.ComponentAction.EXECUTE_BASH : imagebuilder2.ComponentAction.EXECUTE_POWERSHELL; let steps: any[] = []; @@ -201,7 +203,7 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { source: asset.asset.s3ObjectUrl, destination: `${asset.path}.zip`, }); - if (props.platform === 'Windows') { + if (props.platform === imagebuilder2.Platform.WINDOWS) { extractCommands.push(`Expand-Archive "${asset.path}.zip" -DestinationPath "${asset.path}"`); extractCommands.push(`del "${asset.path}.zip"`); } else { @@ -215,14 +217,14 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { steps.push({ name: 'Download', - action: 'S3Download', + action: imagebuilder2.ComponentAction.S3_DOWNLOAD, inputs, }); if (extractCommands.length > 0) { steps.push({ name: 'Extract', - action: props.platform === 'Linux' ? 'ExecuteBash' : 'ExecutePowerShell', + action: execAction, inputs: { commands: this.prefixCommandsWithErrorHandling(props.platform, extractCommands), }, @@ -233,7 +235,7 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { if (props.commands.length > 0) { steps.push({ name: 'Run', - action: props.platform === 'Linux' ? 'ExecuteBash' : 'ExecutePowerShell', + action: execAction, inputs: { commands: this.prefixCommandsWithErrorHandling(props.platform, props.commands), }, @@ -243,36 +245,29 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { if (props.reboot ?? false) { steps.push({ name: 'Reboot', - action: 'Reboot', + action: imagebuilder2.ComponentAction.REBOOT, inputs: {}, }); } const data = { name: props.displayName, - schemaVersion: '1.0', + schemaVersion: imagebuilder2.ComponentSchemaVersion.V1_0, phases: [ { - name: 'build', + name: imagebuilder2.ComponentPhaseName.BUILD, steps, }, ], }; - const name = uniqueImageBuilderName(this); - const component = new imagebuilder.CfnComponent(this, 'Component', { - name: name, + const component = new imagebuilder2.Component(this, 'Component', { description: props.description, platform: props.platform, - version: this.generateVersion('Component', name, { - platform: props.platform, - data, - description: props.description, - }), - data: JSON.stringify(data), + data: imagebuilder2.ComponentData.fromJsonObject(data), }); - this.arn = component.attrArn; + this.arn = component.componentArn; } /** @@ -286,8 +281,8 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase { } } - prefixCommandsWithErrorHandling(platform: 'Windows' | 'Linux', commands: string[]) { - if (platform == 'Windows') { + prefixCommandsWithErrorHandling(platform: imagebuilder2.Platform, commands: string[]) { + if (platform == imagebuilder2.Platform.WINDOWS) { return [ '$ErrorActionPreference = \'Stop\'', '$ProgressPreference = \'SilentlyContinue\'', diff --git a/src/image-builders/aws-image-builder/deprecated/linux-components.ts b/src/image-builders/aws-image-builder/deprecated/linux-components.ts index 94342b0a..d8d7591f 100644 --- a/src/image-builders/aws-image-builder/deprecated/linux-components.ts +++ b/src/image-builders/aws-image-builder/deprecated/linux-components.ts @@ -1,3 +1,4 @@ +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import { aws_s3_assets as s3_assets } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { Architecture, RunnerVersion } from '../../../providers'; @@ -20,7 +21,7 @@ export class LinuxUbuntuComponents { } return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'Required packages', description: 'Install packages required for GitHub Runner and upgrade all packages', commands: [ @@ -36,7 +37,7 @@ export class LinuxUbuntuComponents { public static runnerUser(scope: Construct, id: string, _architecture: Architecture) { return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'GitHub Runner user', description: 'Install latest version of AWS CLI', commands: [ @@ -58,7 +59,7 @@ export class LinuxUbuntuComponents { } return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'AWS CLI', description: 'Install latest version of AWS CLI', commands: [ @@ -72,7 +73,7 @@ export class LinuxUbuntuComponents { public static githubCli(scope: Construct, id: string, _architecture: Architecture) { return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'GitHub CLI', description: 'Install latest version of gh', commands: [ @@ -87,7 +88,7 @@ export class LinuxUbuntuComponents { public static git(scope: Construct, id: string, _architecture: Architecture) { return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'Git', description: 'Install latest version of git', commands: [ @@ -116,7 +117,7 @@ export class LinuxUbuntuComponents { } return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'GitHub Actions Runner', description: 'Install latest version of GitHub Actions Runner', commands: [ @@ -132,7 +133,7 @@ export class LinuxUbuntuComponents { public static docker(scope: Construct, id: string, _architecture: Architecture) { return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'Docker', description: 'Install latest version of Docker', commands: [ @@ -150,7 +151,7 @@ export class LinuxUbuntuComponents { public static extraCertificates(scope: Construct, id: string, path: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Linux', + platform: imagebuilder2.Platform.LINUX, displayName: 'Extra certificates', description: 'Install self-signed certificates to provide access to GitHub Enterprise Server', commands: [ diff --git a/src/image-builders/aws-image-builder/deprecated/windows-components.ts b/src/image-builders/aws-image-builder/deprecated/windows-components.ts index bf4fd640..479b8553 100644 --- a/src/image-builders/aws-image-builder/deprecated/windows-components.ts +++ b/src/image-builders/aws-image-builder/deprecated/windows-components.ts @@ -1,3 +1,4 @@ +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import { aws_s3_assets as s3_assets } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { Architecture, Os, RunnerVersion } from '../../../providers'; @@ -12,7 +13,7 @@ import { ImageBuilderComponent } from '../builder'; export class WindowsComponents { public static cloudwatchAgent(scope: Construct, id: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'CloudWatch agent', description: 'Install latest version of CloudWatch agent for sending logs to CloudWatch', commands: [ @@ -24,7 +25,7 @@ export class WindowsComponents { public static awsCli(scope: Construct, id: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'AWS CLI', description: 'Install latest version of AWS CLI', commands: [ @@ -36,7 +37,7 @@ export class WindowsComponents { public static githubCli(scope: Construct, id: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'GitHub CLI', description: 'Install latest version of gh', commands: [ @@ -53,7 +54,7 @@ export class WindowsComponents { public static git(scope: Construct, id: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'Git', description: 'Install latest version of git', commands: [ @@ -84,7 +85,7 @@ export class WindowsComponents { } return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'GitHub Actions Runner', description: 'Install latest version of GitHub Actions Runner', commands: runnerCommands.concat([ @@ -98,7 +99,7 @@ export class WindowsComponents { public static docker(scope: Construct, id: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'Docker', description: 'Install latest version of Docker', commands: RunnerImageComponent.docker().getCommands(Os.WINDOWS, Architecture.X86_64), @@ -108,7 +109,7 @@ export class WindowsComponents { public static extraCertificates(scope: Construct, id: string, path: string) { return new ImageBuilderComponent(scope, id, { - platform: 'Windows', + platform: imagebuilder2.Platform.WINDOWS, displayName: 'Extra certificates', description: 'Install self-signed certificates to provide access to GitHub Enterprise Server', commands: [ diff --git a/src/image-builders/components.ts b/src/image-builders/components.ts index 1087feca..6d2cb5a2 100644 --- a/src/image-builders/components.ts +++ b/src/image-builders/components.ts @@ -1,4 +1,5 @@ import * as path from 'path'; +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import { aws_s3_assets as s3_assets } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ImageBuilderComponent } from './aws-image-builder'; @@ -640,11 +641,11 @@ export abstract class RunnerImageComponent { * @internal */ _asAwsImageBuilderComponent(scope: Construct, id: string, os: Os, architecture: Architecture) { - let platform: 'Linux' | 'Windows'; + let platform: imagebuilder2.Platform; if (os.isIn(Os._ALL_LINUX_UBUNTU_VERSIONS) || os.isIn(Os._ALL_LINUX_AMAZON_VERSIONS)) { - platform = 'Linux'; + platform = imagebuilder2.Platform.LINUX; } else if (os.is(Os.WINDOWS)) { - platform = 'Windows'; + platform = imagebuilder2.Platform.WINDOWS; } else { throw new Error(`Unknown os/architecture combo for image builder component: ${os.name}/${architecture.name}`); } diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index 541beba0..468ed6ba 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -99,16 +99,16 @@ } } }, - "8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d": { + "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625": { "displayName": "AWS679f53fac002430cb0da5b7982bd2287/Code", "source": { - "path": "asset.8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d", + "path": "asset.bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625", "packaging": "zip" }, "destinations": { - "current_account-current_region-df44eca8": { + "current_account-current_region-d28f70a5": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d.zip", + "objectKey": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -239,16 +239,16 @@ } } }, - "68ddaa8c9b8113295cde2753eb945792fadb736c2b82a66fc4fa646ae0da3b08": { + "f369be4744cd9e0ad9bcf9cad67d7e5b61ca4110cc236572b881ad0f423581e9": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-d39a09a9": { + "current_account-current_region-b2943a66": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "68ddaa8c9b8113295cde2753eb945792fadb736c2b82a66fc4fa646ae0da3b08.json", + "objectKey": "f369be4744cd9e0ad9bcf9cad67d7e5b61ca4110cc236572b881ad0f423581e9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index ae07bb0f..06729ca4 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2010,507 +2010,95 @@ } } }, - "WindowsImageBuilderComponent0RequiredPackagesVersion54CE1D67": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component0RequiredPackages-1A3E0E7C", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 0 RequiredPackages", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - } - ] - } - ] - }, - "description": "Component 0 RequiredPackages" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent0RequiredPackagesComponent490D1D26": { + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 0 RequiredPackages\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]}]}]}", + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-WindowsImageBuilder-Component0RequiredPackages-1A3E0E7C", + "Name": "github-runners-test-windowsimagebuilder-component0requiredpackages-component-963beb47", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent0RequiredPackagesVersion54CE1D67" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent1RunnerUserVersion9DEF18DE": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component1RunnerUser-F040C0BA", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 1 RunnerUser", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - } - ] - } - ] - }, - "description": "Component 1 RunnerUser" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent1RunnerUserComponentCB0163EE": { + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 1 RunnerUser\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]}]}]}", + "Data": "name: Component 1 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", "Description": "Component 1 RunnerUser", - "Name": "github-runners-test-WindowsImageBuilder-Component1RunnerUser-F040C0BA", + "Name": "github-runners-test-windowsimagebuilder-component1runneruser-component-c4a9efb2", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent1RunnerUserVersion9DEF18DE" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent2GitVersion1AA56A2F": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component2Git-316DB12E", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 2 Git", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/git-for-windows/git/releases/latest > $Env:TEMP\\latest-git", - "$LatestUrl = Get-Content $Env:TEMP\\latest-git", - "$GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "$GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]", - "$GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]", - "If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT = \"$GIT_VERSION_SHORT.$GIT_REVISION\"}", - "Invoke-WebRequest -UseBasicParsing -Uri https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe -OutFile git-setup.exe", - "$p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList '/VERYSILENT'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }", - "del git-setup.exe" - ] - } - } - ] - } - ] - }, - "description": "Component 2 Git" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent2GitComponentD5E90F74": { + "WindowsImageBuilderComponent2GitComponent92ACFEF5": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 2 Git\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/git-for-windows/git/releases/latest > $Env:TEMP\\\\latest-git\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-git\",\"$GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"$GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\",\"$GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\",\"If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT = \\\"$GIT_VERSION_SHORT.$GIT_REVISION\\\"}\",\"Invoke-WebRequest -UseBasicParsing -Uri https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe -OutFile git-setup.exe\",\"$p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList '/VERYSILENT'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\",\"del git-setup.exe\"]}}]}]}", + "Data": "name: Component 2 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", "Description": "Component 2 Git", - "Name": "github-runners-test-WindowsImageBuilder-Component2Git-316DB12E", + "Name": "github-runners-test-windowsimagebuilder-component2git-component-f09bbd59", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent2GitVersion1AA56A2F" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent3GithubCliVersionFE27093C": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component3GithubCli-8D855BAC", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 3 GithubCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh", - "$LatestUrl = Get-Content $Env:TEMP\\latest-gh", - "$GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\" -OutFile gh.msi", - "$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i gh.msi /qn'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }", - "del gh.msi" - ] - } - } - ] - } - ] - }, - "description": "Component 3 GithubCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent3GithubCliComponent3D6C7BCE": { + "WindowsImageBuilderComponent3GithubCliComponentF18685D5": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 3 GithubCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/cli/cli/releases/latest > $Env:TEMP\\\\latest-gh\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-gh\",\"$GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\\\" -OutFile gh.msi\",\"$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i gh.msi /qn'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\",\"del gh.msi\"]}}]}]}", + "Data": "name: Component 3 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", "Description": "Component 3 GithubCli", - "Name": "github-runners-test-WindowsImageBuilder-Component3GithubCli-8D855BAC", + "Name": "github-runners-test-windowsimagebuilder-component3githubcli-component-a0ec305e", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent3GithubCliVersionFE27093C" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent4AwsCliVersion597B7A92": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component4AwsCli-1B2DBBE1", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 4 AwsCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i https://awscli.amazonaws.com/AWSCLIV2.msi /qn'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }" - ] - } - } - ] - } - ] - }, - "description": "Component 4 AwsCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent4AwsCliComponentE42A66BF": { + "WindowsImageBuilderComponent4AwsCliComponent6654838D": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 4 AwsCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\"]}}]}]}", + "Data": "name: Component 4 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", "Description": "Component 4 AwsCli", - "Name": "github-runners-test-WindowsImageBuilder-Component4AwsCli-1B2DBBE1", + "Name": "github-runners-test-windowsimagebuilder-component4awscli-component-c1cc638a", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent4AwsCliVersion597B7A92" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent5GithubRunnerVersionDA209B9C": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component5GithubRunner-7AC775C5", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 5 GithubRunner", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/actions/runner/releases/latest > $Env:TEMP\\latest-gha", - "$LatestUrl = Get-Content $Env:TEMP\\latest-gha", - "$RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "mkdir C:\\hostedtoolcache\\windows", - "mkdir C:\\tools", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/facebook/zstd/releases/latest > $Env:TEMP\\latest-zstd", - "$LatestUrl = Get-Content $Env:TEMP\\latest-zstd", - "$ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\" -OutFile zstd.zip", - "Expand-Archive zstd.zip -DestinationPath C:\\tools", - "Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe C:\\tools", - "Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\" -Force -Recurse", - "del zstd.zip", - "$persistedPaths = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)", - "[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths + \";C:\\tools\", [EnvironmentVariableTarget]::Machine)", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\" -OutFile actions.zip", - "Expand-Archive actions.zip -DestinationPath C:\\actions", - "del actions.zip", - "echo latest | Out-File -Encoding ASCII -NoNewline C:\\actions\\RUNNER_VERSION" - ] - } - } - ] - } - ] - }, - "description": "Component 5 GithubRunner" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent5GithubRunnerComponent34C12ED4": { + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 5 GithubRunner\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest > $Env:TEMP\\\\latest-gha\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-gha\",\"$RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"mkdir C:\\\\hostedtoolcache\\\\windows\",\"mkdir C:\\\\tools\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/facebook/zstd/releases/latest > $Env:TEMP\\\\latest-zstd\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-zstd\",\"$ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\\\" -OutFile zstd.zip\",\"Expand-Archive zstd.zip -DestinationPath C:\\\\tools\",\"Move-Item -Path C:\\\\tools\\\\zstd-v$ZSTD_VERSION-win64\\\\zstd.exe C:\\\\tools\",\"Remove-Item -LiteralPath \\\"C:\\\\tools\\\\zstd-v$ZSTD_VERSION-win64\\\" -Force -Recurse\",\"del zstd.zip\",\"$persistedPaths = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)\",\"[Environment]::SetEnvironmentVariable(\\\"PATH\\\", $persistedPaths + \\\";C:\\\\tools\\\", [EnvironmentVariableTarget]::Machine)\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\\\" -OutFile actions.zip\",\"Expand-Archive actions.zip -DestinationPath C:\\\\actions\",\"del actions.zip\",\"echo latest | Out-File -Encoding ASCII -NoNewline C:\\\\actions\\\\RUNNER_VERSION\"]}}]}]}", + "Data": "name: Component 5 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", "Description": "Component 5 GithubRunner", - "Name": "github-runners-test-WindowsImageBuilder-Component5GithubRunner-7AC775C5", + "Name": "github-runners-test-windowsimagebuilder-component5githubrunner-component-c7c81d8e", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent5GithubRunnerVersionDA209B9C" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent6CustomUndefinedVersionB3367BF0": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component6Custom-Undefined-0A739BAE", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 6 Custom-Undefined", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [ - { - "source": { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "destination": "FUNDING.yml" - } - ] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "New-Item -ItemType file -Path / -Name custom-file", - "New-Item -ItemType directory -Path / -Name custom-dir", - "Move-Item FUNDING.yml /custom-dir" - ] - } - } - ] - } - ] - }, - "description": "Component 6 Custom-Undefined" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent6CustomUndefinedComponentC1AEB345": { + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD": { "Type": "AWS::ImageBuilder::Component", "Properties": { "Data": { "Fn::Join": [ "", [ - "{\"name\":\"Component 6 Custom-Undefined\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[{\"source\":\"", + "name: Component 6 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", { "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" }, - "\",\"destination\":\"FUNDING.yml\"}]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"New-Item -ItemType file -Path / -Name custom-file\",\"New-Item -ItemType directory -Path / -Name custom-dir\",\"Move-Item FUNDING.yml /custom-dir\"]}}]}]}" + "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" ] ] }, "Description": "Component 6 Custom-Undefined", - "Name": "github-runners-test-WindowsImageBuilder-Component6Custom-Undefined-0A739BAE", + "Name": "github-runners-test-windowsimagebuilder-component6custom-undefined-component-955efea2", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent6CustomUndefinedVersionB3367BF0" - } + "Version": "1.0.0" } }, - "WindowsImageBuilderComponent7EnvironmentVariablesVersion87D8A6C5": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsImageBuilder-Component7EnvironmentVariables-40E688D7", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 7 EnvironmentVariables", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'", - "Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'" - ] - } - } - ] - } - ] - }, - "description": "Component 7 EnvironmentVariables" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsImageBuilderComponent7EnvironmentVariablesComponentE150D95A": { + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 7 EnvironmentVariables\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"Add-Content -Path C:\\\\actions\\\\.env -Value 'HELLO=world'\",\"Add-Content -Path C:\\\\actions\\\\.env -Value 'FOO=bar'\"]}}]}]}", + "Data": "name: Component 7 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", "Description": "Component 7 EnvironmentVariables", - "Name": "github-runners-test-WindowsImageBuilder-Component7EnvironmentVariables-40E688D7", + "Name": "github-runners-test-windowsimagebuilder-component7environmentvariables-component-f73418d2", "Platform": "Windows", - "Version": { - "Ref": "WindowsImageBuilderComponent7EnvironmentVariablesVersion87D8A6C5" - } + "Version": "1.0.0" } }, "WindowsImageBuilderContainerRecipeVersion13A2E3FD": { @@ -2530,7 +2118,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent0RequiredPackagesComponent490D1D26", + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3", "Arn" ] } @@ -2538,7 +2126,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent1RunnerUserComponentCB0163EE", + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032", "Arn" ] } @@ -2546,7 +2134,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent2GitComponentD5E90F74", + "WindowsImageBuilderComponent2GitComponent92ACFEF5", "Arn" ] } @@ -2554,7 +2142,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent3GithubCliComponent3D6C7BCE", + "WindowsImageBuilderComponent3GithubCliComponentF18685D5", "Arn" ] } @@ -2562,7 +2150,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent4AwsCliComponentE42A66BF", + "WindowsImageBuilderComponent4AwsCliComponent6654838D", "Arn" ] } @@ -2570,7 +2158,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent5GithubRunnerComponent34C12ED4", + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1", "Arn" ] } @@ -2578,7 +2166,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent6CustomUndefinedComponentC1AEB345", + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD", "Arn" ] } @@ -2586,7 +2174,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent7EnvironmentVariablesComponentE150D95A", + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09", "Arn" ] } @@ -2609,7 +2197,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent0RequiredPackagesComponent490D1D26", + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3", "Arn" ] } @@ -2617,7 +2205,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent1RunnerUserComponentCB0163EE", + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032", "Arn" ] } @@ -2625,7 +2213,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent2GitComponentD5E90F74", + "WindowsImageBuilderComponent2GitComponent92ACFEF5", "Arn" ] } @@ -2633,7 +2221,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent3GithubCliComponent3D6C7BCE", + "WindowsImageBuilderComponent3GithubCliComponentF18685D5", "Arn" ] } @@ -2641,7 +2229,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent4AwsCliComponentE42A66BF", + "WindowsImageBuilderComponent4AwsCliComponent6654838D", "Arn" ] } @@ -2649,7 +2237,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent5GithubRunnerComponent34C12ED4", + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1", "Arn" ] } @@ -2657,7 +2245,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent6CustomUndefinedComponentC1AEB345", + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD", "Arn" ] } @@ -2665,7 +2253,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsImageBuilderComponent7EnvironmentVariablesComponentE150D95A", + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09", "Arn" ] } @@ -3136,621 +2724,115 @@ } } }, - "AMILinuxBuilderComponent0RequiredPackagesVersion1DA9F296": { - "Type": "Custom::ImageBuilder-Component-Version", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6": { + "Type": "AWS::ImageBuilder::Component", "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component0RequiredPackages-DD92E049", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 0 RequiredPackages", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get upgrade -y", - "DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates" - ] - } - } - ] - } - ] - }, - "description": "Component 0 RequiredPackages" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-amilinuxbuilder-component0requiredpackages-component-ccd42ff5", + "Platform": "Linux", + "Version": "1.0.0" + } }, - "AMILinuxBuilderComponent0RequiredPackagesComponent6D0029EE": { + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 0 RequiredPackages\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\"]}}]}]}", - "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-AMILinuxBuilder-Component0RequiredPackages-DD92E049", + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-amilinuxbuilder-component1cloudwatchagent-component-5545ba1f", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent0RequiredPackagesVersion1DA9F296" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent1CloudWatchAgentVersionF6CE8122": { - "Type": "Custom::ImageBuilder-Component-Version", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073": { + "Type": "AWS::ImageBuilder::Component", "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component1CloudWatchAgent-793897CE", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 1 CloudWatchAgent", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -sfLo /tmp/amazon-cloudwatch-agent.deb https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb", - "dpkg -i -E /tmp/amazon-cloudwatch-agent.deb", - "rm /tmp/amazon-cloudwatch-agent.deb" - ] - } - } - ] - } - ] - }, - "description": "Component 1 CloudWatchAgent" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent1CloudWatchAgentComponentEF606A78": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "{\"name\":\"Component 1 CloudWatchAgent\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -sfLo /tmp/amazon-cloudwatch-agent.deb https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb\",\"dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\",\"rm /tmp/amazon-cloudwatch-agent.deb\"]}}]}]}", - "Description": "Component 1 CloudWatchAgent", - "Name": "github-runners-test-AMILinuxBuilder-Component1CloudWatchAgent-793897CE", - "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent1CloudWatchAgentVersionF6CE8122" - } - } - }, - "AMILinuxBuilderComponent2RunnerUserVersion7235C1B1": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component2RunnerUser-2C772040", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 2 RunnerUser", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "addgroup runner", - "adduser --system --disabled-password --home /home/runner --ingroup runner runner", - "echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" > /etc/sudoers.d/runner" - ] - } - } - ] - } - ] - }, - "description": "Component 2 RunnerUser" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent2RunnerUserComponentEE2EFAA9": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "{\"name\":\"Component 2 RunnerUser\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"addgroup runner\",\"adduser --system --disabled-password --home /home/runner --ingroup runner runner\",\"echo \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\"]}}]}]}", + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", "Description": "Component 2 RunnerUser", - "Name": "github-runners-test-AMILinuxBuilder-Component2RunnerUser-2C772040", + "Name": "github-runners-test-amilinuxbuilder-component2runneruser-component-b84742f0", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent2RunnerUserVersion7235C1B1" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent3GitVersion7B3BEDD6": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component3Git-8C35E49F", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 3 Git", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "add-apt-repository ppa:git-core/ppa", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get install -y git" - ] - } - } - ] - } - ] - }, - "description": "Component 3 Git" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent3GitComponent11319ECE": { + "AMILinuxBuilderComponent3GitComponent9011E3AB": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 3 Git\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"add-apt-repository ppa:git-core/ppa\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y git\"]}}]}]}", + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", "Description": "Component 3 Git", - "Name": "github-runners-test-AMILinuxBuilder-Component3Git-8C35E49F", + "Name": "github-runners-test-amilinuxbuilder-component3git-component-5532a5f4", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent3GitVersion7B3BEDD6" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent4GithubCliVersionE4F9F8C3": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component4GithubCli-F89A69D6", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 4 GithubCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg", - "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get install -y gh" - ] - } - } - ] - } - ] - }, - "description": "Component 4 GithubCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent4GithubCliComponent21834DCF": { + "AMILinuxBuilderComponent4GithubCliComponent602EE471": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 4 GithubCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\",\"echo \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y gh\"]}}]}]}", + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", "Description": "Component 4 GithubCli", - "Name": "github-runners-test-AMILinuxBuilder-Component4GithubCli-F89A69D6", + "Name": "github-runners-test-amilinuxbuilder-component4githubcli-component-7925b347", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent4GithubCliVersionE4F9F8C3" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent5AwsCliVersionC6151B91": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component5AwsCli-BE8AC06E", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 5 AwsCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -fsSL \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o awscliv2.zip", - "unzip -q awscliv2.zip", - "./aws/install", - "rm -rf awscliv2.zip aws" - ] - } - } - ] - } - ] - }, - "description": "Component 5 AwsCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent5AwsCliComponent3AA64EA2": { + "AMILinuxBuilderComponent5AwsCliComponent72637C19": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 5 AwsCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\",\"unzip -q awscliv2.zip\",\"./aws/install\",\"rm -rf awscliv2.zip aws\"]}}]}]}", + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", "Description": "Component 5 AwsCli", - "Name": "github-runners-test-AMILinuxBuilder-Component5AwsCli-BE8AC06E", + "Name": "github-runners-test-amilinuxbuilder-component5awscli-component-ea3524b1", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent5AwsCliVersionC6151B91" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent6DockerVersion8FF46707": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component6Docker-75C7B53C", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 6 Docker", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg", - "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin", - "usermod -aG docker runner", - "ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose" - ] - } - } - ] - } - ] - }, - "description": "Component 6 Docker" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent6DockerComponentD5E4165F": { + "AMILinuxBuilderComponent6DockerComponent9E523A42": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 6 Docker\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\",\"echo \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\",\"usermod -aG docker runner\",\"ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\"]}}]}]}", + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", "Description": "Component 6 Docker", - "Name": "github-runners-test-AMILinuxBuilder-Component6Docker-75C7B53C", + "Name": "github-runners-test-amilinuxbuilder-component6docker-component-c57d02ec", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent6DockerVersion8FF46707" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent7GithubRunnerVersion6BDEFC52": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component7GithubRunner-57FB75A5", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 7 GithubRunner", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \"[^/v]+$\"`", - "curl -fsSLO \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"", - "tar -C /home/runner -xzf \"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"", - "rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz", - "echo -n latest > /home/runner/RUNNER_VERSION", - "/home/runner/bin/installdependencies.sh", - "mkdir -p /opt/hostedtoolcache", - "chown runner /opt/hostedtoolcache" - ] - } - } - ] - } - ] - }, - "description": "Component 7 GithubRunner" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent7GithubRunnerComponent898B6A50": { + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 7 GithubRunner\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"RUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\",\"curl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\",\"tar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\",\"rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\",\"echo -n latest > /home/runner/RUNNER_VERSION\",\"/home/runner/bin/installdependencies.sh\",\"mkdir -p /opt/hostedtoolcache\",\"chown runner /opt/hostedtoolcache\"]}}]}]}", + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", "Description": "Component 7 GithubRunner", - "Name": "github-runners-test-AMILinuxBuilder-Component7GithubRunner-57FB75A5", + "Name": "github-runners-test-amilinuxbuilder-component7githubrunner-component-dd50b576", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent7GithubRunnerVersion6BDEFC52" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent8CustomUndefinedVersionF6AA0039": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component8Custom-Undefined-2AC0870D", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 8 Custom-Undefined", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [ - { - "source": { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "destination": "FUNDING.yml" - } - ] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "touch /custom-file", - "mkdir /custom-dir", - "mv FUNDING.yml /custom-dir" - ] - } - } - ] - } - ] - }, - "description": "Component 8 Custom-Undefined" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent8CustomUndefinedComponentCF5507D3": { + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F": { "Type": "AWS::ImageBuilder::Component", "Properties": { "Data": { "Fn::Join": [ "", [ - "{\"name\":\"Component 8 Custom-Undefined\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[{\"source\":\"", + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", { "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" }, - "\",\"destination\":\"FUNDING.yml\"}]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"touch /custom-file\",\"mkdir /custom-dir\",\"mv FUNDING.yml /custom-dir\"]}}]}]}" + "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" ] ] }, "Description": "Component 8 Custom-Undefined", - "Name": "github-runners-test-AMILinuxBuilder-Component8Custom-Undefined-2AC0870D", + "Name": "github-runners-test-amilinuxbuilder-component8custom-undefined-component-35d68e99", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent8CustomUndefinedVersionF6AA0039" - } + "Version": "1.0.0" } }, - "AMILinuxBuilderComponent9EnvironmentVariablesVersion008D0039": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxBuilder-Component9EnvironmentVariables-7237997F", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 9 EnvironmentVariables", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "echo 'HELLO=world' >> /home/runner/.env", - "echo 'FOO=bar' >> /home/runner/.env" - ] - } - } - ] - } - ] - }, - "description": "Component 9 EnvironmentVariables" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E": { + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 9 EnvironmentVariables\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"echo 'HELLO=world' >> /home/runner/.env\",\"echo 'FOO=bar' >> /home/runner/.env\"]}}]}]}", + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", "Description": "Component 9 EnvironmentVariables", - "Name": "github-runners-test-AMILinuxBuilder-Component9EnvironmentVariables-7237997F", + "Name": "github-runners-test-amilinuxbuilder-component9environmentvariables-component-c760ab8d", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxBuilderComponent9EnvironmentVariablesVersion008D0039" - } + "Version": "1.0.0" } }, "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374": { @@ -3799,7 +2881,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent0RequiredPackagesComponent6D0029EE", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", "Arn" ] } @@ -3807,7 +2889,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent1CloudWatchAgentComponentEF606A78", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", "Arn" ] } @@ -3815,7 +2897,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent2RunnerUserComponentEE2EFAA9", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", "Arn" ] } @@ -3823,7 +2905,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent3GitComponent11319ECE", + "AMILinuxBuilderComponent3GitComponent9011E3AB", "Arn" ] } @@ -3831,7 +2913,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent4GithubCliComponent21834DCF", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", "Arn" ] } @@ -3839,7 +2921,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent5AwsCliComponent3AA64EA2", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", "Arn" ] } @@ -3847,7 +2929,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent6DockerComponentD5E4165F", + "AMILinuxBuilderComponent6DockerComponent9E523A42", "Arn" ] } @@ -3855,7 +2937,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent7GithubRunnerComponent898B6A50", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", "Arn" ] } @@ -3863,7 +2945,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent8CustomUndefinedComponentCF5507D3", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", "Arn" ] } @@ -3871,7 +2953,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", "Arn" ] } @@ -3931,7 +3013,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent0RequiredPackagesComponent6D0029EE", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", "Arn" ] } @@ -3939,7 +3021,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent1CloudWatchAgentComponentEF606A78", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", "Arn" ] } @@ -3947,7 +3029,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent2RunnerUserComponentEE2EFAA9", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", "Arn" ] } @@ -3955,7 +3037,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent3GitComponent11319ECE", + "AMILinuxBuilderComponent3GitComponent9011E3AB", "Arn" ] } @@ -3963,7 +3045,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent4GithubCliComponent21834DCF", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", "Arn" ] } @@ -3971,7 +3053,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent5AwsCliComponent3AA64EA2", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", "Arn" ] } @@ -3979,7 +3061,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent6DockerComponentD5E4165F", + "AMILinuxBuilderComponent6DockerComponent9E523A42", "Arn" ] } @@ -3987,7 +3069,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent7GithubRunnerComponent898B6A50", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", "Arn" ] } @@ -3995,7 +3077,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent8CustomUndefinedComponentCF5507D3", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", "Arn" ] } @@ -4003,7 +3085,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", "Arn" ] } @@ -6655,567 +5737,119 @@ } } }, - "AMILinuxarm64BuilderComponent0RequiredPackagesVersion7CCB5268": { - "Type": "Custom::ImageBuilder-Component-Version", + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60": { + "Type": "AWS::ImageBuilder::Component", "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component0RequiredPackages-2E0C774A", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 0 RequiredPackages", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get upgrade -y", - "DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates" - ] - } - } - ] - } - ] - }, - "description": "Component 0 RequiredPackages" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent0RequiredPackagesComponent2ABFFC8F": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "{\"name\":\"Component 0 RequiredPackages\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\"]}}]}]}", + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-AMILinuxarm64Builder-Component0RequiredPackages-2E0C774A", + "Name": "github-runners-test-amilinuxarm64builder-component0requiredpackages-component-24f2e247", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent0RequiredPackagesVersion7CCB5268" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent1CloudWatchAgentVersion6EE6E557": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component1CloudWatchAgent-0EF6E92C", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 1 CloudWatchAgent", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -sfLo /tmp/amazon-cloudwatch-agent.deb https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb", - "dpkg -i -E /tmp/amazon-cloudwatch-agent.deb", - "rm /tmp/amazon-cloudwatch-agent.deb" - ] - } - } - ] - } - ] - }, - "description": "Component 1 CloudWatchAgent" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentE8D7E944": { + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 1 CloudWatchAgent\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -sfLo /tmp/amazon-cloudwatch-agent.deb https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb\",\"dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\",\"rm /tmp/amazon-cloudwatch-agent.deb\"]}}]}]}", + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", "Description": "Component 1 CloudWatchAgent", - "Name": "github-runners-test-AMILinuxarm64Builder-Component1CloudWatchAgent-0EF6E92C", + "Name": "github-runners-test-amilinuxarm64builder-component1cloudwatchagent-component-9127095a", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent1CloudWatchAgentVersion6EE6E557" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent2RunnerUserVersionC25EBA09": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component2RunnerUser-0681B87A", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 2 RunnerUser", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "addgroup runner", - "adduser --system --disabled-password --home /home/runner --ingroup runner runner", - "echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" > /etc/sudoers.d/runner" - ] - } - } - ] - } - ] - }, - "description": "Component 2 RunnerUser" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent2RunnerUserComponent81DDD70D": { + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 2 RunnerUser\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"addgroup runner\",\"adduser --system --disabled-password --home /home/runner --ingroup runner runner\",\"echo \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\"]}}]}]}", + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", "Description": "Component 2 RunnerUser", - "Name": "github-runners-test-AMILinuxarm64Builder-Component2RunnerUser-0681B87A", + "Name": "github-runners-test-amilinuxarm64builder-component2runneruser-component-360117bd", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent2RunnerUserVersionC25EBA09" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent3GitVersion792CCDDA": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component3Git-60F51A23", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 3 Git", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "add-apt-repository ppa:git-core/ppa", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get install -y git" - ] - } - } - ] - } - ] - }, - "description": "Component 3 Git" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent3GitComponent341EEEFC": { + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 3 Git\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"add-apt-repository ppa:git-core/ppa\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y git\"]}}]}]}", + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", "Description": "Component 3 Git", - "Name": "github-runners-test-AMILinuxarm64Builder-Component3Git-60F51A23", + "Name": "github-runners-test-amilinuxarm64builder-component3git-component-c3215149", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent3GitVersion792CCDDA" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent4GithubCliVersion72C57128": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component4GithubCli-3AC99B64", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 4 GithubCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg", - "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get install -y gh" - ] - } - } - ] - } - ] - }, - "description": "Component 4 GithubCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent4GithubCliComponentBB29E40E": { + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 4 GithubCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\",\"echo \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y gh\"]}}]}]}", + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", "Description": "Component 4 GithubCli", - "Name": "github-runners-test-AMILinuxarm64Builder-Component4GithubCli-3AC99B64", + "Name": "github-runners-test-amilinuxarm64builder-component4githubcli-component-585d1ee4", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent4GithubCliVersion72C57128" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent5AwsCliVersion69CAE829": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component5AwsCli-30A943D2", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 5 AwsCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -fsSL \"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\" -o awscliv2.zip", - "unzip -q awscliv2.zip", - "./aws/install", - "rm -rf awscliv2.zip aws" - ] - } - } - ] - } - ] - }, - "description": "Component 5 AwsCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent5AwsCliComponentDFF10DCB": { + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 5 AwsCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\",\"unzip -q awscliv2.zip\",\"./aws/install\",\"rm -rf awscliv2.zip aws\"]}}]}]}", + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", "Description": "Component 5 AwsCli", - "Name": "github-runners-test-AMILinuxarm64Builder-Component5AwsCli-30A943D2", + "Name": "github-runners-test-amilinuxarm64builder-component5awscli-component-706b4769", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent5AwsCliVersion69CAE829" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent6DockerVersion2E656587": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component6Docker-F2A09CCF", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 6 Docker", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg", - "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null", - "apt-get update", - "DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin", - "usermod -aG docker runner", - "ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose" - ] - } - } - ] - } - ] - }, - "description": "Component 6 Docker" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent6DockerComponent1A04C1F4": { + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 6 Docker\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\",\"echo \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\",\"apt-get update\",\"DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\",\"usermod -aG docker runner\",\"ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\"]}}]}]}", + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", "Description": "Component 6 Docker", - "Name": "github-runners-test-AMILinuxarm64Builder-Component6Docker-F2A09CCF", + "Name": "github-runners-test-amilinuxarm64builder-component6docker-component-4c582cde", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent6DockerVersion2E656587" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent7GithubRunnerVersion8A7FD98B": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component7GithubRunner-F14E4EA6", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 7 GithubRunner", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \"[^/v]+$\"`", - "curl -fsSLO \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"", - "tar -C /home/runner -xzf \"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"", - "rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz", - "echo -n latest > /home/runner/RUNNER_VERSION", - "/home/runner/bin/installdependencies.sh", - "mkdir -p /opt/hostedtoolcache", - "chown runner /opt/hostedtoolcache" - ] - } - } - ] - } - ] - }, - "description": "Component 7 GithubRunner" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent7GithubRunnerComponentE1EF4281": { + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 7 GithubRunner\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"RUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\",\"curl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\",\"tar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\",\"rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\",\"echo -n latest > /home/runner/RUNNER_VERSION\",\"/home/runner/bin/installdependencies.sh\",\"mkdir -p /opt/hostedtoolcache\",\"chown runner /opt/hostedtoolcache\"]}}]}]}", + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", "Description": "Component 7 GithubRunner", - "Name": "github-runners-test-AMILinuxarm64Builder-Component7GithubRunner-F14E4EA6", + "Name": "github-runners-test-amilinuxarm64builder-component7githubrunner-component-bdc80137", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent7GithubRunnerVersion8A7FD98B" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent8CustomUndefinedVersion1F3CA7BE": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component8Custom-Undefined-6E825627", - "VersionedData": { - "platform": "Linux", - "data": { - "name": "Component 8 Custom-Undefined", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [ - { - "source": { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "destination": "FUNDING.yml" - } - ] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "touch /custom-file", - "mkdir /custom-dir", - "mv FUNDING.yml /custom-dir" - ] - } - } - ] - } - ] - }, - "description": "Component 8 Custom-Undefined" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent8BF2DD41": { + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437": { "Type": "AWS::ImageBuilder::Component", "Properties": { "Data": { "Fn::Join": [ "", [ - "{\"name\":\"Component 8 Custom-Undefined\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[{\"source\":\"", + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", { "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" }, - "\",\"destination\":\"FUNDING.yml\"}]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"touch /custom-file\",\"mkdir /custom-dir\",\"mv FUNDING.yml /custom-dir\"]}}]}]}" + "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" ] ] }, "Description": "Component 8 Custom-Undefined", - "Name": "github-runners-test-AMILinuxarm64Builder-Component8Custom-Undefined-6E825627", + "Name": "github-runners-test-amilinuxarm64builder-component8custom-undefined-component-e23d33b6", "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent8CustomUndefinedVersion1F3CA7BE" - } + "Version": "1.0.0" } }, - "AMILinuxarm64BuilderComponent9EnvironmentVariablesVersion30CC0910": { - "Type": "Custom::ImageBuilder-Component-Version", + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-amilinuxarm64builder-component9environmentvariables-component-25ee7189", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderAmiRecipeVersion429E7646": { + "Type": "Custom::ImageBuilder-ImageRecipe-Version", "Properties": { "ServiceToken": { "Fn::GetAtt": [ @@ -7223,81 +5857,23 @@ "Arn" ] }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-Component9EnvironmentVariables-70B09CB2", + "ObjectType": "ImageRecipe", + "ObjectName": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", "VersionedData": { "platform": "Linux", - "data": { - "name": "Component 9 EnvironmentVariables", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecuteBash", - "inputs": { - "commands": [ - "set -ex", - "echo 'HELLO=world' >> /home/runner/.env", - "echo 'FOO=bar' >> /home/runner/.env" - ] - } - } - ] - } - ] - }, - "description": "Component 9 EnvironmentVariables" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent99728C6D": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "{\"name\":\"Component 9 EnvironmentVariables\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecuteBash\",\"inputs\":{\"commands\":[\"set -ex\",\"echo 'HELLO=world' >> /home/runner/.env\",\"echo 'FOO=bar' >> /home/runner/.env\"]}}]}]}", - "Description": "Component 9 EnvironmentVariables", - "Name": "github-runners-test-AMILinuxarm64Builder-Component9EnvironmentVariables-70B09CB2", - "Platform": "Linux", - "Version": { - "Ref": "AMILinuxarm64BuilderComponent9EnvironmentVariablesVersion30CC0910" - } - } - }, - "AMILinuxarm64BuilderAmiRecipeVersion429E7646": { - "Type": "Custom::ImageBuilder-ImageRecipe-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "ImageRecipe", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", - "VersionedData": { - "platform": "Linux", - "components": [ - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent0RequiredPackagesComponent2ABFFC8F", - "Arn" + "components": [ + { + "componentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", + "Arn" ] } }, { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentE8D7E944", + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", "Arn" ] } @@ -7305,7 +5881,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent2RunnerUserComponent81DDD70D", + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", "Arn" ] } @@ -7313,7 +5889,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent3GitComponent341EEEFC", + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", "Arn" ] } @@ -7321,7 +5897,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent4GithubCliComponentBB29E40E", + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", "Arn" ] } @@ -7329,7 +5905,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent5AwsCliComponentDFF10DCB", + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", "Arn" ] } @@ -7337,7 +5913,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent6DockerComponent1A04C1F4", + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", "Arn" ] } @@ -7345,7 +5921,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent7GithubRunnerComponentE1EF4281", + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", "Arn" ] } @@ -7353,7 +5929,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent8BF2DD41", + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", "Arn" ] } @@ -7361,7 +5937,7 @@ { "componentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent99728C6D", + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", "Arn" ] } @@ -7399,7 +5975,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent0RequiredPackagesComponent2ABFFC8F", + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", "Arn" ] } @@ -7407,7 +5983,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentE8D7E944", + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", "Arn" ] } @@ -7415,7 +5991,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent2RunnerUserComponent81DDD70D", + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", "Arn" ] } @@ -7423,7 +5999,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent3GitComponent341EEEFC", + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", "Arn" ] } @@ -7431,7 +6007,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent4GithubCliComponentBB29E40E", + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", "Arn" ] } @@ -7439,7 +6015,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent5AwsCliComponentDFF10DCB", + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", "Arn" ] } @@ -7447,7 +6023,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent6DockerComponent1A04C1F4", + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", "Arn" ] } @@ -7455,7 +6031,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent7GithubRunnerComponentE1EF4281", + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", "Arn" ] } @@ -7463,7 +6039,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent8BF2DD41", + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", "Arn" ] } @@ -7471,7 +6047,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent99728C6D", + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", "Arn" ] } @@ -7960,650 +6536,115 @@ } } }, - "WindowsEC2BuilderComponent0RequiredPackagesVersion08C0B23D": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component0RequiredPackages-29E311EC", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 0 RequiredPackages", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - } - ] - } - ] - }, - "description": "Component 0 RequiredPackages" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent0RequiredPackagesComponent42A20182": { + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 0 RequiredPackages\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]}]}]}", + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-WindowsEC2Builder-Component0RequiredPackages-29E311EC", + "Name": "github-runners-test-windowsec2builder-component0requiredpackages-component-bee13031", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent0RequiredPackagesVersion08C0B23D" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent1CloudWatchAgentVersion1BBAB463": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component1CloudWatchAgent-1AA08FD8", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 1 CloudWatchAgent", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi /qn'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }" - ] - } - } - ] - } - ] - }, - "description": "Component 1 CloudWatchAgent" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent1CloudWatchAgentComponent0259F61E": { + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 1 CloudWatchAgent\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi /qn'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\"]}}]}]}", + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi\n /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", "Description": "Component 1 CloudWatchAgent", - "Name": "github-runners-test-WindowsEC2Builder-Component1CloudWatchAgent-1AA08FD8", + "Name": "github-runners-test-windowsec2builder-component1cloudwatchagent-component-64d3d72a", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent1CloudWatchAgentVersion1BBAB463" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent2RunnerUserVersionAC4C576C": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component2RunnerUser-9F617778", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 2 RunnerUser", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - } - ] - } - ] - }, - "description": "Component 2 RunnerUser" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent2RunnerUserComponentB482ECD9": { + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 2 RunnerUser\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]}]}]}", + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", "Description": "Component 2 RunnerUser", - "Name": "github-runners-test-WindowsEC2Builder-Component2RunnerUser-9F617778", + "Name": "github-runners-test-windowsec2builder-component2runneruser-component-91981b9f", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent2RunnerUserVersionAC4C576C" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent3GitVersion13A51650": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component3Git-73F699B0", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 3 Git", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/git-for-windows/git/releases/latest > $Env:TEMP\\latest-git", - "$LatestUrl = Get-Content $Env:TEMP\\latest-git", - "$GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "$GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]", - "$GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]", - "If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT = \"$GIT_VERSION_SHORT.$GIT_REVISION\"}", - "Invoke-WebRequest -UseBasicParsing -Uri https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe -OutFile git-setup.exe", - "$p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList '/VERYSILENT'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }", - "del git-setup.exe" - ] - } - } - ] - } - ] - }, - "description": "Component 3 Git" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent3GitComponent71764393": { + "WindowsEC2BuilderComponent3GitComponent4F86AE54": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 3 Git\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/git-for-windows/git/releases/latest > $Env:TEMP\\\\latest-git\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-git\",\"$GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"$GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\",\"$GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\",\"If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT = \\\"$GIT_VERSION_SHORT.$GIT_REVISION\\\"}\",\"Invoke-WebRequest -UseBasicParsing -Uri https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe -OutFile git-setup.exe\",\"$p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList '/VERYSILENT'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\",\"del git-setup.exe\"]}}]}]}", + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", "Description": "Component 3 Git", - "Name": "github-runners-test-WindowsEC2Builder-Component3Git-73F699B0", + "Name": "github-runners-test-windowsec2builder-component3git-component-cc6f418c", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent3GitVersion13A51650" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent4GithubCliVersionE106A3DA": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component4GithubCli-57AD0DA2", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 4 GithubCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh", - "$LatestUrl = Get-Content $Env:TEMP\\latest-gh", - "$GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\" -OutFile gh.msi", - "$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i gh.msi /qn'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }", - "del gh.msi" - ] - } - } - ] - } - ] - }, - "description": "Component 4 GithubCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent4GithubCliComponent4C5B4A15": { + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 4 GithubCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/cli/cli/releases/latest > $Env:TEMP\\\\latest-gh\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-gh\",\"$GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\\\" -OutFile gh.msi\",\"$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i gh.msi /qn'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\",\"del gh.msi\"]}}]}]}", + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", "Description": "Component 4 GithubCli", - "Name": "github-runners-test-WindowsEC2Builder-Component4GithubCli-57AD0DA2", + "Name": "github-runners-test-windowsec2builder-component4githubcli-component-860aefc0", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent4GithubCliVersionE106A3DA" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent5AwsCliVersionF88E14E7": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component5AwsCli-9A139D36", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 5 AwsCli", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i https://awscli.amazonaws.com/AWSCLIV2.msi /qn'", - "if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }" - ] - } - } - ] - } - ] - }, - "description": "Component 5 AwsCli" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent5AwsCliComponentA5AD7E67": { + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 5 AwsCli\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"$p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\",\"if ($p.ExitCode -ne 0) { throw \\\"Exit code is $p.ExitCode\\\" }\"]}}]}]}", + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", "Description": "Component 5 AwsCli", - "Name": "github-runners-test-WindowsEC2Builder-Component5AwsCli-9A139D36", + "Name": "github-runners-test-windowsec2builder-component5awscli-component-c6a315bd", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent5AwsCliVersionF88E14E7" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent6DockerVersionF82FADF5": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component6Docker-A5CAA74F", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 6 Docker", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "$BaseUrl = \"https://download.docker.com/win/static/stable/x86_64/\"", - "$html = Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl", - "$files = $html.Links.href | Where-Object { $_ -match '^docker-[0-9\\.]+\\.zip$' }", - "if (-not $files) { Write-Error \"No docker-*.zip files found.\" ; exit 1 }", - "$latest = $files | Sort-Object { try { [Version]($_ -replace '^docker-|\\.zip$') } catch { [Version]\"0.0.0\" } } -Descending | Select-Object -First 1", - "Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl$latest -OutFile docker.zip", - "Expand-Archive docker.zip -DestinationPath \"$Env:ProgramFiles\"", - "del docker.zip", - "$persistedPaths = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)", - "[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths + \";$Env:ProgramFiles\\Docker\", [EnvironmentVariableTarget]::Machine)", - "$env:PATH = $env:PATH + \";$Env:ProgramFiles\\Docker\"", - "dockerd --register-service", - "if ($LASTEXITCODE -ne 0) { throw \"Exit code is $LASTEXITCODE\" }", - "Enable-WindowsOptionalFeature -Online -FeatureName containers -All -NoRestart", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/docker/compose/releases/latest > $Env:TEMP\\latest-docker-compose", - "$LatestUrl = Get-Content $Env:TEMP\\latest-docker-compose", - "$LatestDockerCompose = ($LatestUrl -Split '/')[-1]", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/docker/compose/releases/download/${LatestDockerCompose}/docker-compose-Windows-x86_64.exe\" -OutFile $Env:ProgramFiles\\Docker\\docker-compose.exe", - "New-Item -ItemType directory -Path \"$Env:ProgramFiles\\Docker\\cli-plugins\"", - "Copy-Item -Path \"$Env:ProgramFiles\\Docker\\docker-compose.exe\" -Destination \"$Env:ProgramFiles\\Docker\\cli-plugins\\docker-compose.exe\"" - ] - } - }, - { - "name": "Reboot", - "action": "Reboot", - "inputs": {} - } - ] - } - ] - }, - "description": "Component 6 Docker" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent6DockerComponent0A5C21D2": { + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 6 Docker\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"$BaseUrl = \\\"https://download.docker.com/win/static/stable/x86_64/\\\"\",\"$html = Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl\",\"$files = $html.Links.href | Where-Object { $_ -match '^docker-[0-9\\\\.]+\\\\.zip$' }\",\"if (-not $files) { Write-Error \\\"No docker-*.zip files found.\\\" ; exit 1 }\",\"$latest = $files | Sort-Object { try { [Version]($_ -replace '^docker-|\\\\.zip$') } catch { [Version]\\\"0.0.0\\\" } } -Descending | Select-Object -First 1\",\"Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl$latest -OutFile docker.zip\",\"Expand-Archive docker.zip -DestinationPath \\\"$Env:ProgramFiles\\\"\",\"del docker.zip\",\"$persistedPaths = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)\",\"[Environment]::SetEnvironmentVariable(\\\"PATH\\\", $persistedPaths + \\\";$Env:ProgramFiles\\\\Docker\\\", [EnvironmentVariableTarget]::Machine)\",\"$env:PATH = $env:PATH + \\\";$Env:ProgramFiles\\\\Docker\\\"\",\"dockerd --register-service\",\"if ($LASTEXITCODE -ne 0) { throw \\\"Exit code is $LASTEXITCODE\\\" }\",\"Enable-WindowsOptionalFeature -Online -FeatureName containers -All -NoRestart\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/docker/compose/releases/latest > $Env:TEMP\\\\latest-docker-compose\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-docker-compose\",\"$LatestDockerCompose = ($LatestUrl -Split '/')[-1]\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/docker/compose/releases/download/${LatestDockerCompose}/docker-compose-Windows-x86_64.exe\\\" -OutFile $Env:ProgramFiles\\\\Docker\\\\docker-compose.exe\",\"New-Item -ItemType directory -Path \\\"$Env:ProgramFiles\\\\Docker\\\\cli-plugins\\\"\",\"Copy-Item -Path \\\"$Env:ProgramFiles\\\\Docker\\\\docker-compose.exe\\\" -Destination \\\"$Env:ProgramFiles\\\\Docker\\\\cli-plugins\\\\docker-compose.exe\\\"\"]}},{\"name\":\"Reboot\",\"action\":\"Reboot\",\"inputs\":{}}]}]}", + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $BaseUrl = \"https://download.docker.com/win/static/stable/x86_64/\"\n - $html = Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl\n - $files = $html.Links.href | Where-Object { $_ -match\n '^docker-[0-9\\.]+\\.zip$' }\n - if (-not $files) { Write-Error \"No docker-*.zip files found.\" ;\n exit 1 }\n - $latest = $files | Sort-Object { try { [Version]($_ -replace\n '^docker-|\\.zip$') } catch { [Version]\"0.0.0\" } } -Descending |\n Select-Object -First 1\n - Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl$latest -OutFile\n docker.zip\n - Expand-Archive docker.zip -DestinationPath \"$Env:ProgramFiles\"\n - del docker.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";$Env:ProgramFiles\\Docker\",\n [EnvironmentVariableTarget]::Machine)'\n - $env:PATH = $env:PATH + \";$Env:ProgramFiles\\Docker\"\n - dockerd --register-service\n - if ($LASTEXITCODE -ne 0) { throw \"Exit code is $LASTEXITCODE\" }\n - Enable-WindowsOptionalFeature -Online -FeatureName containers -All\n -NoRestart\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/docker/compose/releases/latest >\n $Env:TEMP\\latest-docker-compose\n - $LatestUrl = Get-Content $Env:TEMP\\latest-docker-compose\n - $LatestDockerCompose = ($LatestUrl -Split '/')[-1]\n - Invoke-WebRequest -UseBasicParsing\n -Uri \"https://github.com/docker/compose/releases/download/${LatestDockerCompose}/docker-compose-Windows-x86_64.exe\"\n -OutFile $Env:ProgramFiles\\Docker\\docker-compose.exe\n - New-Item -ItemType directory -Path\n \"$Env:ProgramFiles\\Docker\\cli-plugins\"\n - Copy-Item -Path \"$Env:ProgramFiles\\Docker\\docker-compose.exe\"\n -Destination\n \"$Env:ProgramFiles\\Docker\\cli-plugins\\docker-compose.exe\"\n - name: Reboot\n action: Reboot\n inputs: {}\n", "Description": "Component 6 Docker", - "Name": "github-runners-test-WindowsEC2Builder-Component6Docker-A5CAA74F", + "Name": "github-runners-test-windowsec2builder-component6docker-component-69981091", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent6DockerVersionF82FADF5" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent7GithubRunnerVersionC0E6DE45": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component7GithubRunner-B919BFBF", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 7 GithubRunner", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/actions/runner/releases/latest > $Env:TEMP\\latest-gha", - "$LatestUrl = Get-Content $Env:TEMP\\latest-gha", - "$RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "mkdir C:\\hostedtoolcache\\windows", - "mkdir C:\\tools", - "cmd /c curl -w \"%{redirect_url}\" -fsS https://github.com/facebook/zstd/releases/latest > $Env:TEMP\\latest-zstd", - "$LatestUrl = Get-Content $Env:TEMP\\latest-zstd", - "$ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\" -OutFile zstd.zip", - "Expand-Archive zstd.zip -DestinationPath C:\\tools", - "Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe C:\\tools", - "Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\" -Force -Recurse", - "del zstd.zip", - "$persistedPaths = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)", - "[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths + \";C:\\tools\", [EnvironmentVariableTarget]::Machine)", - "Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\" -OutFile actions.zip", - "Expand-Archive actions.zip -DestinationPath C:\\actions", - "del actions.zip", - "echo latest | Out-File -Encoding ASCII -NoNewline C:\\actions\\RUNNER_VERSION" - ] - } - } - ] - } - ] - }, - "description": "Component 7 GithubRunner" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent7GithubRunnerComponentB05EF94B": { + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 7 GithubRunner\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest > $Env:TEMP\\\\latest-gha\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-gha\",\"$RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"mkdir C:\\\\hostedtoolcache\\\\windows\",\"mkdir C:\\\\tools\",\"cmd /c curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/facebook/zstd/releases/latest > $Env:TEMP\\\\latest-zstd\",\"$LatestUrl = Get-Content $Env:TEMP\\\\latest-zstd\",\"$ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\\\" -OutFile zstd.zip\",\"Expand-Archive zstd.zip -DestinationPath C:\\\\tools\",\"Move-Item -Path C:\\\\tools\\\\zstd-v$ZSTD_VERSION-win64\\\\zstd.exe C:\\\\tools\",\"Remove-Item -LiteralPath \\\"C:\\\\tools\\\\zstd-v$ZSTD_VERSION-win64\\\" -Force -Recurse\",\"del zstd.zip\",\"$persistedPaths = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)\",\"[Environment]::SetEnvironmentVariable(\\\"PATH\\\", $persistedPaths + \\\";C:\\\\tools\\\", [EnvironmentVariableTarget]::Machine)\",\"Invoke-WebRequest -UseBasicParsing -Uri \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\\\" -OutFile actions.zip\",\"Expand-Archive actions.zip -DestinationPath C:\\\\actions\",\"del actions.zip\",\"echo latest | Out-File -Encoding ASCII -NoNewline C:\\\\actions\\\\RUNNER_VERSION\"]}}]}]}", + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", "Description": "Component 7 GithubRunner", - "Name": "github-runners-test-WindowsEC2Builder-Component7GithubRunner-B919BFBF", + "Name": "github-runners-test-windowsec2builder-component7githubrunner-component-a31c580e", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent7GithubRunnerVersionC0E6DE45" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent8CustomUndefinedVersion451771BF": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component8Custom-Undefined-82FF61E0", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 8 Custom-Undefined", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [ - { - "source": { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "destination": "FUNDING.yml" - } - ] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "New-Item -ItemType file -Path / -Name custom-file", - "New-Item -ItemType directory -Path / -Name custom-dir", - "Move-Item FUNDING.yml /custom-dir" - ] - } - } - ] - } - ] - }, - "description": "Component 8 Custom-Undefined" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent8CustomUndefinedComponent1B25F637": { + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552": { "Type": "AWS::ImageBuilder::Component", "Properties": { "Data": { "Fn::Join": [ "", [ - "{\"name\":\"Component 8 Custom-Undefined\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[{\"source\":\"", + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", { "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" }, - "\",\"destination\":\"FUNDING.yml\"}]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"New-Item -ItemType file -Path / -Name custom-file\",\"New-Item -ItemType directory -Path / -Name custom-dir\",\"Move-Item FUNDING.yml /custom-dir\"]}}]}]}" + "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" ] ] }, "Description": "Component 8 Custom-Undefined", - "Name": "github-runners-test-WindowsEC2Builder-Component8Custom-Undefined-82FF61E0", + "Name": "github-runners-test-windowsec2builder-component8custom-undefined-component-c961cd3a", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent8CustomUndefinedVersion451771BF" - } + "Version": "1.0.0" } }, - "WindowsEC2BuilderComponent9EnvironmentVariablesVersionCE6A1762": { - "Type": "Custom::ImageBuilder-Component-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "Component", - "ObjectName": "github-runners-test-WindowsEC2Builder-Component9EnvironmentVariables-06A82763", - "VersionedData": { - "platform": "Windows", - "data": { - "name": "Component 9 EnvironmentVariables", - "schemaVersion": "1.0", - "phases": [ - { - "name": "build", - "steps": [ - { - "name": "Download", - "action": "S3Download", - "inputs": [] - }, - { - "name": "Run", - "action": "ExecutePowerShell", - "inputs": { - "commands": [ - "$ErrorActionPreference = 'Stop'", - "$ProgressPreference = 'SilentlyContinue'", - "Set-PSDebug -Trace 1", - "Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'", - "Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'" - ] - } - } - ] - } - ] - }, - "description": "Component 9 EnvironmentVariables" - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentF10003FD": { + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0": { "Type": "AWS::ImageBuilder::Component", "Properties": { - "Data": "{\"name\":\"Component 9 EnvironmentVariables\",\"schemaVersion\":\"1.0\",\"phases\":[{\"name\":\"build\",\"steps\":[{\"name\":\"Download\",\"action\":\"S3Download\",\"inputs\":[]},{\"name\":\"Run\",\"action\":\"ExecutePowerShell\",\"inputs\":{\"commands\":[\"$ErrorActionPreference = 'Stop'\",\"$ProgressPreference = 'SilentlyContinue'\",\"Set-PSDebug -Trace 1\",\"Add-Content -Path C:\\\\actions\\\\.env -Value 'HELLO=world'\",\"Add-Content -Path C:\\\\actions\\\\.env -Value 'FOO=bar'\"]}}]}]}", + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", "Description": "Component 9 EnvironmentVariables", - "Name": "github-runners-test-WindowsEC2Builder-Component9EnvironmentVariables-06A82763", + "Name": "github-runners-test-windowsec2builder-component9environmentvariables-component-9fb8d548", "Platform": "Windows", - "Version": { - "Ref": "WindowsEC2BuilderComponent9EnvironmentVariablesVersionCE6A1762" - } + "Version": "1.0.0" } }, "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C": { @@ -8623,7 +6664,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent0RequiredPackagesComponent42A20182", + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", "Arn" ] } @@ -8631,7 +6672,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent1CloudWatchAgentComponent0259F61E", + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", "Arn" ] } @@ -8639,7 +6680,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent2RunnerUserComponentB482ECD9", + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", "Arn" ] } @@ -8647,7 +6688,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent3GitComponent71764393", + "WindowsEC2BuilderComponent3GitComponent4F86AE54", "Arn" ] } @@ -8655,7 +6696,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent4GithubCliComponent4C5B4A15", + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", "Arn" ] } @@ -8663,7 +6704,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent5AwsCliComponentA5AD7E67", + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", "Arn" ] } @@ -8671,7 +6712,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent6DockerComponent0A5C21D2", + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", "Arn" ] } @@ -8679,7 +6720,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent7GithubRunnerComponentB05EF94B", + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", "Arn" ] } @@ -8687,7 +6728,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent8CustomUndefinedComponent1B25F637", + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", "Arn" ] } @@ -8695,7 +6736,7 @@ { "componentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentF10003FD", + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", "Arn" ] } @@ -8733,7 +6774,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent0RequiredPackagesComponent42A20182", + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", "Arn" ] } @@ -8741,7 +6782,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent1CloudWatchAgentComponent0259F61E", + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", "Arn" ] } @@ -8749,7 +6790,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent2RunnerUserComponentB482ECD9", + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", "Arn" ] } @@ -8757,7 +6798,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent3GitComponent71764393", + "WindowsEC2BuilderComponent3GitComponent4F86AE54", "Arn" ] } @@ -8765,7 +6806,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent4GithubCliComponent4C5B4A15", + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", "Arn" ] } @@ -8773,7 +6814,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent5AwsCliComponentA5AD7E67", + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", "Arn" ] } @@ -8781,7 +6822,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent6DockerComponent0A5C21D2", + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", "Arn" ] } @@ -8789,7 +6830,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent7GithubRunnerComponentB05EF94B", + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", "Arn" ] } @@ -8797,7 +6838,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent8CustomUndefinedComponent1B25F637", + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", "Arn" ] } @@ -8805,7 +6846,7 @@ { "ComponentArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentF10003FD", + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", "Arn" ] } @@ -13610,7 +11651,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "8d5e97812d0036272ba1fd5bb8772ff51f4712e58c75507e4a0db242bf680f1d.zip" + "S3Key": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip" }, "Handler": "index.handler", "LoggingConfig": { @@ -15638,26 +13679,16 @@ "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", "AMILinuxBuilderAmiRecipe7C7ED6C7", "AMILinuxBuilderAmiRecipeVersionFBE9C9AE", - "AMILinuxBuilderComponent0RequiredPackagesComponent6D0029EE", - "AMILinuxBuilderComponent0RequiredPackagesVersion1DA9F296", - "AMILinuxBuilderComponent1CloudWatchAgentComponentEF606A78", - "AMILinuxBuilderComponent1CloudWatchAgentVersionF6CE8122", - "AMILinuxBuilderComponent2RunnerUserComponentEE2EFAA9", - "AMILinuxBuilderComponent2RunnerUserVersion7235C1B1", - "AMILinuxBuilderComponent3GitComponent11319ECE", - "AMILinuxBuilderComponent3GitVersion7B3BEDD6", - "AMILinuxBuilderComponent4GithubCliComponent21834DCF", - "AMILinuxBuilderComponent4GithubCliVersionE4F9F8C3", - "AMILinuxBuilderComponent5AwsCliComponent3AA64EA2", - "AMILinuxBuilderComponent5AwsCliVersionC6151B91", - "AMILinuxBuilderComponent6DockerComponentD5E4165F", - "AMILinuxBuilderComponent6DockerVersion8FF46707", - "AMILinuxBuilderComponent7GithubRunnerComponent898B6A50", - "AMILinuxBuilderComponent7GithubRunnerVersion6BDEFC52", - "AMILinuxBuilderComponent8CustomUndefinedComponentCF5507D3", - "AMILinuxBuilderComponent8CustomUndefinedVersionF6AA0039", - "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E", - "AMILinuxBuilderComponent9EnvironmentVariablesVersion008D0039", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", "AMILinuxBuilderImageCleanerF1745EF6", "AMILinuxBuilderInfrastructureInstanceProfileB423D304", "AMILinuxBuilderInfrastructure069F0561", @@ -15881,26 +13912,16 @@ "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", "AMILinuxBuilderAmiRecipe7C7ED6C7", "AMILinuxBuilderAmiRecipeVersionFBE9C9AE", - "AMILinuxBuilderComponent0RequiredPackagesComponent6D0029EE", - "AMILinuxBuilderComponent0RequiredPackagesVersion1DA9F296", - "AMILinuxBuilderComponent1CloudWatchAgentComponentEF606A78", - "AMILinuxBuilderComponent1CloudWatchAgentVersionF6CE8122", - "AMILinuxBuilderComponent2RunnerUserComponentEE2EFAA9", - "AMILinuxBuilderComponent2RunnerUserVersion7235C1B1", - "AMILinuxBuilderComponent3GitComponent11319ECE", - "AMILinuxBuilderComponent3GitVersion7B3BEDD6", - "AMILinuxBuilderComponent4GithubCliComponent21834DCF", - "AMILinuxBuilderComponent4GithubCliVersionE4F9F8C3", - "AMILinuxBuilderComponent5AwsCliComponent3AA64EA2", - "AMILinuxBuilderComponent5AwsCliVersionC6151B91", - "AMILinuxBuilderComponent6DockerComponentD5E4165F", - "AMILinuxBuilderComponent6DockerVersion8FF46707", - "AMILinuxBuilderComponent7GithubRunnerComponent898B6A50", - "AMILinuxBuilderComponent7GithubRunnerVersion6BDEFC52", - "AMILinuxBuilderComponent8CustomUndefinedComponentCF5507D3", - "AMILinuxBuilderComponent8CustomUndefinedVersionF6AA0039", - "AMILinuxBuilderComponent9EnvironmentVariablesComponent59394D7E", - "AMILinuxBuilderComponent9EnvironmentVariablesVersion008D0039", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", "AMILinuxBuilderImageCleanerF1745EF6", "AMILinuxBuilderInfrastructureInstanceProfileB423D304", "AMILinuxBuilderInfrastructure069F0561", @@ -16087,26 +14108,16 @@ "AMILinuxarm64BuilderAMIPipeline9CC1354C", "AMILinuxarm64BuilderAmiRecipe6A6ED38F", "AMILinuxarm64BuilderAmiRecipeVersion429E7646", - "AMILinuxarm64BuilderComponent0RequiredPackagesComponent2ABFFC8F", - "AMILinuxarm64BuilderComponent0RequiredPackagesVersion7CCB5268", - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentE8D7E944", - "AMILinuxarm64BuilderComponent1CloudWatchAgentVersion6EE6E557", - "AMILinuxarm64BuilderComponent2RunnerUserComponent81DDD70D", - "AMILinuxarm64BuilderComponent2RunnerUserVersionC25EBA09", - "AMILinuxarm64BuilderComponent3GitComponent341EEEFC", - "AMILinuxarm64BuilderComponent3GitVersion792CCDDA", - "AMILinuxarm64BuilderComponent4GithubCliComponentBB29E40E", - "AMILinuxarm64BuilderComponent4GithubCliVersion72C57128", - "AMILinuxarm64BuilderComponent5AwsCliComponentDFF10DCB", - "AMILinuxarm64BuilderComponent5AwsCliVersion69CAE829", - "AMILinuxarm64BuilderComponent6DockerComponent1A04C1F4", - "AMILinuxarm64BuilderComponent6DockerVersion2E656587", - "AMILinuxarm64BuilderComponent7GithubRunnerComponentE1EF4281", - "AMILinuxarm64BuilderComponent7GithubRunnerVersion8A7FD98B", - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent8BF2DD41", - "AMILinuxarm64BuilderComponent8CustomUndefinedVersion1F3CA7BE", - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent99728C6D", - "AMILinuxarm64BuilderComponent9EnvironmentVariablesVersion30CC0910", + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", "AMILinuxarm64BuilderImageCleanerA5DDFE7A", "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", "AMILinuxarm64BuilderInfrastructureA97EB3DD", @@ -16293,26 +14304,16 @@ "WindowsEC2BuilderAMIPipelineE3836949", "WindowsEC2BuilderAmiRecipe41A137FF", "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C", - "WindowsEC2BuilderComponent0RequiredPackagesComponent42A20182", - "WindowsEC2BuilderComponent0RequiredPackagesVersion08C0B23D", - "WindowsEC2BuilderComponent1CloudWatchAgentComponent0259F61E", - "WindowsEC2BuilderComponent1CloudWatchAgentVersion1BBAB463", - "WindowsEC2BuilderComponent2RunnerUserComponentB482ECD9", - "WindowsEC2BuilderComponent2RunnerUserVersionAC4C576C", - "WindowsEC2BuilderComponent3GitComponent71764393", - "WindowsEC2BuilderComponent3GitVersion13A51650", - "WindowsEC2BuilderComponent4GithubCliComponent4C5B4A15", - "WindowsEC2BuilderComponent4GithubCliVersionE106A3DA", - "WindowsEC2BuilderComponent5AwsCliComponentA5AD7E67", - "WindowsEC2BuilderComponent5AwsCliVersionF88E14E7", - "WindowsEC2BuilderComponent6DockerComponent0A5C21D2", - "WindowsEC2BuilderComponent6DockerVersionF82FADF5", - "WindowsEC2BuilderComponent7GithubRunnerComponentB05EF94B", - "WindowsEC2BuilderComponent7GithubRunnerVersionC0E6DE45", - "WindowsEC2BuilderComponent8CustomUndefinedComponent1B25F637", - "WindowsEC2BuilderComponent8CustomUndefinedVersion451771BF", - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentF10003FD", - "WindowsEC2BuilderComponent9EnvironmentVariablesVersionCE6A1762", + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", + "WindowsEC2BuilderComponent3GitComponent4F86AE54", + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", "WindowsEC2BuilderImageCleanerEF537850", "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", "WindowsEC2BuilderInfrastructure4289B6D2", diff --git a/yarn.lock b/yarn.lock index c7cbd76e..9ebf7665 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,10 +23,10 @@ resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== -"@aws-cdk/aws-imagebuilder-alpha@2.224.0-alpha.0": - version "2.224.0-alpha.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.224.0-alpha.0.tgz#84f76d3c89a88f7a6a9bb81293b246482e0f19da" - integrity sha512-ImW63cadwY9zmoYHAPBuGt+xBXXxdpmFkjtXqVTPTxPocHL2zztq6cbAzBy5Lv1DtvmJwHrE8UzAx4VY1gP8lA== +"@aws-cdk/aws-imagebuilder-alpha@2.227.0-alpha.0": + version "2.227.0-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.227.0-alpha.0.tgz#e3f50636068533139af5ccd0e0195752772d2449" + integrity sha512-1NcqF0hcHhj0wEpgXhvI0L9OsfzIbuF9PRSWtSy+hgcsV0nQvXTpsZoah9ymXxKMjAdlHq8WrMct9FIrlShpSA== dependencies: yaml "1.10.2" @@ -3275,10 +3275,10 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.224.0: - version "2.224.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.224.0.tgz#8e62b31826b23e3796b01735397d2ab44f97d5ed" - integrity sha512-WWc9/LOhSd+QsN2ecfy67BfYBv8B5HQOze+nufNo48Z1TrHqkSJS74JzMN592nPztzjYHjVkcjCuXLJpSzwRig== +aws-cdk-lib@2.227.0: + version "2.227.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.227.0.tgz#e6cc5c84f3acecd2019d5c92944c27f38e8bcb77" + integrity sha512-55zrZrlmtV9IDwciqrqBfy4lV/ZbwZY4nKQosjKJmWC+Y+DYQbK3qO/NbaoeywNFxM5xHZ/bNFYdWqKXNkImWQ== dependencies: "@aws-cdk/asset-awscli-v1" "2.2.242" "@aws-cdk/asset-node-proxy-agent-v6" "^2.1.0" From b2d62229deaafaf5db6fa8e490713c635748d947 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Sat, 22 Nov 2025 12:27:30 -0500 Subject: [PATCH 07/19] distribution config L2 --- .../aws-image-builder/builder.ts | 78 +++++++------------ .../github-runners-test.assets.json | 6 +- .../github-runners-test.template.json | 47 ++++++----- 3 files changed, 54 insertions(+), 77 deletions(-) diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index a476019b..e53f0b29 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -394,21 +394,13 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { emptyOnDelete: true, }); - const dist = new imagebuilder.CfnDistributionConfiguration(this, 'Docker Distribution', { - name: uniqueImageBuilderName(this), + const dist = new imagebuilder2.DistributionConfiguration(this, 'Docker Distribution', { // description: this.description, - distributions: [ - { - region: Stack.of(this).region, - containerDistributionConfiguration: { - ContainerTags: ['latest'], - TargetRepository: { - Service: 'ECR', - RepositoryName: repository.repositoryName, - }, - }, - }, - ], + containerDistributions: [{ + region: Stack.of(this).region, + containerTags: ['latest'], + containerRepository: imagebuilder2.Repository.fromEcr(repository), + }], tags: this.tags, }); @@ -562,11 +554,11 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { return this.infrastructure; } - protected createImage(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder.CfnDistributionConfiguration, log: logs.LogGroup, + protected createImage(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder2.DistributionConfiguration, log: logs.LogGroup, imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImage { const image = new imagebuilder.CfnImage(this, this.amiOrContainerId('Image', imageRecipeArn, containerRecipeArn), { infrastructureConfigurationArn: infra.infrastructureConfigurationArn, - distributionConfigurationArn: dist.attrArn, + distributionConfigurationArn: dist.distributionConfigurationArn, imageRecipeArn, containerRecipeArn, imageTestsConfiguration: { @@ -596,7 +588,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { throw new Error('Either imageRecipeArn or containerRecipeArn must be defined'); } - protected createPipeline(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder.CfnDistributionConfiguration, log: logs.LogGroup, + protected createPipeline(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder2.DistributionConfiguration, log: logs.LogGroup, imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImagePipeline { // set schedule let scheduleOptions: imagebuilder.CfnImagePipeline.ScheduleProperty | undefined; @@ -627,7 +619,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { name: uniqueImageBuilderName(this), // description: this.description, infrastructureConfigurationArn: infra.infrastructureConfigurationArn, - distributionConfigurationArn: dist.attrArn, + distributionConfigurationArn: dist.distributionConfigurationArn, imageRecipeArn, containerRecipeArn, schedule: scheduleOptions, @@ -664,11 +656,11 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { requireImdsv2: true, }); - const launchTemplateConfigs: imagebuilder.CfnDistributionConfiguration.LaunchTemplateConfigurationProperty[] = [{ - launchTemplateId: launchTemplate.launchTemplateId, + const launchTemplateConfigs: imagebuilder2.LaunchTemplateConfiguration[] = [{ + launchTemplate: launchTemplate, setDefaultVersion: true, }]; - const fastLaunchConfigs: imagebuilder.CfnDistributionConfiguration.FastLaunchConfigurationProperty[] = []; + const fastLaunchConfigs: imagebuilder2.FastLaunchConfiguration[] = []; if (this.fastLaunchOptions?.enabled ?? false) { if (!this.os.is(Os.WINDOWS)) { @@ -716,48 +708,36 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { }], }], }); + const fastLaunchTemplateL2 = ec2.LaunchTemplate.fromLaunchTemplateAttributes(this, 'Fast Launch Template L2', { + launchTemplateId: fastLaunchTemplate.ref, + }); launchTemplateConfigs.push({ - launchTemplateId: fastLaunchTemplate.attrLaunchTemplateId, + launchTemplate: fastLaunchTemplateL2, setDefaultVersion: true, }); fastLaunchConfigs.push({ - enabled: true, - launchTemplate: { - launchTemplateId: fastLaunchTemplate.attrLaunchTemplateId, - }, + launchTemplate: fastLaunchTemplateL2, maxParallelLaunches: this.fastLaunchOptions?.maxParallelLaunches ?? 6, - snapshotConfiguration: { - targetResourceCount: this.fastLaunchOptions?.targetResourceCount ?? 1, - }, + targetSnapshotCount: this.fastLaunchOptions?.targetResourceCount ?? 1, }); } const stackName = cdk.Stack.of(this).stackName; const builderName = this.node.path; - const dist = new imagebuilder.CfnDistributionConfiguration(this, 'AMI Distribution', { - name: uniqueImageBuilderName(this), + const dist = new imagebuilder2.DistributionConfiguration(this, 'AMI Distribution', { // description: this.description, - distributions: [ - { - region: Stack.of(this).region, - amiDistributionConfiguration: { - Name: `${cdk.Names.uniqueResourceName(this, { - maxLength: 100, - separator: '-', - allowedSpecialCharacters: '_-', - })}-{{ imagebuilder:buildDate }}`, - AmiTags: { - 'Name': this.node.id, - 'GitHubRunners:Stack': stackName, - 'GitHubRunners:Builder': builderName, - }, - }, - launchTemplateConfigurations: launchTemplateConfigs, - fastLaunchConfigurations: fastLaunchConfigs.length > 0 ? fastLaunchConfigs : undefined, + amiDistributions: [{ + region: Stack.of(this).region, + amiTags: { + 'Name': this.node.id, + 'GitHubRunners:Stack': stackName, + 'GitHubRunners:Builder': builderName, }, - ], + launchTemplates: launchTemplateConfigs, + fastLaunchConfigurations: fastLaunchConfigs.length > 0 ? fastLaunchConfigs : undefined, + }], tags: this.tags, }); diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index 468ed6ba..742f46ef 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -239,16 +239,16 @@ } } }, - "f369be4744cd9e0ad9bcf9cad67d7e5b61ca4110cc236572b881ad0f423581e9": { + "ea758f835d53587a88bdcd019a7a4acc1bdc874070f4698ec4da4eb3d25c5930": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-b2943a66": { + "current_account-current_region-2a3e0438": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f369be4744cd9e0ad9bcf9cad67d7e5b61ca4110cc236572b881ad0f423581e9.json", + "objectKey": "ea758f835d53587a88bdcd019a7a4acc1bdc874070f4698ec4da4eb3d25c5930.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 06729ca4..027e2d99 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -1982,7 +1982,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "WindowsImageBuilderDockerDistributionCDE69DC2": { + "WindowsImageBuilderDockerDistributionE6B7F2F2": { "Type": "AWS::ImageBuilder::DistributionConfiguration", "Properties": { "Distributions": [ @@ -1992,10 +1992,10 @@ "latest" ], "TargetRepository": { - "Service": "ECR", "RepositoryName": { "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - } + }, + "Service": "ECR" } }, "Region": { @@ -2003,7 +2003,7 @@ } } ], - "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", + "Name": "github-runners-test-windowsimagebuilder-dockerdistribution-8c41c0cd", "Tags": { "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", "GitHubRunners:Stack": "github-runners-test" @@ -2338,7 +2338,7 @@ }, "DistributionConfigurationArn": { "Fn::GetAtt": [ - "WindowsImageBuilderDockerDistributionCDE69DC2", + "WindowsImageBuilderDockerDistributionE6B7F2F2", "Arn" ] }, @@ -2505,7 +2505,7 @@ }, "DistributionConfigurationArn": { "Fn::GetAtt": [ - "WindowsImageBuilderDockerDistributionCDE69DC2", + "WindowsImageBuilderDockerDistributionE6B7F2F2", "Arn" ] }, @@ -2691,13 +2691,12 @@ ] } }, - "AMILinuxBuilderAMIDistribution46435AF5": { + "AMILinuxBuilderAMIDistribution215F3A5C": { "Type": "AWS::ImageBuilder::DistributionConfiguration", "Properties": { "Distributions": [ { "AmiDistributionConfiguration": { - "Name": "github-runners-test-AMILinuxBuilder-67243E6D-{{ imagebuilder:buildDate }}", "AmiTags": { "Name": "AMI Linux Builder", "GitHubRunners:Stack": "github-runners-test", @@ -2717,7 +2716,7 @@ } } ], - "Name": "github-runners-test-AMILinuxBuilder-67243E6D", + "Name": "github-runners-test-amilinuxbuilder-amidistribution-f27cc043", "Tags": { "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", "GitHubRunners:Stack": "github-runners-test" @@ -3172,7 +3171,7 @@ "Properties": { "DistributionConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxBuilderAMIDistribution46435AF5", + "AMILinuxBuilderAMIDistribution215F3A5C", "Arn" ] }, @@ -3209,7 +3208,7 @@ "Properties": { "DistributionConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxBuilderAMIDistribution46435AF5", + "AMILinuxBuilderAMIDistribution215F3A5C", "Arn" ] }, @@ -5704,13 +5703,12 @@ ] } }, - "AMILinuxarm64BuilderAMIDistribution2BDAF717": { + "AMILinuxarm64BuilderAMIDistributionE6989D01": { "Type": "AWS::ImageBuilder::DistributionConfiguration", "Properties": { "Distributions": [ { "AmiDistributionConfiguration": { - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283-{{ imagebuilder:buildDate }}", "AmiTags": { "Name": "AMI Linux arm64 Builder", "GitHubRunners:Stack": "github-runners-test", @@ -5730,7 +5728,7 @@ } } ], - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", + "Name": "github-runners-test-amilinuxarm64builder-amidistribution-64ec726d", "Tags": { "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", "GitHubRunners:Stack": "github-runners-test" @@ -6134,7 +6132,7 @@ "Properties": { "DistributionConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderAMIDistribution2BDAF717", + "AMILinuxarm64BuilderAMIDistributionE6989D01", "Arn" ] }, @@ -6171,7 +6169,7 @@ "Properties": { "DistributionConfigurationArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderAMIDistribution2BDAF717", + "AMILinuxarm64BuilderAMIDistributionE6989D01", "Arn" ] }, @@ -6503,13 +6501,12 @@ ] } }, - "WindowsEC2BuilderAMIDistributionC7E428C1": { + "WindowsEC2BuilderAMIDistribution6B33DD89": { "Type": "AWS::ImageBuilder::DistributionConfiguration", "Properties": { "Distributions": [ { "AmiDistributionConfiguration": { - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285-{{ imagebuilder:buildDate }}", "AmiTags": { "Name": "Windows EC2 Builder", "GitHubRunners:Stack": "github-runners-test", @@ -6529,7 +6526,7 @@ } } ], - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", + "Name": "github-runners-test-windowsec2builder-amidistribution-f20c96b4", "Tags": { "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", "GitHubRunners:Stack": "github-runners-test" @@ -6933,7 +6930,7 @@ "Properties": { "DistributionConfigurationArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderAMIDistributionC7E428C1", + "WindowsEC2BuilderAMIDistribution6B33DD89", "Arn" ] }, @@ -6970,7 +6967,7 @@ "Properties": { "DistributionConfigurationArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderAMIDistributionC7E428C1", + "WindowsEC2BuilderAMIDistribution6B33DD89", "Arn" ] }, @@ -13672,7 +13669,7 @@ } }, "DependsOn": [ - "AMILinuxBuilderAMIDistribution46435AF5", + "AMILinuxBuilderAMIDistribution215F3A5C", "AMILinuxBuilderAMIImage93D83DE5", "AMILinuxBuilderAmiLog0DB16E38", "AMILinuxBuilderAMIPipelineEC5051DF", @@ -13905,7 +13902,7 @@ } }, "DependsOn": [ - "AMILinuxBuilderAMIDistribution46435AF5", + "AMILinuxBuilderAMIDistribution215F3A5C", "AMILinuxBuilderAMIImage93D83DE5", "AMILinuxBuilderAmiLog0DB16E38", "AMILinuxBuilderAMIPipelineEC5051DF", @@ -14102,7 +14099,7 @@ } }, "DependsOn": [ - "AMILinuxarm64BuilderAMIDistribution2BDAF717", + "AMILinuxarm64BuilderAMIDistributionE6989D01", "AMILinuxarm64BuilderAMIImage40078F9E", "AMILinuxarm64BuilderAmiLog84A9D94A", "AMILinuxarm64BuilderAMIPipeline9CC1354C", @@ -14298,7 +14295,7 @@ } }, "DependsOn": [ - "WindowsEC2BuilderAMIDistributionC7E428C1", + "WindowsEC2BuilderAMIDistribution6B33DD89", "WindowsEC2BuilderAMIImage9D812188", "WindowsEC2BuilderAmiLog126E54B2", "WindowsEC2BuilderAMIPipelineE3836949", From 6bc010f3dfc051e9b56f4cb8216a29d30f4eef37 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Sat, 22 Nov 2025 16:45:42 -0500 Subject: [PATCH 08/19] better auto-version --- src/image-builders/aws-image-builder/ami.ts | 10 +- .../aws-image-builder/container.ts | 10 +- .../github-runners-test.assets.json | 34 +-- .../github-runners-test.template.json | 289 +++++++----------- 4 files changed, 124 insertions(+), 219 deletions(-) diff --git a/src/image-builders/aws-image-builder/ami.ts b/src/image-builders/aws-image-builder/ami.ts index 656eb898..482f5d7f 100644 --- a/src/image-builders/aws-image-builder/ami.ts +++ b/src/image-builders/aws-image-builder/ami.ts @@ -73,13 +73,6 @@ export class AmiRecipe extends ImageBuilderObjectBase { ] : undefined; this.name = uniqueImageBuilderName(this); - this.version = this.generateVersion('ImageRecipe', this.name, { - platform: props.platform, - components, - parentAmi: props.baseAmi, - tags: props.tags, - blockDeviceMappings, - }); let workingDirectory; if (props.platform == 'Linux') { @@ -92,7 +85,7 @@ export class AmiRecipe extends ImageBuilderObjectBase { const recipe = new imagebuilder.CfnImageRecipe(this, 'Recipe', { name: this.name, - version: this.version, + version: '1.0.x', parentImage: props.baseAmi, components, workingDirectory, @@ -101,6 +94,7 @@ export class AmiRecipe extends ImageBuilderObjectBase { }); this.arn = recipe.attrArn; + this.version = recipe.getAtt('Version', cdk.ResolutionTypeHint.STRING).toString(); } } diff --git a/src/image-builders/aws-image-builder/container.ts b/src/image-builders/aws-image-builder/container.ts index 8724663c..badf14d2 100644 --- a/src/image-builders/aws-image-builder/container.ts +++ b/src/image-builders/aws-image-builder/container.ts @@ -1,3 +1,4 @@ +import * as cdk from 'aws-cdk-lib'; import { aws_ecr as ecr, aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ImageBuilderComponent } from './builder'; @@ -70,16 +71,10 @@ export class ContainerRecipe extends ImageBuilderObjectBase { }); this.name = uniqueImageBuilderName(this); - this.version = this.generateVersion('ContainerRecipe', this.name, { - platform: props.platform, - components, - dockerfileTemplate: props.dockerfileTemplate, - tags: props.tags, - }); const recipe = new imagebuilder.CfnContainerRecipe(this, 'Recipe', { name: this.name, - version: this.version, + version: '1.0.x', parentImage: props.parentImage, platformOverride: props.platform == 'Linux' ? 'Linux' : undefined, components, @@ -93,6 +88,7 @@ export class ContainerRecipe extends ImageBuilderObjectBase { }); this.arn = recipe.attrArn; + this.version = recipe.getAtt('Version', cdk.ResolutionTypeHint.STRING).toString(); } } diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index 742f46ef..a0bcaafe 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -29,20 +29,6 @@ } } }, - "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701": { - "displayName": "aws-image-builder-versioner-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", - "source": { - "path": "asset.5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-7230a3ad": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a": { "displayName": "aws-image-builder-delete-resources-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", "source": { @@ -127,6 +113,20 @@ } } }, + "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701": { + "displayName": "aws-image-builder-versioner-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-7230a3ad": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2": { "displayName": "runners/token-retriever/Code", "source": { @@ -239,16 +239,16 @@ } } }, - "ea758f835d53587a88bdcd019a7a4acc1bdc874070f4698ec4da4eb3d25c5930": { + "a48bda7b9f02e85a8390c1a9db3ee759f68a67304369177076c3fab1d927b520": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-2a3e0438": { + "current_account-current_region-4599759a": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ea758f835d53587a88bdcd019a7a4acc1bdc874070f4698ec4da4eb3d25c5930.json", + "objectKey": "a48bda7b9f02e85a8390c1a9db3ee759f68a67304369177076c3fab1d927b520.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 027e2d99..6d2b1f95 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2101,95 +2101,6 @@ "Version": "1.0.0" } }, - "WindowsImageBuilderContainerRecipeVersion13A2E3FD": { - "Type": "Custom::ImageBuilder-ContainerRecipe-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "ContainerRecipe", - "ObjectName": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", - "VersionedData": { - "platform": "Windows", - "components": [ - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent2GitComponent92ACFEF5", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent3GithubCliComponentF18685D5", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent4AwsCliComponent6654838D", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09", - "Arn" - ] - } - } - ], - "dockerfileTemplate": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\nENV RUNNER_VERSION=latest\n", - "tags": { - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/Windows Image Builder" - } - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, "WindowsImageBuilderContainerRecipeB2A421D7": { "Type": "AWS::ImageBuilder::ContainerRecipe", "Properties": { @@ -2273,9 +2184,7 @@ }, "Service": "ECR" }, - "Version": { - "Ref": "WindowsImageBuilderContainerRecipeVersion13A2E3FD" - } + "Version": "1.0.x" } }, "WindowsImageBuilderDockerLogE660E23E": { @@ -2391,7 +2300,10 @@ }, ":image/github-runners-test-windowsimagebuilder-containerrecipe-c577a80b/", { - "Ref": "WindowsImageBuilderContainerRecipeVersion13A2E3FD" + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeB2A421D7", + "Version" + ] } ] ] @@ -2486,7 +2398,10 @@ { "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", "SemanticVersion": { - "Ref": "WindowsImageBuilderContainerRecipeVersion13A2E3FD" + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeB2A421D7", + "Version" + ] } } ] @@ -8422,99 +8337,6 @@ "TimeoutInMinutes": 60 } }, - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "imagebuilder:ListComponents", - "imagebuilder:ListContainerRecipes", - "imagebuilder:ListImageRecipes", - "imagebuilder:ListWorkflows" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD", - "Roles": [ - { - "Ref": "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58" - } - ] - } - }, - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip" - }, - "Description": "Custom resource handler that bumps up Image Builder versions", - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 300 - }, - "DependsOn": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD", - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58" - ] - }, "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C": { "Type": "AWS::IAM::Role", "Properties": { @@ -13699,6 +13521,99 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "imagebuilder:ListComponents", + "imagebuilder:ListContainerRecipes", + "imagebuilder:ListImageRecipes", + "imagebuilder:ListWorkflows" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD", + "Roles": [ + { + "Ref": "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58" + } + ] + } + }, + "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip" + }, + "Description": "Custom resource handler that bumps up Image Builder versions", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD", + "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58" + ] + }, "deleteamidcc036c8876b451ea2c1552f9e06e9e1ServiceRole1CC58A6F": { "Type": "AWS::IAM::Role", "Properties": { From 9434ffc6f364c1b24d85f80fb6d952035b341a24 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Sat, 22 Nov 2025 20:17:52 -0500 Subject: [PATCH 09/19] aws supports auto-version now --- .eslintrc.json | 1 - .gitattributes | 1 - .gitignore | 1 - .projen/deps.json | 8 - .projen/files.json | 1 - .projen/tasks.json | 25 +- .projenrc.js | 2 - package.json | 4 - src/image-builders/aws-image-builder/ami.ts | 3 +- .../aws-image-builder/builder.ts | 3 +- .../aws-image-builder/common.ts | 48 - .../aws-image-builder/container.ts | 3 +- src/image-builders/aws-image-builder/index.ts | 1 - .../aws-image-builder/versioner-function.ts | 26 - .../aws-image-builder/versioner.lambda.ts | 127 - .../aws-image-builder/workflow.ts | 11 +- .../github-runners-test.assets.json | 258 - .../github-runners-test.template.json | 19636 ---------------- test/versioner.test.ts | 35 - yarn.lock | 5 - 20 files changed, 8 insertions(+), 20191 deletions(-) delete mode 100644 src/image-builders/aws-image-builder/common.ts delete mode 100644 src/image-builders/aws-image-builder/versioner-function.ts delete mode 100644 src/image-builders/aws-image-builder/versioner.lambda.ts delete mode 100644 test/default.integ.snapshot/github-runners-test.assets.json delete mode 100644 test/default.integ.snapshot/github-runners-test.template.json delete mode 100644 test/versioner.test.ts diff --git a/.eslintrc.json b/.eslintrc.json index 3e066d61..2db98bfb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -164,7 +164,6 @@ "src/providers/update-lambda.lambda.ts", "src/image-builders/aws-image-builder/delete-resources.lambda.ts", "src/image-builders/aws-image-builder/filter-failed-builds.lambda.ts", - "src/image-builders/aws-image-builder/versioner.lambda.ts", "src/lambda-helpers.ts", "src/lambda-github.ts", "setup/src/main.ts" diff --git a/.gitattributes b/.gitattributes index bb4dfee1..7f2f1f61 100644 --- a/.gitattributes +++ b/.gitattributes @@ -31,7 +31,6 @@ /src/idle-runner-repear-function.ts linguist-generated /src/image-builders/aws-image-builder/delete-resources-function.ts linguist-generated /src/image-builders/aws-image-builder/filter-failed-builds-function.ts linguist-generated -/src/image-builders/aws-image-builder/versioner-function.ts linguist-generated /src/image-builders/build-image-function.ts linguist-generated /src/providers/ami-root-device-function.ts linguist-generated /src/providers/update-lambda-function.ts linguist-generated diff --git a/.gitignore b/.gitignore index 9ef212a0..92c14a6f 100644 --- a/.gitignore +++ b/.gitignore @@ -66,7 +66,6 @@ tsconfig.json !/src/providers/update-lambda-function.ts !/src/image-builders/aws-image-builder/delete-resources-function.ts !/src/image-builders/aws-image-builder/filter-failed-builds-function.ts -!/src/image-builders/aws-image-builder/versioner-function.ts test/.tmp test/default.integ.snapshot/asset.* test/default.integ.snapshot/**/asset.* diff --git a/.projen/deps.json b/.projen/deps.json index 0f544bc7..b469b45e 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -84,10 +84,6 @@ "version": "ts5.6", "type": "build" }, - { - "name": "@types/semver", - "type": "build" - }, { "name": "@typescript-eslint/eslint-plugin", "version": "^8", @@ -176,10 +172,6 @@ "version": "^1.54.0", "type": "build" }, - { - "name": "semver", - "type": "build" - }, { "name": "svelte-check", "version": "^4", diff --git a/.projen/files.json b/.projen/files.json index b5ea4c2e..0f8b70af 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -19,7 +19,6 @@ "src/idle-runner-repear-function.ts", "src/image-builders/aws-image-builder/delete-resources-function.ts", "src/image-builders/aws-image-builder/filter-failed-builds-function.ts", - "src/image-builders/aws-image-builder/versioner-function.ts", "src/image-builders/build-image-function.ts", "src/providers/ami-root-device-function.ts", "src/providers/update-lambda-function.ts", diff --git a/.projen/tasks.json b/.projen/tasks.json index 8cbceddd..ad51c97a 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -82,9 +82,6 @@ { "spawn": "bundle:image-builders/aws-image-builder/filter-failed-builds.lambda" }, - { - "spawn": "bundle:image-builders/aws-image-builder/versioner.lambda" - }, { "exec": "cp -r src/providers/docker-images assets" }, @@ -171,24 +168,6 @@ } ] }, - "bundle:image-builders/aws-image-builder/versioner.lambda": { - "name": "bundle:image-builders/aws-image-builder/versioner.lambda", - "description": "Create a JavaScript bundle from src/image-builders/aws-image-builder/versioner.lambda.ts", - "steps": [ - { - "exec": "esbuild --bundle src/image-builders/aws-image-builder/versioner.lambda.ts --target=\"node22\" --platform=\"node\" --outfile=\"assets/image-builders/aws-image-builder/versioner.lambda/index.js\" --tsconfig=\"tsconfig.dev.json\" --external:@aws-sdk/*" - } - ] - }, - "bundle:image-builders/aws-image-builder/versioner.lambda:watch": { - "name": "bundle:image-builders/aws-image-builder/versioner.lambda:watch", - "description": "Continuously update the JavaScript bundle from src/image-builders/aws-image-builder/versioner.lambda.ts", - "steps": [ - { - "exec": "esbuild --bundle src/image-builders/aws-image-builder/versioner.lambda.ts --target=\"node22\" --platform=\"node\" --outfile=\"assets/image-builders/aws-image-builder/versioner.lambda/index.js\" --tsconfig=\"tsconfig.dev.json\" --external:@aws-sdk/* --watch" - } - ] - }, "bundle:image-builders/build-image.lambda": { "name": "bundle:image-builders/build-image.lambda", "description": "Create a JavaScript bundle from src/image-builders/build-image.lambda.ts", @@ -693,13 +672,13 @@ }, "steps": [ { - "exec": "npx npm-check-updates@18 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@aws-sdk/client-cloudformation,@aws-sdk/client-codebuild,@aws-sdk/client-ec2,@aws-sdk/client-ecr,@aws-sdk/client-imagebuilder,@aws-sdk/client-lambda,@aws-sdk/client-secrets-manager,@aws-sdk/client-sfn,@aws-sdk/client-sns,@aws-sdk/client-ssm,@octokit/auth-app,@octokit/core,@octokit/request-error,@octokit/rest,@types/aws-lambda,@types/jest,@types/semver,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,jsii-diff,jsii-pacmak,projen,semver,ts-jest,ts-node,@aws-cdk/aws-imagebuilder-alpha" + "exec": "npx npm-check-updates@18 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@aws-sdk/client-cloudformation,@aws-sdk/client-codebuild,@aws-sdk/client-ec2,@aws-sdk/client-ecr,@aws-sdk/client-imagebuilder,@aws-sdk/client-lambda,@aws-sdk/client-secrets-manager,@aws-sdk/client-sfn,@aws-sdk/client-sns,@aws-sdk/client-ssm,@octokit/auth-app,@octokit/core,@octokit/request-error,@octokit/rest,@types/aws-lambda,@types/jest,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,jsii-diff,jsii-pacmak,projen,ts-jest,ts-node,@aws-cdk/aws-imagebuilder-alpha" }, { "exec": "yarn install --check-files" }, { - "exec": "yarn upgrade @aws-sdk/client-cloudformation @aws-sdk/client-codebuild @aws-sdk/client-ec2 @aws-sdk/client-ecr @aws-sdk/client-imagebuilder @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-sfn @aws-sdk/client-sns @aws-sdk/client-ssm @octokit/auth-app @octokit/core @octokit/request-error @octokit/rest @stylistic/eslint-plugin @sveltejs/vite-plugin-svelte @tsconfig/svelte @types/aws-lambda @types/jest @types/node @types/semver @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk bootstrap commit-and-tag-version esbuild eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-svelte eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii projen sass semver svelte-check svelte-preprocess svelte ts-jest ts-node typescript vite-plugin-singlefile vite @aws-cdk/aws-imagebuilder-alpha aws-cdk-lib constructs" + "exec": "yarn upgrade @aws-sdk/client-cloudformation @aws-sdk/client-codebuild @aws-sdk/client-ec2 @aws-sdk/client-ecr @aws-sdk/client-imagebuilder @aws-sdk/client-lambda @aws-sdk/client-secrets-manager @aws-sdk/client-sfn @aws-sdk/client-sns @aws-sdk/client-ssm @octokit/auth-app @octokit/core @octokit/request-error @octokit/rest @stylistic/eslint-plugin @sveltejs/vite-plugin-svelte @tsconfig/svelte @types/aws-lambda @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk bootstrap commit-and-tag-version esbuild eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-svelte eslint jest jest-junit jsii-diff jsii-docgen jsii-pacmak jsii-rosetta jsii projen sass svelte-check svelte-preprocess svelte ts-jest ts-node typescript vite-plugin-singlefile vite @aws-cdk/aws-imagebuilder-alpha aws-cdk-lib constructs" }, { "exec": "npx projen" diff --git a/.projenrc.js b/.projenrc.js index 66188c7e..3c6403fb 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -30,8 +30,6 @@ const project = new awscdk.AwsCdkConstructLibrary({ '@aws-sdk/client-ssm', '@aws-sdk/client-sfn', '@types/aws-lambda', - 'semver', - '@types/semver', // for setup ui '@sveltejs/vite-plugin-svelte@^4', '@tsconfig/svelte@^5', diff --git a/package.json b/package.json index 042097f0..2ef36898 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,6 @@ "bundle:image-builders/aws-image-builder/delete-resources.lambda:watch": "npx projen bundle:image-builders/aws-image-builder/delete-resources.lambda:watch", "bundle:image-builders/aws-image-builder/filter-failed-builds.lambda": "npx projen bundle:image-builders/aws-image-builder/filter-failed-builds.lambda", "bundle:image-builders/aws-image-builder/filter-failed-builds.lambda:watch": "npx projen bundle:image-builders/aws-image-builder/filter-failed-builds.lambda:watch", - "bundle:image-builders/aws-image-builder/versioner.lambda": "npx projen bundle:image-builders/aws-image-builder/versioner.lambda", - "bundle:image-builders/aws-image-builder/versioner.lambda:watch": "npx projen bundle:image-builders/aws-image-builder/versioner.lambda:watch", "bundle:image-builders/build-image.lambda": "npx projen bundle:image-builders/build-image.lambda", "bundle:image-builders/build-image.lambda:watch": "npx projen bundle:image-builders/build-image.lambda:watch", "bundle:providers/ami-root-device.lambda": "npx projen bundle:providers/ami-root-device.lambda", @@ -93,7 +91,6 @@ "@types/aws-lambda": "^8.10.157", "@types/jest": "^29", "@types/node": "ts5.6", - "@types/semver": "^7.7.1", "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", @@ -115,7 +112,6 @@ "jsii-rosetta": "5.8.x", "projen": "^0.98.10", "sass": "^1.54.0", - "semver": "^7.7.3", "svelte": "^5", "svelte-check": "^4", "svelte-preprocess": "^6", diff --git a/src/image-builders/aws-image-builder/ami.ts b/src/image-builders/aws-image-builder/ami.ts index 482f5d7f..5742403a 100644 --- a/src/image-builders/aws-image-builder/ami.ts +++ b/src/image-builders/aws-image-builder/ami.ts @@ -2,7 +2,6 @@ import * as cdk from 'aws-cdk-lib'; import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ImageBuilderComponent } from './builder'; -import { ImageBuilderObjectBase } from './common'; import { amiRootDevice, Architecture, Os } from '../../providers'; import { uniqueImageBuilderName } from '../common'; @@ -48,7 +47,7 @@ interface AmiRecipeProperties { * * @internal */ -export class AmiRecipe extends ImageBuilderObjectBase { +export class AmiRecipe extends cdk.Resource { public readonly arn: string; public readonly name: string; public readonly version: string; diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index e53f0b29..ac24ccda 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -21,7 +21,6 @@ import { TagMutability } from 'aws-cdk-lib/aws-ecr'; import { RetentionDays } from 'aws-cdk-lib/aws-logs'; import { Construct, IConstruct } from 'constructs'; import { AmiRecipe, defaultBaseAmi } from './ami'; -import { ImageBuilderObjectBase } from './common'; import { ContainerRecipe, defaultBaseDockerImage } from './container'; import { DeleteResourcesFunction } from './delete-resources-function'; import { DeleteResourcesProps } from './delete-resources.lambda'; @@ -165,7 +164,7 @@ export interface ImageBuilderComponentProperties { * * @deprecated Use `RunnerImageComponent` instead as this be internal soon. */ -export class ImageBuilderComponent extends ImageBuilderObjectBase { +export class ImageBuilderComponent extends cdk.Resource { /** * Component ARN. */ diff --git a/src/image-builders/aws-image-builder/common.ts b/src/image-builders/aws-image-builder/common.ts deleted file mode 100644 index 6af4b1bc..00000000 --- a/src/image-builders/aws-image-builder/common.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as cdk from 'aws-cdk-lib'; -import { aws_iam as iam, aws_lambda as lambda, CustomResource } from 'aws-cdk-lib'; -import { Construct } from 'constructs'; -import { VersionerFunction } from './versioner-function'; -import { singletonLambda, singletonLogGroup, SingletonLogType } from '../../utils'; - -/** - * @internal - */ -export abstract class ImageBuilderObjectBase extends cdk.Resource { - protected constructor(scope: Construct, id: string) { - super(scope, id); - } - - protected generateVersion(type: 'Component' | 'ImageRecipe' | 'ContainerRecipe' | 'Workflow', name: string, data: any): string { - return new CustomResource(this, 'Version', { - serviceToken: this.versionFunction().functionArn, - resourceType: `Custom::ImageBuilder-${type}-Version`, - removalPolicy: cdk.RemovalPolicy.RETAIN, // no point in deleting as it doesn't even create anything - properties: { - ObjectType: type, - ObjectName: name, - VersionedData: data, // get a new version every time something changes, like Image Builder wants - }, - }).ref; - } - - private versionFunction(): VersionerFunction { - return singletonLambda(VersionerFunction, this, 'aws-image-builder-versioner', { - description: 'Custom resource handler that bumps up Image Builder versions', - initialPolicy: [ - new iam.PolicyStatement({ - actions: [ - 'imagebuilder:ListComponents', - 'imagebuilder:ListContainerRecipes', - 'imagebuilder:ListImageRecipes', - 'imagebuilder:ListWorkflows', - ], - resources: ['*'], - }), - ], - logGroup: singletonLogGroup(this, SingletonLogType.RUNNER_IMAGE_BUILD), - loggingFormat: lambda.LoggingFormat.JSON, - timeout: cdk.Duration.minutes(5), - }); - } -} - diff --git a/src/image-builders/aws-image-builder/container.ts b/src/image-builders/aws-image-builder/container.ts index badf14d2..1baee1d8 100644 --- a/src/image-builders/aws-image-builder/container.ts +++ b/src/image-builders/aws-image-builder/container.ts @@ -2,7 +2,6 @@ import * as cdk from 'aws-cdk-lib'; import { aws_ecr as ecr, aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ImageBuilderComponent } from './builder'; -import { ImageBuilderObjectBase } from './common'; import { Os } from '../../providers'; import { uniqueImageBuilderName } from '../common'; @@ -56,7 +55,7 @@ export interface ContainerRecipeProperties { * * @internal */ -export class ContainerRecipe extends ImageBuilderObjectBase { +export class ContainerRecipe extends cdk.Resource { public readonly arn: string; public readonly name: string; public readonly version: string; diff --git a/src/image-builders/aws-image-builder/index.ts b/src/image-builders/aws-image-builder/index.ts index fa4f61be..a54825e0 100644 --- a/src/image-builders/aws-image-builder/index.ts +++ b/src/image-builders/aws-image-builder/index.ts @@ -1,5 +1,4 @@ export * from './ami'; export * from './builder'; -export * from './common'; export * from './container'; export * from './deprecated'; diff --git a/src/image-builders/aws-image-builder/versioner-function.ts b/src/image-builders/aws-image-builder/versioner-function.ts deleted file mode 100644 index 7bfda5d0..00000000 --- a/src/image-builders/aws-image-builder/versioner-function.ts +++ /dev/null @@ -1,26 +0,0 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -import * as path from 'path'; -import * as lambda from 'aws-cdk-lib/aws-lambda'; -import { Construct } from 'constructs'; - -/** - * Props for VersionerFunction - */ -export interface VersionerFunctionProps extends lambda.FunctionOptions { -} - -/** - * An AWS Lambda function which executes src/image-builders/aws-image-builder/versioner. - */ -export class VersionerFunction extends lambda.Function { - constructor(scope: Construct, id: string, props?: VersionerFunctionProps) { - super(scope, id, { - description: 'src/image-builders/aws-image-builder/versioner.lambda.ts', - ...props, - runtime: new lambda.Runtime('nodejs22.x', lambda.RuntimeFamily.NODEJS), - handler: 'index.handler', - code: lambda.Code.fromAsset(path.join(__dirname, '../../../assets/image-builders/aws-image-builder/versioner.lambda')), - }); - this.addEnvironment('AWS_NODEJS_CONNECTION_REUSE_ENABLED', '1', { removeInEdge: true }); - } -} \ No newline at end of file diff --git a/src/image-builders/aws-image-builder/versioner.lambda.ts b/src/image-builders/aws-image-builder/versioner.lambda.ts deleted file mode 100644 index cd09f404..00000000 --- a/src/image-builders/aws-image-builder/versioner.lambda.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { - ImagebuilderClient, - ListComponentsCommand, - ListComponentsResponse, - ListContainerRecipesCommand, - ListContainerRecipesResponse, - ListImageRecipesCommand, - ListImageRecipesResponse, - ListWorkflowsCommand, - ListWorkflowsResponse, -} from '@aws-sdk/client-imagebuilder'; -import * as AWSLambda from 'aws-lambda'; -import { inc, maxSatisfying } from 'semver'; -import { customResourceRespond } from '../../lambda-helpers'; - -const ib = new ImagebuilderClient(); - -/** - * Exported for unit tests. - * @internal - */ -export function increaseVersion(allVersions: string[]) { - let version = maxSatisfying(allVersions, '>=0.0.0'); - if (version === null) { - version = '1.0.0'; - } - console.log(`Found versions ${allVersions} -- latest is ${version}`); - - version = inc(version, 'patch'); - if (version === null) { - throw new Error('Unable to bump version'); - } - - return version; -} - -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent, context: AWSLambda.Context) { - console.log({ ...event, ResponseURL: '...' }); - - try { - const objectType = event.ResourceProperties.ObjectType; - const objectName = event.ResourceProperties.ObjectName; - - switch (event.RequestType) { - case 'Create': - case 'Update': - let allVersions: string[] = []; - try { - switch (objectType) { - case 'Component': { - let result: ListComponentsResponse = {}; - do { - result = await ib.send(new ListComponentsCommand({ - filters: [{ - name: 'name', - values: [objectName], - }], - nextToken: result.nextToken, - })); - allVersions = allVersions.concat(result.componentVersionList!.map(i => i.version || '1.0.0')); - } while (result.nextToken); - break; - } - case 'ImageRecipe': { - let result: ListImageRecipesResponse = {}; - do { - result = await ib.send(new ListImageRecipesCommand({ - filters: [{ - name: 'name', - values: [objectName], - }], - nextToken: result.nextToken, - })); - allVersions = allVersions.concat(result.imageRecipeSummaryList!.map(i => i.arn?.split('/').pop() || '1.0.0')); - } while (result.nextToken); - break; - } - case 'ContainerRecipe': { - let result: ListContainerRecipesResponse = {}; - do { - result = await ib.send(new ListContainerRecipesCommand({ - filters: [{ - name: 'name', - values: [objectName], - }], - nextToken: result.nextToken, - })); - allVersions = allVersions.concat(result.containerRecipeSummaryList!.map(i => i.arn?.split('/').pop() || '1.0.0')); - } while (result.nextToken); - break; - } - case 'Workflow': { - let result: ListWorkflowsResponse = {}; - do { - result = await ib.send(new ListWorkflowsCommand({ - filters: [{ - name: 'name', - values: [objectName], - }], - nextToken: result.nextToken, - })); - allVersions = allVersions.concat(result.workflowVersionList!.map(i => i.arn?.split('/').pop() || '1.0.0')); - } while (result.nextToken); - break; - } - } - } catch (e) { - if ((e as any).code !== 'ResourceNotFoundException') { - throw e; - } else { - console.log('Resource not found, assuming first version'); - } - } - - const version = increaseVersion(allVersions); - await customResourceRespond(event, 'SUCCESS', 'OK', version, {}); - - break; - case 'Delete': - await customResourceRespond(event, 'SUCCESS', 'OK', event.PhysicalResourceId, {}); - break; - } - } catch (e) { - console.log(e); - await customResourceRespond(event, 'FAILED', (e as Error).message || 'Internal Error', context.logStreamName, {}); - } -} diff --git a/src/image-builders/aws-image-builder/workflow.ts b/src/image-builders/aws-image-builder/workflow.ts index 38856ce3..dfd3c3a4 100644 --- a/src/image-builders/aws-image-builder/workflow.ts +++ b/src/image-builders/aws-image-builder/workflow.ts @@ -1,6 +1,6 @@ +import * as cdk from 'aws-cdk-lib'; import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; import { Construct } from 'constructs'; -import { ImageBuilderObjectBase } from './common'; import { uniqueImageBuilderName } from '../common'; /** @@ -25,23 +25,18 @@ export interface WorkflowProperties { * * @internal */ -export class Workflow extends ImageBuilderObjectBase { +export class Workflow extends cdk.Resource { public readonly arn: string; public readonly name: string; - public readonly version: string; constructor(scope: Construct, id: string, props: WorkflowProperties) { super(scope, id); this.name = uniqueImageBuilderName(this); - this.version = this.generateVersion('Workflow', this.name, { - type: props.type, - data: props.data, - }); const workflow = new imagebuilder.CfnWorkflow(this, 'Workflow', { name: uniqueImageBuilderName(this), - version: this.version, + version: '1.0.x', type: props.type, data: JSON.stringify(props.data), }); diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json deleted file mode 100644 index a0bcaafe..00000000 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ /dev/null @@ -1,258 +0,0 @@ -{ - "version": "48.0.0", - "files": { - "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68": { - "displayName": "CodeBuild Image Builder/Component 7 Custom-Undefined Asset 0", - "source": { - "path": "asset.64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", - "packaging": "file" - }, - "destinations": { - "current_account-current_region-ddf90974": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0": { - "displayName": "build-image-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", - "source": { - "path": "asset.2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-022085c0": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a": { - "displayName": "aws-image-builder-delete-resources-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", - "source": { - "path": "asset.b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-d6a52ecd": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c": { - "displayName": "AMI Root Device Reader-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", - "source": { - "path": "asset.88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-d9353ac7": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9": { - "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 0", - "source": { - "path": "asset.2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", - "packaging": "file" - }, - "destinations": { - "current_account-current_region-07fa966c": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18": { - "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 1", - "source": { - "path": "asset.914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh", - "packaging": "file" - }, - "destinations": { - "current_account-current_region-652b9b07": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625": { - "displayName": "AWS679f53fac002430cb0da5b7982bd2287/Code", - "source": { - "path": "asset.bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-d28f70a5": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea": { - "displayName": "update-lambda-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", - "source": { - "path": "asset.aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-01742b58": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701": { - "displayName": "aws-image-builder-versioner-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", - "source": { - "path": "asset.5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-7230a3ad": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2": { - "displayName": "runners/token-retriever/Code", - "source": { - "path": "asset.2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-e26bf12f": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb": { - "displayName": "runners/delete-runner/Code", - "source": { - "path": "asset.27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-f69630e5": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364": { - "displayName": "runners/Idle Reaper/Code", - "source": { - "path": "asset.27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-4a8838bc": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56": { - "displayName": "runners/Webhook Handler/webhook-handler/Code", - "source": { - "path": "asset.12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-3229b282": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18": { - "displayName": "runners/Webhook Redelivery/Lambda/Code", - "source": { - "path": "asset.43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-4bd461a4": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5": { - "displayName": "runners/setup/Code", - "source": { - "path": "asset.77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-34f23b64": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9": { - "displayName": "runners/status/Code", - "source": { - "path": "asset.b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-b1fd60d6": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122": { - "displayName": "runners/Image Builder Builds Filter/Code", - "source": { - "path": "asset.f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.lambda", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region-017eb7bb": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "a48bda7b9f02e85a8390c1a9db3ee759f68a67304369177076c3fab1d927b520": { - "displayName": "github-runners-test Template", - "source": { - "path": "github-runners-test.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region-4599759a": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a48bda7b9f02e85a8390c1a9db3ee759f68a67304369177076c3fab1d927b520.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json deleted file mode 100644 index 6d2b1f95..00000000 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ /dev/null @@ -1,19636 +0,0 @@ -{ - "Resources": { - "Vpc8378EB38": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Vpc" - } - ] - } - }, - "VpcPublicSubnet1Subnet5C2D37C4": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/17", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "github-runners-test/Vpc/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet1RouteTable6C95E38E": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Vpc/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet1RouteTableAssociation97140677": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcPublicSubnet1RouteTable6C95E38E" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "VpcPublicSubnet1DefaultRoute3DA9E72A": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "RouteTableId": { - "Ref": "VpcPublicSubnet1RouteTable6C95E38E" - } - }, - "DependsOn": [ - "VpcVPCGWBF912B6E" - ] - }, - "VpcPublicSubnet2Subnet691E08A3": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/17", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "github-runners-test/Vpc/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet2RouteTable94F7E489": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Vpc/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet2RouteTableAssociationDD5762D8": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcPublicSubnet2RouteTable94F7E489" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - } - }, - "VpcPublicSubnet2DefaultRoute97F91067": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "RouteTableId": { - "Ref": "VpcPublicSubnet2RouteTable94F7E489" - } - }, - "DependsOn": [ - "VpcVPCGWBF912B6E" - ] - }, - "VpcIGWD7BA715C": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Vpc" - } - ] - } - }, - "VpcVPCGWBF912B6E": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "cluster611F8AFF": { - "Type": "AWS::ECS::Cluster" - }, - "clusterA4C38409": { - "Type": "AWS::ECS::ClusterCapacityProviderAssociations", - "Properties": { - "CapacityProviders": [ - "FARGATE", - "FARGATE_SPOT" - ], - "Cluster": { - "Ref": "cluster611F8AFF" - }, - "DefaultCapacityProviderStrategy": [] - } - }, - "FargatebuilderRoleDA300BCD": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "FargatebuilderRoleDefaultPolicyE56CF8DA": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderLogs2F794091", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "FargatebuilderCodeBuild4F182743" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "FargatebuilderCodeBuild4F182743" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "FargatebuilderCodeBuild4F182743" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatebuilderRoleDefaultPolicyE56CF8DA", - "Roles": [ - { - "Ref": "FargatebuilderRoleDA300BCD" - } - ] - } - }, - "FargatebuilderRepository8F7BA13C": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargatebuilderLogs2F794091": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargatebuilderCodeBuild4F182743": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Fargate builder (Ubuntu Linux/X86_64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "LINUX_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "FargatebuilderLogs2F794091" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "FargatebuilderRoleDA300BCD", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderRepository8F7BA13C" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset6-Custom-Undefined-0\",\n \"cat > component6-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Custom-Undefined.sh\",\n \"cat > component7-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Custom-Undefined-0 FUNDING.yml\\nCOPY component6-Custom-Undefined.sh /tmp\\nRUN /tmp/component6-Custom-Undefined.sh\\n\\nCOPY component7-EnvironmentVariables.sh /tmp\\nRUN /tmp/component7-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "FargatebuilderCodeBuildEventsRole92F2259E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderCodeBuild4F182743", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD", - "Roles": [ - { - "Ref": "FargatebuilderCodeBuildEventsRole92F2259E" - } - ] - } - }, - "FargatebuilderCodeBuildBuildFailed1D2D3785": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "githubrunnerstestFargatebuilderCodeBuildBuildFailed8BDBCD42", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderCodeBuild4F182743", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "FargatebuilderCRPolicy22FB4B05": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderCodeBuild4F182743", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatebuilderCRPolicy22FB4B05", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "FargatebuilderBuildWaitc91bc68c5e438864A5": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005" - }, - "Timeout": "3600" - } - }, - "FargatebuilderBuilder0834CD0B": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "FargatebuilderRepository8F7BA13C" - }, - "ProjectName": { - "Ref": "FargatebuilderCodeBuild4F182743" - }, - "WaitHandle": { - "Ref": "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "FargatebuilderCodeBuildBuildFailed1D2D3785", - "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD", - "FargatebuilderCodeBuildEventsRole92F2259E", - "FargatebuilderCodeBuild4F182743", - "FargatebuilderCRPolicy22FB4B05", - "FargatebuilderRoleDefaultPolicyE56CF8DA", - "FargatebuilderRoleDA300BCD" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargatebuilderBuildSchedule0B083A73": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "FargatebuilderRepository8F7BA13C" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "FargatebuilderCodeBuild4F182743", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "FargatebuilderCodeBuildEventsRole92F2259E", - "Arn" - ] - } - } - ] - } - }, - "FargatebuilderarmRoleB6343E8F": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "FargatebuilderarmRoleDefaultPolicy89F1BA94": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmLogs63D60F4D", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "FargatebuilderarmCodeBuild0D30679A" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "FargatebuilderarmCodeBuild0D30679A" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "FargatebuilderarmCodeBuild0D30679A" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatebuilderarmRoleDefaultPolicy89F1BA94", - "Roles": [ - { - "Ref": "FargatebuilderarmRoleB6343E8F" - } - ] - } - }, - "FargatebuilderarmRepository77DCC132": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargatebuilderarmLogs63D60F4D": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargatebuilderarmCodeBuild0D30679A": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Fargate builder arm (Ubuntu Linux/ARM64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "ARM_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "FargatebuilderarmLogs63D60F4D" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "FargatebuilderarmRoleB6343E8F", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderarmRepository77DCC132" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset6-Custom-Undefined-0\",\n \"cat > component6-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Custom-Undefined.sh\",\n \"cat > component7-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Custom-Undefined-0 FUNDING.yml\\nCOPY component6-Custom-Undefined.sh /tmp\\nRUN /tmp/component6-Custom-Undefined.sh\\n\\nCOPY component7-EnvironmentVariables.sh /tmp\\nRUN /tmp/component7-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "FargatebuilderarmCodeBuildEventsRole20E8CE66": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmCodeBuild0D30679A", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB", - "Roles": [ - { - "Ref": "FargatebuilderarmCodeBuildEventsRole20E8CE66" - } - ] - } - }, - "FargatebuilderarmCodeBuildBuildFailed264992E6": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "githubrunnerstestFargatebuilderarmCodeBuildBuildFailed60EDAF2B", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmCodeBuild0D30679A", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "FargatebuilderarmCRPolicyD241BB66": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmCodeBuild0D30679A", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatebuilderarmCRPolicyD241BB66", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "FargatebuilderarmBuildWait6310e519d75E2EEA1B": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1" - }, - "Timeout": "3600" - } - }, - "FargatebuilderarmBuilder48D1AF5A": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "FargatebuilderarmRepository77DCC132" - }, - "ProjectName": { - "Ref": "FargatebuilderarmCodeBuild0D30679A" - }, - "WaitHandle": { - "Ref": "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "FargatebuilderarmCodeBuildBuildFailed264992E6", - "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB", - "FargatebuilderarmCodeBuildEventsRole20E8CE66", - "FargatebuilderarmCodeBuild0D30679A", - "FargatebuilderarmCRPolicyD241BB66", - "FargatebuilderarmRoleDefaultPolicy89F1BA94", - "FargatebuilderarmRoleB6343E8F" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargatebuilderarmBuildSchedule854B2895": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "FargatebuilderarmRepository77DCC132" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "FargatebuilderarmCodeBuild0D30679A", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "FargatebuilderarmCodeBuildEventsRole20E8CE66", - "Arn" - ] - } - } - ] - } - }, - "LambdaImageBuilderx64RoleEE3EE1CB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Logs1C003BB4", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4", - "Roles": [ - { - "Ref": "LambdaImageBuilderx64RoleEE3EE1CB" - } - ] - } - }, - "LambdaImageBuilderx64Repository57F632F1": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - }, - "RepositoryPolicyText": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaImageBuilderx64RepositoryPushrule1C711F47": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": "Update GitHub Actions runner Lambda on ECR image push", - "EventPattern": { - "detail-type": [ - "ECR Image Action" - ], - "detail": { - "action-type": [ - "PUSH" - ], - "repository-name": [ - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - } - ], - "image-tag": [ - "latest" - ], - "result": [ - "SUCCESS" - ] - }, - "source": [ - "aws.ecr" - ] - }, - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", - "Arn" - ] - }, - "Id": "Target0", - "Input": { - "Fn::Join": [ - "", - [ - "{\"lambdaName\":\"", - { - "Ref": "LambdaFunction9233991D" - }, - "\",\"repositoryUri\":\"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - }, - "\",\"repositoryTag\":\"latest\"}" - ] - ] - } - } - ] - } - }, - "LambdaImageBuilderx64RepositoryPushruleAllowEventRulegithubrunnerstestupdatelambdadcc036c8876b451ea2c1552f9e06e9e17433A98EAF8930B2": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", - "Arn" - ] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64RepositoryPushrule1C711F47", - "Arn" - ] - } - } - }, - "LambdaImageBuilderx64Logs1C003BB4": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaImageBuilderx64CodeBuild67DE14C8": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Lambda Image Builder x64 (Amazon Linux 2023/X86_64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "LINUX_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "LambdaImageBuilderx64Logs1C003BB4" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64RoleEE3EE1CB", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf upgrade -y\\ndnf install -y jq tar gzip bzip2 which binutils zip unzip sudo shadow-utils findutils\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n/usr/sbin/groupadd runner\\n/usr/sbin/useradd --system --shell /usr/sbin/nologin --home-dir /home/runner --gid runner runner\\nmkdir -p /home/runner\\nchown runner /home/runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSSL https://cli.github.com/packages/rpm/gh-cli.repo -o /etc/yum.repos.d/gh-cli.repo\\ndnf install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\ndnf install -y openssl-libs krb5-libs zlib libicu-67.1\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh" - }, - " asset6-Lambda-Entrypoint-0\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh" - }, - " asset6-Lambda-Entrypoint-1\",\n \"cat > component6-Lambda-Entrypoint.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Lambda-Entrypoint.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/amazonlinux/amazonlinux:2023\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Lambda-Entrypoint-0 /bootstrap.sh\\nCOPY asset6-Lambda-Entrypoint-1 /runner.sh\\nCOPY component6-Lambda-Entrypoint.sh /tmp\\nRUN /tmp/component6-Lambda-Entrypoint.sh\\nLABEL DISABLE_SOCI=1\\nENTRYPOINT [\\\"bash\\\", \\\"/bootstrap.sh\\\"]\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64CodeBuild67DE14C8", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997", - "Roles": [ - { - "Ref": "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21" - } - ] - } - }, - "LambdaImageBuilderx64CodeBuildBuildFailed7E839416": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "thubrunnerstestLambdaImageBuilderx64CodeBuildBuildFailedE326D971", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64CodeBuild67DE14C8", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "LambdaImageBuilderx64CRPolicy6DBE0D1F": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64CodeBuild67DE14C8", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageBuilderx64CRPolicy6DBE0D1F", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "LambdaImageBuilderx64BuildWaitHandle0ef960775aB1E8095D": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "LambdaImageBuilderx64BuildWait0ef960775aDC1D350E": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "LambdaImageBuilderx64BuildWaitHandle0ef960775aB1E8095D" - }, - "Timeout": "3600" - } - }, - "LambdaImageBuilderx64Builder42F384AF": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - }, - "ProjectName": { - "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" - }, - "WaitHandle": { - "Ref": "LambdaImageBuilderx64BuildWaitHandle0ef960775aB1E8095D" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "LambdaImageBuilderx64CodeBuildBuildFailed7E839416", - "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997", - "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21", - "LambdaImageBuilderx64CodeBuild67DE14C8", - "LambdaImageBuilderx64CRPolicy6DBE0D1F", - "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4", - "LambdaImageBuilderx64RoleEE3EE1CB" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaImageBuilderx64BuildScheduleFA3DBF6A": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64CodeBuild67DE14C8", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21", - "Arn" - ] - } - } - ] - } - }, - "WindowsImageBuilderSG5ACD1618": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Windows Image Builder/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "WindowsImageBuilderRole717C46A6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AmazonSSMManagedInstanceCore" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/EC2InstanceProfileForImageBuilderECRContainerBuilds" - ] - ] - } - ] - } - }, - "WindowsImageBuilderRoleDefaultPolicy8BEB7BE3": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "WindowsImageBuilderRoleDefaultPolicy8BEB7BE3", - "Roles": [ - { - "Ref": "WindowsImageBuilderRole717C46A6" - } - ] - } - }, - "WindowsImageBuilderRepositoryA4CBB6D8": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WindowsImageBuilderDockerDistributionE6B7F2F2": { - "Type": "AWS::ImageBuilder::DistributionConfiguration", - "Properties": { - "Distributions": [ - { - "ContainerDistributionConfiguration": { - "ContainerTags": [ - "latest" - ], - "TargetRepository": { - "RepositoryName": { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - }, - "Service": "ECR" - } - }, - "Region": { - "Ref": "AWS::Region" - } - } - ], - "Name": "github-runners-test-windowsimagebuilder-dockerdistribution-8c41c0cd", - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", - "GitHubRunners:Stack": "github-runners-test" - } - } - }, - "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", - "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-windowsimagebuilder-component0requiredpackages-component-963beb47", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 1 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", - "Description": "Component 1 RunnerUser", - "Name": "github-runners-test-windowsimagebuilder-component1runneruser-component-c4a9efb2", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent2GitComponent92ACFEF5": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 2 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", - "Description": "Component 2 Git", - "Name": "github-runners-test-windowsimagebuilder-component2git-component-f09bbd59", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent3GithubCliComponentF18685D5": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 3 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", - "Description": "Component 3 GithubCli", - "Name": "github-runners-test-windowsimagebuilder-component3githubcli-component-a0ec305e", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent4AwsCliComponent6654838D": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 4 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", - "Description": "Component 4 AwsCli", - "Name": "github-runners-test-windowsimagebuilder-component4awscli-component-c1cc638a", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 5 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", - "Description": "Component 5 GithubRunner", - "Name": "github-runners-test-windowsimagebuilder-component5githubrunner-component-c7c81d8e", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": { - "Fn::Join": [ - "", - [ - "name: Component 6 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" - ] - ] - }, - "Description": "Component 6 Custom-Undefined", - "Name": "github-runners-test-windowsimagebuilder-component6custom-undefined-component-955efea2", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 7 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", - "Description": "Component 7 EnvironmentVariables", - "Name": "github-runners-test-windowsimagebuilder-component7environmentvariables-component-f73418d2", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsImageBuilderContainerRecipeB2A421D7": { - "Type": "AWS::ImageBuilder::ContainerRecipe", - "Properties": { - "Components": [ - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent2GitComponent92ACFEF5", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent3GithubCliComponentF18685D5", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent4AwsCliComponent6654838D", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09", - "Arn" - ] - } - } - ], - "ContainerType": "DOCKER", - "DockerfileTemplateData": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\nENV RUNNER_VERSION=latest\n", - "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", - "ParentImage": "mcr.microsoft.com/windows/servercore:ltsc2019-amd64", - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", - "GitHubRunners:Stack": "github-runners-test" - }, - "TargetRepository": { - "RepositoryName": { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - }, - "Service": "ECR" - }, - "Version": "1.0.x" - } - }, - "WindowsImageBuilderDockerLogE660E23E": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WindowsImageBuilderInfrastructureInstanceProfile253C95CE": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "WindowsImageBuilderRole717C46A6" - } - ] - } - }, - "WindowsImageBuilderInfrastructure14D24F2C": { - "Type": "AWS::ImageBuilder::InfrastructureConfiguration", - "Properties": { - "InstanceMetadataOptions": { - "HttpPutResponseHopLimit": 2, - "HttpTokens": "required" - }, - "InstanceProfileName": { - "Ref": "WindowsImageBuilderInfrastructureInstanceProfile253C95CE" - }, - "InstanceTypes": [ - "m6i.large" - ], - "Name": "github-runners-test-windowsimagebuilder-infrastructure-17f3ac1c", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "WindowsImageBuilderSG5ACD1618", - "GroupId" - ] - } - ], - "SnsTopicArn": { - "Ref": "runnersImageBuilderBuildsDF5A50E4" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "WindowsImageBuilderDockerImage8672CA3E": { - "Type": "AWS::ImageBuilder::Image", - "Properties": { - "ContainerRecipeArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", - "Arn" - ] - }, - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderDockerDistributionE6B7F2F2", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderInfrastructure14D24F2C", - "Arn" - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "WindowsImageBuilderDockerLogE660E23E", - "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", - "WindowsImageBuilderInfrastructure14D24F2C" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "RetainExceptOnCreate" - }, - "WindowsImageBuilderContainerCleaner9CB998CD": { - "Type": "Custom::ImageBuilder-Delete-Resources", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", - "Arn" - ] - }, - "ImageVersionArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":image/github-runners-test-windowsimagebuilder-containerrecipe-c577a80b/", - { - "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", - "Version" - ] - } - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WindowsImageBuilderLifecyclePolicyDockerRole13C6E553": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "imagebuilder.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "tag:GetResources", - "imagebuilder:DeleteImage" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ib" - }, - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchGetImage", - "ecr:BatchDeleteImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ecr" - } - ] - } - }, - "WindowsImageBuilderLifecyclePolicyDockerB9CE4B0A": { - "Type": "AWS::ImageBuilder::LifecyclePolicy", - "Properties": { - "Description": "Delete old GitHub Runner Docker images for github-runners-test/Windows Image Builder", - "ExecutionRole": { - "Fn::GetAtt": [ - "WindowsImageBuilderLifecyclePolicyDockerRole13C6E553", - "Arn" - ] - }, - "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", - "PolicyDetails": [ - { - "Action": { - "IncludeResources": { - "Containers": true - }, - "Type": "DELETE" - }, - "Filter": { - "Type": "COUNT", - "Value": 2 - } - } - ], - "ResourceSelection": { - "Recipes": [ - { - "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", - "SemanticVersion": { - "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", - "Version" - ] - } - } - ] - }, - "ResourceType": "CONTAINER_IMAGE" - } - }, - "WindowsImageBuilderDockerPipeline3613721A": { - "Type": "AWS::ImageBuilder::ImagePipeline", - "Properties": { - "ContainerRecipeArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", - "Arn" - ] - }, - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderDockerDistributionE6B7F2F2", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "WindowsImageBuilderInfrastructure14D24F2C", - "Arn" - ] - }, - "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", - "Schedule": { - "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", - "ScheduleExpression": "rate(7 days)" - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "WindowsImageBuilderDockerLogE660E23E", - "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", - "WindowsImageBuilderInfrastructure14D24F2C" - ] - }, - "AMILinuxBuilderSGEDC86329": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/AMI Linux Builder/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "AMILinuxBuilderRole0C42378A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AmazonSSMManagedInstanceCore" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/EC2InstanceProfileForImageBuilder" - ] - ] - } - ] - } - }, - "AMILinuxBuilderRoleDefaultPolicy69ED051F": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "AMILinuxBuilderRoleDefaultPolicy69ED051F", - "Roles": [ - { - "Ref": "AMILinuxBuilderRole0C42378A" - } - ] - } - }, - "AMILinuxBuilderLaunchtemplateA29452C4": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "MetadataOptions": { - "HttpTokens": "required" - }, - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/AMI Linux Builder/Launch template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/AMI Linux Builder/Launch template" - } - ] - } - ] - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/AMI Linux Builder/Launch template" - } - ] - } - ] - } - }, - "AMILinuxBuilderAMIDistribution215F3A5C": { - "Type": "AWS::ImageBuilder::DistributionConfiguration", - "Properties": { - "Distributions": [ - { - "AmiDistributionConfiguration": { - "AmiTags": { - "Name": "AMI Linux Builder", - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" - } - }, - "LaunchTemplateConfigurations": [ - { - "LaunchTemplateId": { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "SetDefaultVersion": true - } - ], - "Region": { - "Ref": "AWS::Region" - } - } - ], - "Name": "github-runners-test-amilinuxbuilder-amidistribution-f27cc043", - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", - "GitHubRunners:Stack": "github-runners-test" - } - } - }, - "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", - "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-amilinuxbuilder-component0requiredpackages-component-ccd42ff5", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", - "Description": "Component 1 CloudWatchAgent", - "Name": "github-runners-test-amilinuxbuilder-component1cloudwatchagent-component-5545ba1f", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent2RunnerUserComponentCDE71073": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", - "Description": "Component 2 RunnerUser", - "Name": "github-runners-test-amilinuxbuilder-component2runneruser-component-b84742f0", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent3GitComponent9011E3AB": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", - "Description": "Component 3 Git", - "Name": "github-runners-test-amilinuxbuilder-component3git-component-5532a5f4", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent4GithubCliComponent602EE471": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", - "Description": "Component 4 GithubCli", - "Name": "github-runners-test-amilinuxbuilder-component4githubcli-component-7925b347", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent5AwsCliComponent72637C19": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", - "Description": "Component 5 AwsCli", - "Name": "github-runners-test-amilinuxbuilder-component5awscli-component-ea3524b1", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent6DockerComponent9E523A42": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", - "Description": "Component 6 Docker", - "Name": "github-runners-test-amilinuxbuilder-component6docker-component-c57d02ec", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", - "Description": "Component 7 GithubRunner", - "Name": "github-runners-test-amilinuxbuilder-component7githubrunner-component-dd50b576", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": { - "Fn::Join": [ - "", - [ - "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" - ] - ] - }, - "Description": "Component 8 Custom-Undefined", - "Name": "github-runners-test-amilinuxbuilder-component8custom-undefined-component-35d68e99", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", - "Description": "Component 9 EnvironmentVariables", - "Name": "github-runners-test-amilinuxbuilder-component9environmentvariables-component-c760ab8d", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/ubuntu-server-22-lts-x86/x.x.x" - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AMILinuxBuilderAmiRecipeVersionFBE9C9AE": { - "Type": "Custom::ImageBuilder-ImageRecipe-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "ImageRecipe", - "ObjectName": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", - "VersionedData": { - "platform": "Linux", - "components": [ - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent3GitComponent9011E3AB", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent4GithubCliComponent602EE471", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent5AwsCliComponent72637C19", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent6DockerComponent9E523A42", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", - "Arn" - ] - } - } - ], - "parentAmi": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/ubuntu-server-22-lts-x86/x.x.x" - ] - ] - }, - "tags": { - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" - }, - "blockDeviceMappings": [ - { - "deviceName": { - "Ref": "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374" - }, - "ebs": { - "volumeSize": 33, - "deleteOnTermination": true - } - } - ] - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxBuilderAmiRecipe7C7ED6C7": { - "Type": "AWS::ImageBuilder::ImageRecipe", - "Properties": { - "BlockDeviceMappings": [ - { - "DeviceName": { - "Ref": "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374" - }, - "Ebs": { - "DeleteOnTermination": true, - "VolumeSize": 33 - } - } - ], - "Components": [ - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent3GitComponent9011E3AB", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent4GithubCliComponent602EE471", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent5AwsCliComponent72637C19", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent6DockerComponent9E523A42", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", - "Arn" - ] - } - } - ], - "Name": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", - "ParentImage": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/ubuntu-server-22-lts-x86/x.x.x" - ] - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", - "GitHubRunners:Stack": "github-runners-test" - }, - "Version": { - "Ref": "AMILinuxBuilderAmiRecipeVersionFBE9C9AE" - }, - "WorkingDirectory": "/home/runner" - } - }, - "AMILinuxBuilderAmiLog0DB16E38": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AMILinuxBuilderInfrastructureInstanceProfileB423D304": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "AMILinuxBuilderRole0C42378A" - } - ] - } - }, - "AMILinuxBuilderInfrastructure069F0561": { - "Type": "AWS::ImageBuilder::InfrastructureConfiguration", - "Properties": { - "InstanceMetadataOptions": { - "HttpPutResponseHopLimit": 2, - "HttpTokens": "required" - }, - "InstanceProfileName": { - "Ref": "AMILinuxBuilderInfrastructureInstanceProfileB423D304" - }, - "InstanceTypes": [ - "m6i.large" - ], - "Name": "github-runners-test-amilinuxbuilder-infrastructure-52c63716", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "AMILinuxBuilderSGEDC86329", - "GroupId" - ] - } - ], - "SnsTopicArn": { - "Ref": "runnersImageBuilderBuildsDF5A50E4" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "AMILinuxBuilderAMIImage93D83DE5": { - "Type": "AWS::ImageBuilder::Image", - "Properties": { - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderAMIDistribution215F3A5C", - "Arn" - ] - }, - "ImageRecipeArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderAmiRecipe7C7ED6C7", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderInfrastructure069F0561", - "Arn" - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderInfrastructureInstanceProfileB423D304", - "AMILinuxBuilderInfrastructure069F0561" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "RetainExceptOnCreate" - }, - "AMILinuxBuilderAMIPipelineEC5051DF": { - "Type": "AWS::ImageBuilder::ImagePipeline", - "Properties": { - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderAMIDistribution215F3A5C", - "Arn" - ] - }, - "ImageRecipeArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderAmiRecipe7C7ED6C7", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxBuilderInfrastructure069F0561", - "Arn" - ] - }, - "Name": "github-runners-test-AMILinuxBuilder-67243E6D", - "Schedule": { - "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", - "ScheduleExpression": "rate(7 days)" - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderInfrastructureInstanceProfileB423D304", - "AMILinuxBuilderInfrastructure069F0561" - ] - }, - "AMILinuxBuilderImageCleanerF1745EF6": { - "Type": "Custom::ImageBuilder-Delete-Resources", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", - "Arn" - ] - }, - "ImageVersionArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":image/github-runners-test-amilinuxbuilder-amirecipe-2b5c5a8b/", - { - "Ref": "AMILinuxBuilderAmiRecipeVersionFBE9C9AE" - } - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "imagebuilder.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "tag:GetResources", - "imagebuilder:DeleteImage" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ib" - }, - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ec2:DescribeImages", - "ec2:DescribeImageAttribute" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ec2:DeregisterImage", - "ec2:DeleteSnapshot" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", - "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" - } - }, - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ami" - } - ] - } - }, - "AMILinuxBuilderLifecyclePolicyAMIFB556CB2": { - "Type": "AWS::ImageBuilder::LifecyclePolicy", - "Properties": { - "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux Builder", - "ExecutionRole": { - "Fn::GetAtt": [ - "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", - "Arn" - ] - }, - "Name": "github-runners-test-AMILinuxBuilder-67243E6D", - "PolicyDetails": [ - { - "Action": { - "IncludeResources": { - "Amis": true, - "Snapshots": true - }, - "Type": "DELETE" - }, - "Filter": { - "Type": "COUNT", - "Value": 2 - } - } - ], - "ResourceSelection": { - "Recipes": [ - { - "Name": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", - "SemanticVersion": { - "Ref": "AMILinuxBuilderAmiRecipeVersionFBE9C9AE" - } - } - ] - }, - "ResourceType": "AMI_IMAGE" - } - }, - "CodeBuildImageBuilderRoleF1F34984": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "CodeBuildImageBuilderRoleDefaultPolicy6982821E": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderLogsE4CADFCC", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildImageBuilderRoleDefaultPolicy6982821E", - "Roles": [ - { - "Ref": "CodeBuildImageBuilderRoleF1F34984" - } - ] - } - }, - "CodeBuildImageBuilderRepository9DE3B6F0": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildImageBuilderLogsE4CADFCC": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildImageBuilderCodeBuild38ECAA44": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Image Builder (Ubuntu Linux/X86_64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "LINUX_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildImageBuilderLogsE4CADFCC" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRoleF1F34984", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "CodeBuildImageBuilderCodeBuildEventsRole4277A55E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderCodeBuild38ECAA44", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D", - "Roles": [ - { - "Ref": "CodeBuildImageBuilderCodeBuildEventsRole4277A55E" - } - ] - } - }, - "CodeBuildImageBuilderCodeBuildBuildFailed9B205D70": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "thubrunnerstestCodeBuildImageBuilderCodeBuildBuildFailed73942339", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderCodeBuild38ECAA44", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "CodeBuildImageBuilderCRPolicyAFC63F28": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderCodeBuild38ECAA44", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildImageBuilderCRPolicyAFC63F28", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "CodeBuildImageBuilderBuildWait6c559791c302D896CB": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C" - }, - "Timeout": "3600" - } - }, - "CodeBuildImageBuilderB8638EC8": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - }, - "ProjectName": { - "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" - }, - "WaitHandle": { - "Ref": "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "CodeBuildImageBuilderCodeBuildBuildFailed9B205D70", - "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D", - "CodeBuildImageBuilderCodeBuildEventsRole4277A55E", - "CodeBuildImageBuilderCodeBuild38ECAA44", - "CodeBuildImageBuilderCRPolicyAFC63F28", - "CodeBuildImageBuilderRoleDefaultPolicy6982821E", - "CodeBuildImageBuilderRoleF1F34984" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildImageBuilderBuildSchedule66D9D18A": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderCodeBuild38ECAA44", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderCodeBuildEventsRole4277A55E", - "Arn" - ] - } - } - ] - } - }, - "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13", - "Roles": [ - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB" - } - ] - } - }, - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Ubuntu 2404 Image Builder (Ubuntu Linux 24.04/X86_64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "LINUX_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:24.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8", - "Roles": [ - { - "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981" - } - ] - } - }, - "CodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed90989099": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "stestCodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed22054A19", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "CodeBuildUbuntu2404ImageBuilderBuildWait869992dae157E3A527": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5" - }, - "Timeout": "3600" - } - }, - "CodeBuildUbuntu2404ImageBuilder2CDBC05E": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - }, - "ProjectName": { - "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" - }, - "WaitHandle": { - "Ref": "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "CodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed90989099", - "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8", - "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981", - "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", - "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB", - "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13", - "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildUbuntu2404ImageBuilderBuildScheduleEDD400B0": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981", - "Arn" - ] - } - } - ] - } - }, - "CodeBuildImageBuilderarmRole96BC26FB": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmLogs5A60CB81", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE", - "Roles": [ - { - "Ref": "CodeBuildImageBuilderarmRole96BC26FB" - } - ] - } - }, - "CodeBuildImageBuilderarmRepositoryE967421B": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildImageBuilderarmLogs5A60CB81": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildImageBuilderarmCodeBuildBFF1CF57": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Image Builder arm (Ubuntu Linux/ARM64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "ARM_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRole96BC26FB", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmCodeBuildBFF1CF57", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D", - "Roles": [ - { - "Ref": "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89" - } - ] - } - }, - "CodeBuildImageBuilderarmCodeBuildBuildFailed7605ECB2": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "brunnerstestCodeBuildImageBuilderarmCodeBuildBuildFailedF9370687", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmCodeBuildBFF1CF57", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "CodeBuildImageBuilderarmCRPolicy75CB8D91": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmCodeBuildBFF1CF57", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildImageBuilderarmCRPolicy75CB8D91", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "CodeBuildImageBuilderarmBuildWaitf181c92a802A4BA349": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303" - }, - "Timeout": "3600" - } - }, - "CodeBuildImageBuilderarmBuilder755EB37D": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - }, - "ProjectName": { - "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" - }, - "WaitHandle": { - "Ref": "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "CodeBuildImageBuilderarmCodeBuildBuildFailed7605ECB2", - "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D", - "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89", - "CodeBuildImageBuilderarmCodeBuildBFF1CF57", - "CodeBuildImageBuilderarmCRPolicy75CB8D91", - "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE", - "CodeBuildImageBuilderarmRole96BC26FB" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildImageBuilderarmBuildSchedule909D75E9": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmCodeBuildBFF1CF57", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89", - "Arn" - ] - } - } - ] - } - }, - "LambdaImageBuilderzRole6F1A63E5": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzLogsC9FB42C8", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "LambdaImageBuilderzCodeBuild73AB6718" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "LambdaImageBuilderzCodeBuild73AB6718" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "LambdaImageBuilderzCodeBuild73AB6718" - }, - "-*" - ] - ] - } - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage", - "ecr:CompleteLayerUpload", - "ecr:UploadLayerPart", - "ecr:InitiateLayerUpload", - "ecr:PutImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7", - "Roles": [ - { - "Ref": "LambdaImageBuilderzRole6F1A63E5" - } - ] - } - }, - "LambdaImageBuilderzRepository7C7AD146": { - "Type": "AWS::ECR::Repository", - "Properties": { - "EmptyOnDelete": true, - "ImageScanningConfiguration": { - "ScanOnPush": true - }, - "ImageTagMutability": "MUTABLE", - "LifecyclePolicy": { - "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" - }, - "RepositoryPolicyText": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaImageBuilderzRepositoryPushruleA1F1B44F": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": "Update GitHub Actions runner Lambda on ECR image push", - "EventPattern": { - "detail-type": [ - "ECR Image Action" - ], - "detail": { - "action-type": [ - "PUSH" - ], - "repository-name": [ - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - } - ], - "image-tag": [ - "latest" - ], - "result": [ - "SUCCESS" - ] - }, - "source": [ - "aws.ecr" - ] - }, - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", - "Arn" - ] - }, - "Id": "Target0", - "Input": { - "Fn::Join": [ - "", - [ - "{\"lambdaName\":\"", - { - "Ref": "LambdaARMFunctionDD4B5FF7" - }, - "\",\"repositoryUri\":\"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - }, - "\",\"repositoryTag\":\"latest\"}" - ] - ] - } - } - ] - } - }, - "LambdaImageBuilderzRepositoryPushruleAllowEventRulegithubrunnerstestupdatelambdadcc036c8876b451ea2c1552f9e06e9e17433A98E002B5DB7": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", - "Arn" - ] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepositoryPushruleA1F1B44F", - "Arn" - ] - } - } - }, - "LambdaImageBuilderzLogsC9FB42C8": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaImageBuilderzCodeBuild73AB6718": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Lambda Image Builderz (Amazon Linux 2023/ARM64)", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", - "ImagePullCredentialsType": "CODEBUILD", - "PrivilegedMode": true, - "Type": "ARM_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "LambdaImageBuilderzLogsC9FB42C8" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "LambdaImageBuilderzRole6F1A63E5", - "Arn" - ] - }, - "Source": { - "BuildSpec": { - "Fn::Join": [ - "", - [ - "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - }, - "\",\n \"REPO_URI\": \"", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - }, - "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf upgrade -y\\ndnf install -y jq tar gzip bzip2 which binutils zip unzip sudo shadow-utils findutils\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n/usr/sbin/groupadd runner\\n/usr/sbin/useradd --system --shell /usr/sbin/nologin --home-dir /home/runner --gid runner runner\\nmkdir -p /home/runner\\nchown runner /home/runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSSL https://cli.github.com/packages/rpm/gh-cli.repo -o /etc/yum.repos.d/gh-cli.repo\\ndnf install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\ndnf install -y openssl-libs krb5-libs zlib libicu-67.1\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh" - }, - " asset6-Lambda-Entrypoint-0\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh" - }, - " asset6-Lambda-Entrypoint-1\",\n \"cat > component6-Lambda-Entrypoint.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Lambda-Entrypoint.sh\",\n \"aws s3 cp ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/amazonlinux/amazonlinux:2023\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Lambda-Entrypoint-0 /bootstrap.sh\\nCOPY asset6-Lambda-Entrypoint-1 /runner.sh\\nCOPY component6-Lambda-Entrypoint.sh /tmp\\nRUN /tmp/component6-Lambda-Entrypoint.sh\\nLABEL DISABLE_SOCI=1\\nENTRYPOINT [\\\"bash\\\", \\\"/bootstrap.sh\\\"]\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" - ] - ] - }, - "Type": "NO_SOURCE" - }, - "TimeoutInMinutes": 60 - } - }, - "LambdaImageBuilderzCodeBuildEventsRoleE9E50664": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzCodeBuild73AB6718", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23", - "Roles": [ - { - "Ref": "LambdaImageBuilderzCodeBuildEventsRoleE9E50664" - } - ] - } - }, - "LambdaImageBuilderzCodeBuildBuildFailedFBCC1CE8": { - "Type": "AWS::CodeStarNotifications::NotificationRule", - "Properties": { - "DetailType": "FULL", - "EventTypeIds": [ - "codebuild-project-build-state-failed" - ], - "Name": "githubrunnerstestLambdaImageBuilderzCodeBuildBuildFailedD221038C", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzCodeBuild73AB6718", - "Arn" - ] - }, - "Targets": [ - { - "TargetAddress": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "TargetType": "SNS" - } - ] - } - }, - "LambdaImageBuilderzCRPolicyC9B09855": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "codebuild:StartBuild", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzCodeBuild73AB6718", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageBuilderzCRPolicyC9B09855", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "LambdaImageBuilderzBuildWaitHandle781886e2d8A063F430": { - "Type": "AWS::CloudFormation::WaitConditionHandle" - }, - "LambdaImageBuilderzBuildWait781886e2d89352301D": { - "Type": "AWS::CloudFormation::WaitCondition", - "Properties": { - "Count": 1, - "Handle": { - "Ref": "LambdaImageBuilderzBuildWaitHandle781886e2d8A063F430" - }, - "Timeout": "3600" - } - }, - "LambdaImageBuilderzBuilder235DD147": { - "Type": "Custom::ImageBuilder", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "Arn" - ] - }, - "RepoName": { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - }, - "ProjectName": { - "Ref": "LambdaImageBuilderzCodeBuild73AB6718" - }, - "WaitHandle": { - "Ref": "LambdaImageBuilderzBuildWaitHandle781886e2d8A063F430" - } - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "LambdaImageBuilderzCodeBuildBuildFailedFBCC1CE8", - "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23", - "LambdaImageBuilderzCodeBuildEventsRoleE9E50664", - "LambdaImageBuilderzCodeBuild73AB6718", - "LambdaImageBuilderzCRPolicyC9B09855", - "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7", - "LambdaImageBuilderzRole6F1A63E5" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaImageBuilderzBuildSchedule81F79A6A": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": { - "Fn::Join": [ - "", - [ - "Rebuild runner image for ", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - } - ] - ] - }, - "ScheduleExpression": "rate(7 days)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "LambdaImageBuilderzCodeBuild73AB6718", - "Arn" - ] - }, - "Id": "Target0", - "RoleArn": { - "Fn::GetAtt": [ - "LambdaImageBuilderzCodeBuildEventsRoleE9E50664", - "Arn" - ] - } - } - ] - } - }, - "AMILinuxarm64BuilderSG94315968": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/AMI Linux arm64 Builder/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "AMILinuxarm64BuilderRole40D54E29": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AmazonSSMManagedInstanceCore" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/EC2InstanceProfileForImageBuilder" - ] - ] - } - ] - } - }, - "AMILinuxarm64BuilderRoleDefaultPolicy113305EE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", - "Roles": [ - { - "Ref": "AMILinuxarm64BuilderRole40D54E29" - } - ] - } - }, - "AMILinuxarm64BuilderLaunchtemplate8F5EFF44": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "MetadataOptions": { - "HttpTokens": "required" - }, - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" - } - ] - } - ] - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" - } - ] - } - ] - } - }, - "AMILinuxarm64BuilderAMIDistributionE6989D01": { - "Type": "AWS::ImageBuilder::DistributionConfiguration", - "Properties": { - "Distributions": [ - { - "AmiDistributionConfiguration": { - "AmiTags": { - "Name": "AMI Linux arm64 Builder", - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" - } - }, - "LaunchTemplateConfigurations": [ - { - "LaunchTemplateId": { - "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" - }, - "SetDefaultVersion": true - } - ], - "Region": { - "Ref": "AWS::Region" - } - } - ], - "Name": "github-runners-test-amilinuxarm64builder-amidistribution-64ec726d", - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", - "GitHubRunners:Stack": "github-runners-test" - } - } - }, - "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", - "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-amilinuxarm64builder-component0requiredpackages-component-24f2e247", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", - "Description": "Component 1 CloudWatchAgent", - "Name": "github-runners-test-amilinuxarm64builder-component1cloudwatchagent-component-9127095a", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", - "Description": "Component 2 RunnerUser", - "Name": "github-runners-test-amilinuxarm64builder-component2runneruser-component-360117bd", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", - "Description": "Component 3 Git", - "Name": "github-runners-test-amilinuxarm64builder-component3git-component-c3215149", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", - "Description": "Component 4 GithubCli", - "Name": "github-runners-test-amilinuxarm64builder-component4githubcli-component-585d1ee4", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", - "Description": "Component 5 AwsCli", - "Name": "github-runners-test-amilinuxarm64builder-component5awscli-component-706b4769", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent6DockerComponentE31D0222": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", - "Description": "Component 6 Docker", - "Name": "github-runners-test-amilinuxarm64builder-component6docker-component-4c582cde", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", - "Description": "Component 7 GithubRunner", - "Name": "github-runners-test-amilinuxarm64builder-component7githubrunner-component-bdc80137", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": { - "Fn::Join": [ - "", - [ - "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" - ] - ] - }, - "Description": "Component 8 Custom-Undefined", - "Name": "github-runners-test-amilinuxarm64builder-component8custom-undefined-component-e23d33b6", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", - "Description": "Component 9 EnvironmentVariables", - "Name": "github-runners-test-amilinuxarm64builder-component9environmentvariables-component-25ee7189", - "Platform": "Linux", - "Version": "1.0.0" - } - }, - "AMILinuxarm64BuilderAmiRecipeVersion429E7646": { - "Type": "Custom::ImageBuilder-ImageRecipe-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "ImageRecipe", - "ObjectName": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", - "VersionedData": { - "platform": "Linux", - "components": [ - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", - "Arn" - ] - } - } - ], - "parentAmi": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/ubuntu-server-22-lts-arm64/x.x.x" - ] - ] - }, - "tags": { - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" - } - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "AMILinuxarm64BuilderAmiRecipe6A6ED38F": { - "Type": "AWS::ImageBuilder::ImageRecipe", - "Properties": { - "Components": [ - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", - "Arn" - ] - } - } - ], - "Name": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", - "ParentImage": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/ubuntu-server-22-lts-arm64/x.x.x" - ] - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", - "GitHubRunners:Stack": "github-runners-test" - }, - "Version": { - "Ref": "AMILinuxarm64BuilderAmiRecipeVersion429E7646" - }, - "WorkingDirectory": "/home/runner" - } - }, - "AMILinuxarm64BuilderAmiLog84A9D94A": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "AMILinuxarm64BuilderRole40D54E29" - } - ] - } - }, - "AMILinuxarm64BuilderInfrastructureA97EB3DD": { - "Type": "AWS::ImageBuilder::InfrastructureConfiguration", - "Properties": { - "InstanceMetadataOptions": { - "HttpPutResponseHopLimit": 2, - "HttpTokens": "required" - }, - "InstanceProfileName": { - "Ref": "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7" - }, - "InstanceTypes": [ - "m6g.large" - ], - "Name": "github-runners-test-amilinuxarm64builder-infrastructure-4dd30f96", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderSG94315968", - "GroupId" - ] - } - ], - "SnsTopicArn": { - "Ref": "runnersImageBuilderBuildsDF5A50E4" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "AMILinuxarm64BuilderAMIImage40078F9E": { - "Type": "AWS::ImageBuilder::Image", - "Properties": { - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderAMIDistributionE6989D01", - "Arn" - ] - }, - "ImageRecipeArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderInfrastructureA97EB3DD", - "Arn" - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "AMILinuxarm64BuilderAmiLog84A9D94A", - "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", - "AMILinuxarm64BuilderInfrastructureA97EB3DD" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "RetainExceptOnCreate" - }, - "AMILinuxarm64BuilderAMIPipeline9CC1354C": { - "Type": "AWS::ImageBuilder::ImagePipeline", - "Properties": { - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderAMIDistributionE6989D01", - "Arn" - ] - }, - "ImageRecipeArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderInfrastructureA97EB3DD", - "Arn" - ] - }, - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", - "Schedule": { - "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", - "ScheduleExpression": "rate(7 days)" - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "AMILinuxarm64BuilderAmiLog84A9D94A", - "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", - "AMILinuxarm64BuilderInfrastructureA97EB3DD" - ] - }, - "AMILinuxarm64BuilderImageCleanerA5DDFE7A": { - "Type": "Custom::ImageBuilder-Delete-Resources", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", - "Arn" - ] - }, - "ImageVersionArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":image/github-runners-test-amilinuxarm64builder-amirecipe-9167b5ef/", - { - "Ref": "AMILinuxarm64BuilderAmiRecipeVersion429E7646" - } - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "imagebuilder.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "tag:GetResources", - "imagebuilder:DeleteImage" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ib" - }, - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ec2:DescribeImages", - "ec2:DescribeImageAttribute" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ec2:DeregisterImage", - "ec2:DeleteSnapshot" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", - "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" - } - }, - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ami" - } - ] - } - }, - "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD": { - "Type": "AWS::ImageBuilder::LifecyclePolicy", - "Properties": { - "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux arm64 Builder", - "ExecutionRole": { - "Fn::GetAtt": [ - "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", - "Arn" - ] - }, - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", - "PolicyDetails": [ - { - "Action": { - "IncludeResources": { - "Amis": true, - "Snapshots": true - }, - "Type": "DELETE" - }, - "Filter": { - "Type": "COUNT", - "Value": 2 - } - } - ], - "ResourceSelection": { - "Recipes": [ - { - "Name": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", - "SemanticVersion": { - "Ref": "AMILinuxarm64BuilderAmiRecipeVersion429E7646" - } - } - ] - }, - "ResourceType": "AMI_IMAGE" - } - }, - "WindowsEC2BuilderSGE3F67842": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Windows EC2 Builder/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "WindowsEC2BuilderRole1BA7D3E7": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AmazonSSMManagedInstanceCore" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/EC2InstanceProfileForImageBuilder" - ] - ] - } - ] - } - }, - "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", - "Roles": [ - { - "Ref": "WindowsEC2BuilderRole1BA7D3E7" - } - ] - } - }, - "WindowsEC2BuilderLaunchtemplate0A66E9C2": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "MetadataOptions": { - "HttpTokens": "required" - }, - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Windows EC2 Builder/Launch template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Windows EC2 Builder/Launch template" - } - ] - } - ] - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "Name", - "Value": "github-runners-test/Windows EC2 Builder/Launch template" - } - ] - } - ] - } - }, - "WindowsEC2BuilderAMIDistribution6B33DD89": { - "Type": "AWS::ImageBuilder::DistributionConfiguration", - "Properties": { - "Distributions": [ - { - "AmiDistributionConfiguration": { - "AmiTags": { - "Name": "Windows EC2 Builder", - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" - } - }, - "LaunchTemplateConfigurations": [ - { - "LaunchTemplateId": { - "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" - }, - "SetDefaultVersion": true - } - ], - "Region": { - "Ref": "AWS::Region" - } - } - ], - "Name": "github-runners-test-windowsec2builder-amidistribution-f20c96b4", - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", - "GitHubRunners:Stack": "github-runners-test" - } - } - }, - "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", - "Description": "Component 0 RequiredPackages", - "Name": "github-runners-test-windowsec2builder-component0requiredpackages-component-bee13031", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi\n /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", - "Description": "Component 1 CloudWatchAgent", - "Name": "github-runners-test-windowsec2builder-component1cloudwatchagent-component-64d3d72a", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", - "Description": "Component 2 RunnerUser", - "Name": "github-runners-test-windowsec2builder-component2runneruser-component-91981b9f", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent3GitComponent4F86AE54": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", - "Description": "Component 3 Git", - "Name": "github-runners-test-windowsec2builder-component3git-component-cc6f418c", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", - "Description": "Component 4 GithubCli", - "Name": "github-runners-test-windowsec2builder-component4githubcli-component-860aefc0", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", - "Description": "Component 5 AwsCli", - "Name": "github-runners-test-windowsec2builder-component5awscli-component-c6a315bd", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $BaseUrl = \"https://download.docker.com/win/static/stable/x86_64/\"\n - $html = Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl\n - $files = $html.Links.href | Where-Object { $_ -match\n '^docker-[0-9\\.]+\\.zip$' }\n - if (-not $files) { Write-Error \"No docker-*.zip files found.\" ;\n exit 1 }\n - $latest = $files | Sort-Object { try { [Version]($_ -replace\n '^docker-|\\.zip$') } catch { [Version]\"0.0.0\" } } -Descending |\n Select-Object -First 1\n - Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl$latest -OutFile\n docker.zip\n - Expand-Archive docker.zip -DestinationPath \"$Env:ProgramFiles\"\n - del docker.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";$Env:ProgramFiles\\Docker\",\n [EnvironmentVariableTarget]::Machine)'\n - $env:PATH = $env:PATH + \";$Env:ProgramFiles\\Docker\"\n - dockerd --register-service\n - if ($LASTEXITCODE -ne 0) { throw \"Exit code is $LASTEXITCODE\" }\n - Enable-WindowsOptionalFeature -Online -FeatureName containers -All\n -NoRestart\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/docker/compose/releases/latest >\n $Env:TEMP\\latest-docker-compose\n - $LatestUrl = Get-Content $Env:TEMP\\latest-docker-compose\n - $LatestDockerCompose = ($LatestUrl -Split '/')[-1]\n - Invoke-WebRequest -UseBasicParsing\n -Uri \"https://github.com/docker/compose/releases/download/${LatestDockerCompose}/docker-compose-Windows-x86_64.exe\"\n -OutFile $Env:ProgramFiles\\Docker\\docker-compose.exe\n - New-Item -ItemType directory -Path\n \"$Env:ProgramFiles\\Docker\\cli-plugins\"\n - Copy-Item -Path \"$Env:ProgramFiles\\Docker\\docker-compose.exe\"\n -Destination\n \"$Env:ProgramFiles\\Docker\\cli-plugins\\docker-compose.exe\"\n - name: Reboot\n action: Reboot\n inputs: {}\n", - "Description": "Component 6 Docker", - "Name": "github-runners-test-windowsec2builder-component6docker-component-69981091", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", - "Description": "Component 7 GithubRunner", - "Name": "github-runners-test-windowsec2builder-component7githubrunner-component-a31c580e", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": { - "Fn::Join": [ - "", - [ - "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", - { - "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" - }, - "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" - ] - ] - }, - "Description": "Component 8 Custom-Undefined", - "Name": "github-runners-test-windowsec2builder-component8custom-undefined-component-c961cd3a", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0": { - "Type": "AWS::ImageBuilder::Component", - "Properties": { - "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", - "Description": "Component 9 EnvironmentVariables", - "Name": "github-runners-test-windowsec2builder-component9environmentvariables-component-9fb8d548", - "Platform": "Windows", - "Version": "1.0.0" - } - }, - "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C": { - "Type": "Custom::ImageBuilder-ImageRecipe-Version", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E", - "Arn" - ] - }, - "ObjectType": "ImageRecipe", - "ObjectName": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", - "VersionedData": { - "platform": "Windows", - "components": [ - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent3GitComponent4F86AE54", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", - "Arn" - ] - } - }, - { - "componentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", - "Arn" - ] - } - } - ], - "parentAmi": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/windows-server-2022-english-full-base-x86/x.x.x" - ] - ] - }, - "tags": { - "GitHubRunners:Stack": "github-runners-test", - "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" - } - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "WindowsEC2BuilderAmiRecipe41A137FF": { - "Type": "AWS::ImageBuilder::ImageRecipe", - "Properties": { - "Components": [ - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent3GitComponent4F86AE54", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", - "Arn" - ] - } - }, - { - "ComponentArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", - "Arn" - ] - } - } - ], - "Name": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", - "ParentImage": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":aws:image/windows-server-2022-english-full-base-x86/x.x.x" - ] - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", - "GitHubRunners:Stack": "github-runners-test" - }, - "Version": { - "Ref": "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C" - }, - "WorkingDirectory": "C:/" - } - }, - "WindowsEC2BuilderAmiLog126E54B2": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "WindowsEC2BuilderRole1BA7D3E7" - } - ] - } - }, - "WindowsEC2BuilderInfrastructure4289B6D2": { - "Type": "AWS::ImageBuilder::InfrastructureConfiguration", - "Properties": { - "InstanceMetadataOptions": { - "HttpPutResponseHopLimit": 2, - "HttpTokens": "required" - }, - "InstanceProfileName": { - "Ref": "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA" - }, - "InstanceTypes": [ - "m6i.large" - ], - "Name": "github-runners-test-windowsec2builder-infrastructure-8e08e175", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "WindowsEC2BuilderSGE3F67842", - "GroupId" - ] - } - ], - "SnsTopicArn": { - "Ref": "runnersImageBuilderBuildsDF5A50E4" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "WindowsEC2BuilderAMIImage9D812188": { - "Type": "AWS::ImageBuilder::Image", - "Properties": { - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderAMIDistribution6B33DD89", - "Arn" - ] - }, - "ImageRecipeArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderAmiRecipe41A137FF", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderInfrastructure4289B6D2", - "Arn" - ] - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "WindowsEC2BuilderAmiLog126E54B2", - "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", - "WindowsEC2BuilderInfrastructure4289B6D2" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "RetainExceptOnCreate" - }, - "WindowsEC2BuilderAMIPipelineE3836949": { - "Type": "AWS::ImageBuilder::ImagePipeline", - "Properties": { - "DistributionConfigurationArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderAMIDistribution6B33DD89", - "Arn" - ] - }, - "ImageRecipeArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderAmiRecipe41A137FF", - "Arn" - ] - }, - "ImageTestsConfiguration": { - "ImageTestsEnabled": false - }, - "InfrastructureConfigurationArn": { - "Fn::GetAtt": [ - "WindowsEC2BuilderInfrastructure4289B6D2", - "Arn" - ] - }, - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", - "Schedule": { - "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", - "ScheduleExpression": "rate(7 days)" - }, - "Tags": { - "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", - "GitHubRunners:Stack": "github-runners-test" - } - }, - "DependsOn": [ - "WindowsEC2BuilderAmiLog126E54B2", - "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", - "WindowsEC2BuilderInfrastructure4289B6D2" - ] - }, - "WindowsEC2BuilderImageCleanerEF537850": { - "Type": "Custom::ImageBuilder-Delete-Resources", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", - "Arn" - ] - }, - "ImageVersionArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":imagebuilder:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":image/github-runners-test-windowsec2builder-amirecipe-beda5750/", - { - "Ref": "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C" - } - ] - ] - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "imagebuilder.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "tag:GetResources", - "imagebuilder:DeleteImage" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ib" - }, - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ec2:DescribeImages", - "ec2:DescribeImageAttribute" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ec2:DeregisterImage", - "ec2:DeleteSnapshot" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", - "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" - } - }, - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ami" - } - ] - } - }, - "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7": { - "Type": "AWS::ImageBuilder::LifecyclePolicy", - "Properties": { - "Description": "Delete old GitHub Runner AMIs for github-runners-test/Windows EC2 Builder", - "ExecutionRole": { - "Fn::GetAtt": [ - "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", - "Arn" - ] - }, - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", - "PolicyDetails": [ - { - "Action": { - "IncludeResources": { - "Amis": true, - "Snapshots": true - }, - "Type": "DELETE" - }, - "Filter": { - "Type": "COUNT", - "Value": 2 - } - } - ], - "ResourceSelection": { - "Recipes": [ - { - "Name": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", - "SemanticVersion": { - "Ref": "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C" - } - } - ] - }, - "ResourceType": "AMI_IMAGE" - } - }, - "CodeBuildx64LogsA21ECD59": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildx64" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildx64LogsLogsfilter915A4B6F": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "CodeBuildx64LogsA21ECD59" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "CodeBuildx64CodeBuildRole32E5C764": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildx64" - } - ] - } - }, - "CodeBuildx64CodeBuildRoleDefaultPolicy221DA642": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildx64LogsA21ECD59", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildx64CodeBuild7DC01A1E" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildx64CodeBuild7DC01A1E" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildx64CodeBuild7DC01A1E" - }, - "-*" - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildx64CodeBuildRoleDefaultPolicy221DA642", - "Roles": [ - { - "Ref": "CodeBuildx64CodeBuildRole32E5C764" - } - ] - } - }, - "CodeBuildx64CodeBuild7DC01A1E": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "GitHub Actions self-hosted runner for labels codebuild-x64", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - }, - ":latest" - ] - ] - }, - "ImagePullCredentialsType": "SERVICE_ROLE", - "PrivilegedMode": true, - "Type": "LINUX_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildx64LogsA21ECD59" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildx64CodeBuildRole32E5C764", - "Arn" - ] - }, - "Source": { - "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", - "Type": "NO_SOURCE" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildx64" - } - ], - "TimeoutInMinutes": 60 - } - }, - "RunnerImageBuildHelpersLog13186633": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "imagebuilder:DeleteImage", - "Effect": "Deny", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "Roles": [ - { - "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - } - ] - } - }, - "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip" - }, - "Description": "Custom resource handler that triggers CodeBuild to build runner images", - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 180 - }, - "DependsOn": [ - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", - "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" - ] - }, - "CodeBuildUbuntu2404x64Logs27D26829": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildUbuntu2404x64" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildUbuntu2404x64LogsLogsfilter5AD0BDC2": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "CodeBuildUbuntu2404x64Logs27D26829" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildUbuntu2404x64" - } - ] - } - }, - "CodeBuildUbuntu2404x64CodeBuildRoleDefaultPolicy378D5938": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404x64Logs27D26829", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" - }, - "-*" - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildUbuntu2404x64CodeBuildRoleDefaultPolicy378D5938", - "Roles": [ - { - "Ref": "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92" - } - ] - } - }, - "CodeBuildUbuntu2404x64CodeBuild261399A8": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "GitHub Actions self-hosted runner for labels codebuild-ubuntu-2404-x64", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - }, - ":latest" - ] - ] - }, - "ImagePullCredentialsType": "SERVICE_ROLE", - "PrivilegedMode": true, - "Type": "LINUX_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildUbuntu2404x64Logs27D26829" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92", - "Arn" - ] - }, - "Source": { - "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", - "Type": "NO_SOURCE" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildUbuntu2404x64" - } - ], - "TimeoutInMinutes": 60 - } - }, - "CodeBuildARMLogs7C7FC5A7": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildARM" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildARMLogsLogsfilter32B5122B": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "CodeBuildARMLogs7C7FC5A7" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "CodeBuildARMCodeBuildRole74DB4985": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildARM" - } - ] - } - }, - "CodeBuildARMCodeBuildRoleDefaultPolicyFC84CEAE": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildARMLogs7C7FC5A7", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildARMCodeBuildC5F301F2" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildARMCodeBuildC5F301F2" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildARMCodeBuildC5F301F2" - }, - "-*" - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildARMCodeBuildRoleDefaultPolicyFC84CEAE", - "Roles": [ - { - "Ref": "CodeBuildARMCodeBuildRole74DB4985" - } - ] - } - }, - "CodeBuildARMCodeBuildC5F301F2": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "GitHub Actions self-hosted runner for labels codebuild,linux,arm64", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_SMALL", - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - }, - ":latest" - ] - ] - }, - "ImagePullCredentialsType": "SERVICE_ROLE", - "PrivilegedMode": true, - "Type": "ARM_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildARMLogs7C7FC5A7" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildARMCodeBuildRole74DB4985", - "Arn" - ] - }, - "Source": { - "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", - "Type": "NO_SOURCE" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildARM" - } - ], - "TimeoutInMinutes": 60 - } - }, - "CodeBuildWindowsLogsF4DD93A5": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildWindows" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "CodeBuildWindowsLogsLogsfilterC0A33A89": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "CodeBuildWindowsLogsF4DD93A5" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "CodeBuildWindowsCodeBuildRoleDC93697E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "codebuild.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildWindows" - } - ] - } - }, - "CodeBuildWindowsCodeBuildRoleDefaultPolicyA932AC4D": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildWindowsLogsF4DD93A5", - "Arn" - ] - } - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildWindowsCodeBuildC39F35C1" - } - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":logs:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":log-group:/aws/codebuild/", - { - "Ref": "CodeBuildWindowsCodeBuildC39F35C1" - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:CreateReportGroup", - "codebuild:CreateReport", - "codebuild:UpdateReport", - "codebuild:BatchPutTestCases", - "codebuild:BatchPutCodeCoverages" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":codebuild:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":report-group/", - { - "Ref": "CodeBuildWindowsCodeBuildC39F35C1" - }, - "-*" - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "CodeBuildWindowsCodeBuildRoleDefaultPolicyA932AC4D", - "Roles": [ - { - "Ref": "CodeBuildWindowsCodeBuildRoleDC93697E" - } - ] - } - }, - "CodeBuildWindowsCodeBuildC39F35C1": { - "Type": "AWS::CodeBuild::Project", - "Properties": { - "Artifacts": { - "Type": "NO_ARTIFACTS" - }, - "Cache": { - "Type": "NO_CACHE" - }, - "Description": "GitHub Actions self-hosted runner for labels codebuild,windows,x64", - "EncryptionKey": "alias/aws/s3", - "Environment": { - "ComputeType": "BUILD_GENERAL1_MEDIUM", - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - }, - ":latest" - ] - ] - }, - "ImagePullCredentialsType": "SERVICE_ROLE", - "PrivilegedMode": false, - "Type": "WINDOWS_SERVER_2019_CONTAINER" - }, - "LogsConfig": { - "CloudWatchLogs": { - "GroupName": { - "Ref": "CodeBuildWindowsLogsF4DD93A5" - }, - "Status": "ENABLED" - } - }, - "ServiceRole": { - "Fn::GetAtt": [ - "CodeBuildWindowsCodeBuildRoleDC93697E", - "Arn" - ] - }, - "Source": { - "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"cd \\\\actions\",\n \"if (${Env:RUNNER_VERSION} -eq \\\"latest\\\") { $RunnerFlags = \\\"\\\" } else { $RunnerFlags = \\\"--disableupdate\\\" }\",\n \"./config.cmd --unattended --url \\\"${Env:REGISTRATION_URL}\\\" --token \\\"${Env:RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat %s)\\\" ${RunnerFlags} --name \\\"${Env:RUNNER_NAME}\\\" ${Env:RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cd \\\\actions\",\n \"./run.cmd\",\n \"$STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1\",\n \"if ($STATUS) { echo \\\"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\\\" }\"\n ]\n }\n }\n}", - "Type": "NO_SOURCE" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/CodeBuildWindows" - } - ], - "TimeoutInMinutes": 60 - } - }, - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "imagebuilder:ListImageBuildVersions", - "imagebuilder:DeleteImage" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "ec2:DescribeImages", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ec2:DeregisterImage", - "ec2:DeleteSnapshot" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test" - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "ecr:BatchDeleteImage", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E", - "Roles": [ - { - "Ref": "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C" - } - ] - } - }, - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip" - }, - "Description": "Custom resource handler that deletes resources of old versions of EC2 Image Builder images", - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 600 - }, - "DependsOn": [ - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E", - "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C" - ] - }, - "ECSsecuritygroup76605212": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/ECS/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "ECScluster20BC0B82": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ] - } - }, - "ECScluster9E223943": { - "Type": "AWS::ECS::ClusterCapacityProviderAssociations", - "Properties": { - "CapacityProviders": [ - { - "Ref": "ECSCapacityProviderABF1B146" - } - ], - "Cluster": { - "Ref": "ECScluster20BC0B82" - }, - "DefaultCapacityProviderStrategy": [] - } - }, - "ECSAMIRootDevice35683156": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ECSLaunchTemplateRole3D54417B": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ] - } - }, - "ECSLaunchTemplateRoleDefaultPolicyA6578409": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DeregisterContainerInstance", - "ecs:RegisterContainerInstance", - "ecs:Submit*" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECScluster20BC0B82", - "Arn" - ] - } - }, - { - "Action": [ - "ecs:Poll", - "ecs:StartTelemetrySession" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ECScluster20BC0B82", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DiscoverPollEndpoint", - "ecr:GetAuthorizationToken", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSLaunchTemplateRoleDefaultPolicyA6578409", - "Roles": [ - { - "Ref": "ECSLaunchTemplateRole3D54417B" - } - ] - } - }, - "ECSLaunchTemplateProfileC7A3F149": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "ECSLaunchTemplateRole3D54417B" - } - ] - } - }, - "ECSLaunchTemplate3A132D2F": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "BlockDeviceMappings": [ - { - "DeviceName": { - "Ref": "ECSAMIRootDevice35683156" - }, - "Ebs": { - "DeleteOnTermination": true, - "Iops": 1500, - "Throughput": 150, - "VolumeSize": 40, - "VolumeType": "gp3" - } - } - ], - "IamInstanceProfile": { - "Arn": { - "Fn::GetAtt": [ - "ECSLaunchTemplateProfileC7A3F149", - "Arn" - ] - } - }, - "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id", - "InstanceMarketOptions": { - "MarketType": "spot", - "SpotOptions": { - "SpotInstanceType": "one-time" - } - }, - "InstanceType": "m6i.large", - "MetadataOptions": { - "HttpTokens": "required" - }, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ECSsecuritygroup76605212", - "GroupId" - ] - } - ], - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS/Launch Template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS/Launch Template" - } - ] - } - ], - "UserData": { - "Fn::Base64": { - "Fn::Join": [ - "", - [ - "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", - { - "Ref": "AWS::Region" - }, - " | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\ndocker pull ", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - }, - ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", - { - "Ref": "ECScluster20BC0B82" - }, - " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" - ] - ] - } - } - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS/Launch Template" - } - ] - } - ] - }, - "DependsOn": [ - "ECSLaunchTemplateRoleDefaultPolicyA6578409", - "ECSLaunchTemplateRole3D54417B" - ] - }, - "ECSAutoScalingGroupASG88763D9A": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "LaunchTemplate": { - "LaunchTemplateId": { - "Ref": "ECSLaunchTemplate3A132D2F" - }, - "Version": { - "Fn::GetAtt": [ - "ECSLaunchTemplate3A132D2F", - "LatestVersionNumber" - ] - } - }, - "MaxSize": "1", - "MinSize": "0", - "NewInstancesProtectedFromScaleIn": true, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "PropagateAtLaunch": true, - "Value": "github-runners-test/ECS" - } - ], - "VPCZoneIdentifier": [ - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - ] - }, - "UpdatePolicy": { - "AutoScalingScheduledAction": { - "IgnoreUnmodifiedGroupSizeProperties": true - } - } - }, - "ECSCapacityProviderABF1B146": { - "Type": "AWS::ECS::CapacityProvider", - "Properties": { - "AutoScalingGroupProvider": { - "AutoScalingGroupArn": { - "Ref": "ECSAutoScalingGroupASG88763D9A" - }, - "ManagedScaling": { - "Status": "ENABLED", - "TargetCapacity": 100 - }, - "ManagedTerminationProtection": "ENABLED" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ] - } - }, - "ECSlogs71446134": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ECSlogslogsfilterC744F425": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "ECSlogs71446134" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "ECStaskTaskRoleFE831ECD": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ] - } - }, - "ECStaskTaskRoleDefaultPolicy46A3CB3A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECStaskTaskRoleDefaultPolicy46A3CB3A", - "Roles": [ - { - "Ref": "ECStaskTaskRoleFE831ECD" - } - ] - } - }, - "ECStask8F0DD550": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Cpu": 1024, - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "ECSlogs71446134" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 3500, - "Name": "runner", - "Privileged": true, - "User": "runner" - } - ], - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "ECStaskExecutionRole1A6D19A5", - "Arn" - ] - }, - "Family": "githubrunnerstestECStaskCE74CC84", - "NetworkMode": "bridge", - "RequiresCompatibilities": [ - "EC2" - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "ECStaskTaskRoleFE831ECD", - "Arn" - ] - } - } - }, - "ECStaskExecutionRole1A6D19A5": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS" - } - ] - } - }, - "ECStaskExecutionRoleDefaultPolicy564C1271": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSlogs71446134", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECStaskExecutionRoleDefaultPolicy564C1271", - "Roles": [ - { - "Ref": "ECStaskExecutionRole1A6D19A5" - } - ] - } - }, - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssm:GetParameter", - "ec2:DescribeImages", - "ec2:DescribeLaunchTemplateVersions", - "imagebuilder:GetImage" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6", - "Roles": [ - { - "Ref": "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36" - } - ] - } - }, - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip" - }, - "Description": "Custom resource handler that discovers the boot drive device name for a given AMI", - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 60 - }, - "DependsOn": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6", - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36" - ] - }, - "ECSUbuntu2404securitygroupEE405C76": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/ECS Ubuntu 2404/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "ECSUbuntu2404cluster21C05FA1": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ] - } - }, - "ECSUbuntu2404cluster0A1E8926": { - "Type": "AWS::ECS::ClusterCapacityProviderAssociations", - "Properties": { - "CapacityProviders": [ - { - "Ref": "ECSUbuntu2404CapacityProviderFAE73340" - } - ], - "Cluster": { - "Ref": "ECSUbuntu2404cluster21C05FA1" - }, - "DefaultCapacityProviderStrategy": [] - } - }, - "ECSUbuntu2404AMIRootDevice9455BDF7": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ECSUbuntu2404LaunchTemplateRole77926CCA": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ] - } - }, - "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DeregisterContainerInstance", - "ecs:RegisterContainerInstance", - "ecs:Submit*" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSUbuntu2404cluster21C05FA1", - "Arn" - ] - } - }, - { - "Action": [ - "ecs:Poll", - "ecs:StartTelemetrySession" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ECSUbuntu2404cluster21C05FA1", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DiscoverPollEndpoint", - "ecr:GetAuthorizationToken", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94", - "Roles": [ - { - "Ref": "ECSUbuntu2404LaunchTemplateRole77926CCA" - } - ] - } - }, - "ECSUbuntu2404LaunchTemplateProfile7CCE115D": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "ECSUbuntu2404LaunchTemplateRole77926CCA" - } - ] - } - }, - "ECSUbuntu2404LaunchTemplate360B1216": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "BlockDeviceMappings": [ - { - "DeviceName": { - "Ref": "ECSUbuntu2404AMIRootDevice9455BDF7" - }, - "Ebs": { - "DeleteOnTermination": true, - "Iops": 1500, - "Throughput": 150, - "VolumeSize": 40, - "VolumeType": "gp3" - } - } - ], - "IamInstanceProfile": { - "Arn": { - "Fn::GetAtt": [ - "ECSUbuntu2404LaunchTemplateProfile7CCE115D", - "Arn" - ] - } - }, - "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id", - "InstanceMarketOptions": { - "MarketType": "spot", - "SpotOptions": { - "SpotInstanceType": "one-time" - } - }, - "InstanceType": "m6i.large", - "MetadataOptions": { - "HttpTokens": "required" - }, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ECSUbuntu2404securitygroupEE405C76", - "GroupId" - ] - } - ], - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" - } - ] - } - ], - "UserData": { - "Fn::Base64": { - "Fn::Join": [ - "", - [ - "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", - { - "Ref": "AWS::Region" - }, - " | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\ndocker pull ", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - }, - ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", - { - "Ref": "ECSUbuntu2404cluster21C05FA1" - }, - " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" - ] - ] - } - } - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" - } - ] - } - ] - }, - "DependsOn": [ - "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94", - "ECSUbuntu2404LaunchTemplateRole77926CCA" - ] - }, - "ECSUbuntu2404AutoScalingGroupASG40115790": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "LaunchTemplate": { - "LaunchTemplateId": { - "Ref": "ECSUbuntu2404LaunchTemplate360B1216" - }, - "Version": { - "Fn::GetAtt": [ - "ECSUbuntu2404LaunchTemplate360B1216", - "LatestVersionNumber" - ] - } - }, - "MaxSize": "1", - "MinSize": "0", - "NewInstancesProtectedFromScaleIn": true, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "PropagateAtLaunch": true, - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ], - "VPCZoneIdentifier": [ - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - ] - }, - "UpdatePolicy": { - "AutoScalingScheduledAction": { - "IgnoreUnmodifiedGroupSizeProperties": true - } - } - }, - "ECSUbuntu2404CapacityProviderFAE73340": { - "Type": "AWS::ECS::CapacityProvider", - "Properties": { - "AutoScalingGroupProvider": { - "AutoScalingGroupArn": { - "Ref": "ECSUbuntu2404AutoScalingGroupASG40115790" - }, - "ManagedScaling": { - "Status": "ENABLED", - "TargetCapacity": 100 - }, - "ManagedTerminationProtection": "ENABLED" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ] - } - }, - "ECSUbuntu2404logsFB15C25B": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ECSUbuntu2404logslogsfilterEAA30ADB": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "ECSUbuntu2404logsFB15C25B" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "ECSUbuntu2404taskTaskRoleDF683F3B": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ] - } - }, - "ECSUbuntu2404taskTaskRoleDefaultPolicyEA2F978C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSUbuntu2404taskTaskRoleDefaultPolicyEA2F978C", - "Roles": [ - { - "Ref": "ECSUbuntu2404taskTaskRoleDF683F3B" - } - ] - } - }, - "ECSUbuntu2404taskFC90B155": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Cpu": 1024, - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "ECSUbuntu2404logsFB15C25B" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 3500, - "Name": "runner", - "Privileged": true, - "User": "runner" - } - ], - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "ECSUbuntu2404taskExecutionRoleC5FEA726", - "Arn" - ] - }, - "Family": "githubrunnerstestECSUbuntu2404taskB7D564C7", - "NetworkMode": "bridge", - "RequiresCompatibilities": [ - "EC2" - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "ECSUbuntu2404taskTaskRoleDF683F3B", - "Arn" - ] - } - } - }, - "ECSUbuntu2404taskExecutionRoleC5FEA726": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Ubuntu 2404" - } - ] - } - }, - "ECSUbuntu2404taskExecutionRoleDefaultPolicy580200B4": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSUbuntu2404logsFB15C25B", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSUbuntu2404taskExecutionRoleDefaultPolicy580200B4", - "Roles": [ - { - "Ref": "ECSUbuntu2404taskExecutionRoleC5FEA726" - } - ] - } - }, - "ECSARM64securitygroup281D94B2": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/ECS ARM64/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "ECSARM64cluster4ECAA083": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ] - } - }, - "ECSARM64cluster43E75409": { - "Type": "AWS::ECS::ClusterCapacityProviderAssociations", - "Properties": { - "CapacityProviders": [ - { - "Ref": "ECSARM64CapacityProvider8627FEF9" - } - ], - "Cluster": { - "Ref": "ECSARM64cluster4ECAA083" - }, - "DefaultCapacityProviderStrategy": [] - } - }, - "ECSARM64LaunchTemplateRole9D1574E2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ] - } - }, - "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DeregisterContainerInstance", - "ecs:RegisterContainerInstance", - "ecs:Submit*" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSARM64cluster4ECAA083", - "Arn" - ] - } - }, - { - "Action": [ - "ecs:Poll", - "ecs:StartTelemetrySession" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ECSARM64cluster4ECAA083", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DiscoverPollEndpoint", - "ecr:GetAuthorizationToken", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA", - "Roles": [ - { - "Ref": "ECSARM64LaunchTemplateRole9D1574E2" - } - ] - } - }, - "ECSARM64LaunchTemplateProfileBF272018": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "ECSARM64LaunchTemplateRole9D1574E2" - } - ] - } - }, - "ECSARM64LaunchTemplateC44F6059": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "IamInstanceProfile": { - "Arn": { - "Fn::GetAtt": [ - "ECSARM64LaunchTemplateProfileBF272018", - "Arn" - ] - } - }, - "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/arm64/recommended/image_id", - "InstanceType": "m6g.large", - "MetadataOptions": { - "HttpTokens": "required" - }, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ECSARM64securitygroup281D94B2", - "GroupId" - ] - } - ], - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS ARM64/Launch Template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS ARM64/Launch Template" - } - ] - } - ], - "UserData": { - "Fn::Base64": { - "Fn::Join": [ - "", - [ - "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", - { - "Ref": "AWS::Region" - }, - " | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\ndocker pull ", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - }, - ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", - { - "Ref": "ECSARM64cluster4ECAA083" - }, - " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" - ] - ] - } - } - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS ARM64/Launch Template" - } - ] - } - ] - }, - "DependsOn": [ - "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA", - "ECSARM64LaunchTemplateRole9D1574E2" - ] - }, - "ECSARM64AutoScalingGroupASGA19FC118": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "LaunchTemplate": { - "LaunchTemplateId": { - "Ref": "ECSARM64LaunchTemplateC44F6059" - }, - "Version": { - "Fn::GetAtt": [ - "ECSARM64LaunchTemplateC44F6059", - "LatestVersionNumber" - ] - } - }, - "MaxSize": "1", - "MinSize": "0", - "NewInstancesProtectedFromScaleIn": true, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "PropagateAtLaunch": true, - "Value": "github-runners-test/ECS ARM64" - } - ], - "VPCZoneIdentifier": [ - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - ] - }, - "UpdatePolicy": { - "AutoScalingScheduledAction": { - "IgnoreUnmodifiedGroupSizeProperties": true - } - } - }, - "ECSARM64CapacityProvider8627FEF9": { - "Type": "AWS::ECS::CapacityProvider", - "Properties": { - "AutoScalingGroupProvider": { - "AutoScalingGroupArn": { - "Ref": "ECSARM64AutoScalingGroupASGA19FC118" - }, - "ManagedScaling": { - "Status": "ENABLED", - "TargetCapacity": 100 - }, - "ManagedTerminationProtection": "ENABLED" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ] - } - }, - "ECSARM64logs1A2F1E00": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ECSARM64logslogsfilter6914CFA1": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "ECSARM64logs1A2F1E00" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "ECSARM64taskTaskRole23B1CB4E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ] - } - }, - "ECSARM64taskTaskRoleDefaultPolicyD893D7DC": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSARM64taskTaskRoleDefaultPolicyD893D7DC", - "Roles": [ - { - "Ref": "ECSARM64taskTaskRole23B1CB4E" - } - ] - } - }, - "ECSARM64task27EB8443": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Cpu": 1024, - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "ECSARM64logs1A2F1E00" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 3500, - "Name": "runner", - "Privileged": true, - "User": "runner" - } - ], - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "ECSARM64taskExecutionRoleBF2AE76F", - "Arn" - ] - }, - "Family": "githubrunnerstestECSARM64taskE94E43A3", - "NetworkMode": "bridge", - "RequiresCompatibilities": [ - "EC2" - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "ECSARM64taskTaskRole23B1CB4E", - "Arn" - ] - } - } - }, - "ECSARM64taskExecutionRoleBF2AE76F": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS ARM64" - } - ] - } - }, - "ECSARM64taskExecutionRoleDefaultPolicy17294239": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSARM64logs1A2F1E00", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSARM64taskExecutionRoleDefaultPolicy17294239", - "Roles": [ - { - "Ref": "ECSARM64taskExecutionRoleBF2AE76F" - } - ] - } - }, - "ECSWindowssecuritygroupB4EE54DA": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/ECS Windows/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "ECSWindowscluster14061F74": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ] - } - }, - "ECSWindowscluster49B54894": { - "Type": "AWS::ECS::ClusterCapacityProviderAssociations", - "Properties": { - "CapacityProviders": [ - { - "Ref": "ECSWindowsCapacityProvider8F8896A5" - } - ], - "Cluster": { - "Ref": "ECSWindowscluster14061F74" - }, - "DefaultCapacityProviderStrategy": [] - } - }, - "ECSWindowsLaunchTemplateRole610E9A88": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ] - } - }, - "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DeregisterContainerInstance", - "ecs:RegisterContainerInstance", - "ecs:Submit*" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSWindowscluster14061F74", - "Arn" - ] - } - }, - { - "Action": [ - "ecs:Poll", - "ecs:StartTelemetrySession" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ECSWindowscluster14061F74", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:DiscoverPollEndpoint", - "ecr:GetAuthorizationToken", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459", - "Roles": [ - { - "Ref": "ECSWindowsLaunchTemplateRole610E9A88" - } - ] - } - }, - "ECSWindowsLaunchTemplateProfile4B6AA05B": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "ECSWindowsLaunchTemplateRole610E9A88" - } - ] - } - }, - "ECSWindowsLaunchTemplateA6BF5C73": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "IamInstanceProfile": { - "Arn": { - "Fn::GetAtt": [ - "ECSWindowsLaunchTemplateProfile4B6AA05B", - "Arn" - ] - } - }, - "ImageId": "resolve:ssm:/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized/image_id", - "InstanceType": "m6i.large", - "MetadataOptions": { - "HttpTokens": "required" - }, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ECSWindowssecuritygroupB4EE54DA", - "GroupId" - ] - } - ], - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS Windows/Launch Template" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS Windows/Launch Template" - } - ] - } - ], - "UserData": { - "Fn::Base64": { - "Fn::Join": [ - "", - [ - "(Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin ", - { - "Ref": "AWS::AccountId" - }, - ".dkr.ecr.", - { - "Ref": "AWS::Region" - }, - ".amazonaws.com\nStart-Job -ScriptBlock { docker pull ", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - }, - ":latest }\n[Environment]::SetEnvironmentVariable(\"ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION\", \"5s\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER\", \"5s\", \"Machine\")\nRemove-Item -Recurse C:\\ProgramData\\Amazon\\ECS\\Cache\nImport-Module ECSTools\n[Environment]::SetEnvironmentVariable(\"ECS_CLUSTER\", \"", - { - "Ref": "ECSWindowscluster14061F74" - }, - "\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE\", \"true\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_AVAILABLE_LOGGING_DRIVERS\", '[\"json-file\",\"awslogs\"]', \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_TASK_IAM_ROLE\", \"true\", \"Machine\")\nInitialize-ECSAgent -Cluster '", - { - "Ref": "ECSWindowscluster14061F74" - }, - "' -EnableTaskIAMRole" - ] - ] - } - } - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - }, - { - "Key": "Name", - "Value": "github-runners-test/ECS Windows/Launch Template" - } - ] - } - ] - }, - "DependsOn": [ - "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459", - "ECSWindowsLaunchTemplateRole610E9A88" - ] - }, - "ECSWindowsAutoScalingGroupASG864E3AAF": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "LaunchTemplate": { - "LaunchTemplateId": { - "Ref": "ECSWindowsLaunchTemplateA6BF5C73" - }, - "Version": { - "Fn::GetAtt": [ - "ECSWindowsLaunchTemplateA6BF5C73", - "LatestVersionNumber" - ] - } - }, - "MaxSize": "1", - "MinSize": "0", - "NewInstancesProtectedFromScaleIn": true, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "PropagateAtLaunch": true, - "Value": "github-runners-test/ECS Windows" - } - ], - "VPCZoneIdentifier": [ - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - ] - }, - "UpdatePolicy": { - "AutoScalingScheduledAction": { - "IgnoreUnmodifiedGroupSizeProperties": true - } - } - }, - "ECSWindowsCapacityProvider8F8896A5": { - "Type": "AWS::ECS::CapacityProvider", - "Properties": { - "AutoScalingGroupProvider": { - "AutoScalingGroupArn": { - "Ref": "ECSWindowsAutoScalingGroupASG864E3AAF" - }, - "ManagedScaling": { - "Status": "ENABLED", - "TargetCapacity": 100 - }, - "ManagedTerminationProtection": "ENABLED" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ] - } - }, - "ECSWindowslogs83D9D352": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ECSWindowslogslogsfilterA25F0C55": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "ECSWindowslogs83D9D352" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "ECSWindowstaskTaskRole17C8DA48": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ] - } - }, - "ECSWindowstaskTaskRoleDefaultPolicy529AC984": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSWindowstaskTaskRoleDefaultPolicy529AC984", - "Roles": [ - { - "Ref": "ECSWindowstaskTaskRole17C8DA48" - } - ] - } - }, - "ECSWindowstask73A31B6C": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "powershell", - "-Command", - "cd \\actions ;\n if ($Env:RUNNER_VERSION -eq \"latest\") { $RunnerFlags = \"\" } else { $RunnerFlags = \"--disableupdate\" } ;\n ./config.cmd --unattended --url \"${Env:REGISTRATION_URL}\" --token \"${Env:RUNNER_TOKEN}\" --ephemeral --work _work --labels \"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat +%s)\" $RunnerFlags --name \"${Env:RUNNER_NAME}\" ${Env:RUNNER_GROUP} ;\n ./run.cmd ;\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1 ;\n if ($STATUS) { echo \"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\" }" - ], - "Cpu": 1024, - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "ECSWindowslogs83D9D352" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Memory": 3500, - "Name": "runner", - "Privileged": false - } - ], - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "ECSWindowstaskExecutionRoleF164B5BF", - "Arn" - ] - }, - "Family": "githubrunnerstestECSWindowstask6B1D5861", - "NetworkMode": "bridge", - "RequiresCompatibilities": [ - "EC2" - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "ECSWindowstaskTaskRole17C8DA48", - "Arn" - ] - } - } - }, - "ECSWindowstaskExecutionRoleF164B5BF": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/ECS Windows" - } - ] - } - }, - "ECSWindowstaskExecutionRoleDefaultPolicyA46C9687": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ECSWindowslogs83D9D352", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ECSWindowstaskExecutionRoleDefaultPolicyA46C9687", - "Roles": [ - { - "Ref": "ECSWindowstaskExecutionRoleF164B5BF" - } - ] - } - }, - "LambdaImageDigestReaderE0842577": { - "Type": "Custom::EcrImageDigest", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd22872D164C4C", - "Arn" - ] - }, - "Create": { - "Fn::Join": [ - "", - [ - "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - }, - "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" - ] - ] - }, - "Update": { - "Fn::Join": [ - "", - [ - "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - }, - "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" - ] - ] - }, - "Delete": { - "Fn::Join": [ - "", - [ - "{\"service\":\"fake\",\"action\":\"fake\",\"parameters\":{\"version\":1,\"labels\":[\"lambda\",\"x64\"],\"architecture\":\"x86_64\",\"dependable\":\"", - { - "Ref": "LambdaImageBuilderx64BuildWait0ef960775aDC1D350E" - }, - "\"}}" - ] - ] - }, - "InstallLatestAwsSdk": false - }, - "DependsOn": [ - "LambdaImageDigestReaderCustomResourcePolicyE8E146E6" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "LambdaImageDigestReaderCustomResourcePolicyE8E146E6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - }, - { - "Action": "fake:Fake", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaImageDigestReaderCustomResourcePolicyE8E146E6", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - } - }, - "LambdaLog2764B04F": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Lambda" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaLogLogfilter1003281A": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "LambdaLog2764B04F" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "LambdaFunctionServiceRoleB1826A50": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Lambda" - } - ] - } - }, - "LambdaFunction9233991D": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Architectures": [ - "x86_64" - ], - "Code": { - "ImageUri": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - }, - "@sha256:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageDigestReaderE0842577", - "imageDetails.0.imageDigest" - ] - } - ] - } - ] - } - ] - ] - } - }, - "Description": "GitHub Actions runner for labels lambda,x64", - "EphemeralStorage": { - "Size": 10240 - }, - "LoggingConfig": { - "LogGroup": { - "Ref": "LambdaLog2764B04F" - } - }, - "MemorySize": 2048, - "PackageType": "Image", - "Role": { - "Fn::GetAtt": [ - "LambdaFunctionServiceRoleB1826A50", - "Arn" - ] - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Lambda" - } - ], - "Timeout": 900 - }, - "DependsOn": [ - "LambdaFunctionServiceRoleB1826A50" - ] - }, - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip" - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 120 - }, - "DependsOn": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - ] - }, - "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:UpdateFunctionCode", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaFunction9233991D", - "Arn" - ] - } - }, - { - "Action": "lambda:UpdateFunctionCode", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaARMFunctionDD4B5FF7", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6", - "Roles": [ - { - "Ref": "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA" - } - ] - } - }, - "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip" - }, - "Description": "Function that updates a GitHub Actions runner function with the latest image digest after the image has been rebuilt", - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 900 - }, - "DependsOn": [ - "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6", - "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA" - ] - }, - "LambdaARMImageDigestReaderF3DD55C4": { - "Type": "Custom::EcrImageDigest", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd22872D164C4C", - "Arn" - ] - }, - "Create": { - "Fn::Join": [ - "", - [ - "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - }, - "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" - ] - ] - }, - "Update": { - "Fn::Join": [ - "", - [ - "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - }, - "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" - ] - ] - }, - "Delete": { - "Fn::Join": [ - "", - [ - "{\"service\":\"fake\",\"action\":\"fake\",\"parameters\":{\"version\":1,\"labels\":[\"lambda\",\"arm64\"],\"architecture\":\"arm64\",\"dependable\":\"", - { - "Ref": "LambdaImageBuilderzBuildWait781886e2d89352301D" - }, - "\"}}" - ] - ] - }, - "InstallLatestAwsSdk": false - }, - "DependsOn": [ - "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - }, - { - "Action": "fake:Fake", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - } - }, - "LambdaARMLogAA2DA09F": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/LambdaARM" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaARMLogLogfilterE0BE5E30": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "LambdaARMLogAA2DA09F" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "LambdaARMFunctionServiceRole136069A0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/LambdaARM" - } - ] - } - }, - "LambdaARMFunctionDD4B5FF7": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Architectures": [ - "arm64" - ], - "Code": { - "ImageUri": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - }, - "@sha256:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaARMImageDigestReaderF3DD55C4", - "imageDetails.0.imageDigest" - ] - } - ] - } - ] - } - ] - ] - } - }, - "Description": "GitHub Actions runner for labels lambda,arm64", - "EphemeralStorage": { - "Size": 10240 - }, - "LoggingConfig": { - "LogGroup": { - "Ref": "LambdaARMLogAA2DA09F" - } - }, - "MemorySize": 2048, - "PackageType": "Image", - "Role": { - "Fn::GetAtt": [ - "LambdaARMFunctionServiceRole136069A0", - "Arn" - ] - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/LambdaARM" - } - ], - "Timeout": 900 - }, - "DependsOn": [ - "LambdaARMFunctionServiceRole136069A0" - ] - }, - "FargatesecuritygroupAFCAFD34": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Fargate/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "FargatelogsCB753638": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "Fargatelogslogsfilter89D6A772": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "FargatelogsCB753638" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "FargatetaskTaskRoleEFFCDAF8": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate" - } - ] - } - }, - "FargatetaskTaskRoleDefaultPolicy4E176780": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatetaskTaskRoleDefaultPolicy4E176780", - "Roles": [ - { - "Ref": "FargatetaskTaskRoleEFFCDAF8" - } - ] - } - }, - "FargatetaskFDFF3302": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderRepository8F7BA13C" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "FargatelogsCB753638" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Name": "runner", - "User": "runner" - } - ], - "Cpu": "256", - "EphemeralStorage": { - "SizeInGiB": 25 - }, - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "FargatetaskExecutionRole88A42307", - "Arn" - ] - }, - "Family": "githubrunnerstestFargatetaskA755E0CE", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "FARGATE" - ], - "RuntimePlatform": { - "CpuArchitecture": "X86_64", - "OperatingSystemFamily": "LINUX" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "FargatetaskTaskRoleEFFCDAF8", - "Arn" - ] - } - } - }, - "FargatetaskExecutionRole88A42307": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate" - } - ] - } - }, - "FargatetaskExecutionRoleDefaultPolicy72A5073A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatelogsCB753638", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargatetaskExecutionRoleDefaultPolicy72A5073A", - "Roles": [ - { - "Ref": "FargatetaskExecutionRole88A42307" - } - ] - } - }, - "Fargatex64spotsecuritygroup2A9F4299": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Fargate-x64-spot/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-x64-spot" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "Fargatex64spotlogs0BCF618B": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-x64-spot" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "Fargatex64spotlogslogsfilter6590358B": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "Fargatex64spotlogs0BCF618B" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "Fargatex64spottaskTaskRole02893C25": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-x64-spot" - } - ] - } - }, - "Fargatex64spottaskTaskRoleDefaultPolicyDBB9916E": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "Fargatex64spottaskTaskRoleDefaultPolicyDBB9916E", - "Roles": [ - { - "Ref": "Fargatex64spottaskTaskRole02893C25" - } - ] - } - }, - "Fargatex64spottask4C8B023D": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderRepository8F7BA13C" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Fargatex64spotlogs0BCF618B" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Name": "runner", - "User": "runner" - } - ], - "Cpu": "256", - "EphemeralStorage": { - "SizeInGiB": 25 - }, - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "Fargatex64spottaskExecutionRoleD0E0B7D6", - "Arn" - ] - }, - "Family": "githubrunnerstestFargatex64spottask7B2E300E", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "FARGATE" - ], - "RuntimePlatform": { - "CpuArchitecture": "X86_64", - "OperatingSystemFamily": "LINUX" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-x64-spot" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "Fargatex64spottaskTaskRole02893C25", - "Arn" - ] - } - } - }, - "Fargatex64spottaskExecutionRoleD0E0B7D6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-x64-spot" - } - ] - } - }, - "Fargatex64spottaskExecutionRoleDefaultPolicyA51A696A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Fargatex64spotlogs0BCF618B", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "Fargatex64spottaskExecutionRoleDefaultPolicyA51A696A", - "Roles": [ - { - "Ref": "Fargatex64spottaskExecutionRoleD0E0B7D6" - } - ] - } - }, - "Fargatearm64securitygroup08ABAD9E": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Fargate-arm64/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "Fargatearm64logs00171A52": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "Fargatearm64logslogsfilter4A2869DC": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "Fargatearm64logs00171A52" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "Fargatearm64taskTaskRoleD3C2CD58": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64" - } - ] - } - }, - "Fargatearm64taskTaskRoleDefaultPolicy0D37729A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "Fargatearm64taskTaskRoleDefaultPolicy0D37729A", - "Roles": [ - { - "Ref": "Fargatearm64taskTaskRoleD3C2CD58" - } - ] - } - }, - "Fargatearm64taskECD67399": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderarmRepository77DCC132" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Fargatearm64logs00171A52" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Name": "runner", - "User": "runner" - } - ], - "Cpu": "256", - "EphemeralStorage": { - "SizeInGiB": 25 - }, - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "Fargatearm64taskExecutionRoleD10B61DC", - "Arn" - ] - }, - "Family": "githubrunnerstestFargatearm64task6B95C05B", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "FARGATE" - ], - "RuntimePlatform": { - "CpuArchitecture": "ARM64", - "OperatingSystemFamily": "LINUX" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "Fargatearm64taskTaskRoleD3C2CD58", - "Arn" - ] - } - } - }, - "Fargatearm64taskExecutionRoleD10B61DC": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64" - } - ] - } - }, - "Fargatearm64taskExecutionRoleDefaultPolicy0E3D42DB": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Fargatearm64logs00171A52", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "Fargatearm64taskExecutionRoleDefaultPolicy0E3D42DB", - "Roles": [ - { - "Ref": "Fargatearm64taskExecutionRoleD10B61DC" - } - ] - } - }, - "Fargatearm64spotsecuritygroup20C885E4": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Fargate-arm64-spot/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64-spot" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "Fargatearm64spotlogsEFCCEC59": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64-spot" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "Fargatearm64spotlogslogsfilter7E2CFF7B": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "Fargatearm64spotlogsEFCCEC59" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "Fargatearm64spottaskTaskRole0F078C81": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64-spot" - } - ] - } - }, - "Fargatearm64spottaskTaskRoleDefaultPolicyB8772E50": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "Fargatearm64spottaskTaskRoleDefaultPolicyB8772E50", - "Roles": [ - { - "Ref": "Fargatearm64spottaskTaskRole0F078C81" - } - ] - } - }, - "Fargatearm64spottaskD21E60F2": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "sh", - "-c", - "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" - ], - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderarmRepository77DCC132" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "Fargatearm64spotlogsEFCCEC59" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Name": "runner", - "User": "runner" - } - ], - "Cpu": "256", - "EphemeralStorage": { - "SizeInGiB": 25 - }, - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "Fargatearm64spottaskExecutionRole90E5A05B", - "Arn" - ] - }, - "Family": "githubrunnerstestFargatearm64spottaskF9ADF192", - "Memory": "512", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "FARGATE" - ], - "RuntimePlatform": { - "CpuArchitecture": "ARM64", - "OperatingSystemFamily": "LINUX" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64-spot" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "Fargatearm64spottaskTaskRole0F078C81", - "Arn" - ] - } - } - }, - "Fargatearm64spottaskExecutionRole90E5A05B": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-arm64-spot" - } - ] - } - }, - "Fargatearm64spottaskExecutionRoleDefaultPolicyB9BB282A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "Fargatearm64spotlogsEFCCEC59", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "Fargatearm64spottaskExecutionRoleDefaultPolicyB9BB282A", - "Roles": [ - { - "Ref": "Fargatearm64spottaskExecutionRole90E5A05B" - } - ] - } - }, - "FargateWindowssecuritygroupE684A7B0": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/Fargate-Windows/security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-Windows" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "FargateWindowslogs52881DBF": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-Windows" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "FargateWindowslogslogsfilterB5B72E7C": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "FargateWindowslogs52881DBF" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "FargateWindowstaskTaskRole364508C8": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-Windows" - } - ] - } - }, - "FargateWindowstaskTaskRoleDefaultPolicy17F0249C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargateWindowstaskTaskRoleDefaultPolicy17F0249C", - "Roles": [ - { - "Ref": "FargateWindowstaskTaskRole364508C8" - } - ] - } - }, - "FargateWindowstask9F9B942D": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "ContainerDefinitions": [ - { - "Command": [ - "powershell", - "-Command", - "cd \\actions ;\n if ($Env:RUNNER_VERSION -eq \"latest\") { $RunnerFlags = \"\" } else { $RunnerFlags = \"--disableupdate\" } ;\n ./config.cmd --unattended --url \"${Env:REGISTRATION_URL}\" --token \"${Env:RUNNER_TOKEN}\" --ephemeral --work _work --labels \"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat +%s)\" $RunnerFlags --name \"${Env:RUNNER_NAME}\" ${Env:RUNNER_GROUP} ;\n ./run.cmd ;\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1 ;\n if ($STATUS) { echo \"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\" }" - ], - "Essential": true, - "Image": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - }, - ":latest" - ] - ] - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "FargateWindowslogs52881DBF" - }, - "awslogs-stream-prefix": "runner", - "awslogs-region": { - "Ref": "AWS::Region" - } - } - }, - "Name": "runner" - } - ], - "Cpu": "1024", - "ExecutionRoleArn": { - "Fn::GetAtt": [ - "FargateWindowstaskExecutionRoleEE562927", - "Arn" - ] - }, - "Family": "githubrunnerstestFargateWindowstask95BB2245", - "Memory": "2048", - "NetworkMode": "awsvpc", - "RequiresCompatibilities": [ - "FARGATE" - ], - "RuntimePlatform": { - "CpuArchitecture": "X86_64", - "OperatingSystemFamily": "WINDOWS_SERVER_2019_CORE" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-Windows" - } - ], - "TaskRoleArn": { - "Fn::GetAtt": [ - "FargateWindowstaskTaskRole364508C8", - "Arn" - ] - } - } - }, - "FargateWindowstaskExecutionRoleEE562927": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ecs-tasks.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/Fargate-Windows" - } - ] - } - }, - "FargateWindowstaskExecutionRoleDefaultPolicy2EF7D3FD": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecr:BatchCheckLayerAvailability", - "ecr:GetDownloadUrlForLayer", - "ecr:BatchGetImage" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - }, - { - "Action": "ecr:GetAuthorizationToken", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargateWindowslogs52881DBF", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "FargateWindowstaskExecutionRoleDefaultPolicy2EF7D3FD", - "Roles": [ - { - "Ref": "FargateWindowstaskExecutionRoleEE562927" - } - ] - } - }, - "EC2LinuxSGF5B89300": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/EC2 Linux/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Linux" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "EC2LinuxRole8B6519A2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Linux" - } - ] - } - }, - "EC2LinuxRoleDefaultPolicy1369791B": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "states:SendTaskFailure", - "states:SendTaskSuccess", - "states:SendTaskHeartbeat" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/aws:cloudformation:stack-id": { - "Ref": "AWS::StackId" - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2LinuxLogsC4CD8F14", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EC2LinuxRoleDefaultPolicy1369791B", - "Roles": [ - { - "Ref": "EC2LinuxRole8B6519A2" - } - ] - } - }, - "EC2LinuxLogsC4CD8F14": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Linux" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EC2LinuxLogsLogsfilter186C2AB7": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "EC2LinuxLogsC4CD8F14" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "EC2LinuxInstanceProfile2D2BB473": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "EC2LinuxRole8B6519A2" - } - ] - } - }, - "EC2LinuxAMIRootDevice26D5E56E": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - } - }, - "DependsOn": [ - "AMILinuxBuilderAMIDistribution215F3A5C", - "AMILinuxBuilderAMIImage93D83DE5", - "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderAMIPipelineEC5051DF", - "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", - "AMILinuxBuilderAmiRecipe7C7ED6C7", - "AMILinuxBuilderAmiRecipeVersionFBE9C9AE", - "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", - "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", - "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", - "AMILinuxBuilderComponent3GitComponent9011E3AB", - "AMILinuxBuilderComponent4GithubCliComponent602EE471", - "AMILinuxBuilderComponent5AwsCliComponent72637C19", - "AMILinuxBuilderComponent6DockerComponent9E523A42", - "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", - "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", - "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", - "AMILinuxBuilderImageCleanerF1745EF6", - "AMILinuxBuilderInfrastructureInstanceProfileB423D304", - "AMILinuxBuilderInfrastructure069F0561", - "AMILinuxBuilderLaunchtemplateA29452C4", - "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", - "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", - "AMILinuxBuilderRoleDefaultPolicy69ED051F", - "AMILinuxBuilderRole0C42378A", - "AMILinuxBuilderSGEDC86329" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "imagebuilder:ListComponents", - "imagebuilder:ListContainerRecipes", - "imagebuilder:ListImageRecipes", - "imagebuilder:ListWorkflows" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD", - "Roles": [ - { - "Ref": "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58" - } - ] - } - }, - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1591B871E": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "5d66225428a905928484115cbfa180dd86311011eb453686bcf37b4fe56dd701.zip" - }, - "Description": "Custom resource handler that bumps up Image Builder versions", - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 300 - }, - "DependsOn": [ - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy93D80BBD", - "awsimagebuilderversionerdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE25C1A58" - ] - }, - "deleteamidcc036c8876b451ea2c1552f9e06e9e1ServiceRole1CC58A6F": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Description": "Empty role to prevent deletion of AMIs on cdk-github-runners upgrade", - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ec2:DeregisterImage", - "ec2:DeleteSnapshot" - ], - "Effect": "Deny", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "deny" - } - ] - } - }, - "EC2SpotLinuxSG8D846B64": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/EC2 Spot Linux/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Spot Linux" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "EC2SpotLinuxRole86333E5D": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Spot Linux" - } - ] - } - }, - "EC2SpotLinuxRoleDefaultPolicy061AD1D0": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "states:SendTaskFailure", - "states:SendTaskSuccess", - "states:SendTaskHeartbeat" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/aws:cloudformation:stack-id": { - "Ref": "AWS::StackId" - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2SpotLinuxLogsF78D5F0E", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EC2SpotLinuxRoleDefaultPolicy061AD1D0", - "Roles": [ - { - "Ref": "EC2SpotLinuxRole86333E5D" - } - ] - } - }, - "EC2SpotLinuxLogsF78D5F0E": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Spot Linux" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EC2SpotLinuxLogsLogsfilter89CE719F": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "EC2SpotLinuxLogsF78D5F0E" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "EC2SpotLinuxInstanceProfileB12320D4": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "EC2SpotLinuxRole86333E5D" - } - ] - } - }, - "EC2SpotLinuxAMIRootDeviceC8A06843": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - } - }, - "DependsOn": [ - "AMILinuxBuilderAMIDistribution215F3A5C", - "AMILinuxBuilderAMIImage93D83DE5", - "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderAMIPipelineEC5051DF", - "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", - "AMILinuxBuilderAmiRecipe7C7ED6C7", - "AMILinuxBuilderAmiRecipeVersionFBE9C9AE", - "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", - "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", - "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", - "AMILinuxBuilderComponent3GitComponent9011E3AB", - "AMILinuxBuilderComponent4GithubCliComponent602EE471", - "AMILinuxBuilderComponent5AwsCliComponent72637C19", - "AMILinuxBuilderComponent6DockerComponent9E523A42", - "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", - "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", - "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", - "AMILinuxBuilderImageCleanerF1745EF6", - "AMILinuxBuilderInfrastructureInstanceProfileB423D304", - "AMILinuxBuilderInfrastructure069F0561", - "AMILinuxBuilderLaunchtemplateA29452C4", - "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", - "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", - "AMILinuxBuilderRoleDefaultPolicy69ED051F", - "AMILinuxBuilderRole0C42378A", - "AMILinuxBuilderSGEDC86329" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EC2Linuxarm64SG550ECD6C": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/EC2 Linux arm64/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Linux arm64" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "EC2Linuxarm64Role242F68FF": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Linux arm64" - } - ] - } - }, - "EC2Linuxarm64RoleDefaultPolicyDE9193C3": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "states:SendTaskFailure", - "states:SendTaskSuccess", - "states:SendTaskHeartbeat" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/aws:cloudformation:stack-id": { - "Ref": "AWS::StackId" - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2Linuxarm64Logs577E371E", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EC2Linuxarm64RoleDefaultPolicyDE9193C3", - "Roles": [ - { - "Ref": "EC2Linuxarm64Role242F68FF" - } - ] - } - }, - "EC2Linuxarm64Logs577E371E": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Linux arm64" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EC2Linuxarm64LogsLogsfilter0A247938": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "EC2Linuxarm64Logs577E371E" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "EC2Linuxarm64InstanceProfile1E6F8D53": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "EC2Linuxarm64Role242F68FF" - } - ] - } - }, - "EC2Linuxarm64AMIRootDevice3046D37D": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": { - "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" - } - }, - "DependsOn": [ - "AMILinuxarm64BuilderAMIDistributionE6989D01", - "AMILinuxarm64BuilderAMIImage40078F9E", - "AMILinuxarm64BuilderAmiLog84A9D94A", - "AMILinuxarm64BuilderAMIPipeline9CC1354C", - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", - "AMILinuxarm64BuilderAmiRecipeVersion429E7646", - "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", - "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", - "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", - "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", - "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", - "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", - "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", - "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", - "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", - "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", - "AMILinuxarm64BuilderImageCleanerA5DDFE7A", - "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", - "AMILinuxarm64BuilderInfrastructureA97EB3DD", - "AMILinuxarm64BuilderLaunchtemplate8F5EFF44", - "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD", - "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", - "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", - "AMILinuxarm64BuilderRole40D54E29", - "AMILinuxarm64BuilderSG94315968" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EC2WindowsSG13E24976": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "github-runners-test/EC2 Windows/SG", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Windows" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "EC2WindowsRoleC0D850D2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Windows" - } - ] - } - }, - "EC2WindowsRoleDefaultPolicyB6A15409": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "states:SendTaskFailure", - "states:SendTaskSuccess", - "states:SendTaskHeartbeat" - ], - "Condition": { - "StringEquals": { - "aws:ResourceTag/aws:cloudformation:stack-id": { - "Ref": "AWS::StackId" - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ssmmessages:CreateControlChannel", - "ssmmessages:CreateDataChannel", - "ssmmessages:OpenControlChannel", - "ssmmessages:OpenDataChannel", - "s3:GetEncryptionConfiguration", - "ssm:UpdateInstanceInformation" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2WindowsLogsDC1F2ABF", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "EC2WindowsRoleDefaultPolicyB6A15409", - "Roles": [ - { - "Ref": "EC2WindowsRoleC0D850D2" - } - ] - } - }, - "EC2WindowsLogsDC1F2ABF": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30, - "Tags": [ - { - "Key": "GitHubRunners:Provider", - "Value": "github-runners-test/EC2 Windows" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "EC2WindowsLogsLogsfilter253E4D4D": { - "Type": "AWS::Logs::MetricFilter", - "Properties": { - "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", - "LogGroupName": { - "Ref": "EC2WindowsLogsDC1F2ABF" - }, - "MetricTransformations": [ - { - "Dimensions": [ - { - "Key": "ProviderLabels", - "Value": "$labels" - }, - { - "Key": "Status", - "Value": "$status" - } - ], - "MetricName": "JobCompleted", - "MetricNamespace": "GitHubRunners", - "MetricValue": "1", - "Unit": "Count" - } - ] - } - }, - "EC2WindowsInstanceProfileDCA59D9C": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "EC2WindowsRoleC0D850D2" - } - ] - } - }, - "EC2WindowsAMIRootDevice9FFC971A": { - "Type": "Custom::AmiRootDevice", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", - "Arn" - ] - }, - "Ami": { - "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" - } - }, - "DependsOn": [ - "WindowsEC2BuilderAMIDistribution6B33DD89", - "WindowsEC2BuilderAMIImage9D812188", - "WindowsEC2BuilderAmiLog126E54B2", - "WindowsEC2BuilderAMIPipelineE3836949", - "WindowsEC2BuilderAmiRecipe41A137FF", - "WindowsEC2BuilderAmiRecipeVersionEE5C2F0C", - "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", - "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", - "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", - "WindowsEC2BuilderComponent3GitComponent4F86AE54", - "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", - "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", - "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", - "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", - "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", - "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", - "WindowsEC2BuilderImageCleanerEF537850", - "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", - "WindowsEC2BuilderInfrastructure4289B6D2", - "WindowsEC2BuilderLaunchtemplate0A66E9C2", - "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7", - "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", - "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", - "WindowsEC2BuilderRole1BA7D3E7", - "WindowsEC2BuilderSGE3F67842" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnersSecretsWebhook7AF0D74E": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "GenerateSecretString": { - "ExcludePunctuation": true, - "GenerateStringKey": "webhookSecret", - "IncludeSpace": false, - "SecretStringTemplate": "{}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnersSecretsGitHubEFD96479": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "GenerateSecretString": { - "ExcludePunctuation": true, - "GenerateStringKey": "dummy", - "IncludeSpace": false, - "SecretStringTemplate": "{\"domain\":\"github.com\",\"appId\":\"\",\"personalAuthToken\":\"\"}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnersSecretsGitHubPrivateKey79498F91": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "SecretString": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnersSecretsSetup692A93B1": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "GenerateSecretString": { - "ExcludePunctuation": true, - "GenerateStringKey": "token", - "IncludeSpace": false, - "SecretStringTemplate": "{\"token\":\"\"}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnerstokenretrieverServiceRole6099F71C": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnerstokenretrieverServiceRoleDefaultPolicy24965D29": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnerstokenretrieverServiceRoleDefaultPolicy24965D29", - "Roles": [ - { - "Ref": "runnerstokenretrieverServiceRole6099F71C" - } - ] - } - }, - "runnerstokenretrieverD5E8392A": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip" - }, - "Description": "Get token from GitHub Actions used to start new self-hosted runner", - "Environment": { - "Variables": { - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "OrchestratorLogFB9610E7" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnerstokenretrieverServiceRole6099F71C", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 30 - }, - "DependsOn": [ - "runnerstokenretrieverServiceRoleDefaultPolicy24965D29", - "runnerstokenretrieverServiceRole6099F71C" - ] - }, - "runnersdeleterunnerServiceRole35856967": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7", - "Roles": [ - { - "Ref": "runnersdeleterunnerServiceRole35856967" - } - ] - } - }, - "runnersdeleterunner7F8D5293": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip" - }, - "Description": "Delete failed GitHub Actions runner on error", - "Environment": { - "Variables": { - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "OrchestratorLogFB9610E7" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnersdeleterunnerServiceRole35856967", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 30 - }, - "DependsOn": [ - "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7", - "runnersdeleterunnerServiceRole35856967" - ] - }, - "runnersIdleReaperServiceRoleA775758D": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:ReceiveMessage", - "sqs:ChangeMessageVisibility", - "sqs:GetQueueUrl", - "sqs:DeleteMessage", - "sqs:GetQueueAttributes" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "runnersIdleReaperQueue117EFB9F", - "Arn" - ] - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - }, - { - "Action": [ - "states:ListExecutions", - "states:ListStateMachines" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - } - }, - { - "Action": [ - "states:DescribeExecution", - "states:DescribeStateMachineForExecution", - "states:GetExecutionHistory" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":states:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":execution:", - { - "Fn::Select": [ - 6, - { - "Fn::Split": [ - ":", - { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": [ - "states:ListActivities", - "states:DescribeStateMachine", - "states:DescribeActivity" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "states:StopExecution", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":states:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":execution:", - { - "Fn::Select": [ - 6, - { - "Fn::Split": [ - ":", - { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - } - ] - } - ] - }, - ":*" - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0", - "Roles": [ - { - "Ref": "runnersIdleReaperServiceRoleA775758D" - } - ] - } - }, - "runnersIdleReaper6FBF63A3": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip" - }, - "Description": "Stop idle GitHub runners to avoid paying for runners when the job was already canceled", - "Environment": { - "Variables": { - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "OrchestratorLogFB9610E7" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnersIdleReaperServiceRoleA775758D", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 300 - }, - "DependsOn": [ - "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0", - "runnersIdleReaperServiceRoleA775758D" - ] - }, - "runnersIdleReaperSqsEventSourcegithubrunnerstestrunnersIdleReaperQueue5E84F4E4B0DB6768": { - "Type": "AWS::Lambda::EventSourceMapping", - "Properties": { - "EventSourceArn": { - "Fn::GetAtt": [ - "runnersIdleReaperQueue117EFB9F", - "Arn" - ] - }, - "FunctionName": { - "Ref": "runnersIdleReaper6FBF63A3" - }, - "FunctionResponseTypes": [ - "ReportBatchItemFailures" - ], - "MaximumBatchingWindowInSeconds": 60 - } - }, - "runnersIdleReaperQueue117EFB9F": { - "Type": "AWS::SQS::Queue", - "Properties": { - "DelaySeconds": 600, - "VisibilityTimeout": 600 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnersRunnerOrchestratorRole5D220AD7": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "states.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - } - } - }, - "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sqs:SendMessage", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "runnersIdleReaperQueue117EFB9F", - "Arn" - ] - } - }, - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "runnersdeleterunner7F8D5293", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "runnersdeleterunner7F8D5293", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - }, - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "runnerstokenretrieverD5E8392A", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "runnerstokenretrieverD5E8392A", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - }, - { - "Action": [ - "codebuild:StartBuild", - "codebuild:StopBuild", - "codebuild:BatchGetBuilds", - "codebuild:BatchGetReports" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildx64CodeBuild7DC01A1E", - "Arn" - ] - } - }, - { - "Action": [ - "events:PutTargets", - "events:PutRule", - "events:DescribeRule" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":events:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":rule/StepFunctionsGetEventForCodeBuildStartBuildRule" - ] - ] - } - }, - { - "Action": [ - "codebuild:StartBuild", - "codebuild:StopBuild", - "codebuild:BatchGetBuilds", - "codebuild:BatchGetReports" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404x64CodeBuild261399A8", - "Arn" - ] - } - }, - { - "Action": [ - "codebuild:StartBuild", - "codebuild:StopBuild", - "codebuild:BatchGetBuilds", - "codebuild:BatchGetReports" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildARMCodeBuildC5F301F2", - "Arn" - ] - } - }, - { - "Action": [ - "codebuild:StartBuild", - "codebuild:StopBuild", - "codebuild:BatchGetBuilds", - "codebuild:BatchGetReports" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildWindowsCodeBuildC39F35C1", - "Arn" - ] - } - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "ECStask8F0DD550" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "ECStask8F0DD550" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "ECStask8F0DD550" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "ECStask8F0DD550" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECStask8F0DD550" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECStask8F0DD550" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": [ - "ecs:StopTask", - "ecs:DescribeTasks" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "ECStaskTaskRoleFE831ECD", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "ECStaskExecutionRole1A6D19A5", - "Arn" - ] - } - ] - }, - { - "Action": [ - "events:PutTargets", - "events:PutRule", - "events:DescribeRule" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":events:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":rule/StepFunctionsGetEventsForECSTaskRule" - ] - ] - } - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSUbuntu2404taskFC90B155" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSUbuntu2404taskFC90B155" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSUbuntu2404taskFC90B155" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSUbuntu2404taskFC90B155" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSUbuntu2404taskFC90B155" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSUbuntu2404taskFC90B155" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "ECSUbuntu2404taskTaskRoleDF683F3B", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "ECSUbuntu2404taskExecutionRoleC5FEA726", - "Arn" - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSARM64task27EB8443" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSARM64task27EB8443" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSARM64task27EB8443" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSARM64task27EB8443" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSARM64task27EB8443" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSARM64task27EB8443" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "ECSARM64taskTaskRole23B1CB4E", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "ECSARM64taskExecutionRoleBF2AE76F", - "Arn" - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSWindowstask73A31B6C" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSWindowstask73A31B6C" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSWindowstask73A31B6C" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSWindowstask73A31B6C" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSWindowstask73A31B6C" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "ECSWindowstask73A31B6C" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "ECSWindowstaskTaskRole17C8DA48", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "ECSWindowstaskExecutionRoleF164B5BF", - "Arn" - ] - } - ] - }, - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "LambdaFunction9233991D", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "LambdaFunction9233991D", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - }, - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "LambdaARMFunctionDD4B5FF7", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "LambdaARMFunctionDD4B5FF7", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "FargatetaskFDFF3302" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "FargatetaskFDFF3302" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "FargatetaskFDFF3302" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "FargatetaskFDFF3302" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "FargatetaskFDFF3302" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "FargatetaskFDFF3302" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "FargatetaskTaskRoleEFFCDAF8", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "FargatetaskExecutionRole88A42307", - "Arn" - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatex64spottask4C8B023D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatex64spottask4C8B023D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatex64spottask4C8B023D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatex64spottask4C8B023D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatex64spottask4C8B023D" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatex64spottask4C8B023D" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "Fargatex64spottaskTaskRole02893C25", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "Fargatex64spottaskExecutionRoleD0E0B7D6", - "Arn" - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64taskECD67399" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64taskECD67399" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64taskECD67399" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64taskECD67399" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64taskECD67399" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64taskECD67399" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "Fargatearm64taskTaskRoleD3C2CD58", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "Fargatearm64taskExecutionRoleD10B61DC", - "Arn" - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64spottaskD21E60F2" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64spottaskD21E60F2" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64spottaskD21E60F2" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64spottaskD21E60F2" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64spottaskD21E60F2" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "Fargatearm64spottaskD21E60F2" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "Fargatearm64spottaskTaskRole0F078C81", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "Fargatearm64spottaskExecutionRole90E5A05B", - "Arn" - ] - } - ] - }, - { - "Action": "ecs:RunTask", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - ":", - { - "Ref": "FargateWindowstask9F9B942D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - ":", - { - "Ref": "FargateWindowstask9F9B942D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Ref": "FargateWindowstask9F9B942D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Ref": "FargateWindowstask9F9B942D" - } - ] - } - ] - }, - ":", - { - "Fn::Select": [ - 0, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "FargateWindowstask9F9B942D" - } - ] - } - ] - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Fn::Select": [ - 5, - { - "Fn::Split": [ - ":", - { - "Ref": "FargateWindowstask9F9B942D" - } - ] - } - ] - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:PassRole", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "FargateWindowstaskTaskRole364508C8", - "Arn" - ] - }, - { - "Fn::GetAtt": [ - "FargateWindowstaskExecutionRoleEE562927", - "Arn" - ] - } - ] - }, - { - "Action": "ec2:runInstances", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "iam:PassRole", - "Condition": { - "StringEquals": { - "iam:PassedToService": "ec2.amazonaws.com" - } - }, - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2LinuxRole8B6519A2", - "Arn" - ] - } - }, - { - "Action": "ec2:createTags", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":*" - ] - ] - } - }, - { - "Action": "iam:CreateServiceLinkedRole", - "Condition": { - "StringEquals": { - "iam:AWSServiceName": "spot.amazonaws.com" - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "iam:PassRole", - "Condition": { - "StringEquals": { - "iam:PassedToService": "ec2.amazonaws.com" - } - }, - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2SpotLinuxRole86333E5D", - "Arn" - ] - } - }, - { - "Action": "iam:PassRole", - "Condition": { - "StringEquals": { - "iam:PassedToService": "ec2.amazonaws.com" - } - }, - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2Linuxarm64Role242F68FF", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61", - "Roles": [ - { - "Ref": "runnersRunnerOrchestratorRole5D220AD7" - } - ] - } - }, - "runnersRunnerOrchestratorRoleOverflowPolicy11A794735": { - "Type": "AWS::IAM::ManagedPolicy", - "Properties": { - "Description": "Part of the policies for github-runners-test/runners/Runner Orchestrator/Role", - "Path": "/", - "PolicyDocument": { - "Statement": [ - { - "Action": "iam:PassRole", - "Condition": { - "StringEquals": { - "iam:PassedToService": "ec2.amazonaws.com" - } - }, - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "EC2WindowsRoleC0D850D2", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "Roles": [ - { - "Ref": "runnersRunnerOrchestratorRole5D220AD7" - } - ] - } - }, - "runnersRunnerOrchestratorF9B66EBA": { - "Type": "AWS::StepFunctions::StateMachine", - "Properties": { - "DefinitionString": { - "Fn::Join": [ - "", - [ - "{\"StartAt\":\"Queue Idle Reaper\",\"States\":{\"Queue Idle Reaper\":{\"Next\":\"Run Providers\",\"Type\":\"Task\",\"ResultPath\":null,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::sqs:sendMessage\",\"Parameters\":{\"QueueUrl\":\"", - { - "Ref": "runnersIdleReaperQueue117EFB9F" - }, - "\",\"MessageBody\":{\"executionArn.$\":\"$$.Execution.Id\",\"runnerName.$\":\"$$.Execution.Name\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"installationId.$\":\"$.installationId\",\"maxIdleSeconds\":300}}},\"Run Providers\":{\"Type\":\"Parallel\",\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":60,\"MaxAttempts\":23,\"BackoffRate\":1.3}],\"Branches\":[{\"StartAt\":\"Error Handler\",\"States\":{\"Error Handler\":{\"Type\":\"Parallel\",\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"ResultPath\":\"$.error\",\"Next\":\"Delete Failed Runner\"}],\"Branches\":[{\"StartAt\":\"Get Runner Token\",\"States\":{\"Get Runner Token\":{\"Next\":\"Choose provider\",\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"ResultPath\":\"$.runner\",\"Resource\":\"", - { - "Fn::GetAtt": [ - "runnerstokenretrieverD5E8392A", - "Arn" - ] - }, - "\"},\"Choose provider\":{\"Type\":\"Choice\",\"Choices\":[{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildx64\"}],\"Next\":\"codebuild-x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildUbuntu2404x64\"}],\"Next\":\"codebuild-ubuntu-2404-x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildARM\"}],\"Next\":\"codebuild, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildWindows\"}],\"Next\":\"codebuild, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS\"}],\"Next\":\"ecs, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS Ubuntu 2404\"}],\"Next\":\"ecs-ubuntu-2404, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS ARM64\"}],\"Next\":\"ecs, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS Windows\"}],\"Next\":\"ecs, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Lambda\"}],\"Next\":\"lambda, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/LambdaARM\"}],\"Next\":\"lambda, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate\"}],\"Next\":\"fargate, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-x64-spot\"}],\"Next\":\"fargate-spot, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-arm64\"}],\"Next\":\"fargate, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-arm64-spot\"}],\"Next\":\"fargate-spot, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-Windows\"}],\"Next\":\"fargate, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Linux\"}],\"Next\":\"ec2, linux, x64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Spot Linux\"}],\"Next\":\"ec2-spot, linux, x64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Linux arm64\"}],\"Next\":\"ec2, linux, arm64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Windows\"}],\"Next\":\"ec2, windows, x64 data\"}],\"Default\":\"Unknown label\"},\"Unknown label\":{\"Type\":\"Succeed\"},\"codebuild-x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", - { - "Ref": "CodeBuildx64CodeBuild7DC01A1E" - }, - "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild-x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild-ubuntu-2404-x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", - { - "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" - }, - "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild-ubuntu-2404-x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", - { - "Ref": "CodeBuildARMCodeBuildC5F301F2" - }, - "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", - { - "Ref": "CodeBuildWindowsCodeBuildC39F35C1" - }, - "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"ecs, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "ECScluster20BC0B82", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestECStaskCE74CC84\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", - { - "Ref": "ECSCapacityProviderABF1B146" - }, - "\"}],\"EnableExecuteCommand\":true}},\"ecs-ubuntu-2404, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "ECSUbuntu2404cluster21C05FA1", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestECSUbuntu2404taskB7D564C7\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs-ubuntu-2404,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", - { - "Ref": "ECSUbuntu2404CapacityProviderFAE73340" - }, - "\"}],\"EnableExecuteCommand\":true}},\"ecs, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "ECSARM64cluster4ECAA083", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestECSARM64taskE94E43A3\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", - { - "Ref": "ECSARM64CapacityProvider8627FEF9" - }, - "\"}],\"EnableExecuteCommand\":true}},\"ecs, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "ECSWindowscluster14061F74", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestECSWindowstask6B1D5861\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", - { - "Ref": "ECSWindowsCapacityProvider8F8896A5" - }, - "\"}],\"EnableExecuteCommand\":false}},\"lambda, x64\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", - { - "Fn::GetAtt": [ - "LambdaFunction9233991D", - "Arn" - ] - }, - "\",\"Payload\":{\"token.$\":\"$.runner.token\",\"runnerName.$\":\"$$.Execution.Name\",\"label\":\"lambda,x64\",\"githubDomain.$\":\"$.runner.domain\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"registrationUrl.$\":\"$.runner.registrationUrl\",\"group\":\"\"}}},\"lambda, arm64\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", - { - "Fn::GetAtt": [ - "LambdaARMFunctionDD4B5FF7", - "Arn" - ] - }, - "\",\"Payload\":{\"token.$\":\"$.runner.token\",\"runnerName.$\":\"$$.Execution.Name\",\"label\":\"lambda,arm64\",\"githubDomain.$\":\"$.runner.domain\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"registrationUrl.$\":\"$.runner.registrationUrl\",\"group\":\"\"}}},\"fargate, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "cluster611F8AFF", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestFargatetaskA755E0CE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\"],\"SecurityGroups\":[\"", - { - "Fn::GetAtt": [ - "FargatesecuritygroupAFCAFD34", - "GroupId" - ] - }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":true}},\"fargate-spot, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "cluster611F8AFF", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestFargatex64spottask7B2E300E\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\"],\"SecurityGroups\":[\"", - { - "Fn::GetAtt": [ - "Fargatex64spotsecuritygroup2A9F4299", - "GroupId" - ] - }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate-spot,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE_SPOT\"}],\"EnableExecuteCommand\":true}},\"fargate, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "cluster611F8AFF", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestFargatearm64task6B95C05B\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\"],\"SecurityGroups\":[\"", - { - "Fn::GetAtt": [ - "Fargatearm64securitygroup08ABAD9E", - "GroupId" - ] - }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":true}},\"fargate-spot, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "cluster611F8AFF", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestFargatearm64spottaskF9ADF192\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\"],\"SecurityGroups\":[\"", - { - "Fn::GetAtt": [ - "Fargatearm64spotsecuritygroup20C885E4", - "GroupId" - ] - }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate-spot,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE_SPOT\"}],\"EnableExecuteCommand\":true}},\"fargate, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", - { - "Fn::GetAtt": [ - "cluster611F8AFF", - "Arn" - ] - }, - "\",\"TaskDefinition\":\"githubrunnerstestFargateWindowstask95BB2245\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\"],\"SecurityGroups\":[\"", - { - "Fn::GetAtt": [ - "FargateWindowssecuritygroupE684A7B0", - "GroupId" - ] - }, - "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":false}},\"ec2, linux, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2, linux, x64 subnet1\"},\"ec2, linux, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, linux, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2LinuxLogsC4CD8F14" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2LinuxInstanceProfile2D2BB473", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2LinuxSGF5B89300", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2LinuxAMIRootDevice26D5E56E" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40,\"VolumeType\":\"gp3\",\"Iops\":3000,\"Throughput\":200}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]}]}},\"ec2, linux, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2LinuxLogsC4CD8F14" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2LinuxInstanceProfile2D2BB473", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2LinuxSGF5B89300", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2LinuxAMIRootDevice26D5E56E" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40,\"VolumeType\":\"gp3\",\"Iops\":3000,\"Throughput\":200}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]}]}},\"ec2-spot, linux, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2-spot, linux, x64 subnet1\"},\"ec2-spot, linux, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2-spot, linux, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2SpotLinuxLogsF78D5F0E" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2-spot,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2SpotLinuxInstanceProfileB12320D4", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2SpotLinuxSG8D846B64", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2SpotLinuxAMIRootDeviceC8A06843" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40}}],\"InstanceMarketOptions\":{\"MarketType\":\"spot\",\"SpotOptions\":{\"SpotInstanceType\":\"one-time\"}},\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]}]}},\"ec2-spot, linux, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2SpotLinuxLogsF78D5F0E" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2-spot,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2SpotLinuxInstanceProfileB12320D4", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2SpotLinuxSG8D846B64", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2SpotLinuxAMIRootDeviceC8A06843" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40}}],\"InstanceMarketOptions\":{\"MarketType\":\"spot\",\"SpotOptions\":{\"SpotInstanceType\":\"one-time\"}},\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]}]}},\"ec2, linux, arm64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2, linux, arm64 subnet1\"},\"ec2, linux, arm64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, linux, arm64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6g.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2Linuxarm64Logs577E371E" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,arm64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2Linuxarm64InstanceProfile1E6F8D53", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2Linuxarm64SG550ECD6C", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2Linuxarm64AMIRootDevice3046D37D" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]}]}},\"ec2, linux, arm64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6g.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2Linuxarm64Logs577E371E" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,arm64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2Linuxarm64InstanceProfile1E6F8D53", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2Linuxarm64SG550ECD6C", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2Linuxarm64AMIRootDevice3046D37D" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]}]}},\"ec2, windows, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"\\n$TASK_TOKEN = \\\"{}\\\"\\n$logGroupName=\\\"{}\\\"\\n$runnerNamePath=\\\"{}\\\"\\n$githubDomainPath=\\\"{}\\\"\\n$ownerPath=\\\"{}\\\"\\n$repoPath=\\\"{}\\\"\\n$runnerTokenPath=\\\"{}\\\"\\n$labels=\\\"{}\\\"\\n$registrationURL=\\\"{}\\\"\\n$runnerGroup=\\\"{}\\\"\\n\\n# EC2Launch only starts ssm agent after user data is done, so we need to start it ourselves (it is disabled by default)\\nSet-Service -StartupType Manual AmazonSSMAgent\\nStart-Service AmazonSSMAgent\\n\\nStart-Job -ScriptBlock \\\\{\\n while (1) \\\\{\\n aws stepfunctions send-task-heartbeat --task-token \\\"$using:TASK_TOKEN\\\"\\n sleep 60\\n \\\\}\\n\\\\}\\nfunction setup_logs () \\\\{\\n echo \\\"\\\\{\\n `\\\"logs`\\\": \\\\{\\n `\\\"log_stream_name`\\\": `\\\"unknown`\\\",\\n `\\\"logs_collected`\\\": \\\\{\\n `\\\"files`\\\": \\\\{\\n `\\\"collect_list`\\\": [\\n \\\\{\\n `\\\"file_path`\\\": `\\\"/actions/runner.log`\\\",\\n `\\\"log_group_name`\\\": `\\\"$logGroupName`\\\",\\n `\\\"log_stream_name`\\\": `\\\"$runnerNamePath`\\\",\\n `\\\"timezone`\\\": `\\\"UTC`\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\\" | Out-File -Encoding ASCII $Env:TEMP/log.conf\\n & \\\"C:/Program Files/Amazon/AmazonCloudWatchAgent/amazon-cloudwatch-agent-ctl.ps1\\\" -a fetch-config -m ec2 -s -c file:$Env:TEMP/log.conf\\n\\\\}\\nfunction action () \\\\{\\n cd /actions\\n $RunnerVersion = Get-Content /actions/RUNNER_VERSION -Raw\\n if ($RunnerVersion -eq \\\"latest\\\") \\\\{ $RunnerFlags = \\\"\\\" \\\\} else \\\\{ $RunnerFlags = \\\"--disableupdate\\\" \\\\}\\n ./config.cmd --unattended --url \\\"$\\\\{registrationUrl\\\\}\\\" --token \\\"$\\\\{runnerTokenPath\\\\}\\\" --ephemeral --work _work --labels \\\"$\\\\{labels\\\\},cdkghr:started:$(Get-Date -UFormat +%s)\\\" $RunnerFlags --name \\\"$\\\\{runnerNamePath\\\\}\\\" $\\\\{runnerGroup\\\\} 2>&1 | Out-File -Encoding ASCII -Append /actions/runner.log\\n\\n if ($LASTEXITCODE -ne 0) \\\\{ return 1 \\\\}\\n ./run.cmd 2>&1 | Out-File -Encoding ASCII -Append /actions/runner.log\\n if ($LASTEXITCODE -ne 0) \\\\{ return 2 \\\\}\\n\\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\\\-]+ with result: (.*)' | %\\\\{$_.Matches.Groups[1].Value\\\\} | Select-Object -Last 1\\n\\n if ($STATUS) \\\\{\\n echo \\\"CDKGHA JOB DONE $\\\\{labels\\\\} $STATUS\\\" | Out-File -Encoding ASCII -Append /actions/runner.log\\n \\\\}\\n\\n return 0\\n\\\\}\\nsetup_logs\\n$r = action\\nif ($r -eq 0) \\\\{\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{ \\\\}'\\n\\\\} else \\\\{\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\n\\\\}\\nStart-Sleep -Seconds 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\nStop-Computer -ComputerName localhost -Force\\n\\n\"},\"Next\":\"ec2, windows, x64 subnet1\"},\"ec2, windows, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, windows, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2WindowsLogsDC1F2ABF" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,windows,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2WindowsInstanceProfileDCA59D9C", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2WindowsSG13E24976", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2WindowsAMIRootDevice9FFC971A" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]}]}},\"ec2, windows, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", - { - "Ref": "AWS::Partition" - }, - ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", - { - "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" - }, - "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", - { - "Ref": "EC2WindowsLogsDC1F2ABF" - }, - "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,windows,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", - { - "Fn::GetAtt": [ - "EC2WindowsInstanceProfileDCA59D9C", - "Arn" - ] - }, - "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", - { - "Fn::GetAtt": [ - "EC2WindowsSG13E24976", - "GroupId" - ] - }, - "\"],\"SubnetId\":\"", - { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", - { - "Ref": "EC2WindowsAMIRootDevice9FFC971A" - }, - "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]}]}}}}]},\"Delete Failed Runner\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2},{\"ErrorEquals\":[\"RunnerBusy\"],\"IntervalSeconds\":60,\"MaxAttempts\":60,\"BackoffRate\":1}],\"Type\":\"Task\",\"ResultPath\":\"$.delete\",\"Resource\":\"", - { - "Fn::GetAtt": [ - "runnersdeleterunner7F8D5293", - "Arn" - ] - }, - "\",\"Parameters\":{\"runnerName.$\":\"$$.Execution.Name\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"installationId.$\":\"$.installationId\",\"error.$\":\"$.error\"}}}}]}}}" - ] - ] - }, - "RoleArn": { - "Fn::GetAtt": [ - "runnersRunnerOrchestratorRole5D220AD7", - "Arn" - ] - } - }, - "DependsOn": [ - "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61", - "runnersRunnerOrchestratorRoleOverflowPolicy11A794735", - "runnersRunnerOrchestratorRole5D220AD7" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsWebhook7AF0D74E" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - }, - { - "Action": "states:StartExecution", - "Effect": "Allow", - "Resource": { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C", - "Roles": [ - { - "Ref": "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2" - } - ] - } - }, - "runnersWebhookHandlerwebhookhandler22779A81": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip" - }, - "Description": "Handle GitHub webhook and start runner orchestrator", - "Environment": { - "Variables": { - "STEP_FUNCTION_ARN": { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - }, - "WEBHOOK_SECRET_ARN": { - "Ref": "runnersSecretsWebhook7AF0D74E" - }, - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "SUPPORTED_LABELS": "[{\"provider\":\"github-runners-test/CodeBuildx64\",\"labels\":[\"codebuild-x64\"]},{\"provider\":\"github-runners-test/CodeBuildUbuntu2404x64\",\"labels\":[\"codebuild-ubuntu-2404-x64\"]},{\"provider\":\"github-runners-test/CodeBuildARM\",\"labels\":[\"codebuild\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/CodeBuildWindows\",\"labels\":[\"codebuild\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/ECS\",\"labels\":[\"ecs\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/ECS Ubuntu 2404\",\"labels\":[\"ecs-ubuntu-2404\",\"x64\"]},{\"provider\":\"github-runners-test/ECS ARM64\",\"labels\":[\"ecs\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/ECS Windows\",\"labels\":[\"ecs\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/Lambda\",\"labels\":[\"lambda\",\"x64\"]},{\"provider\":\"github-runners-test/LambdaARM\",\"labels\":[\"lambda\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate\",\"labels\":[\"fargate\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/Fargate-x64-spot\",\"labels\":[\"fargate-spot\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/Fargate-arm64\",\"labels\":[\"fargate\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate-arm64-spot\",\"labels\":[\"fargate-spot\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate-Windows\",\"labels\":[\"fargate\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Linux\",\"labels\":[\"ec2\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Spot Linux\",\"labels\":[\"ec2-spot\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Linux arm64\",\"labels\":[\"ec2\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/EC2 Windows\",\"labels\":[\"ec2\",\"windows\",\"x64\"]}]", - "REQUIRE_SELF_HOSTED_LABEL": "1", - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "OrchestratorLogFB9610E7" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 31 - }, - "DependsOn": [ - "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C", - "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2" - ] - }, - "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17": { - "Type": "AWS::Lambda::Url", - "Properties": { - "AuthType": "NONE", - "TargetFunctionArn": { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandler22779A81", - "Arn" - ] - } - } - }, - "runnersWebhookHandlerwebhookhandlerinvokefunctionurl871AC245": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunctionUrl", - "FunctionName": { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandler22779A81", - "Arn" - ] - }, - "FunctionUrlAuthType": "NONE", - "Principal": "*" - } - }, - "runnersWebhookHandlerwebhookhandlerinvokefunction76559985": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandler22779A81", - "Arn" - ] - }, - "InvokedViaFunctionUrl": true, - "Principal": "*" - } - }, - "runnersWebhookRedeliveryLambdaServiceRole464CDD30": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640", - "Roles": [ - { - "Ref": "runnersWebhookRedeliveryLambdaServiceRole464CDD30" - } - ] - } - }, - "runnersWebhookRedeliveryLambdaCF5EE41B": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip" - }, - "Description": "Check for GitHub webhook delivery failures and redeliver them", - "Environment": { - "Variables": { - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "OrchestratorLogFB9610E7" - } - }, - "ReservedConcurrentExecutions": 1, - "Role": { - "Fn::GetAtt": [ - "runnersWebhookRedeliveryLambdaServiceRole464CDD30", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 270 - }, - "DependsOn": [ - "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640", - "runnersWebhookRedeliveryLambdaServiceRole464CDD30" - ] - }, - "runnersWebhookRedeliverySchedule88D0314C": { - "Type": "AWS::Events::Rule", - "Properties": { - "Description": "Schedule to run the webhook redelivery lambda every 5 minutes", - "ScheduleExpression": "rate(5 minutes)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "runnersWebhookRedeliveryLambdaCF5EE41B", - "Arn" - ] - }, - "Id": "Target0", - "RetryPolicy": { - "MaximumRetryAttempts": 0 - } - } - ] - } - }, - "runnersWebhookRedeliveryScheduleAllowEventRulegithubrunnerstestrunnersWebhookRedeliveryLambdaC352F4E1E8F30E7D": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "runnersWebhookRedeliveryLambdaCF5EE41B", - "Arn" - ] - }, - "Principal": "events.amazonaws.com", - "SourceArn": { - "Fn::GetAtt": [ - "runnersWebhookRedeliverySchedule88D0314C", - "Arn" - ] - } - } - }, - "runnerssetupServiceRole588BFE9A": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnerssetupServiceRoleDefaultPolicy40EF213B": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret", - "secretsmanager:UpdateSecretVersionStage" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsWebhook7AF0D74E" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret", - "secretsmanager:UpdateSecretVersionStage" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret", - "secretsmanager:UpdateSecretVersionStage" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsSetup692A93B1" - } - }, - { - "Action": [ - "secretsmanager:PutSecretValue", - "secretsmanager:UpdateSecret", - "secretsmanager:UpdateSecretVersionStage" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsSetup692A93B1" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnerssetupServiceRoleDefaultPolicy40EF213B", - "Roles": [ - { - "Ref": "runnerssetupServiceRole588BFE9A" - } - ] - } - }, - "runnerssetup9896CB59": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.zip" - }, - "Description": "Setup GitHub Actions integration with self-hosted runners", - "Environment": { - "Variables": { - "SETUP_SECRET_ARN": { - "Ref": "runnersSecretsSetup692A93B1" - }, - "WEBHOOK_SECRET_ARN": { - "Ref": "runnersSecretsWebhook7AF0D74E" - }, - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "WEBHOOK_URL": { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17", - "FunctionUrl" - ] - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "SetupLog8A8B0E5C" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnerssetupServiceRole588BFE9A", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 180 - }, - "DependsOn": [ - "runnerssetupServiceRoleDefaultPolicy40EF213B", - "runnerssetupServiceRole588BFE9A" - ] - }, - "runnerssetupFunctionUrlB8BC43E8": { - "Type": "AWS::Lambda::Url", - "Properties": { - "AuthType": "NONE", - "TargetFunctionArn": { - "Fn::GetAtt": [ - "runnerssetup9896CB59", - "Arn" - ] - } - } - }, - "runnerssetupinvokefunctionurl5F3B865C": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunctionUrl", - "FunctionName": { - "Fn::GetAtt": [ - "runnerssetup9896CB59", - "Arn" - ] - }, - "FunctionUrlAuthType": "NONE", - "Principal": "*" - } - }, - "runnerssetupinvokefunctionC1E3C6E6": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "runnerssetup9896CB59", - "Arn" - ] - }, - "InvokedViaFunctionUrl": true, - "Principal": "*" - } - }, - "runnersstatusServiceRole71A1ADB6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnersstatusServiceRoleDefaultPolicyBD4E619B": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - }, - { - "Action": "ecr:DescribeImages", - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - }, - { - "Action": "ec2:DescribeLaunchTemplateVersions", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "cloudformation:DescribeStackResource", - "Effect": "Allow", - "Resource": { - "Ref": "AWS::StackId" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsWebhook7AF0D74E" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubEFD96479" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - } - }, - { - "Action": [ - "secretsmanager:GetSecretValue", - "secretsmanager:DescribeSecret" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersSecretsSetup692A93B1" - } - }, - { - "Action": [ - "states:ListExecutions", - "states:ListStateMachines" - ], - "Effect": "Allow", - "Resource": { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - } - }, - { - "Action": [ - "states:DescribeExecution", - "states:DescribeStateMachineForExecution", - "states:GetExecutionHistory" - ], - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":states:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":execution:", - { - "Fn::Select": [ - 6, - { - "Fn::Split": [ - ":", - { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - } - ] - } - ] - }, - ":*" - ] - ] - } - }, - { - "Action": [ - "states:ListActivities", - "states:DescribeStateMachine", - "states:DescribeActivity" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersstatusServiceRoleDefaultPolicyBD4E619B", - "Roles": [ - { - "Ref": "runnersstatusServiceRole71A1ADB6" - } - ] - } - }, - "runnersstatus1A5771C0": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip" - }, - "Description": "Provide user with status about self-hosted GitHub Actions runners", - "Environment": { - "Variables": { - "WEBHOOK_SECRET_ARN": { - "Ref": "runnersSecretsWebhook7AF0D74E" - }, - "GITHUB_SECRET_ARN": { - "Ref": "runnersSecretsGitHubEFD96479" - }, - "GITHUB_PRIVATE_KEY_SECRET_ARN": { - "Ref": "runnersSecretsGitHubPrivateKey79498F91" - }, - "SETUP_SECRET_ARN": { - "Ref": "runnersSecretsSetup692A93B1" - }, - "WEBHOOK_URL": { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17", - "FunctionUrl" - ] - }, - "WEBHOOK_HANDLER_ARN": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "runnersWebhookHandlerwebhookhandler22779A81", - "Arn" - ] - }, - ":$LATEST" - ] - ] - }, - "STEP_FUNCTION_ARN": { - "Ref": "runnersRunnerOrchestratorF9B66EBA" - }, - "STEP_FUNCTION_LOG_GROUP": "", - "SETUP_FUNCTION_URL": { - "Fn::GetAtt": [ - "runnerssetupFunctionUrlB8BC43E8", - "FunctionUrl" - ] - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1", - "LOGICAL_ID": "runnersstatus1A5771C0", - "STACK_NAME": "github-runners-test" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "SetupLog8A8B0E5C" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnersstatusServiceRole71A1ADB6", - "Arn" - ] - }, - "Runtime": "nodejs22.x", - "Timeout": 180 - }, - "DependsOn": [ - "runnersstatusServiceRoleDefaultPolicyBD4E619B", - "runnersstatusServiceRole71A1ADB6" - ], - "Metadata": { - "providers": [ - { - "type": "CodeBuildRunnerProvider", - "labels": [ - "codebuild-x64" - ], - "roleArn": { - "Fn::GetAtt": [ - "CodeBuildx64CodeBuildRole32E5C764", - "Arn" - ] - }, - "logGroup": { - "Ref": "CodeBuildx64LogsA21ECD59" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "CodeBuildImageBuilderLogsE4CADFCC" - } - } - }, - { - "type": "CodeBuildRunnerProvider", - "labels": [ - "codebuild-ubuntu-2404-x64" - ], - "roleArn": { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92", - "Arn" - ] - }, - "logGroup": { - "Ref": "CodeBuildUbuntu2404x64Logs27D26829" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" - } - } - }, - { - "type": "CodeBuildRunnerProvider", - "labels": [ - "codebuild", - "linux", - "arm64" - ], - "roleArn": { - "Fn::GetAtt": [ - "CodeBuildARMCodeBuildRole74DB4985", - "Arn" - ] - }, - "logGroup": { - "Ref": "CodeBuildARMLogs7C7FC5A7" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" - } - } - }, - { - "type": "CodeBuildRunnerProvider", - "labels": [ - "codebuild", - "windows", - "x64" - ], - "roleArn": { - "Fn::GetAtt": [ - "CodeBuildWindowsCodeBuildRoleDC93697E", - "Arn" - ] - }, - "logGroup": { - "Ref": "CodeBuildWindowsLogsF4DD93A5" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "WindowsImageBuilderDockerLogE660E23E" - } - } - }, - { - "type": "EcsRunnerProvider", - "labels": [ - "ecs", - "linux", - "x64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "ECSsecuritygroup76605212", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "ECStaskTaskRoleFE831ECD", - "Arn" - ] - }, - "logGroup": { - "Ref": "ECSlogs71446134" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderRepository9DE3B6F0", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "CodeBuildImageBuilderLogsE4CADFCC" - } - } - }, - { - "type": "EcsRunnerProvider", - "labels": [ - "ecs-ubuntu-2404", - "x64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "ECSUbuntu2404securitygroupEE405C76", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "ECSUbuntu2404taskTaskRoleDF683F3B", - "Arn" - ] - }, - "logGroup": { - "Ref": "ECSUbuntu2404logsFB15C25B" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" - } - } - }, - { - "type": "EcsRunnerProvider", - "labels": [ - "ecs", - "linux", - "arm64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "ECSARM64securitygroup281D94B2", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "ECSARM64taskTaskRole23B1CB4E", - "Arn" - ] - }, - "logGroup": { - "Ref": "ECSARM64logs1A2F1E00" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "CodeBuildImageBuilderarmRepositoryE967421B", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" - } - } - }, - { - "type": "EcsRunnerProvider", - "labels": [ - "ecs", - "windows", - "x64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "ECSWindowssecuritygroupB4EE54DA", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "ECSWindowstaskTaskRole17C8DA48", - "Arn" - ] - }, - "logGroup": { - "Ref": "ECSWindowslogs83D9D352" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "WindowsImageBuilderDockerLogE660E23E" - } - } - }, - { - "type": "LambdaRunnerProvider", - "labels": [ - "lambda", - "x64" - ], - "roleArn": { - "Fn::GetAtt": [ - "LambdaFunctionServiceRoleB1826A50", - "Arn" - ] - }, - "logGroup": { - "Ref": "LambdaLog2764B04F" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderx64Repository57F632F1", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderx64Repository57F632F1" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "LambdaImageBuilderx64Logs1C003BB4" - } - } - }, - { - "type": "LambdaRunnerProvider", - "labels": [ - "lambda", - "arm64" - ], - "roleArn": { - "Fn::GetAtt": [ - "LambdaARMFunctionServiceRole136069A0", - "Arn" - ] - }, - "logGroup": { - "Ref": "LambdaARMLogAA2DA09F" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "LambdaImageBuilderzRepository7C7AD146", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "LambdaImageBuilderzRepository7C7AD146" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "LambdaImageBuilderzLogsC9FB42C8" - } - } - }, - { - "type": "FargateRunnerProvider", - "labels": [ - "fargate", - "linux", - "x64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "FargatesecuritygroupAFCAFD34", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "FargatetaskTaskRoleEFFCDAF8", - "Arn" - ] - }, - "logGroup": { - "Ref": "FargatelogsCB753638" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderRepository8F7BA13C" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "FargatebuilderLogs2F794091" - } - } - }, - { - "type": "FargateRunnerProvider", - "labels": [ - "fargate-spot", - "linux", - "x64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "Fargatex64spotsecuritygroup2A9F4299", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "Fargatex64spottaskTaskRole02893C25", - "Arn" - ] - }, - "logGroup": { - "Ref": "Fargatex64spotlogs0BCF618B" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderRepository8F7BA13C", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderRepository8F7BA13C" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "FargatebuilderLogs2F794091" - } - } - }, - { - "type": "FargateRunnerProvider", - "labels": [ - "fargate", - "linux", - "arm64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "Fargatearm64securitygroup08ABAD9E", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "Fargatearm64taskTaskRoleD3C2CD58", - "Arn" - ] - }, - "logGroup": { - "Ref": "Fargatearm64logs00171A52" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderarmRepository77DCC132" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "FargatebuilderarmLogs63D60F4D" - } - } - }, - { - "type": "FargateRunnerProvider", - "labels": [ - "fargate-spot", - "linux", - "arm64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "Fargatearm64spotsecuritygroup20C885E4", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "Fargatearm64spottaskTaskRole0F078C81", - "Arn" - ] - }, - "logGroup": { - "Ref": "Fargatearm64spotlogsEFCCEC59" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "FargatebuilderarmRepository77DCC132", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "FargatebuilderarmRepository77DCC132" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "FargatebuilderarmLogs63D60F4D" - } - } - }, - { - "type": "FargateRunnerProvider", - "labels": [ - "fargate", - "windows", - "x64" - ], - "vpcArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":ec2:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":vpc/", - { - "Ref": "Vpc8378EB38" - } - ] - ] - }, - "securityGroups": [ - { - "Fn::GetAtt": [ - "FargateWindowssecuritygroupE684A7B0", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "FargateWindowstaskTaskRole364508C8", - "Arn" - ] - }, - "logGroup": { - "Ref": "FargateWindowslogs52881DBF" - }, - "image": { - "imageRepository": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 4, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".dkr.ecr.", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - ":", - { - "Fn::GetAtt": [ - "WindowsImageBuilderRepositoryA4CBB6D8", - "Arn" - ] - } - ] - } - ] - }, - ".", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" - } - ] - ] - }, - "imageTag": "latest", - "imageBuilderLogGroup": { - "Ref": "WindowsImageBuilderDockerLogE660E23E" - } - } - }, - { - "type": "Ec2RunnerProvider", - "labels": [ - "ec2", - "linux", - "x64" - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "EC2LinuxSGF5B89300", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "EC2LinuxRole8B6519A2", - "Arn" - ] - }, - "logGroup": { - "Ref": "EC2LinuxLogsC4CD8F14" - }, - "ami": { - "launchTemplate": { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "amiBuilderLogGroup": { - "Ref": "AMILinuxBuilderAmiLog0DB16E38" - } - } - }, - { - "type": "Ec2RunnerProvider", - "labels": [ - "ec2-spot", - "linux", - "x64" - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "EC2SpotLinuxSG8D846B64", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "EC2SpotLinuxRole86333E5D", - "Arn" - ] - }, - "logGroup": { - "Ref": "EC2SpotLinuxLogsF78D5F0E" - }, - "ami": { - "launchTemplate": { - "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" - }, - "amiBuilderLogGroup": { - "Ref": "AMILinuxBuilderAmiLog0DB16E38" - } - } - }, - { - "type": "Ec2RunnerProvider", - "labels": [ - "ec2", - "linux", - "arm64" - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "EC2Linuxarm64SG550ECD6C", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "EC2Linuxarm64Role242F68FF", - "Arn" - ] - }, - "logGroup": { - "Ref": "EC2Linuxarm64Logs577E371E" - }, - "ami": { - "launchTemplate": { - "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" - }, - "amiBuilderLogGroup": { - "Ref": "AMILinuxarm64BuilderAmiLog84A9D94A" - } - } - }, - { - "type": "Ec2RunnerProvider", - "labels": [ - "ec2", - "windows", - "x64" - ], - "securityGroups": [ - { - "Fn::GetAtt": [ - "EC2WindowsSG13E24976", - "GroupId" - ] - } - ], - "roleArn": { - "Fn::GetAtt": [ - "EC2WindowsRoleC0D850D2", - "Arn" - ] - }, - "logGroup": { - "Ref": "EC2WindowsLogsDC1F2ABF" - }, - "ami": { - "launchTemplate": { - "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" - }, - "amiBuilderLogGroup": { - "Ref": "WindowsEC2BuilderAmiLog126E54B2" - } - } - } - ] - } - }, - "runnersFailedRunnerImageBuilds233D2237": { - "Type": "AWS::SNS::Topic" - }, - "runnersFailedRunnerImageBuildsPolicyC1C99AF8": { - "Type": "AWS::SNS::TopicPolicy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Principal": { - "Service": "codestar-notifications.amazonaws.com" - }, - "Resource": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "Sid": "0" - } - ], - "Version": "2012-10-17" - }, - "Topics": [ - { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - } - ] - } - }, - "runnersImageBuilderBuildsDF5A50E4": { - "Type": "AWS::SNS::Topic" - }, - "runnersImageBuilderBuildsFilterServiceRoleED82BC5F": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Resource": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1", - "Roles": [ - { - "Ref": "runnersImageBuilderBuildsFilterServiceRoleED82BC5F" - } - ] - } - }, - "runnersImageBuilderBuildsFilterD708AA06": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip" - }, - "Description": "src/image-builders/aws-image-builder/filter-failed-builds.lambda.ts", - "Environment": { - "Variables": { - "TARGET_TOPIC_ARN": { - "Ref": "runnersFailedRunnerImageBuilds233D2237" - }, - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" - } - }, - "Handler": "index.handler", - "LoggingConfig": { - "LogFormat": "JSON", - "LogGroup": { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - }, - "Role": { - "Fn::GetAtt": [ - "runnersImageBuilderBuildsFilterServiceRoleED82BC5F", - "Arn" - ] - }, - "Runtime": "nodejs22.x" - }, - "DependsOn": [ - "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1", - "runnersImageBuilderBuildsFilterServiceRoleED82BC5F" - ] - }, - "runnersImageBuilderBuildsFilterAllowInvokegithubrunnerstestrunnersImageBuilderBuilds109FC9E855AB30DD": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "runnersImageBuilderBuildsFilterD708AA06", - "Arn" - ] - }, - "Principal": "sns.amazonaws.com", - "SourceArn": { - "Ref": "runnersImageBuilderBuildsDF5A50E4" - } - } - }, - "runnersImageBuilderBuildsFilterImageBuilderBuilds7F42F563": { - "Type": "AWS::SNS::Subscription", - "Properties": { - "Endpoint": { - "Fn::GetAtt": [ - "runnersImageBuilderBuildsFilterD708AA06", - "Arn" - ] - }, - "Protocol": "lambda", - "TopicArn": { - "Ref": "runnersImageBuilderBuildsDF5A50E4" - } - } - }, - "runnersWebhookerrors72F5BFF3": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "OrchestratorLogFB9610E7" - } - ], - "Name": "GitHub Runners/Webhook errors", - "QueryString": { - "Fn::Join": [ - "", - [ - "filter strcontains(@logStream, \"", - { - "Ref": "runnersWebhookHandlerwebhookhandler22779A81" - }, - "\")\n| filter level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" - ] - ] - } - } - }, - "runnersOrchestrationerrors9EFE206B": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "OrchestratorLogFB9610E7" - } - ], - "Name": "GitHub Runners/Orchestration errors", - "QueryString": "filter level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" - } - }, - "runnersRunnerimagebuilderrorsC1D423F8": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "RunnerImageBuildHelpersLog13186633" - } - ], - "Name": "GitHub Runners/Runner image build errors", - "QueryString": "filter strcontains(message, \"error\") or strcontains(message, \"ERROR\") or strcontains(message, \"Error\") or level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" - } - }, - "runnersIgnoredwebhooksAD368063": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "OrchestratorLogFB9610E7" - } - ], - "Name": "GitHub Runners/Ignored webhooks", - "QueryString": { - "Fn::Join": [ - "", - [ - "fields @timestamp, message.notice\n| filter strcontains(@logStream, \"", - { - "Ref": "runnersWebhookHandlerwebhookhandler22779A81" - }, - "\")\n| filter strcontains(message.notice, \"Ignoring\")\n| sort @timestamp desc\n| limit 100" - ] - ] - } - } - }, - "runnersIgnoredjobsbasedonlabels120F3D1A": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "OrchestratorLogFB9610E7" - } - ], - "Name": "GitHub Runners/Ignored jobs based on labels", - "QueryString": { - "Fn::Join": [ - "", - [ - "fields @timestamp, message.notice\n| filter strcontains(@logStream, \"", - { - "Ref": "runnersWebhookHandlerwebhookhandler22779A81" - }, - "\")\n| filter strcontains(message.notice, \"Ignoring labels\")\n| sort @timestamp desc\n| limit 100" - ] - ] - } - } - }, - "runnersWebhookstartedrunners63776EDF": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "OrchestratorLogFB9610E7" - } - ], - "Name": "GitHub Runners/Webhook started runners", - "QueryString": { - "Fn::Join": [ - "", - [ - "fields @timestamp, message.sfnInput.jobUrl, message.sfnInput.labels, message.sfnInput.provider\n| filter strcontains(@logStream, \"", - { - "Ref": "runnersWebhookHandlerwebhookhandler22779A81" - }, - "\")\n| filter message.sfnInput.jobUrl like /http.*/\n| sort @timestamp desc\n| limit 100" - ] - ] - } - } - }, - "runnersWebhookredeliveriesD3F14437": { - "Type": "AWS::Logs::QueryDefinition", - "Properties": { - "LogGroupNames": [ - { - "Ref": "OrchestratorLogFB9610E7" - } - ], - "Name": "GitHub Runners/Webhook redeliveries", - "QueryString": "fields @timestamp, message.notice, message.deliveryId, message.guid\n| filter isPresent(message.deliveryId)\n| sort @timestamp desc\n| limit 100" - } - }, - "OrchestratorLogFB9610E7": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SetupLog8A8B0E5C": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 30 - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Parameters": { - "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id" - }, - "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2arm64recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended/image_id" - }, - "SsmParameterValueawsserviceamiwindowslatestWindowsServer2019EnglishFullECSOptimizedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized/image_id" - }, - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Outputs": { - "runnersstatuscommand4A30F0F5": { - "Value": { - "Fn::Join": [ - "", - [ - "aws --region ", - { - "Ref": "AWS::Region" - }, - " lambda invoke --function-name ", - { - "Ref": "runnersstatus1A5771C0" - }, - " status.json" - ] - ] - } - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/test/versioner.test.ts b/test/versioner.test.ts deleted file mode 100644 index d2e9be0d..00000000 --- a/test/versioner.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { increaseVersion } from '../src/image-builders/aws-image-builder/versioner.lambda'; - -test('No versions found', () => { - expect( - increaseVersion([]), - ).toBe('1.0.1'); -}); - -test('Simple version increments', () => { - expect( - increaseVersion(['1.0.0']), - ).toBe('1.0.1'); - - expect( - increaseVersion(['1.0.1']), - ).toBe('1.0.2'); - - expect( - increaseVersion(['0.0.1']), - ).toBe('0.0.2'); - - expect( - increaseVersion(['135.55.68']), - ).toBe('135.55.69'); -}); - -test('Multi version increments', () => { - expect( - increaseVersion(['1.0.0', '1.0.1', '1.0.2']), - ).toBe('1.0.3'); - - expect( - increaseVersion(['1.0.2', '1.0.1', '1.0.0']), - ).toBe('1.0.3'); -}); diff --git a/yarn.lock b/yarn.lock index 9ebf7665..460ab536 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2929,11 +2929,6 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== -"@types/semver@^7.7.1": - version "7.7.1" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.7.1.tgz#3ce3af1a5524ef327d2da9e4fd8b6d95c8d70528" - integrity sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA== - "@types/stack-utils@^2.0.0": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" From 3ea5925fb9c3c72598594c3342a38c8c193d7bbd Mon Sep 17 00:00:00 2001 From: CloudSnorkel Bot <106900599+CloudSnorkelBot@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:58:34 -0500 Subject: [PATCH 10/19] chore(deps): update snapshot (#811) --- .../github-runners-test.assets.json | 244 + .../github-runners-test.template.json | 19180 ++++++++++++++++ 2 files changed, 19424 insertions(+) create mode 100644 test/default.integ.snapshot/github-runners-test.assets.json create mode 100644 test/default.integ.snapshot/github-runners-test.template.json diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json new file mode 100644 index 00000000..bf395328 --- /dev/null +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -0,0 +1,244 @@ +{ + "version": "48.0.0", + "files": { + "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68": { + "displayName": "CodeBuild Image Builder/Component 7 Custom-Undefined Asset 0", + "source": { + "path": "asset.64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-ddf90974": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0": { + "displayName": "build-image-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-022085c0": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a": { + "displayName": "aws-image-builder-delete-resources-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-d6a52ecd": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c": { + "displayName": "AMI Root Device Reader-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-d9353ac7": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9": { + "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 0", + "source": { + "path": "asset.2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-07fa966c": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18": { + "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 1", + "source": { + "path": "asset.914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-652b9b07": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625": { + "displayName": "AWS679f53fac002430cb0da5b7982bd2287/Code", + "source": { + "path": "asset.bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-d28f70a5": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea": { + "displayName": "update-lambda-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-01742b58": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2": { + "displayName": "runners/token-retriever/Code", + "source": { + "path": "asset.2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-e26bf12f": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb": { + "displayName": "runners/delete-runner/Code", + "source": { + "path": "asset.27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-f69630e5": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364": { + "displayName": "runners/Idle Reaper/Code", + "source": { + "path": "asset.27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-4a8838bc": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56": { + "displayName": "runners/Webhook Handler/webhook-handler/Code", + "source": { + "path": "asset.12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-3229b282": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18": { + "displayName": "runners/Webhook Redelivery/Lambda/Code", + "source": { + "path": "asset.43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-4bd461a4": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5": { + "displayName": "runners/setup/Code", + "source": { + "path": "asset.77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-34f23b64": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9": { + "displayName": "runners/status/Code", + "source": { + "path": "asset.b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-b1fd60d6": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122": { + "displayName": "runners/Image Builder Builds Filter/Code", + "source": { + "path": "asset.f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-017eb7bb": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "baa8fec0d53edb3c21e84e2370b7fd8fceae946fdb4287b5a4bf72a274337ee8": { + "displayName": "github-runners-test Template", + "source": { + "path": "github-runners-test.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-2bdeb9d0": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "baa8fec0d53edb3c21e84e2370b7fd8fceae946fdb4287b5a4bf72a274337ee8.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json new file mode 100644 index 00000000..915bf522 --- /dev/null +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -0,0 +1,19180 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc" + } + ] + } + }, + "VpcPublicSubnet1Subnet5C2D37C4": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTable6C95E38E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTableAssociation97140677": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet2Subnet691E08A3": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTable94F7E489": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTableAssociationDD5762D8": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "VpcPublicSubnet2DefaultRoute97F91067": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcIGWD7BA715C": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc" + } + ] + } + }, + "VpcVPCGWBF912B6E": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "cluster611F8AFF": { + "Type": "AWS::ECS::Cluster" + }, + "clusterA4C38409": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + "FARGATE", + "FARGATE_SPOT" + ], + "Cluster": { + "Ref": "cluster611F8AFF" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "FargatebuilderRoleDA300BCD": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderRoleDefaultPolicyE56CF8DA": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderLogs2F794091", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderCodeBuild4F182743" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderCodeBuild4F182743" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "FargatebuilderCodeBuild4F182743" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderRoleDefaultPolicyE56CF8DA", + "Roles": [ + { + "Ref": "FargatebuilderRoleDA300BCD" + } + ] + } + }, + "FargatebuilderRepository8F7BA13C": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderLogs2F794091": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderCodeBuild4F182743": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Fargate builder (Ubuntu Linux/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "FargatebuilderLogs2F794091" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "FargatebuilderRoleDA300BCD", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset6-Custom-Undefined-0\",\n \"cat > component6-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Custom-Undefined.sh\",\n \"cat > component7-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Custom-Undefined-0 FUNDING.yml\\nCOPY component6-Custom-Undefined.sh /tmp\\nRUN /tmp/component6-Custom-Undefined.sh\\n\\nCOPY component7-EnvironmentVariables.sh /tmp\\nRUN /tmp/component7-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "FargatebuilderCodeBuildEventsRole92F2259E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD", + "Roles": [ + { + "Ref": "FargatebuilderCodeBuildEventsRole92F2259E" + } + ] + } + }, + "FargatebuilderCodeBuildBuildFailed1D2D3785": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "githubrunnerstestFargatebuilderCodeBuildBuildFailed8BDBCD42", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "FargatebuilderCRPolicy22FB4B05": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderCRPolicy22FB4B05", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "FargatebuilderBuildWaitc91bc68c5e438864A5": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005" + }, + "Timeout": "3600" + } + }, + "FargatebuilderBuilder0834CD0B": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + "ProjectName": { + "Ref": "FargatebuilderCodeBuild4F182743" + }, + "WaitHandle": { + "Ref": "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "FargatebuilderCodeBuildBuildFailed1D2D3785", + "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD", + "FargatebuilderCodeBuildEventsRole92F2259E", + "FargatebuilderCodeBuild4F182743", + "FargatebuilderCRPolicy22FB4B05", + "FargatebuilderRoleDefaultPolicyE56CF8DA", + "FargatebuilderRoleDA300BCD" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderBuildSchedule0B083A73": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "FargatebuilderRepository8F7BA13C" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuildEventsRole92F2259E", + "Arn" + ] + } + } + ] + } + }, + "FargatebuilderarmRoleB6343E8F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderarmRoleDefaultPolicy89F1BA94": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmLogs63D60F4D", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderarmRoleDefaultPolicy89F1BA94", + "Roles": [ + { + "Ref": "FargatebuilderarmRoleB6343E8F" + } + ] + } + }, + "FargatebuilderarmRepository77DCC132": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderarmLogs63D60F4D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderarmCodeBuild0D30679A": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Fargate builder arm (Ubuntu Linux/ARM64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "FargatebuilderarmLogs63D60F4D" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "FargatebuilderarmRoleB6343E8F", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset6-Custom-Undefined-0\",\n \"cat > component6-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Custom-Undefined.sh\",\n \"cat > component7-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Custom-Undefined-0 FUNDING.yml\\nCOPY component6-Custom-Undefined.sh /tmp\\nRUN /tmp/component6-Custom-Undefined.sh\\n\\nCOPY component7-EnvironmentVariables.sh /tmp\\nRUN /tmp/component7-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "FargatebuilderarmCodeBuildEventsRole20E8CE66": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB", + "Roles": [ + { + "Ref": "FargatebuilderarmCodeBuildEventsRole20E8CE66" + } + ] + } + }, + "FargatebuilderarmCodeBuildBuildFailed264992E6": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "githubrunnerstestFargatebuilderarmCodeBuildBuildFailed60EDAF2B", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "FargatebuilderarmCRPolicyD241BB66": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderarmCRPolicyD241BB66", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "FargatebuilderarmBuildWait6310e519d75E2EEA1B": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1" + }, + "Timeout": "3600" + } + }, + "FargatebuilderarmBuilder48D1AF5A": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + "ProjectName": { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + }, + "WaitHandle": { + "Ref": "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "FargatebuilderarmCodeBuildBuildFailed264992E6", + "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB", + "FargatebuilderarmCodeBuildEventsRole20E8CE66", + "FargatebuilderarmCodeBuild0D30679A", + "FargatebuilderarmCRPolicyD241BB66", + "FargatebuilderarmRoleDefaultPolicy89F1BA94", + "FargatebuilderarmRoleB6343E8F" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderarmBuildSchedule854B2895": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "FargatebuilderarmRepository77DCC132" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuildEventsRole20E8CE66", + "Arn" + ] + } + } + ] + } + }, + "LambdaImageBuilderx64RoleEE3EE1CB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Logs1C003BB4", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4", + "Roles": [ + { + "Ref": "LambdaImageBuilderx64RoleEE3EE1CB" + } + ] + } + }, + "LambdaImageBuilderx64Repository57F632F1": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + }, + "RepositoryPolicyText": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderx64RepositoryPushrule1C711F47": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": "Update GitHub Actions runner Lambda on ECR image push", + "EventPattern": { + "detail-type": [ + "ECR Image Action" + ], + "detail": { + "action-type": [ + "PUSH" + ], + "repository-name": [ + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + } + ], + "image-tag": [ + "latest" + ], + "result": [ + "SUCCESS" + ] + }, + "source": [ + "aws.ecr" + ] + }, + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Id": "Target0", + "Input": { + "Fn::Join": [ + "", + [ + "{\"lambdaName\":\"", + { + "Ref": "LambdaFunction9233991D" + }, + "\",\"repositoryUri\":\"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\"repositoryTag\":\"latest\"}" + ] + ] + } + } + ] + } + }, + "LambdaImageBuilderx64RepositoryPushruleAllowEventRulegithubrunnerstestupdatelambdadcc036c8876b451ea2c1552f9e06e9e17433A98EAF8930B2": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64RepositoryPushrule1C711F47", + "Arn" + ] + } + } + }, + "LambdaImageBuilderx64Logs1C003BB4": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderx64CodeBuild67DE14C8": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Lambda Image Builder x64 (Amazon Linux 2023/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "LambdaImageBuilderx64Logs1C003BB4" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64RoleEE3EE1CB", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf upgrade -y\\ndnf install -y jq tar gzip bzip2 which binutils zip unzip sudo shadow-utils findutils\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n/usr/sbin/groupadd runner\\n/usr/sbin/useradd --system --shell /usr/sbin/nologin --home-dir /home/runner --gid runner runner\\nmkdir -p /home/runner\\nchown runner /home/runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSSL https://cli.github.com/packages/rpm/gh-cli.repo -o /etc/yum.repos.d/gh-cli.repo\\ndnf install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\ndnf install -y openssl-libs krb5-libs zlib libicu-67.1\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh" + }, + " asset6-Lambda-Entrypoint-0\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh" + }, + " asset6-Lambda-Entrypoint-1\",\n \"cat > component6-Lambda-Entrypoint.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Lambda-Entrypoint.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/amazonlinux/amazonlinux:2023\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Lambda-Entrypoint-0 /bootstrap.sh\\nCOPY asset6-Lambda-Entrypoint-1 /runner.sh\\nCOPY component6-Lambda-Entrypoint.sh /tmp\\nRUN /tmp/component6-Lambda-Entrypoint.sh\\nLABEL DISABLE_SOCI=1\\nENTRYPOINT [\\\"bash\\\", \\\"/bootstrap.sh\\\"]\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997", + "Roles": [ + { + "Ref": "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21" + } + ] + } + }, + "LambdaImageBuilderx64CodeBuildBuildFailed7E839416": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "thubrunnerstestLambdaImageBuilderx64CodeBuildBuildFailedE326D971", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "LambdaImageBuilderx64CRPolicy6DBE0D1F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderx64CRPolicy6DBE0D1F", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "LambdaImageBuilderx64BuildWaitHandle0ef960775aB1E8095D": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "LambdaImageBuilderx64BuildWait0ef960775aDC1D350E": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "LambdaImageBuilderx64BuildWaitHandle0ef960775aB1E8095D" + }, + "Timeout": "3600" + } + }, + "LambdaImageBuilderx64Builder42F384AF": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "ProjectName": { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + }, + "WaitHandle": { + "Ref": "LambdaImageBuilderx64BuildWaitHandle0ef960775aB1E8095D" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "LambdaImageBuilderx64CodeBuildBuildFailed7E839416", + "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997", + "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21", + "LambdaImageBuilderx64CodeBuild67DE14C8", + "LambdaImageBuilderx64CRPolicy6DBE0D1F", + "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4", + "LambdaImageBuilderx64RoleEE3EE1CB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderx64BuildScheduleFA3DBF6A": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21", + "Arn" + ] + } + } + ] + } + }, + "WindowsImageBuilderSG5ACD1618": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Windows Image Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "WindowsImageBuilderRole717C46A6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilderECRContainerBuilds" + ] + ] + } + ] + } + }, + "WindowsImageBuilderRoleDefaultPolicy8BEB7BE3": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "WindowsImageBuilderRoleDefaultPolicy8BEB7BE3", + "Roles": [ + { + "Ref": "WindowsImageBuilderRole717C46A6" + } + ] + } + }, + "WindowsImageBuilderRepositoryA4CBB6D8": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsImageBuilderDockerDistributionE6B7F2F2": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "ContainerDistributionConfiguration": { + "ContainerTags": [ + "latest" + ], + "TargetRepository": { + "RepositoryName": { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + "Service": "ECR" + } + }, + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-windowsimagebuilder-dockerdistribution-8c41c0cd", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-windowsimagebuilder-component0requiredpackages-component-963beb47", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 1 RunnerUser", + "Name": "github-runners-test-windowsimagebuilder-component1runneruser-component-c4a9efb2", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent2GitComponent92ACFEF5": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", + "Description": "Component 2 Git", + "Name": "github-runners-test-windowsimagebuilder-component2git-component-f09bbd59", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent3GithubCliComponentF18685D5": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", + "Description": "Component 3 GithubCli", + "Name": "github-runners-test-windowsimagebuilder-component3githubcli-component-a0ec305e", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent4AwsCliComponent6654838D": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", + "Description": "Component 4 AwsCli", + "Name": "github-runners-test-windowsimagebuilder-component4awscli-component-c1cc638a", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", + "Description": "Component 5 GithubRunner", + "Name": "github-runners-test-windowsimagebuilder-component5githubrunner-component-c7c81d8e", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 6 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 6 Custom-Undefined", + "Name": "github-runners-test-windowsimagebuilder-component6custom-undefined-component-955efea2", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", + "Description": "Component 7 EnvironmentVariables", + "Name": "github-runners-test-windowsimagebuilder-component7environmentvariables-component-f73418d2", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderContainerRecipeB2A421D7": { + "Type": "AWS::ImageBuilder::ContainerRecipe", + "Properties": { + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent2GitComponent92ACFEF5", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent3GithubCliComponentF18685D5", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent4AwsCliComponent6654838D", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09", + "Arn" + ] + } + } + ], + "ContainerType": "DOCKER", + "DockerfileTemplateData": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\nENV RUNNER_VERSION=latest\n", + "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", + "ParentImage": "mcr.microsoft.com/windows/servercore:ltsc2019-amd64", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "TargetRepository": { + "RepositoryName": { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + "Service": "ECR" + }, + "Version": "1.0.x" + } + }, + "WindowsImageBuilderDockerLogE660E23E": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/imagebuilder/github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "WindowsImageBuilderRole717C46A6" + } + ] + } + }, + "WindowsImageBuilderInfrastructure14D24F2C": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "WindowsImageBuilderInfrastructureInstanceProfile253C95CE" + }, + "InstanceTypes": [ + "m6i.large" + ], + "Name": "github-runners-test-windowsimagebuilder-infrastructure-17f3ac1c", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "WindowsImageBuilderSG5ACD1618", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "WindowsImageBuilderDockerImage8672CA3E": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "ContainerRecipeArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeB2A421D7", + "Arn" + ] + }, + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderDockerDistributionE6B7F2F2", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderInfrastructure14D24F2C", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsImageBuilderDockerLogE660E23E", + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", + "WindowsImageBuilderInfrastructure14D24F2C" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "WindowsImageBuilderContainerCleaner9CB998CD": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/github-runners-test-windowsimagebuilder-containerrecipe-c577a80b/", + { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeB2A421D7", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsImageBuilderLifecyclePolicyDockerRole13C6E553": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchGetImage", + "ecr:BatchDeleteImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ecr" + } + ] + } + }, + "WindowsImageBuilderLifecyclePolicyDockerB9CE4B0A": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner Docker images for github-runners-test/Windows Image Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "WindowsImageBuilderLifecyclePolicyDockerRole13C6E553", + "Arn" + ] + }, + "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Containers": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", + "SemanticVersion": { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeB2A421D7", + "Version" + ] + } + } + ] + }, + "ResourceType": "CONTAINER_IMAGE" + } + }, + "WindowsImageBuilderDockerPipeline3613721A": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "ContainerRecipeArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeB2A421D7", + "Arn" + ] + }, + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderDockerDistributionE6B7F2F2", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderInfrastructure14D24F2C", + "Arn" + ] + }, + "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsImageBuilderDockerLogE660E23E", + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", + "WindowsImageBuilderInfrastructure14D24F2C" + ] + }, + "AMILinuxBuilderSGEDC86329": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/AMI Linux Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "AMILinuxBuilderRole0C42378A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilder" + ] + ] + } + ] + } + }, + "AMILinuxBuilderRoleDefaultPolicy69ED051F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AMILinuxBuilderRoleDefaultPolicy69ED051F", + "Roles": [ + { + "Ref": "AMILinuxBuilderRole0C42378A" + } + ] + } + }, + "AMILinuxBuilderLaunchtemplateA29452C4": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "MetadataOptions": { + "HttpTokens": "required" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux Builder/Launch template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux Builder/Launch template" + } + ] + } + ] + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux Builder/Launch template" + } + ] + } + ] + } + }, + "AMILinuxBuilderAMIDistribution215F3A5C": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "AmiDistributionConfiguration": { + "AmiTags": { + "Name": "AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test", + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" + } + }, + "LaunchTemplateConfigurations": [ + { + "LaunchTemplateId": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "SetDefaultVersion": true + } + ], + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-amilinuxbuilder-amidistribution-f27cc043", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-amilinuxbuilder-component0requiredpackages-component-ccd42ff5", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-amilinuxbuilder-component1cloudwatchagent-component-5545ba1f", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", + "Description": "Component 2 RunnerUser", + "Name": "github-runners-test-amilinuxbuilder-component2runneruser-component-b84742f0", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent3GitComponent9011E3AB": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", + "Description": "Component 3 Git", + "Name": "github-runners-test-amilinuxbuilder-component3git-component-5532a5f4", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent4GithubCliComponent602EE471": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", + "Description": "Component 4 GithubCli", + "Name": "github-runners-test-amilinuxbuilder-component4githubcli-component-7925b347", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent5AwsCliComponent72637C19": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", + "Description": "Component 5 AwsCli", + "Name": "github-runners-test-amilinuxbuilder-component5awscli-component-ea3524b1", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent6DockerComponent9E523A42": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", + "Description": "Component 6 Docker", + "Name": "github-runners-test-amilinuxbuilder-component6docker-component-c57d02ec", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", + "Description": "Component 7 GithubRunner", + "Name": "github-runners-test-amilinuxbuilder-component7githubrunner-component-dd50b576", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 8 Custom-Undefined", + "Name": "github-runners-test-amilinuxbuilder-component8custom-undefined-component-35d68e99", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-amilinuxbuilder-component9environmentvariables-component-c760ab8d", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/ubuntu-server-22-lts-x86/x.x.x" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxBuilderAmiRecipe7C7ED6C7": { + "Type": "AWS::ImageBuilder::ImageRecipe", + "Properties": { + "BlockDeviceMappings": [ + { + "DeviceName": { + "Ref": "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374" + }, + "Ebs": { + "DeleteOnTermination": true, + "VolumeSize": 33 + } + } + ], + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", + "Arn" + ] + } + } + ], + "Name": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", + "ParentImage": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/ubuntu-server-22-lts-x86/x.x.x" + ] + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "Version": "1.0.x", + "WorkingDirectory": "/home/runner" + } + }, + "AMILinuxBuilderAmiLog0DB16E38": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/imagebuilder/github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxBuilderInfrastructureInstanceProfileB423D304": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "AMILinuxBuilderRole0C42378A" + } + ] + } + }, + "AMILinuxBuilderInfrastructure069F0561": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "AMILinuxBuilderInfrastructureInstanceProfileB423D304" + }, + "InstanceTypes": [ + "m6i.large" + ], + "Name": "github-runners-test-amilinuxbuilder-infrastructure-52c63716", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "AMILinuxBuilderSGEDC86329", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "AMILinuxBuilderAMIImage93D83DE5": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipe7C7ED6C7", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderInfrastructure069F0561", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "AMILinuxBuilderAMIPipelineEC5051DF": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipe7C7ED6C7", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderInfrastructure069F0561", + "Arn" + ] + }, + "Name": "github-runners-test-AMILinuxBuilder-67243E6D", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561" + ] + }, + "AMILinuxBuilderImageCleanerF1745EF6": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/github-runners-test-amilinuxbuilder-amirecipe-2b5c5a8b/", + { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipe7C7ED6C7", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeImages", + "ec2:DescribeImageAttribute" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", + "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" + } + }, + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ami" + } + ] + } + }, + "AMILinuxBuilderLifecyclePolicyAMIFB556CB2": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "Arn" + ] + }, + "Name": "github-runners-test-AMILinuxBuilder-67243E6D", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Amis": true, + "Snapshots": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", + "SemanticVersion": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipe7C7ED6C7", + "Version" + ] + } + } + ] + }, + "ResourceType": "AMI_IMAGE" + } + }, + "CodeBuildImageBuilderRoleF1F34984": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderRoleDefaultPolicy6982821E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderLogsE4CADFCC", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderRoleDefaultPolicy6982821E", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderRoleF1F34984" + } + ] + } + }, + "CodeBuildImageBuilderRepository9DE3B6F0": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderLogsE4CADFCC": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderCodeBuild38ECAA44": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Image Builder (Ubuntu Linux/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildImageBuilderLogsE4CADFCC" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRoleF1F34984", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "CodeBuildImageBuilderCodeBuildEventsRole4277A55E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderCodeBuildEventsRole4277A55E" + } + ] + } + }, + "CodeBuildImageBuilderCodeBuildBuildFailed9B205D70": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "thubrunnerstestCodeBuildImageBuilderCodeBuildBuildFailed73942339", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "CodeBuildImageBuilderCRPolicyAFC63F28": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderCRPolicyAFC63F28", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "CodeBuildImageBuilderBuildWait6c559791c302D896CB": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C" + }, + "Timeout": "3600" + } + }, + "CodeBuildImageBuilderB8638EC8": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + "ProjectName": { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + }, + "WaitHandle": { + "Ref": "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "CodeBuildImageBuilderCodeBuildBuildFailed9B205D70", + "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D", + "CodeBuildImageBuilderCodeBuildEventsRole4277A55E", + "CodeBuildImageBuilderCodeBuild38ECAA44", + "CodeBuildImageBuilderCRPolicyAFC63F28", + "CodeBuildImageBuilderRoleDefaultPolicy6982821E", + "CodeBuildImageBuilderRoleF1F34984" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderBuildSchedule66D9D18A": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuildEventsRole4277A55E", + "Arn" + ] + } + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13", + "Roles": [ + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Ubuntu 2404 Image Builder (Ubuntu Linux 24.04/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:24.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8", + "Roles": [ + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed90989099": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "stestCodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed22054A19", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "CodeBuildUbuntu2404ImageBuilderBuildWait869992dae157E3A527": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5" + }, + "Timeout": "3600" + } + }, + "CodeBuildUbuntu2404ImageBuilder2CDBC05E": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + "ProjectName": { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + }, + "WaitHandle": { + "Ref": "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "CodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed90989099", + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8", + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981", + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB", + "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13", + "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404ImageBuilderBuildScheduleEDD400B0": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981", + "Arn" + ] + } + } + ] + } + }, + "CodeBuildImageBuilderarmRole96BC26FB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmLogs5A60CB81", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderarmRole96BC26FB" + } + ] + } + }, + "CodeBuildImageBuilderarmRepositoryE967421B": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderarmLogs5A60CB81": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderarmCodeBuildBFF1CF57": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Image Builder arm (Ubuntu Linux/ARM64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRole96BC26FB", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89" + } + ] + } + }, + "CodeBuildImageBuilderarmCodeBuildBuildFailed7605ECB2": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "brunnerstestCodeBuildImageBuilderarmCodeBuildBuildFailedF9370687", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "CodeBuildImageBuilderarmCRPolicy75CB8D91": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderarmCRPolicy75CB8D91", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "CodeBuildImageBuilderarmBuildWaitf181c92a802A4BA349": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303" + }, + "Timeout": "3600" + } + }, + "CodeBuildImageBuilderarmBuilder755EB37D": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + "ProjectName": { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + }, + "WaitHandle": { + "Ref": "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "CodeBuildImageBuilderarmCodeBuildBuildFailed7605ECB2", + "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D", + "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89", + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "CodeBuildImageBuilderarmCRPolicy75CB8D91", + "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE", + "CodeBuildImageBuilderarmRole96BC26FB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderarmBuildSchedule909D75E9": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89", + "Arn" + ] + } + } + ] + } + }, + "LambdaImageBuilderzRole6F1A63E5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzLogsC9FB42C8", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7", + "Roles": [ + { + "Ref": "LambdaImageBuilderzRole6F1A63E5" + } + ] + } + }, + "LambdaImageBuilderzRepository7C7AD146": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + }, + "RepositoryPolicyText": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderzRepositoryPushruleA1F1B44F": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": "Update GitHub Actions runner Lambda on ECR image push", + "EventPattern": { + "detail-type": [ + "ECR Image Action" + ], + "detail": { + "action-type": [ + "PUSH" + ], + "repository-name": [ + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + } + ], + "image-tag": [ + "latest" + ], + "result": [ + "SUCCESS" + ] + }, + "source": [ + "aws.ecr" + ] + }, + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Id": "Target0", + "Input": { + "Fn::Join": [ + "", + [ + "{\"lambdaName\":\"", + { + "Ref": "LambdaARMFunctionDD4B5FF7" + }, + "\",\"repositoryUri\":\"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\"repositoryTag\":\"latest\"}" + ] + ] + } + } + ] + } + }, + "LambdaImageBuilderzRepositoryPushruleAllowEventRulegithubrunnerstestupdatelambdadcc036c8876b451ea2c1552f9e06e9e17433A98E002B5DB7": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepositoryPushruleA1F1B44F", + "Arn" + ] + } + } + }, + "LambdaImageBuilderzLogsC9FB42C8": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderzCodeBuild73AB6718": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Lambda Image Builderz (Amazon Linux 2023/ARM64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "LambdaImageBuilderzLogsC9FB42C8" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRole6F1A63E5", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf upgrade -y\\ndnf install -y jq tar gzip bzip2 which binutils zip unzip sudo shadow-utils findutils\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n/usr/sbin/groupadd runner\\n/usr/sbin/useradd --system --shell /usr/sbin/nologin --home-dir /home/runner --gid runner runner\\nmkdir -p /home/runner\\nchown runner /home/runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSSL https://cli.github.com/packages/rpm/gh-cli.repo -o /etc/yum.repos.d/gh-cli.repo\\ndnf install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\ndnf install -y openssl-libs krb5-libs zlib libicu-67.1\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh" + }, + " asset6-Lambda-Entrypoint-0\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/914d4fe73199c3182a0fa42b5c35cbfc70e883a96d7cc0abd00b8d9d744c7a18.sh" + }, + " asset6-Lambda-Entrypoint-1\",\n \"cat > component6-Lambda-Entrypoint.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Lambda-Entrypoint.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/amazonlinux/amazonlinux:2023\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Lambda-Entrypoint-0 /bootstrap.sh\\nCOPY asset6-Lambda-Entrypoint-1 /runner.sh\\nCOPY component6-Lambda-Entrypoint.sh /tmp\\nRUN /tmp/component6-Lambda-Entrypoint.sh\\nLABEL DISABLE_SOCI=1\\nENTRYPOINT [\\\"bash\\\", \\\"/bootstrap.sh\\\"]\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "LambdaImageBuilderzCodeBuildEventsRoleE9E50664": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23", + "Roles": [ + { + "Ref": "LambdaImageBuilderzCodeBuildEventsRoleE9E50664" + } + ] + } + }, + "LambdaImageBuilderzCodeBuildBuildFailedFBCC1CE8": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "githubrunnerstestLambdaImageBuilderzCodeBuildBuildFailedD221038C", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "LambdaImageBuilderzCRPolicyC9B09855": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderzCRPolicyC9B09855", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "LambdaImageBuilderzBuildWaitHandle781886e2d8A063F430": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "LambdaImageBuilderzBuildWait781886e2d89352301D": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "LambdaImageBuilderzBuildWaitHandle781886e2d8A063F430" + }, + "Timeout": "3600" + } + }, + "LambdaImageBuilderzBuilder235DD147": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "ProjectName": { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + }, + "WaitHandle": { + "Ref": "LambdaImageBuilderzBuildWaitHandle781886e2d8A063F430" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "LambdaImageBuilderzCodeBuildBuildFailedFBCC1CE8", + "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23", + "LambdaImageBuilderzCodeBuildEventsRoleE9E50664", + "LambdaImageBuilderzCodeBuild73AB6718", + "LambdaImageBuilderzCRPolicyC9B09855", + "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7", + "LambdaImageBuilderzRole6F1A63E5" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderzBuildSchedule81F79A6A": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuildEventsRoleE9E50664", + "Arn" + ] + } + } + ] + } + }, + "AMILinuxarm64BuilderSG94315968": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/AMI Linux arm64 Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "AMILinuxarm64BuilderRole40D54E29": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilder" + ] + ] + } + ] + } + }, + "AMILinuxarm64BuilderRoleDefaultPolicy113305EE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", + "Roles": [ + { + "Ref": "AMILinuxarm64BuilderRole40D54E29" + } + ] + } + }, + "AMILinuxarm64BuilderLaunchtemplate8F5EFF44": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "MetadataOptions": { + "HttpTokens": "required" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" + } + ] + } + ] + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" + } + ] + } + ] + } + }, + "AMILinuxarm64BuilderAMIDistributionE6989D01": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "AmiDistributionConfiguration": { + "AmiTags": { + "Name": "AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test", + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" + } + }, + "LaunchTemplateConfigurations": [ + { + "LaunchTemplateId": { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "SetDefaultVersion": true + } + ], + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-amilinuxarm64builder-amidistribution-64ec726d", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-amilinuxarm64builder-component0requiredpackages-component-24f2e247", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-amilinuxarm64builder-component1cloudwatchagent-component-9127095a", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", + "Description": "Component 2 RunnerUser", + "Name": "github-runners-test-amilinuxarm64builder-component2runneruser-component-360117bd", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", + "Description": "Component 3 Git", + "Name": "github-runners-test-amilinuxarm64builder-component3git-component-c3215149", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", + "Description": "Component 4 GithubCli", + "Name": "github-runners-test-amilinuxarm64builder-component4githubcli-component-585d1ee4", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", + "Description": "Component 5 AwsCli", + "Name": "github-runners-test-amilinuxarm64builder-component5awscli-component-706b4769", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", + "Description": "Component 6 Docker", + "Name": "github-runners-test-amilinuxarm64builder-component6docker-component-4c582cde", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", + "Description": "Component 7 GithubRunner", + "Name": "github-runners-test-amilinuxarm64builder-component7githubrunner-component-bdc80137", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 8 Custom-Undefined", + "Name": "github-runners-test-amilinuxarm64builder-component8custom-undefined-component-e23d33b6", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-amilinuxarm64builder-component9environmentvariables-component-25ee7189", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderAmiRecipe6A6ED38F": { + "Type": "AWS::ImageBuilder::ImageRecipe", + "Properties": { + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", + "Arn" + ] + } + } + ], + "Name": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", + "ParentImage": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/ubuntu-server-22-lts-arm64/x.x.x" + ] + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "Version": "1.0.x", + "WorkingDirectory": "/home/runner" + } + }, + "AMILinuxarm64BuilderAmiLog84A9D94A": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/imagebuilder/github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "AMILinuxarm64BuilderRole40D54E29" + } + ] + } + }, + "AMILinuxarm64BuilderInfrastructureA97EB3DD": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7" + }, + "InstanceTypes": [ + "m6g.large" + ], + "Name": "github-runners-test-amilinuxarm64builder-infrastructure-4dd30f96", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderSG94315968", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "AMILinuxarm64BuilderAMIImage40078F9E": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAMIDistributionE6989D01", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderInfrastructureA97EB3DD", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxarm64BuilderAmiLog84A9D94A", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "AMILinuxarm64BuilderAMIPipeline9CC1354C": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAMIDistributionE6989D01", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderInfrastructureA97EB3DD", + "Arn" + ] + }, + "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxarm64BuilderAmiLog84A9D94A", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD" + ] + }, + "AMILinuxarm64BuilderImageCleanerA5DDFE7A": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/github-runners-test-amilinuxarm64builder-amirecipe-9167b5ef/", + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeImages", + "ec2:DescribeImageAttribute" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", + "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" + } + }, + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ami" + } + ] + } + }, + "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux arm64 Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", + "Arn" + ] + }, + "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Amis": true, + "Snapshots": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", + "SemanticVersion": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "Version" + ] + } + } + ] + }, + "ResourceType": "AMI_IMAGE" + } + }, + "WindowsEC2BuilderSGE3F67842": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Windows EC2 Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "WindowsEC2BuilderRole1BA7D3E7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilder" + ] + ] + } + ] + } + }, + "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", + "Roles": [ + { + "Ref": "WindowsEC2BuilderRole1BA7D3E7" + } + ] + } + }, + "WindowsEC2BuilderLaunchtemplate0A66E9C2": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "MetadataOptions": { + "HttpTokens": "required" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Windows EC2 Builder/Launch template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Windows EC2 Builder/Launch template" + } + ] + } + ] + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Windows EC2 Builder/Launch template" + } + ] + } + ] + } + }, + "WindowsEC2BuilderAMIDistribution6B33DD89": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "AmiDistributionConfiguration": { + "AmiTags": { + "Name": "Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test", + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" + } + }, + "LaunchTemplateConfigurations": [ + { + "LaunchTemplateId": { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "SetDefaultVersion": true + } + ], + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-windowsec2builder-amidistribution-f20c96b4", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-windowsec2builder-component0requiredpackages-component-bee13031", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi\n /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-windowsec2builder-component1cloudwatchagent-component-64d3d72a", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 2 RunnerUser", + "Name": "github-runners-test-windowsec2builder-component2runneruser-component-91981b9f", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent3GitComponent4F86AE54": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", + "Description": "Component 3 Git", + "Name": "github-runners-test-windowsec2builder-component3git-component-cc6f418c", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", + "Description": "Component 4 GithubCli", + "Name": "github-runners-test-windowsec2builder-component4githubcli-component-860aefc0", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", + "Description": "Component 5 AwsCli", + "Name": "github-runners-test-windowsec2builder-component5awscli-component-c6a315bd", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $BaseUrl = \"https://download.docker.com/win/static/stable/x86_64/\"\n - $html = Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl\n - $files = $html.Links.href | Where-Object { $_ -match\n '^docker-[0-9\\.]+\\.zip$' }\n - if (-not $files) { Write-Error \"No docker-*.zip files found.\" ;\n exit 1 }\n - $latest = $files | Sort-Object { try { [Version]($_ -replace\n '^docker-|\\.zip$') } catch { [Version]\"0.0.0\" } } -Descending |\n Select-Object -First 1\n - Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl$latest -OutFile\n docker.zip\n - Expand-Archive docker.zip -DestinationPath \"$Env:ProgramFiles\"\n - del docker.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";$Env:ProgramFiles\\Docker\",\n [EnvironmentVariableTarget]::Machine)'\n - $env:PATH = $env:PATH + \";$Env:ProgramFiles\\Docker\"\n - dockerd --register-service\n - if ($LASTEXITCODE -ne 0) { throw \"Exit code is $LASTEXITCODE\" }\n - Enable-WindowsOptionalFeature -Online -FeatureName containers -All\n -NoRestart\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/docker/compose/releases/latest >\n $Env:TEMP\\latest-docker-compose\n - $LatestUrl = Get-Content $Env:TEMP\\latest-docker-compose\n - $LatestDockerCompose = ($LatestUrl -Split '/')[-1]\n - Invoke-WebRequest -UseBasicParsing\n -Uri \"https://github.com/docker/compose/releases/download/${LatestDockerCompose}/docker-compose-Windows-x86_64.exe\"\n -OutFile $Env:ProgramFiles\\Docker\\docker-compose.exe\n - New-Item -ItemType directory -Path\n \"$Env:ProgramFiles\\Docker\\cli-plugins\"\n - Copy-Item -Path \"$Env:ProgramFiles\\Docker\\docker-compose.exe\"\n -Destination\n \"$Env:ProgramFiles\\Docker\\cli-plugins\\docker-compose.exe\"\n - name: Reboot\n action: Reboot\n inputs: {}\n", + "Description": "Component 6 Docker", + "Name": "github-runners-test-windowsec2builder-component6docker-component-69981091", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", + "Description": "Component 7 GithubRunner", + "Name": "github-runners-test-windowsec2builder-component7githubrunner-component-a31c580e", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 8 Custom-Undefined", + "Name": "github-runners-test-windowsec2builder-component8custom-undefined-component-c961cd3a", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-windowsec2builder-component9environmentvariables-component-9fb8d548", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderAmiRecipe41A137FF": { + "Type": "AWS::ImageBuilder::ImageRecipe", + "Properties": { + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent3GitComponent4F86AE54", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", + "Arn" + ] + } + } + ], + "Name": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", + "ParentImage": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/windows-server-2022-english-full-base-x86/x.x.x" + ] + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "Version": "1.0.x", + "WorkingDirectory": "C:/" + } + }, + "WindowsEC2BuilderAmiLog126E54B2": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/imagebuilder/github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "WindowsEC2BuilderRole1BA7D3E7" + } + ] + } + }, + "WindowsEC2BuilderInfrastructure4289B6D2": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA" + }, + "InstanceTypes": [ + "m6i.large" + ], + "Name": "github-runners-test-windowsec2builder-infrastructure-8e08e175", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "WindowsEC2BuilderSGE3F67842", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "WindowsEC2BuilderAMIImage9D812188": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAMIDistribution6B33DD89", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe41A137FF", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderInfrastructure4289B6D2", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsEC2BuilderAmiLog126E54B2", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "WindowsEC2BuilderAMIPipelineE3836949": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAMIDistribution6B33DD89", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe41A137FF", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderInfrastructure4289B6D2", + "Arn" + ] + }, + "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsEC2BuilderAmiLog126E54B2", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2" + ] + }, + "WindowsEC2BuilderImageCleanerEF537850": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/github-runners-test-windowsec2builder-amirecipe-beda5750/", + { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe41A137FF", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeImages", + "ec2:DescribeImageAttribute" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", + "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" + } + }, + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ami" + } + ] + } + }, + "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner AMIs for github-runners-test/Windows EC2 Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", + "Arn" + ] + }, + "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Amis": true, + "Snapshots": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", + "SemanticVersion": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe41A137FF", + "Version" + ] + } + } + ] + }, + "ResourceType": "AMI_IMAGE" + } + }, + "CodeBuildx64LogsA21ECD59": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildx64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildx64LogsLogsfilter915A4B6F": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildx64LogsA21ECD59" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildx64CodeBuildRole32E5C764": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildx64" + } + ] + } + }, + "CodeBuildx64CodeBuildRoleDefaultPolicy221DA642": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildx64LogsA21ECD59", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildx64CodeBuildRoleDefaultPolicy221DA642", + "Roles": [ + { + "Ref": "CodeBuildx64CodeBuildRole32E5C764" + } + ] + } + }, + "CodeBuildx64CodeBuild7DC01A1E": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild-x64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildx64LogsA21ECD59" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildx64CodeBuildRole32E5C764", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildx64" + } + ], + "TimeoutInMinutes": 60 + } + }, + "RunnerImageBuildHelpersLog13186633": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "imagebuilder:DeleteImage", + "Effect": "Deny", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip" + }, + "Description": "Custom resource handler that triggers CodeBuild to build runner images", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 180 + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + ] + }, + "CodeBuildUbuntu2404x64Logs27D26829": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildUbuntu2404x64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404x64LogsLogsfilter5AD0BDC2": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildUbuntu2404x64Logs27D26829" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildUbuntu2404x64" + } + ] + } + }, + "CodeBuildUbuntu2404x64CodeBuildRoleDefaultPolicy378D5938": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64Logs27D26829", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404x64CodeBuildRoleDefaultPolicy378D5938", + "Roles": [ + { + "Ref": "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92" + } + ] + } + }, + "CodeBuildUbuntu2404x64CodeBuild261399A8": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild-ubuntu-2404-x64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildUbuntu2404x64Logs27D26829" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildUbuntu2404x64" + } + ], + "TimeoutInMinutes": 60 + } + }, + "CodeBuildARMLogs7C7FC5A7": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildARM" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildARMLogsLogsfilter32B5122B": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildARMLogs7C7FC5A7" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildARMCodeBuildRole74DB4985": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildARM" + } + ] + } + }, + "CodeBuildARMCodeBuildRoleDefaultPolicyFC84CEAE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildARMLogs7C7FC5A7", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildARMCodeBuildRoleDefaultPolicyFC84CEAE", + "Roles": [ + { + "Ref": "CodeBuildARMCodeBuildRole74DB4985" + } + ] + } + }, + "CodeBuildARMCodeBuildC5F301F2": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild,linux,arm64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildARMLogs7C7FC5A7" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildARMCodeBuildRole74DB4985", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildARM" + } + ], + "TimeoutInMinutes": 60 + } + }, + "CodeBuildWindowsLogsF4DD93A5": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildWindows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildWindowsLogsLogsfilterC0A33A89": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildWindowsLogsF4DD93A5" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildWindowsCodeBuildRoleDC93697E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildWindows" + } + ] + } + }, + "CodeBuildWindowsCodeBuildRoleDefaultPolicyA932AC4D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildWindowsLogsF4DD93A5", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildWindowsCodeBuildRoleDefaultPolicyA932AC4D", + "Roles": [ + { + "Ref": "CodeBuildWindowsCodeBuildRoleDC93697E" + } + ] + } + }, + "CodeBuildWindowsCodeBuildC39F35C1": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild,windows,x64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_MEDIUM", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": false, + "Type": "WINDOWS_SERVER_2019_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildWindowsLogsF4DD93A5" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildWindowsCodeBuildRoleDC93697E", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"cd \\\\actions\",\n \"if (${Env:RUNNER_VERSION} -eq \\\"latest\\\") { $RunnerFlags = \\\"\\\" } else { $RunnerFlags = \\\"--disableupdate\\\" }\",\n \"./config.cmd --unattended --url \\\"${Env:REGISTRATION_URL}\\\" --token \\\"${Env:RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat %s)\\\" ${RunnerFlags} --name \\\"${Env:RUNNER_NAME}\\\" ${Env:RUNNER_GROUP}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cd \\\\actions\",\n \"./run.cmd\",\n \"$STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1\",\n \"if ($STATUS) { echo \\\"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\\\" }\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildWindows" + } + ], + "TimeoutInMinutes": 60 + } + }, + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "imagebuilder:ListImageBuildVersions", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "ec2:DescribeImages", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test" + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "ecr:BatchDeleteImage", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E", + "Roles": [ + { + "Ref": "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C" + } + ] + } + }, + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip" + }, + "Description": "Custom resource handler that deletes resources of old versions of EC2 Image Builder images", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 600 + }, + "DependsOn": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E", + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C" + ] + }, + "ECSsecuritygroup76605212": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECScluster20BC0B82": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECScluster9E223943": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSCapacityProviderABF1B146" + } + ], + "Cluster": { + "Ref": "ECScluster20BC0B82" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSAMIRootDevice35683156": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSLaunchTemplateRole3D54417B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECSLaunchTemplateRoleDefaultPolicyA6578409": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECScluster20BC0B82", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECScluster20BC0B82", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSLaunchTemplateRoleDefaultPolicyA6578409", + "Roles": [ + { + "Ref": "ECSLaunchTemplateRole3D54417B" + } + ] + } + }, + "ECSLaunchTemplateProfileC7A3F149": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSLaunchTemplateRole3D54417B" + } + ] + } + }, + "ECSLaunchTemplate3A132D2F": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "BlockDeviceMappings": [ + { + "DeviceName": { + "Ref": "ECSAMIRootDevice35683156" + }, + "Ebs": { + "DeleteOnTermination": true, + "Iops": 1500, + "Throughput": 150, + "VolumeSize": 40, + "VolumeType": "gp3" + } + } + ], + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSLaunchTemplateProfileC7A3F149", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id", + "InstanceMarketOptions": { + "MarketType": "spot", + "SpotOptions": { + "SpotInstanceType": "one-time" + } + }, + "InstanceType": "m6i.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSsecuritygroup76605212", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", + { + "Ref": "AWS::Region" + }, + " | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\ndocker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", + { + "Ref": "ECScluster20BC0B82" + }, + " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSLaunchTemplateRoleDefaultPolicyA6578409", + "ECSLaunchTemplateRole3D54417B" + ] + }, + "ECSAutoScalingGroupASG88763D9A": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSLaunchTemplate3A132D2F" + }, + "Version": { + "Fn::GetAtt": [ + "ECSLaunchTemplate3A132D2F", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSCapacityProviderABF1B146": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSAutoScalingGroupASG88763D9A" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECSlogs71446134": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSlogslogsfilterC744F425": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSlogs71446134" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECStaskTaskRoleFE831ECD": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECStaskTaskRoleDefaultPolicy46A3CB3A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECStaskTaskRoleDefaultPolicy46A3CB3A", + "Roles": [ + { + "Ref": "ECStaskTaskRoleFE831ECD" + } + ] + } + }, + "ECStask8F0DD550": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSlogs71446134" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": true, + "User": "runner" + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECStaskExecutionRole1A6D19A5", + "Arn" + ] + }, + "Family": "githubrunnerstestECStaskCE74CC84", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECStaskTaskRoleFE831ECD", + "Arn" + ] + } + } + }, + "ECStaskExecutionRole1A6D19A5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECStaskExecutionRoleDefaultPolicy564C1271": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSlogs71446134", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECStaskExecutionRoleDefaultPolicy564C1271", + "Roles": [ + { + "Ref": "ECStaskExecutionRole1A6D19A5" + } + ] + } + }, + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssm:GetParameter", + "ec2:DescribeImages", + "ec2:DescribeLaunchTemplateVersions", + "imagebuilder:GetImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6", + "Roles": [ + { + "Ref": "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36" + } + ] + } + }, + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip" + }, + "Description": "Custom resource handler that discovers the boot drive device name for a given AMI", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 60 + }, + "DependsOn": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6", + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36" + ] + }, + "ECSUbuntu2404securitygroupEE405C76": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS Ubuntu 2404/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECSUbuntu2404cluster21C05FA1": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404cluster0A1E8926": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSUbuntu2404CapacityProviderFAE73340" + } + ], + "Cluster": { + "Ref": "ECSUbuntu2404cluster21C05FA1" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSUbuntu2404AMIRootDevice9455BDF7": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSUbuntu2404LaunchTemplateRole77926CCA": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSUbuntu2404cluster21C05FA1", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECSUbuntu2404cluster21C05FA1", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94", + "Roles": [ + { + "Ref": "ECSUbuntu2404LaunchTemplateRole77926CCA" + } + ] + } + }, + "ECSUbuntu2404LaunchTemplateProfile7CCE115D": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSUbuntu2404LaunchTemplateRole77926CCA" + } + ] + } + }, + "ECSUbuntu2404LaunchTemplate360B1216": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "BlockDeviceMappings": [ + { + "DeviceName": { + "Ref": "ECSUbuntu2404AMIRootDevice9455BDF7" + }, + "Ebs": { + "DeleteOnTermination": true, + "Iops": 1500, + "Throughput": 150, + "VolumeSize": 40, + "VolumeType": "gp3" + } + } + ], + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSUbuntu2404LaunchTemplateProfile7CCE115D", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id", + "InstanceMarketOptions": { + "MarketType": "spot", + "SpotOptions": { + "SpotInstanceType": "one-time" + } + }, + "InstanceType": "m6i.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSUbuntu2404securitygroupEE405C76", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", + { + "Ref": "AWS::Region" + }, + " | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\ndocker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", + { + "Ref": "ECSUbuntu2404cluster21C05FA1" + }, + " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94", + "ECSUbuntu2404LaunchTemplateRole77926CCA" + ] + }, + "ECSUbuntu2404AutoScalingGroupASG40115790": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSUbuntu2404LaunchTemplate360B1216" + }, + "Version": { + "Fn::GetAtt": [ + "ECSUbuntu2404LaunchTemplate360B1216", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSUbuntu2404CapacityProviderFAE73340": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSUbuntu2404AutoScalingGroupASG40115790" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404logsFB15C25B": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSUbuntu2404logslogsfilterEAA30ADB": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSUbuntu2404logsFB15C25B" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECSUbuntu2404taskTaskRoleDF683F3B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404taskTaskRoleDefaultPolicyEA2F978C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSUbuntu2404taskTaskRoleDefaultPolicyEA2F978C", + "Roles": [ + { + "Ref": "ECSUbuntu2404taskTaskRoleDF683F3B" + } + ] + } + }, + "ECSUbuntu2404taskFC90B155": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSUbuntu2404logsFB15C25B" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": true, + "User": "runner" + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECSUbuntu2404taskExecutionRoleC5FEA726", + "Arn" + ] + }, + "Family": "githubrunnerstestECSUbuntu2404taskB7D564C7", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECSUbuntu2404taskTaskRoleDF683F3B", + "Arn" + ] + } + } + }, + "ECSUbuntu2404taskExecutionRoleC5FEA726": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404taskExecutionRoleDefaultPolicy580200B4": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSUbuntu2404logsFB15C25B", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSUbuntu2404taskExecutionRoleDefaultPolicy580200B4", + "Roles": [ + { + "Ref": "ECSUbuntu2404taskExecutionRoleC5FEA726" + } + ] + } + }, + "ECSARM64securitygroup281D94B2": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS ARM64/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECSARM64cluster4ECAA083": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64cluster43E75409": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSARM64CapacityProvider8627FEF9" + } + ], + "Cluster": { + "Ref": "ECSARM64cluster4ECAA083" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSARM64LaunchTemplateRole9D1574E2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSARM64cluster4ECAA083", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECSARM64cluster4ECAA083", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA", + "Roles": [ + { + "Ref": "ECSARM64LaunchTemplateRole9D1574E2" + } + ] + } + }, + "ECSARM64LaunchTemplateProfileBF272018": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSARM64LaunchTemplateRole9D1574E2" + } + ] + } + }, + "ECSARM64LaunchTemplateC44F6059": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSARM64LaunchTemplateProfileBF272018", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/arm64/recommended/image_id", + "InstanceType": "m6g.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSARM64securitygroup281D94B2", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS ARM64/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS ARM64/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", + { + "Ref": "AWS::Region" + }, + " | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\ndocker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", + { + "Ref": "ECSARM64cluster4ECAA083" + }, + " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS ARM64/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA", + "ECSARM64LaunchTemplateRole9D1574E2" + ] + }, + "ECSARM64AutoScalingGroupASGA19FC118": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSARM64LaunchTemplateC44F6059" + }, + "Version": { + "Fn::GetAtt": [ + "ECSARM64LaunchTemplateC44F6059", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS ARM64" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSARM64CapacityProvider8627FEF9": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSARM64AutoScalingGroupASGA19FC118" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64logs1A2F1E00": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSARM64logslogsfilter6914CFA1": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSARM64logs1A2F1E00" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECSARM64taskTaskRole23B1CB4E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64taskTaskRoleDefaultPolicyD893D7DC": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSARM64taskTaskRoleDefaultPolicyD893D7DC", + "Roles": [ + { + "Ref": "ECSARM64taskTaskRole23B1CB4E" + } + ] + } + }, + "ECSARM64task27EB8443": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSARM64logs1A2F1E00" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": true, + "User": "runner" + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECSARM64taskExecutionRoleBF2AE76F", + "Arn" + ] + }, + "Family": "githubrunnerstestECSARM64taskE94E43A3", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECSARM64taskTaskRole23B1CB4E", + "Arn" + ] + } + } + }, + "ECSARM64taskExecutionRoleBF2AE76F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64taskExecutionRoleDefaultPolicy17294239": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSARM64logs1A2F1E00", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSARM64taskExecutionRoleDefaultPolicy17294239", + "Roles": [ + { + "Ref": "ECSARM64taskExecutionRoleBF2AE76F" + } + ] + } + }, + "ECSWindowssecuritygroupB4EE54DA": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS Windows/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECSWindowscluster14061F74": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowscluster49B54894": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSWindowsCapacityProvider8F8896A5" + } + ], + "Cluster": { + "Ref": "ECSWindowscluster14061F74" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSWindowsLaunchTemplateRole610E9A88": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSWindowscluster14061F74", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECSWindowscluster14061F74", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459", + "Roles": [ + { + "Ref": "ECSWindowsLaunchTemplateRole610E9A88" + } + ] + } + }, + "ECSWindowsLaunchTemplateProfile4B6AA05B": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSWindowsLaunchTemplateRole610E9A88" + } + ] + } + }, + "ECSWindowsLaunchTemplateA6BF5C73": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSWindowsLaunchTemplateProfile4B6AA05B", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized/image_id", + "InstanceType": "m6i.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSWindowssecuritygroupB4EE54DA", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Windows/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Windows/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "(Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\nStart-Job -ScriptBlock { docker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest }\n[Environment]::SetEnvironmentVariable(\"ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION\", \"5s\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER\", \"5s\", \"Machine\")\nRemove-Item -Recurse C:\\ProgramData\\Amazon\\ECS\\Cache\nImport-Module ECSTools\n[Environment]::SetEnvironmentVariable(\"ECS_CLUSTER\", \"", + { + "Ref": "ECSWindowscluster14061F74" + }, + "\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE\", \"true\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_AVAILABLE_LOGGING_DRIVERS\", '[\"json-file\",\"awslogs\"]', \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_TASK_IAM_ROLE\", \"true\", \"Machine\")\nInitialize-ECSAgent -Cluster '", + { + "Ref": "ECSWindowscluster14061F74" + }, + "' -EnableTaskIAMRole" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Windows/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459", + "ECSWindowsLaunchTemplateRole610E9A88" + ] + }, + "ECSWindowsAutoScalingGroupASG864E3AAF": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSWindowsLaunchTemplateA6BF5C73" + }, + "Version": { + "Fn::GetAtt": [ + "ECSWindowsLaunchTemplateA6BF5C73", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS Windows" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSWindowsCapacityProvider8F8896A5": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSWindowsAutoScalingGroupASG864E3AAF" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowslogs83D9D352": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSWindowslogslogsfilterA25F0C55": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSWindowslogs83D9D352" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECSWindowstaskTaskRole17C8DA48": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowstaskTaskRoleDefaultPolicy529AC984": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSWindowstaskTaskRoleDefaultPolicy529AC984", + "Roles": [ + { + "Ref": "ECSWindowstaskTaskRole17C8DA48" + } + ] + } + }, + "ECSWindowstask73A31B6C": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "powershell", + "-Command", + "cd \\actions ;\n if ($Env:RUNNER_VERSION -eq \"latest\") { $RunnerFlags = \"\" } else { $RunnerFlags = \"--disableupdate\" } ;\n ./config.cmd --unattended --url \"${Env:REGISTRATION_URL}\" --token \"${Env:RUNNER_TOKEN}\" --ephemeral --work _work --labels \"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat +%s)\" $RunnerFlags --name \"${Env:RUNNER_NAME}\" ${Env:RUNNER_GROUP} ;\n ./run.cmd ;\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1 ;\n if ($STATUS) { echo \"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\" }" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSWindowslogs83D9D352" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": false + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECSWindowstaskExecutionRoleF164B5BF", + "Arn" + ] + }, + "Family": "githubrunnerstestECSWindowstask6B1D5861", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECSWindowstaskTaskRole17C8DA48", + "Arn" + ] + } + } + }, + "ECSWindowstaskExecutionRoleF164B5BF": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowstaskExecutionRoleDefaultPolicyA46C9687": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSWindowslogs83D9D352", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSWindowstaskExecutionRoleDefaultPolicyA46C9687", + "Roles": [ + { + "Ref": "ECSWindowstaskExecutionRoleF164B5BF" + } + ] + } + }, + "LambdaImageDigestReaderE0842577": { + "Type": "Custom::EcrImageDigest", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "Arn" + ] + }, + "Create": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Update": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Delete": { + "Fn::Join": [ + "", + [ + "{\"service\":\"fake\",\"action\":\"fake\",\"parameters\":{\"version\":1,\"labels\":[\"lambda\",\"x64\"],\"architecture\":\"x86_64\",\"dependable\":\"", + { + "Ref": "LambdaImageBuilderx64BuildWait0ef960775aDC1D350E" + }, + "\"}}" + ] + ] + }, + "InstallLatestAwsSdk": false + }, + "DependsOn": [ + "LambdaImageDigestReaderCustomResourcePolicyE8E146E6" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "LambdaImageDigestReaderCustomResourcePolicyE8E146E6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + }, + { + "Action": "fake:Fake", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageDigestReaderCustomResourcePolicyE8E146E6", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "LambdaLog2764B04F": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Lambda" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaLogLogfilter1003281A": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "LambdaLog2764B04F" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "LambdaFunctionServiceRoleB1826A50": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Lambda" + } + ] + } + }, + "LambdaFunction9233991D": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Architectures": [ + "x86_64" + ], + "Code": { + "ImageUri": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "@sha256:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageDigestReaderE0842577", + "imageDetails.0.imageDigest" + ] + } + ] + } + ] + } + ] + ] + } + }, + "Description": "GitHub Actions runner for labels lambda,x64", + "EphemeralStorage": { + "Size": 10240 + }, + "LoggingConfig": { + "LogGroup": { + "Ref": "LambdaLog2764B04F" + } + }, + "MemorySize": 2048, + "PackageType": "Image", + "Role": { + "Fn::GetAtt": [ + "LambdaFunctionServiceRoleB1826A50", + "Arn" + ] + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Lambda" + } + ], + "Timeout": 900 + }, + "DependsOn": [ + "LambdaFunctionServiceRoleB1826A50" + ] + }, + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip" + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 120 + }, + "DependsOn": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + ] + }, + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:UpdateFunctionCode", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + } + }, + { + "Action": "lambda:UpdateFunctionCode", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6", + "Roles": [ + { + "Ref": "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA" + } + ] + } + }, + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip" + }, + "Description": "Function that updates a GitHub Actions runner function with the latest image digest after the image has been rebuilt", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 900 + }, + "DependsOn": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6", + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA" + ] + }, + "LambdaARMImageDigestReaderF3DD55C4": { + "Type": "Custom::EcrImageDigest", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "Arn" + ] + }, + "Create": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Update": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Delete": { + "Fn::Join": [ + "", + [ + "{\"service\":\"fake\",\"action\":\"fake\",\"parameters\":{\"version\":1,\"labels\":[\"lambda\",\"arm64\"],\"architecture\":\"arm64\",\"dependable\":\"", + { + "Ref": "LambdaImageBuilderzBuildWait781886e2d89352301D" + }, + "\"}}" + ] + ] + }, + "InstallLatestAwsSdk": false + }, + "DependsOn": [ + "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + }, + { + "Action": "fake:Fake", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "LambdaARMLogAA2DA09F": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/LambdaARM" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaARMLogLogfilterE0BE5E30": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "LambdaARMLogAA2DA09F" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "LambdaARMFunctionServiceRole136069A0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/LambdaARM" + } + ] + } + }, + "LambdaARMFunctionDD4B5FF7": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Architectures": [ + "arm64" + ], + "Code": { + "ImageUri": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "@sha256:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaARMImageDigestReaderF3DD55C4", + "imageDetails.0.imageDigest" + ] + } + ] + } + ] + } + ] + ] + } + }, + "Description": "GitHub Actions runner for labels lambda,arm64", + "EphemeralStorage": { + "Size": 10240 + }, + "LoggingConfig": { + "LogGroup": { + "Ref": "LambdaARMLogAA2DA09F" + } + }, + "MemorySize": 2048, + "PackageType": "Image", + "Role": { + "Fn::GetAtt": [ + "LambdaARMFunctionServiceRole136069A0", + "Arn" + ] + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/LambdaARM" + } + ], + "Timeout": 900 + }, + "DependsOn": [ + "LambdaARMFunctionServiceRole136069A0" + ] + }, + "FargatesecuritygroupAFCAFD34": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "FargatelogsCB753638": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatelogslogsfilter89D6A772": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "FargatelogsCB753638" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "FargatetaskTaskRoleEFFCDAF8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ] + } + }, + "FargatetaskTaskRoleDefaultPolicy4E176780": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatetaskTaskRoleDefaultPolicy4E176780", + "Roles": [ + { + "Ref": "FargatetaskTaskRoleEFFCDAF8" + } + ] + } + }, + "FargatetaskFDFF3302": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "FargatelogsCB753638" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "FargatetaskExecutionRole88A42307", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatetaskA755E0CE", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "FargatetaskTaskRoleEFFCDAF8", + "Arn" + ] + } + } + }, + "FargatetaskExecutionRole88A42307": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ] + } + }, + "FargatetaskExecutionRoleDefaultPolicy72A5073A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatelogsCB753638", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatetaskExecutionRoleDefaultPolicy72A5073A", + "Roles": [ + { + "Ref": "FargatetaskExecutionRole88A42307" + } + ] + } + }, + "Fargatex64spotsecuritygroup2A9F4299": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-x64-spot/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "Fargatex64spotlogs0BCF618B": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatex64spotlogslogsfilter6590358B": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "Fargatex64spotlogs0BCF618B" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "Fargatex64spottaskTaskRole02893C25": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ] + } + }, + "Fargatex64spottaskTaskRoleDefaultPolicyDBB9916E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatex64spottaskTaskRoleDefaultPolicyDBB9916E", + "Roles": [ + { + "Ref": "Fargatex64spottaskTaskRole02893C25" + } + ] + } + }, + "Fargatex64spottask4C8B023D": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "Fargatex64spotlogs0BCF618B" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "Fargatex64spottaskExecutionRoleD0E0B7D6", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatex64spottask7B2E300E", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Fargatex64spottaskTaskRole02893C25", + "Arn" + ] + } + } + }, + "Fargatex64spottaskExecutionRoleD0E0B7D6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ] + } + }, + "Fargatex64spottaskExecutionRoleDefaultPolicyA51A696A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Fargatex64spotlogs0BCF618B", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatex64spottaskExecutionRoleDefaultPolicyA51A696A", + "Roles": [ + { + "Ref": "Fargatex64spottaskExecutionRoleD0E0B7D6" + } + ] + } + }, + "Fargatearm64securitygroup08ABAD9E": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-arm64/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "Fargatearm64logs00171A52": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatearm64logslogsfilter4A2869DC": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "Fargatearm64logs00171A52" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "Fargatearm64taskTaskRoleD3C2CD58": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ] + } + }, + "Fargatearm64taskTaskRoleDefaultPolicy0D37729A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64taskTaskRoleDefaultPolicy0D37729A", + "Roles": [ + { + "Ref": "Fargatearm64taskTaskRoleD3C2CD58" + } + ] + } + }, + "Fargatearm64taskECD67399": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "Fargatearm64logs00171A52" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64taskExecutionRoleD10B61DC", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatearm64task6B95C05B", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "ARM64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64taskTaskRoleD3C2CD58", + "Arn" + ] + } + } + }, + "Fargatearm64taskExecutionRoleD10B61DC": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ] + } + }, + "Fargatearm64taskExecutionRoleDefaultPolicy0E3D42DB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Fargatearm64logs00171A52", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64taskExecutionRoleDefaultPolicy0E3D42DB", + "Roles": [ + { + "Ref": "Fargatearm64taskExecutionRoleD10B61DC" + } + ] + } + }, + "Fargatearm64spotsecuritygroup20C885E4": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-arm64-spot/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "Fargatearm64spotlogsEFCCEC59": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatearm64spotlogslogsfilter7E2CFF7B": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "Fargatearm64spotlogsEFCCEC59" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "Fargatearm64spottaskTaskRole0F078C81": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ] + } + }, + "Fargatearm64spottaskTaskRoleDefaultPolicyB8772E50": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64spottaskTaskRoleDefaultPolicyB8772E50", + "Roles": [ + { + "Ref": "Fargatearm64spottaskTaskRole0F078C81" + } + ] + } + }, + "Fargatearm64spottaskD21E60F2": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "Fargatearm64spotlogsEFCCEC59" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64spottaskExecutionRole90E5A05B", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatearm64spottaskF9ADF192", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "ARM64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64spottaskTaskRole0F078C81", + "Arn" + ] + } + } + }, + "Fargatearm64spottaskExecutionRole90E5A05B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ] + } + }, + "Fargatearm64spottaskExecutionRoleDefaultPolicyB9BB282A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Fargatearm64spotlogsEFCCEC59", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64spottaskExecutionRoleDefaultPolicyB9BB282A", + "Roles": [ + { + "Ref": "Fargatearm64spottaskExecutionRole90E5A05B" + } + ] + } + }, + "FargateWindowssecuritygroupE684A7B0": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-Windows/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "FargateWindowslogs52881DBF": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargateWindowslogslogsfilterB5B72E7C": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "FargateWindowslogs52881DBF" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "FargateWindowstaskTaskRole364508C8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ] + } + }, + "FargateWindowstaskTaskRoleDefaultPolicy17F0249C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargateWindowstaskTaskRoleDefaultPolicy17F0249C", + "Roles": [ + { + "Ref": "FargateWindowstaskTaskRole364508C8" + } + ] + } + }, + "FargateWindowstask9F9B942D": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "powershell", + "-Command", + "cd \\actions ;\n if ($Env:RUNNER_VERSION -eq \"latest\") { $RunnerFlags = \"\" } else { $RunnerFlags = \"--disableupdate\" } ;\n ./config.cmd --unattended --url \"${Env:REGISTRATION_URL}\" --token \"${Env:RUNNER_TOKEN}\" --ephemeral --work _work --labels \"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat +%s)\" $RunnerFlags --name \"${Env:RUNNER_NAME}\" ${Env:RUNNER_GROUP} ;\n ./run.cmd ;\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1 ;\n if ($STATUS) { echo \"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\" }" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "FargateWindowslogs52881DBF" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner" + } + ], + "Cpu": "1024", + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "FargateWindowstaskExecutionRoleEE562927", + "Arn" + ] + }, + "Family": "githubrunnerstestFargateWindowstask95BB2245", + "Memory": "2048", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "WINDOWS_SERVER_2019_CORE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "FargateWindowstaskTaskRole364508C8", + "Arn" + ] + } + } + }, + "FargateWindowstaskExecutionRoleEE562927": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ] + } + }, + "FargateWindowstaskExecutionRoleDefaultPolicy2EF7D3FD": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargateWindowslogs52881DBF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargateWindowstaskExecutionRoleDefaultPolicy2EF7D3FD", + "Roles": [ + { + "Ref": "FargateWindowstaskExecutionRoleEE562927" + } + ] + } + }, + "EC2LinuxSGF5B89300": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Linux/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2LinuxRole8B6519A2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux" + } + ] + } + }, + "EC2LinuxRoleDefaultPolicy1369791B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2LinuxLogsC4CD8F14", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2LinuxRoleDefaultPolicy1369791B", + "Roles": [ + { + "Ref": "EC2LinuxRole8B6519A2" + } + ] + } + }, + "EC2LinuxLogsC4CD8F14": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2LinuxLogsLogsfilter186C2AB7": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2LinuxInstanceProfile2D2BB473": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2LinuxRole8B6519A2" + } + ] + } + }, + "EC2LinuxAMIRootDevice26D5E56E": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + } + }, + "DependsOn": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "AMILinuxBuilderAMIImage93D83DE5", + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderAMIPipelineEC5051DF", + "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", + "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", + "AMILinuxBuilderImageCleanerF1745EF6", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561", + "AMILinuxBuilderLaunchtemplateA29452C4", + "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "AMILinuxBuilderRoleDefaultPolicy69ED051F", + "AMILinuxBuilderRole0C42378A", + "AMILinuxBuilderSGEDC86329" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "deleteamidcc036c8876b451ea2c1552f9e06e9e1ServiceRole1CC58A6F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Description": "Empty role to prevent deletion of AMIs on cdk-github-runners upgrade", + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Effect": "Deny", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "deny" + } + ] + } + }, + "EC2SpotLinuxSG8D846B64": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Spot Linux/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Spot Linux" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2SpotLinuxRole86333E5D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Spot Linux" + } + ] + } + }, + "EC2SpotLinuxRoleDefaultPolicy061AD1D0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2SpotLinuxLogsF78D5F0E", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2SpotLinuxRoleDefaultPolicy061AD1D0", + "Roles": [ + { + "Ref": "EC2SpotLinuxRole86333E5D" + } + ] + } + }, + "EC2SpotLinuxLogsF78D5F0E": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Spot Linux" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2SpotLinuxLogsLogsfilter89CE719F": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2SpotLinuxInstanceProfileB12320D4": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2SpotLinuxRole86333E5D" + } + ] + } + }, + "EC2SpotLinuxAMIRootDeviceC8A06843": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + } + }, + "DependsOn": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "AMILinuxBuilderAMIImage93D83DE5", + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderAMIPipelineEC5051DF", + "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", + "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", + "AMILinuxBuilderImageCleanerF1745EF6", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561", + "AMILinuxBuilderLaunchtemplateA29452C4", + "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "AMILinuxBuilderRoleDefaultPolicy69ED051F", + "AMILinuxBuilderRole0C42378A", + "AMILinuxBuilderSGEDC86329" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2Linuxarm64SG550ECD6C": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Linux arm64/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux arm64" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2Linuxarm64Role242F68FF": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux arm64" + } + ] + } + }, + "EC2Linuxarm64RoleDefaultPolicyDE9193C3": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2Linuxarm64Logs577E371E", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2Linuxarm64RoleDefaultPolicyDE9193C3", + "Roles": [ + { + "Ref": "EC2Linuxarm64Role242F68FF" + } + ] + } + }, + "EC2Linuxarm64Logs577E371E": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux arm64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2Linuxarm64LogsLogsfilter0A247938": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2Linuxarm64InstanceProfile1E6F8D53": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2Linuxarm64Role242F68FF" + } + ] + } + }, + "EC2Linuxarm64AMIRootDevice3046D37D": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + } + }, + "DependsOn": [ + "AMILinuxarm64BuilderAMIDistributionE6989D01", + "AMILinuxarm64BuilderAMIImage40078F9E", + "AMILinuxarm64BuilderAmiLog84A9D94A", + "AMILinuxarm64BuilderAMIPipeline9CC1354C", + "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", + "AMILinuxarm64BuilderImageCleanerA5DDFE7A", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD", + "AMILinuxarm64BuilderLaunchtemplate8F5EFF44", + "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD", + "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", + "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", + "AMILinuxarm64BuilderRole40D54E29", + "AMILinuxarm64BuilderSG94315968" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2WindowsSG13E24976": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Windows/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Windows" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2WindowsRoleC0D850D2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Windows" + } + ] + } + }, + "EC2WindowsRoleDefaultPolicyB6A15409": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2WindowsLogsDC1F2ABF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2WindowsRoleDefaultPolicyB6A15409", + "Roles": [ + { + "Ref": "EC2WindowsRoleC0D850D2" + } + ] + } + }, + "EC2WindowsLogsDC1F2ABF": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Windows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2WindowsLogsLogsfilter253E4D4D": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2WindowsInstanceProfileDCA59D9C": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2WindowsRoleC0D850D2" + } + ] + } + }, + "EC2WindowsAMIRootDevice9FFC971A": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + } + }, + "DependsOn": [ + "WindowsEC2BuilderAMIDistribution6B33DD89", + "WindowsEC2BuilderAMIImage9D812188", + "WindowsEC2BuilderAmiLog126E54B2", + "WindowsEC2BuilderAMIPipelineE3836949", + "WindowsEC2BuilderAmiRecipe41A137FF", + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", + "WindowsEC2BuilderComponent3GitComponent4F86AE54", + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", + "WindowsEC2BuilderImageCleanerEF537850", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2", + "WindowsEC2BuilderLaunchtemplate0A66E9C2", + "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7", + "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", + "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", + "WindowsEC2BuilderRole1BA7D3E7", + "WindowsEC2BuilderSGE3F67842" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsWebhook7AF0D74E": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludePunctuation": true, + "GenerateStringKey": "webhookSecret", + "IncludeSpace": false, + "SecretStringTemplate": "{}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsGitHubEFD96479": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludePunctuation": true, + "GenerateStringKey": "dummy", + "IncludeSpace": false, + "SecretStringTemplate": "{\"domain\":\"github.com\",\"appId\":\"\",\"personalAuthToken\":\"\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsGitHubPrivateKey79498F91": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "SecretString": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsSetup692A93B1": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludePunctuation": true, + "GenerateStringKey": "token", + "IncludeSpace": false, + "SecretStringTemplate": "{\"token\":\"\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnerstokenretrieverServiceRole6099F71C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnerstokenretrieverServiceRoleDefaultPolicy24965D29": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnerstokenretrieverServiceRoleDefaultPolicy24965D29", + "Roles": [ + { + "Ref": "runnerstokenretrieverServiceRole6099F71C" + } + ] + } + }, + "runnerstokenretrieverD5E8392A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip" + }, + "Description": "Get token from GitHub Actions used to start new self-hosted runner", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnerstokenretrieverServiceRole6099F71C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 30 + }, + "DependsOn": [ + "runnerstokenretrieverServiceRoleDefaultPolicy24965D29", + "runnerstokenretrieverServiceRole6099F71C" + ] + }, + "runnersdeleterunnerServiceRole35856967": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7", + "Roles": [ + { + "Ref": "runnersdeleterunnerServiceRole35856967" + } + ] + } + }, + "runnersdeleterunner7F8D5293": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip" + }, + "Description": "Delete failed GitHub Actions runner on error", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersdeleterunnerServiceRole35856967", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 30 + }, + "DependsOn": [ + "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7", + "runnersdeleterunnerServiceRole35856967" + ] + }, + "runnersIdleReaperServiceRoleA775758D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:ReceiveMessage", + "sqs:ChangeMessageVisibility", + "sqs:GetQueueUrl", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "runnersIdleReaperQueue117EFB9F", + "Arn" + ] + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": [ + "states:ListExecutions", + "states:ListStateMachines" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + }, + { + "Action": [ + "states:DescribeExecution", + "states:DescribeStateMachineForExecution", + "states:GetExecutionHistory" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":states:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": [ + "states:ListActivities", + "states:DescribeStateMachine", + "states:DescribeActivity" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "states:StopExecution", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":states:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + ] + } + ] + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0", + "Roles": [ + { + "Ref": "runnersIdleReaperServiceRoleA775758D" + } + ] + } + }, + "runnersIdleReaper6FBF63A3": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip" + }, + "Description": "Stop idle GitHub runners to avoid paying for runners when the job was already canceled", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersIdleReaperServiceRoleA775758D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0", + "runnersIdleReaperServiceRoleA775758D" + ] + }, + "runnersIdleReaperSqsEventSourcegithubrunnerstestrunnersIdleReaperQueue5E84F4E4B0DB6768": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": { + "Fn::GetAtt": [ + "runnersIdleReaperQueue117EFB9F", + "Arn" + ] + }, + "FunctionName": { + "Ref": "runnersIdleReaper6FBF63A3" + }, + "FunctionResponseTypes": [ + "ReportBatchItemFailures" + ], + "MaximumBatchingWindowInSeconds": 60 + } + }, + "runnersIdleReaperQueue117EFB9F": { + "Type": "AWS::SQS::Queue", + "Properties": { + "DelaySeconds": 600, + "VisibilityTimeout": 600 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersRunnerOrchestratorRole5D220AD7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sqs:SendMessage", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "runnersIdleReaperQueue117EFB9F", + "Arn" + ] + } + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "runnersdeleterunner7F8D5293", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "runnersdeleterunner7F8D5293", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "runnerstokenretrieverD5E8392A", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "runnerstokenretrieverD5E8392A", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildx64CodeBuild7DC01A1E", + "Arn" + ] + } + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":events:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":rule/StepFunctionsGetEventForCodeBuildStartBuildRule" + ] + ] + } + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64CodeBuild261399A8", + "Arn" + ] + } + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildARMCodeBuildC5F301F2", + "Arn" + ] + } + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildWindowsCodeBuildC39F35C1", + "Arn" + ] + } + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": [ + "ecs:StopTask", + "ecs:DescribeTasks" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECStaskTaskRoleFE831ECD", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECStaskExecutionRole1A6D19A5", + "Arn" + ] + } + ] + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":events:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":rule/StepFunctionsGetEventsForECSTaskRule" + ] + ] + } + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECSUbuntu2404taskTaskRoleDF683F3B", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECSUbuntu2404taskExecutionRoleC5FEA726", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECSARM64taskTaskRole23B1CB4E", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECSARM64taskExecutionRoleBF2AE76F", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECSWindowstaskTaskRole17C8DA48", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECSWindowstaskExecutionRoleF164B5BF", + "Arn" + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "FargatetaskTaskRoleEFFCDAF8", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "FargatetaskExecutionRole88A42307", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Fargatex64spottaskTaskRole02893C25", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "Fargatex64spottaskExecutionRoleD0E0B7D6", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Fargatearm64taskTaskRoleD3C2CD58", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "Fargatearm64taskExecutionRoleD10B61DC", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Fargatearm64spottaskTaskRole0F078C81", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "Fargatearm64spottaskExecutionRole90E5A05B", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "FargateWindowstaskTaskRole364508C8", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "FargateWindowstaskExecutionRoleEE562927", + "Arn" + ] + } + ] + }, + { + "Action": "ec2:runInstances", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2LinuxRole8B6519A2", + "Arn" + ] + } + }, + { + "Action": "ec2:createTags", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:CreateServiceLinkedRole", + "Condition": { + "StringEquals": { + "iam:AWSServiceName": "spot.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2SpotLinuxRole86333E5D", + "Arn" + ] + } + }, + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2Linuxarm64Role242F68FF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61", + "Roles": [ + { + "Ref": "runnersRunnerOrchestratorRole5D220AD7" + } + ] + } + }, + "runnersRunnerOrchestratorRoleOverflowPolicy11A794735": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "Description": "Part of the policies for github-runners-test/runners/Runner Orchestrator/Role", + "Path": "/", + "PolicyDocument": { + "Statement": [ + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2WindowsRoleC0D850D2", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "Roles": [ + { + "Ref": "runnersRunnerOrchestratorRole5D220AD7" + } + ] + } + }, + "runnersRunnerOrchestratorF9B66EBA": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"Queue Idle Reaper\",\"States\":{\"Queue Idle Reaper\":{\"Next\":\"Run Providers\",\"Type\":\"Task\",\"ResultPath\":null,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::sqs:sendMessage\",\"Parameters\":{\"QueueUrl\":\"", + { + "Ref": "runnersIdleReaperQueue117EFB9F" + }, + "\",\"MessageBody\":{\"executionArn.$\":\"$$.Execution.Id\",\"runnerName.$\":\"$$.Execution.Name\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"installationId.$\":\"$.installationId\",\"maxIdleSeconds\":300}}},\"Run Providers\":{\"Type\":\"Parallel\",\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":60,\"MaxAttempts\":23,\"BackoffRate\":1.3}],\"Branches\":[{\"StartAt\":\"Error Handler\",\"States\":{\"Error Handler\":{\"Type\":\"Parallel\",\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"ResultPath\":\"$.error\",\"Next\":\"Delete Failed Runner\"}],\"Branches\":[{\"StartAt\":\"Get Runner Token\",\"States\":{\"Get Runner Token\":{\"Next\":\"Choose provider\",\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"ResultPath\":\"$.runner\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "runnerstokenretrieverD5E8392A", + "Arn" + ] + }, + "\"},\"Choose provider\":{\"Type\":\"Choice\",\"Choices\":[{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildx64\"}],\"Next\":\"codebuild-x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildUbuntu2404x64\"}],\"Next\":\"codebuild-ubuntu-2404-x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildARM\"}],\"Next\":\"codebuild, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildWindows\"}],\"Next\":\"codebuild, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS\"}],\"Next\":\"ecs, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS Ubuntu 2404\"}],\"Next\":\"ecs-ubuntu-2404, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS ARM64\"}],\"Next\":\"ecs, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS Windows\"}],\"Next\":\"ecs, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Lambda\"}],\"Next\":\"lambda, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/LambdaARM\"}],\"Next\":\"lambda, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate\"}],\"Next\":\"fargate, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-x64-spot\"}],\"Next\":\"fargate-spot, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-arm64\"}],\"Next\":\"fargate, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-arm64-spot\"}],\"Next\":\"fargate-spot, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-Windows\"}],\"Next\":\"fargate, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Linux\"}],\"Next\":\"ec2, linux, x64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Spot Linux\"}],\"Next\":\"ec2-spot, linux, x64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Linux arm64\"}],\"Next\":\"ec2, linux, arm64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Windows\"}],\"Next\":\"ec2, windows, x64 data\"}],\"Default\":\"Unknown label\"},\"Unknown label\":{\"Type\":\"Succeed\"},\"codebuild-x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild-x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild-ubuntu-2404-x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild-ubuntu-2404-x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"ecs, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECScluster20BC0B82", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECStaskCE74CC84\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSCapacityProviderABF1B146" + }, + "\"}],\"EnableExecuteCommand\":true}},\"ecs-ubuntu-2404, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECSUbuntu2404cluster21C05FA1", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECSUbuntu2404taskB7D564C7\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs-ubuntu-2404,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSUbuntu2404CapacityProviderFAE73340" + }, + "\"}],\"EnableExecuteCommand\":true}},\"ecs, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECSARM64cluster4ECAA083", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECSARM64taskE94E43A3\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSARM64CapacityProvider8627FEF9" + }, + "\"}],\"EnableExecuteCommand\":true}},\"ecs, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECSWindowscluster14061F74", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECSWindowstask6B1D5861\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSWindowsCapacityProvider8F8896A5" + }, + "\"}],\"EnableExecuteCommand\":false}},\"lambda, x64\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + }, + "\",\"Payload\":{\"token.$\":\"$.runner.token\",\"runnerName.$\":\"$$.Execution.Name\",\"label\":\"lambda,x64\",\"githubDomain.$\":\"$.runner.domain\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"registrationUrl.$\":\"$.runner.registrationUrl\",\"group\":\"\"}}},\"lambda, arm64\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + }, + "\",\"Payload\":{\"token.$\":\"$.runner.token\",\"runnerName.$\":\"$$.Execution.Name\",\"label\":\"lambda,arm64\",\"githubDomain.$\":\"$.runner.domain\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"registrationUrl.$\":\"$.runner.registrationUrl\",\"group\":\"\"}}},\"fargate, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatetaskA755E0CE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "FargatesecuritygroupAFCAFD34", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":true}},\"fargate-spot, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatex64spottask7B2E300E\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "Fargatex64spotsecuritygroup2A9F4299", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate-spot,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE_SPOT\"}],\"EnableExecuteCommand\":true}},\"fargate, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatearm64task6B95C05B\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "Fargatearm64securitygroup08ABAD9E", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":true}},\"fargate-spot, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatearm64spottaskF9ADF192\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "Fargatearm64spotsecuritygroup20C885E4", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate-spot,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE_SPOT\"}],\"EnableExecuteCommand\":true}},\"fargate, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargateWindowstask95BB2245\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "FargateWindowssecuritygroupE684A7B0", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":false}},\"ec2, linux, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2, linux, x64 subnet1\"},\"ec2, linux, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, linux, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2LinuxInstanceProfile2D2BB473", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2LinuxSGF5B89300", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2LinuxAMIRootDevice26D5E56E" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40,\"VolumeType\":\"gp3\",\"Iops\":3000,\"Throughput\":200}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]}]}},\"ec2, linux, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2LinuxInstanceProfile2D2BB473", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2LinuxSGF5B89300", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2LinuxAMIRootDevice26D5E56E" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40,\"VolumeType\":\"gp3\",\"Iops\":3000,\"Throughput\":200}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]}]}},\"ec2-spot, linux, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2-spot, linux, x64 subnet1\"},\"ec2-spot, linux, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2-spot, linux, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2-spot,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxInstanceProfileB12320D4", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxSG8D846B64", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2SpotLinuxAMIRootDeviceC8A06843" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40}}],\"InstanceMarketOptions\":{\"MarketType\":\"spot\",\"SpotOptions\":{\"SpotInstanceType\":\"one-time\"}},\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]}]}},\"ec2-spot, linux, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2-spot,linux,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxInstanceProfileB12320D4", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxSG8D846B64", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2SpotLinuxAMIRootDeviceC8A06843" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40}}],\"InstanceMarketOptions\":{\"MarketType\":\"spot\",\"SpotOptions\":{\"SpotInstanceType\":\"one-time\"}},\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]}]}},\"ec2, linux, arm64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2, linux, arm64 subnet1\"},\"ec2, linux, arm64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, linux, arm64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6g.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,arm64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64InstanceProfile1E6F8D53", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64SG550ECD6C", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2Linuxarm64AMIRootDevice3046D37D" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]}]}},\"ec2, linux, arm64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6g.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,arm64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64InstanceProfile1E6F8D53", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64SG550ECD6C", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2Linuxarm64AMIRootDevice3046D37D" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]}]}},\"ec2, windows, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"\\n$TASK_TOKEN = \\\"{}\\\"\\n$logGroupName=\\\"{}\\\"\\n$runnerNamePath=\\\"{}\\\"\\n$githubDomainPath=\\\"{}\\\"\\n$ownerPath=\\\"{}\\\"\\n$repoPath=\\\"{}\\\"\\n$runnerTokenPath=\\\"{}\\\"\\n$labels=\\\"{}\\\"\\n$registrationURL=\\\"{}\\\"\\n$runnerGroup=\\\"{}\\\"\\n\\n# EC2Launch only starts ssm agent after user data is done, so we need to start it ourselves (it is disabled by default)\\nSet-Service -StartupType Manual AmazonSSMAgent\\nStart-Service AmazonSSMAgent\\n\\nStart-Job -ScriptBlock \\\\{\\n while (1) \\\\{\\n aws stepfunctions send-task-heartbeat --task-token \\\"$using:TASK_TOKEN\\\"\\n sleep 60\\n \\\\}\\n\\\\}\\nfunction setup_logs () \\\\{\\n echo \\\"\\\\{\\n `\\\"logs`\\\": \\\\{\\n `\\\"log_stream_name`\\\": `\\\"unknown`\\\",\\n `\\\"logs_collected`\\\": \\\\{\\n `\\\"files`\\\": \\\\{\\n `\\\"collect_list`\\\": [\\n \\\\{\\n `\\\"file_path`\\\": `\\\"/actions/runner.log`\\\",\\n `\\\"log_group_name`\\\": `\\\"$logGroupName`\\\",\\n `\\\"log_stream_name`\\\": `\\\"$runnerNamePath`\\\",\\n `\\\"timezone`\\\": `\\\"UTC`\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\\" | Out-File -Encoding ASCII $Env:TEMP/log.conf\\n & \\\"C:/Program Files/Amazon/AmazonCloudWatchAgent/amazon-cloudwatch-agent-ctl.ps1\\\" -a fetch-config -m ec2 -s -c file:$Env:TEMP/log.conf\\n\\\\}\\nfunction action () \\\\{\\n cd /actions\\n $RunnerVersion = Get-Content /actions/RUNNER_VERSION -Raw\\n if ($RunnerVersion -eq \\\"latest\\\") \\\\{ $RunnerFlags = \\\"\\\" \\\\} else \\\\{ $RunnerFlags = \\\"--disableupdate\\\" \\\\}\\n ./config.cmd --unattended --url \\\"$\\\\{registrationUrl\\\\}\\\" --token \\\"$\\\\{runnerTokenPath\\\\}\\\" --ephemeral --work _work --labels \\\"$\\\\{labels\\\\},cdkghr:started:$(Get-Date -UFormat +%s)\\\" $RunnerFlags --name \\\"$\\\\{runnerNamePath\\\\}\\\" $\\\\{runnerGroup\\\\} 2>&1 | Out-File -Encoding ASCII -Append /actions/runner.log\\n\\n if ($LASTEXITCODE -ne 0) \\\\{ return 1 \\\\}\\n ./run.cmd 2>&1 | Out-File -Encoding ASCII -Append /actions/runner.log\\n if ($LASTEXITCODE -ne 0) \\\\{ return 2 \\\\}\\n\\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\\\-]+ with result: (.*)' | %\\\\{$_.Matches.Groups[1].Value\\\\} | Select-Object -Last 1\\n\\n if ($STATUS) \\\\{\\n echo \\\"CDKGHA JOB DONE $\\\\{labels\\\\} $STATUS\\\" | Out-File -Encoding ASCII -Append /actions/runner.log\\n \\\\}\\n\\n return 0\\n\\\\}\\nsetup_logs\\n$r = action\\nif ($r -eq 0) \\\\{\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{ \\\\}'\\n\\\\} else \\\\{\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\n\\\\}\\nStart-Sleep -Seconds 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\nStop-Computer -ComputerName localhost -Force\\n\\n\"},\"Next\":\"ec2, windows, x64 subnet1\"},\"ec2, windows, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, windows, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,windows,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2WindowsInstanceProfileDCA59D9C", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2WindowsSG13E24976", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2WindowsAMIRootDevice9FFC971A" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]}]}},\"ec2, windows, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,windows,x64', $.runner.registrationUrl, ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2WindowsInstanceProfileDCA59D9C", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2WindowsSG13E24976", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2WindowsAMIRootDevice9FFC971A" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]}]}}}}]},\"Delete Failed Runner\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2},{\"ErrorEquals\":[\"RunnerBusy\"],\"IntervalSeconds\":60,\"MaxAttempts\":60,\"BackoffRate\":1}],\"Type\":\"Task\",\"ResultPath\":\"$.delete\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "runnersdeleterunner7F8D5293", + "Arn" + ] + }, + "\",\"Parameters\":{\"runnerName.$\":\"$$.Execution.Name\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"installationId.$\":\"$.installationId\",\"error.$\":\"$.error\"}}}}]}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "runnersRunnerOrchestratorRole5D220AD7", + "Arn" + ] + } + }, + "DependsOn": [ + "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61", + "runnersRunnerOrchestratorRoleOverflowPolicy11A794735", + "runnersRunnerOrchestratorRole5D220AD7" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsWebhook7AF0D74E" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C", + "Roles": [ + { + "Ref": "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2" + } + ] + } + }, + "runnersWebhookHandlerwebhookhandler22779A81": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip" + }, + "Description": "Handle GitHub webhook and start runner orchestrator", + "Environment": { + "Variables": { + "STEP_FUNCTION_ARN": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + }, + "WEBHOOK_SECRET_ARN": { + "Ref": "runnersSecretsWebhook7AF0D74E" + }, + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "SUPPORTED_LABELS": "[{\"provider\":\"github-runners-test/CodeBuildx64\",\"labels\":[\"codebuild-x64\"]},{\"provider\":\"github-runners-test/CodeBuildUbuntu2404x64\",\"labels\":[\"codebuild-ubuntu-2404-x64\"]},{\"provider\":\"github-runners-test/CodeBuildARM\",\"labels\":[\"codebuild\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/CodeBuildWindows\",\"labels\":[\"codebuild\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/ECS\",\"labels\":[\"ecs\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/ECS Ubuntu 2404\",\"labels\":[\"ecs-ubuntu-2404\",\"x64\"]},{\"provider\":\"github-runners-test/ECS ARM64\",\"labels\":[\"ecs\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/ECS Windows\",\"labels\":[\"ecs\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/Lambda\",\"labels\":[\"lambda\",\"x64\"]},{\"provider\":\"github-runners-test/LambdaARM\",\"labels\":[\"lambda\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate\",\"labels\":[\"fargate\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/Fargate-x64-spot\",\"labels\":[\"fargate-spot\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/Fargate-arm64\",\"labels\":[\"fargate\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate-arm64-spot\",\"labels\":[\"fargate-spot\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate-Windows\",\"labels\":[\"fargate\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Linux\",\"labels\":[\"ec2\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Spot Linux\",\"labels\":[\"ec2-spot\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Linux arm64\",\"labels\":[\"ec2\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/EC2 Windows\",\"labels\":[\"ec2\",\"windows\",\"x64\"]}]", + "REQUIRE_SELF_HOSTED_LABEL": "1", + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 31 + }, + "DependsOn": [ + "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C", + "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2" + ] + }, + "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17": { + "Type": "AWS::Lambda::Url", + "Properties": { + "AuthType": "NONE", + "TargetFunctionArn": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + } + } + }, + "runnersWebhookHandlerwebhookhandlerinvokefunctionurl871AC245": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunctionUrl", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + "FunctionUrlAuthType": "NONE", + "Principal": "*" + } + }, + "runnersWebhookHandlerwebhookhandlerinvokefunction76559985": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + "InvokedViaFunctionUrl": true, + "Principal": "*" + } + }, + "runnersWebhookRedeliveryLambdaServiceRole464CDD30": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640", + "Roles": [ + { + "Ref": "runnersWebhookRedeliveryLambdaServiceRole464CDD30" + } + ] + } + }, + "runnersWebhookRedeliveryLambdaCF5EE41B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip" + }, + "Description": "Check for GitHub webhook delivery failures and redeliver them", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "ReservedConcurrentExecutions": 1, + "Role": { + "Fn::GetAtt": [ + "runnersWebhookRedeliveryLambdaServiceRole464CDD30", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 270 + }, + "DependsOn": [ + "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640", + "runnersWebhookRedeliveryLambdaServiceRole464CDD30" + ] + }, + "runnersWebhookRedeliverySchedule88D0314C": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": "Schedule to run the webhook redelivery lambda every 5 minutes", + "ScheduleExpression": "rate(5 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "runnersWebhookRedeliveryLambdaCF5EE41B", + "Arn" + ] + }, + "Id": "Target0", + "RetryPolicy": { + "MaximumRetryAttempts": 0 + } + } + ] + } + }, + "runnersWebhookRedeliveryScheduleAllowEventRulegithubrunnerstestrunnersWebhookRedeliveryLambdaC352F4E1E8F30E7D": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookRedeliveryLambdaCF5EE41B", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "runnersWebhookRedeliverySchedule88D0314C", + "Arn" + ] + } + } + }, + "runnerssetupServiceRole588BFE9A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnerssetupServiceRoleDefaultPolicy40EF213B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsWebhook7AF0D74E" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsSetup692A93B1" + } + }, + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsSetup692A93B1" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnerssetupServiceRoleDefaultPolicy40EF213B", + "Roles": [ + { + "Ref": "runnerssetupServiceRole588BFE9A" + } + ] + } + }, + "runnerssetup9896CB59": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "77fc0ac49eedee2c48312197988590ab7c819de08f88b162c532f7ea1f73f9d5.zip" + }, + "Description": "Setup GitHub Actions integration with self-hosted runners", + "Environment": { + "Variables": { + "SETUP_SECRET_ARN": { + "Ref": "runnersSecretsSetup692A93B1" + }, + "WEBHOOK_SECRET_ARN": { + "Ref": "runnersSecretsWebhook7AF0D74E" + }, + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "WEBHOOK_URL": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17", + "FunctionUrl" + ] + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "SetupLog8A8B0E5C" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnerssetupServiceRole588BFE9A", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 180 + }, + "DependsOn": [ + "runnerssetupServiceRoleDefaultPolicy40EF213B", + "runnerssetupServiceRole588BFE9A" + ] + }, + "runnerssetupFunctionUrlB8BC43E8": { + "Type": "AWS::Lambda::Url", + "Properties": { + "AuthType": "NONE", + "TargetFunctionArn": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + } + } + }, + "runnerssetupinvokefunctionurl5F3B865C": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunctionUrl", + "FunctionName": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + }, + "FunctionUrlAuthType": "NONE", + "Principal": "*" + } + }, + "runnerssetupinvokefunctionC1E3C6E6": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + }, + "InvokedViaFunctionUrl": true, + "Principal": "*" + } + }, + "runnersstatusServiceRole71A1ADB6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersstatusServiceRoleDefaultPolicyBD4E619B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ec2:DescribeLaunchTemplateVersions", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "cloudformation:DescribeStackResource", + "Effect": "Allow", + "Resource": { + "Ref": "AWS::StackId" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsWebhook7AF0D74E" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsSetup692A93B1" + } + }, + { + "Action": [ + "states:ListExecutions", + "states:ListStateMachines" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + }, + { + "Action": [ + "states:DescribeExecution", + "states:DescribeStateMachineForExecution", + "states:GetExecutionHistory" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":states:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": [ + "states:ListActivities", + "states:DescribeStateMachine", + "states:DescribeActivity" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersstatusServiceRoleDefaultPolicyBD4E619B", + "Roles": [ + { + "Ref": "runnersstatusServiceRole71A1ADB6" + } + ] + } + }, + "runnersstatus1A5771C0": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip" + }, + "Description": "Provide user with status about self-hosted GitHub Actions runners", + "Environment": { + "Variables": { + "WEBHOOK_SECRET_ARN": { + "Ref": "runnersSecretsWebhook7AF0D74E" + }, + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "SETUP_SECRET_ARN": { + "Ref": "runnersSecretsSetup692A93B1" + }, + "WEBHOOK_URL": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17", + "FunctionUrl" + ] + }, + "WEBHOOK_HANDLER_ARN": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + ":$LATEST" + ] + ] + }, + "STEP_FUNCTION_ARN": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + }, + "STEP_FUNCTION_LOG_GROUP": "", + "SETUP_FUNCTION_URL": { + "Fn::GetAtt": [ + "runnerssetupFunctionUrlB8BC43E8", + "FunctionUrl" + ] + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1", + "LOGICAL_ID": "runnersstatus1A5771C0", + "STACK_NAME": "github-runners-test" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "SetupLog8A8B0E5C" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersstatusServiceRole71A1ADB6", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 180 + }, + "DependsOn": [ + "runnersstatusServiceRoleDefaultPolicyBD4E619B", + "runnersstatusServiceRole71A1ADB6" + ], + "Metadata": { + "providers": [ + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild-x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildx64CodeBuildRole32E5C764", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildx64LogsA21ECD59" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderLogsE4CADFCC" + } + } + }, + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild-ubuntu-2404-x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildUbuntu2404x64Logs27D26829" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" + } + } + }, + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild", + "linux", + "arm64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildARMCodeBuildRole74DB4985", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildARMLogs7C7FC5A7" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" + } + } + }, + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild", + "windows", + "x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildWindowsCodeBuildRoleDC93697E", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildWindowsLogsF4DD93A5" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "WindowsImageBuilderDockerLogE660E23E" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs", + "linux", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSsecuritygroup76605212", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECStaskTaskRoleFE831ECD", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSlogs71446134" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderLogsE4CADFCC" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs-ubuntu-2404", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSUbuntu2404securitygroupEE405C76", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECSUbuntu2404taskTaskRoleDF683F3B", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSUbuntu2404logsFB15C25B" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs", + "linux", + "arm64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSARM64securitygroup281D94B2", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECSARM64taskTaskRole23B1CB4E", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSARM64logs1A2F1E00" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs", + "windows", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSWindowssecuritygroupB4EE54DA", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECSWindowstaskTaskRole17C8DA48", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSWindowslogs83D9D352" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "WindowsImageBuilderDockerLogE660E23E" + } + } + }, + { + "type": "LambdaRunnerProvider", + "labels": [ + "lambda", + "x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "LambdaFunctionServiceRoleB1826A50", + "Arn" + ] + }, + "logGroup": { + "Ref": "LambdaLog2764B04F" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "LambdaImageBuilderx64Logs1C003BB4" + } + } + }, + { + "type": "LambdaRunnerProvider", + "labels": [ + "lambda", + "arm64" + ], + "roleArn": { + "Fn::GetAtt": [ + "LambdaARMFunctionServiceRole136069A0", + "Arn" + ] + }, + "logGroup": { + "Ref": "LambdaARMLogAA2DA09F" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "LambdaImageBuilderzLogsC9FB42C8" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate", + "linux", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "FargatesecuritygroupAFCAFD34", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "FargatetaskTaskRoleEFFCDAF8", + "Arn" + ] + }, + "logGroup": { + "Ref": "FargatelogsCB753638" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderLogs2F794091" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate-spot", + "linux", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "Fargatex64spotsecuritygroup2A9F4299", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "Fargatex64spottaskTaskRole02893C25", + "Arn" + ] + }, + "logGroup": { + "Ref": "Fargatex64spotlogs0BCF618B" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderLogs2F794091" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate", + "linux", + "arm64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "Fargatearm64securitygroup08ABAD9E", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "Fargatearm64taskTaskRoleD3C2CD58", + "Arn" + ] + }, + "logGroup": { + "Ref": "Fargatearm64logs00171A52" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderarmLogs63D60F4D" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate-spot", + "linux", + "arm64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "Fargatearm64spotsecuritygroup20C885E4", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "Fargatearm64spottaskTaskRole0F078C81", + "Arn" + ] + }, + "logGroup": { + "Ref": "Fargatearm64spotlogsEFCCEC59" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderarmLogs63D60F4D" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate", + "windows", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "FargateWindowssecuritygroupE684A7B0", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "FargateWindowstaskTaskRole364508C8", + "Arn" + ] + }, + "logGroup": { + "Ref": "FargateWindowslogs52881DBF" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "WindowsImageBuilderDockerLogE660E23E" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2", + "linux", + "x64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2LinuxSGF5B89300", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2LinuxRole8B6519A2", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "ami": { + "launchTemplate": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "amiBuilderLogGroup": { + "Ref": "AMILinuxBuilderAmiLog0DB16E38" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2-spot", + "linux", + "x64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2SpotLinuxSG8D846B64", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2SpotLinuxRole86333E5D", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "ami": { + "launchTemplate": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "amiBuilderLogGroup": { + "Ref": "AMILinuxBuilderAmiLog0DB16E38" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2", + "linux", + "arm64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2Linuxarm64SG550ECD6C", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2Linuxarm64Role242F68FF", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "ami": { + "launchTemplate": { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "amiBuilderLogGroup": { + "Ref": "AMILinuxarm64BuilderAmiLog84A9D94A" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2", + "windows", + "x64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2WindowsSG13E24976", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2WindowsRoleC0D850D2", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "ami": { + "launchTemplate": { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "amiBuilderLogGroup": { + "Ref": "WindowsEC2BuilderAmiLog126E54B2" + } + } + } + ] + } + }, + "runnersFailedRunnerImageBuilds233D2237": { + "Type": "AWS::SNS::Topic" + }, + "runnersFailedRunnerImageBuildsPolicyC1C99AF8": { + "Type": "AWS::SNS::TopicPolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Principal": { + "Service": "codestar-notifications.amazonaws.com" + }, + "Resource": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "Sid": "0" + } + ], + "Version": "2012-10-17" + }, + "Topics": [ + { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + } + ] + } + }, + "runnersImageBuilderBuildsDF5A50E4": { + "Type": "AWS::SNS::Topic" + }, + "runnersImageBuilderBuildsFilterServiceRoleED82BC5F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1", + "Roles": [ + { + "Ref": "runnersImageBuilderBuildsFilterServiceRoleED82BC5F" + } + ] + } + }, + "runnersImageBuilderBuildsFilterD708AA06": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip" + }, + "Description": "src/image-builders/aws-image-builder/filter-failed-builds.lambda.ts", + "Environment": { + "Variables": { + "TARGET_TOPIC_ARN": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersImageBuilderBuildsFilterServiceRoleED82BC5F", + "Arn" + ] + }, + "Runtime": "nodejs22.x" + }, + "DependsOn": [ + "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1", + "runnersImageBuilderBuildsFilterServiceRoleED82BC5F" + ] + }, + "runnersImageBuilderBuildsFilterAllowInvokegithubrunnerstestrunnersImageBuilderBuilds109FC9E855AB30DD": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersImageBuilderBuildsFilterD708AA06", + "Arn" + ] + }, + "Principal": "sns.amazonaws.com", + "SourceArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + } + } + }, + "runnersImageBuilderBuildsFilterImageBuilderBuilds7F42F563": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Fn::GetAtt": [ + "runnersImageBuilderBuildsFilterD708AA06", + "Arn" + ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + } + } + }, + "runnersWebhookerrors72F5BFF3": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Webhook errors", + "QueryString": { + "Fn::Join": [ + "", + [ + "filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersOrchestrationerrors9EFE206B": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Orchestration errors", + "QueryString": "filter level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" + } + }, + "runnersRunnerimagebuilderrorsC1D423F8": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + ], + "Name": "GitHub Runners/Runner image build errors", + "QueryString": "filter strcontains(message, \"error\") or strcontains(message, \"ERROR\") or strcontains(message, \"Error\") or level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" + } + }, + "runnersIgnoredwebhooksAD368063": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Ignored webhooks", + "QueryString": { + "Fn::Join": [ + "", + [ + "fields @timestamp, message.notice\n| filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter strcontains(message.notice, \"Ignoring\")\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersIgnoredjobsbasedonlabels120F3D1A": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Ignored jobs based on labels", + "QueryString": { + "Fn::Join": [ + "", + [ + "fields @timestamp, message.notice\n| filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter strcontains(message.notice, \"Ignoring labels\")\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersWebhookstartedrunners63776EDF": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Webhook started runners", + "QueryString": { + "Fn::Join": [ + "", + [ + "fields @timestamp, message.sfnInput.jobUrl, message.sfnInput.labels, message.sfnInput.provider\n| filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter message.sfnInput.jobUrl like /http.*/\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersWebhookredeliveriesD3F14437": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Webhook redeliveries", + "QueryString": "fields @timestamp, message.notice, message.deliveryId, message.guid\n| filter isPresent(message.deliveryId)\n| sort @timestamp desc\n| limit 100" + } + }, + "OrchestratorLogFB9610E7": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SetupLog8A8B0E5C": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id" + }, + "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2arm64recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended/image_id" + }, + "SsmParameterValueawsserviceamiwindowslatestWindowsServer2019EnglishFullECSOptimizedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized/image_id" + }, + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Outputs": { + "runnersstatuscommand4A30F0F5": { + "Value": { + "Fn::Join": [ + "", + [ + "aws --region ", + { + "Ref": "AWS::Region" + }, + " lambda invoke --function-name ", + { + "Ref": "runnersstatus1A5771C0" + }, + " status.json" + ] + ] + } + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file From 15dd40aa4193fcc78265d89d910219f6475cd585 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Mon, 24 Nov 2025 16:26:41 -0500 Subject: [PATCH 11/19] recipe l2 --- .projen/deps.json | 2 +- .projenrc.js | 2 +- package.json | 8 +- src/image-builders/aws-image-builder/ami.ts | 28 ++- .../aws-image-builder/builder.ts | 25 ++- .../aws-image-builder/container.ts | 38 ++-- .../aws-image-builder/deprecated/common.ts | 1 + .../github-runners-test.assets.json | 6 +- .../github-runners-test.template.json | 180 ++++++++++++++---- yarn.lock | 16 +- 10 files changed, 203 insertions(+), 103 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index b469b45e..084ea677 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -216,7 +216,7 @@ }, { "name": "aws-cdk-lib", - "version": "^2.227.0", + "version": "^2.229.0", "type": "peer" }, { diff --git a/.projenrc.js b/.projenrc.js index 3c6403fb..0b5c8e2a 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amir Szekely', authorAddress: 'amir@cloudsnorkel.com', stability: Stability.EXPERIMENTAL, - cdkVersion: '2.227.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.227.0 for imagebuilder + cdkVersion: '2.229.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.227.0 for imagebuilder defaultReleaseBranch: 'main', name: '@cloudsnorkel/cdk-github-runners', repositoryUrl: 'https://github.com/CloudSnorkel/cdk-github-runners.git', diff --git a/package.json b/package.json index 2ef36898..ed3f5347 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "organization": false }, "devDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "2.227.0-alpha.0", + "@aws-cdk/aws-imagebuilder-alpha": "2.229.0-alpha.0", "@aws-sdk/client-cloudformation": "^3.927.0", "@aws-sdk/client-codebuild": "^3.927.0", "@aws-sdk/client-ec2": "^3.927.0", @@ -94,7 +94,7 @@ "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", - "aws-cdk-lib": "2.227.0", + "aws-cdk-lib": "2.229.0", "bootstrap": "^5.2.0", "commit-and-tag-version": "^12", "constructs": "10.0.5", @@ -122,8 +122,8 @@ "vite-plugin-singlefile": "^2" }, "peerDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "^2.224.0-alpha.0", - "aws-cdk-lib": "^2.227.0", + "@aws-cdk/aws-imagebuilder-alpha": "^2.229.0-alpha.0", + "aws-cdk-lib": "^2.229.0", "constructs": "^10.0.5" }, "keywords": [ diff --git a/src/image-builders/aws-image-builder/ami.ts b/src/image-builders/aws-image-builder/ami.ts index 5742403a..eeb7f8a3 100644 --- a/src/image-builders/aws-image-builder/ami.ts +++ b/src/image-builders/aws-image-builder/ami.ts @@ -1,9 +1,8 @@ +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import * as cdk from 'aws-cdk-lib'; -import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ImageBuilderComponent } from './builder'; import { amiRootDevice, Architecture, Os } from '../../providers'; -import { uniqueImageBuilderName } from '../common'; /** * Properties for AmiRecipe construct. @@ -57,22 +56,22 @@ export class AmiRecipe extends cdk.Resource { let components = props.components.map(component => { return { - componentArn: component.arn, + component: component.component, }; }); const blockDeviceMappings = props.storageSize ? [ { deviceName: amiRootDevice(this, props.baseAmi).ref, - ebs: { - volumeSize: props.storageSize.toGibibytes(), - deleteOnTermination: true, + volume: { + ebsDevice: { + volumeSize: props.storageSize.toGibibytes(), + deleteOnTermination: true, + }, }, }, ] : undefined; - this.name = uniqueImageBuilderName(this); - let workingDirectory; if (props.platform == 'Linux') { workingDirectory = '/home/runner'; @@ -82,18 +81,17 @@ export class AmiRecipe extends cdk.Resource { throw new Error(`Unsupported AMI recipe platform: ${props.platform}`); } - const recipe = new imagebuilder.CfnImageRecipe(this, 'Recipe', { - name: this.name, - version: '1.0.x', - parentImage: props.baseAmi, + const recipe = new imagebuilder2.ImageRecipe(this, 'Recipe', { + baseImage: imagebuilder2.BaseImage.fromAmiId(props.baseAmi), components, workingDirectory, tags: props.tags, - blockDeviceMappings, + blockDevices: blockDeviceMappings, }); - this.arn = recipe.attrArn; - this.version = recipe.getAtt('Version', cdk.ResolutionTypeHint.STRING).toString(); + this.arn = recipe.imageRecipeArn; + this.name = recipe.imageRecipeName; + this.version = recipe.imageRecipeVersion; } } diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index ac24ccda..add67ddc 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -166,9 +166,11 @@ export interface ImageBuilderComponentProperties { */ export class ImageBuilderComponent extends cdk.Resource { /** - * Component ARN. + * Actual component resource. + * + * TODO replace this whole class with the new resource */ - public readonly arn: string; + public readonly component: imagebuilder2.Component; /** * Supported platform for the component. @@ -260,13 +262,11 @@ export class ImageBuilderComponent extends cdk.Resource { ], }; - const component = new imagebuilder2.Component(this, 'Component', { + this.component = new imagebuilder2.Component(this, 'Component', { description: props.description, platform: props.platform, data: imagebuilder2.ComponentData.fromJsonObject(data), }); - - this.arn = component.componentArn; } /** @@ -467,7 +467,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { })); // delete old version on update and on stack deletion - this.imageCleaner('Container', recipe.name.toLowerCase(), recipe.version); + this.imageCleaner('Container', recipe.name, recipe.version); // delete old docker images + IB resources daily new imagebuilder.CfnLifecyclePolicy(this, 'Lifecycle Policy Docker', { @@ -799,7 +799,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { } // delete old version on update and on stack deletion - this.imageCleaner('Image', recipe.name.toLowerCase(), recipe.version); + this.imageCleaner('Image', recipe.name, recipe.version); // delete old AMIs + IB resources daily new imagebuilder.CfnLifecyclePolicy(this, 'Lifecycle Policy AMI', { @@ -953,4 +953,15 @@ export class AwsImageBuilderFailedBuildNotifier implements cdk.IAspect { } } } + + // TODO + // { + // "detail-type": ["EC2 Image Builder Image State Change"], + // "source": ["aws.imagebuilder"], + // "detail": { + // "state": { + // "status": ["FAILED"] + // } + // } + // } } diff --git a/src/image-builders/aws-image-builder/container.ts b/src/image-builders/aws-image-builder/container.ts index 1baee1d8..208cd5df 100644 --- a/src/image-builders/aws-image-builder/container.ts +++ b/src/image-builders/aws-image-builder/container.ts @@ -1,9 +1,9 @@ +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import * as cdk from 'aws-cdk-lib'; -import { aws_ecr as ecr, aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; +import { aws_ecr as ecr } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { ImageBuilderComponent } from './builder'; import { Os } from '../../providers'; -import { uniqueImageBuilderName } from '../common'; /** * Properties for ContainerRecipe construct. @@ -63,31 +63,21 @@ export class ContainerRecipe extends cdk.Resource { constructor(scope: Construct, id: string, props: ContainerRecipeProperties) { super(scope, id); - let components = props.components.map(component => { - return { - componentArn: component.arn, - }; - }); - - this.name = uniqueImageBuilderName(this); - - const recipe = new imagebuilder.CfnContainerRecipe(this, 'Recipe', { - name: this.name, - version: '1.0.x', - parentImage: props.parentImage, - platformOverride: props.platform == 'Linux' ? 'Linux' : undefined, - components, - containerType: 'DOCKER', - targetRepository: { - service: 'ECR', - repositoryName: props.targetRepository.repositoryName, - }, - dockerfileTemplateData: props.dockerfileTemplate, + const recipe = new imagebuilder2.ContainerRecipe(this, 'Recipe', { + baseImage: imagebuilder2.BaseContainerImage.fromString(props.parentImage), + osVersion: props.platform == 'Linux' ? imagebuilder2.OSVersion.LINUX : undefined, + components: props.components.map(c => { + return { component: c.component }; + }), + // containerType: 'DOCKER', + targetRepository: imagebuilder2.Repository.fromEcr(props.targetRepository), + dockerfile: imagebuilder2.DockerfileData.fromInline(props.dockerfileTemplate), tags: props.tags, }); - this.arn = recipe.attrArn; - this.version = recipe.getAtt('Version', cdk.ResolutionTypeHint.STRING).toString(); + this.arn = recipe.containerRecipeArn; + this.name = recipe.containerRecipeName; + this.version = recipe.containerRecipeVersion; } } diff --git a/src/image-builders/aws-image-builder/deprecated/common.ts b/src/image-builders/aws-image-builder/deprecated/common.ts index 69d73378..cb3eea92 100644 --- a/src/image-builders/aws-image-builder/deprecated/common.ts +++ b/src/image-builders/aws-image-builder/deprecated/common.ts @@ -87,6 +87,7 @@ export abstract class ImageBuilderBase extends Construct implements IRunnerImage } protected createLog(recipeName: string): logs.LogGroup { + // TODO make image depend on the log group so it is created first return new logs.LogGroup(this, 'Log', { logGroupName: `/aws/imagebuilder/${recipeName}`, retention: this.logRetention, diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index bf395328..22837a09 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -225,16 +225,16 @@ } } }, - "baa8fec0d53edb3c21e84e2370b7fd8fceae946fdb4287b5a4bf72a274337ee8": { + "4fe4bcbe6ddb55fb9566791820d487ce7ff6dad3b455340192009ee4f72a60d6": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-2bdeb9d0": { + "current_account-current_region-c4bd05e9": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "baa8fec0d53edb3c21e84e2370b7fd8fceae946fdb4287b5a4bf72a274337ee8.json", + "objectKey": "4fe4bcbe6ddb55fb9566791820d487ce7ff6dad3b455340192009ee4f72a60d6.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 915bf522..6b1e0b2a 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2101,7 +2101,7 @@ "Version": "1.0.0" } }, - "WindowsImageBuilderContainerRecipeB2A421D7": { + "WindowsImageBuilderContainerRecipeA75D476F": { "Type": "AWS::ImageBuilder::ContainerRecipe", "Properties": { "Components": [ @@ -2172,7 +2172,7 @@ ], "ContainerType": "DOCKER", "DockerfileTemplateData": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\nENV RUNNER_VERSION=latest\n", - "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", + "Name": "github-runners-test-windowsimagebuilder-containerrecipe-f13be2cc", "ParentImage": "mcr.microsoft.com/windows/servercore:ltsc2019-amd64", "Tags": { "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", @@ -2190,7 +2190,20 @@ "WindowsImageBuilderDockerLogE660E23E": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeA75D476F", + "Name" + ] + } + ] + ] + }, "RetentionInDays": 30 }, "UpdateReplacePolicy": "Delete", @@ -2241,7 +2254,7 @@ "Properties": { "ContainerRecipeArn": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", + "WindowsImageBuilderContainerRecipeA75D476F", "Arn" ] }, @@ -2298,10 +2311,17 @@ { "Ref": "AWS::AccountId" }, - ":image/github-runners-test-windowsimagebuilder-containerrecipe-c577a80b/", + ":image/", { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", + "WindowsImageBuilderContainerRecipeA75D476F", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeA75D476F", "Version" ] } @@ -2396,10 +2416,15 @@ "ResourceSelection": { "Recipes": [ { - "Name": "github-runners-test-WindowsImageBuilder-ContainerRecipe-C577A80B", + "Name": { + "Fn::GetAtt": [ + "WindowsImageBuilderContainerRecipeA75D476F", + "Name" + ] + }, "SemanticVersion": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", + "WindowsImageBuilderContainerRecipeA75D476F", "Version" ] } @@ -2414,7 +2439,7 @@ "Properties": { "ContainerRecipeArn": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeB2A421D7", + "WindowsImageBuilderContainerRecipeA75D476F", "Arn" ] }, @@ -2778,7 +2803,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "AMILinuxBuilderAmiRecipe7C7ED6C7": { + "AMILinuxBuilderAmiRecipeB7CF9599": { "Type": "AWS::ImageBuilder::ImageRecipe", "Properties": { "BlockDeviceMappings": [ @@ -2874,7 +2899,7 @@ } } ], - "Name": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", + "Name": "github-runners-test-amilinuxbuilder-amirecipe-711bc2a3", "ParentImage": { "Fn::Join": [ "", @@ -2902,7 +2927,20 @@ "AMILinuxBuilderAmiLog0DB16E38": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Name" + ] + } + ] + ] + }, "RetentionInDays": 30 }, "UpdateReplacePolicy": "Delete", @@ -2959,7 +2997,7 @@ }, "ImageRecipeArn": { "Fn::GetAtt": [ - "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderAmiRecipeB7CF9599", "Arn" ] }, @@ -2996,7 +3034,7 @@ }, "ImageRecipeArn": { "Fn::GetAtt": [ - "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderAmiRecipeB7CF9599", "Arn" ] }, @@ -3050,10 +3088,17 @@ { "Ref": "AWS::AccountId" }, - ":image/github-runners-test-amilinuxbuilder-amirecipe-2b5c5a8b/", + ":image/", { "Fn::GetAtt": [ - "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderAmiRecipeB7CF9599", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", "Version" ] } @@ -3158,10 +3203,15 @@ "ResourceSelection": { "Recipes": [ { - "Name": "github-runners-test-AMILinuxBuilder-AmiRecipe-2B5C5A8B", + "Name": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Name" + ] + }, "SemanticVersion": { "Fn::GetAtt": [ - "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderAmiRecipeB7CF9599", "Version" ] } @@ -5634,7 +5684,7 @@ "Version": "1.0.0" } }, - "AMILinuxarm64BuilderAmiRecipe6A6ED38F": { + "AMILinuxarm64BuilderAmiRecipe4287E320": { "Type": "AWS::ImageBuilder::ImageRecipe", "Properties": { "Components": [ @@ -5719,7 +5769,7 @@ } } ], - "Name": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", + "Name": "github-runners-test-amilinuxarm64builder-amirecipe-841295f9", "ParentImage": { "Fn::Join": [ "", @@ -5747,7 +5797,20 @@ "AMILinuxarm64BuilderAmiLog84A9D94A": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Name" + ] + } + ] + ] + }, "RetentionInDays": 30 }, "UpdateReplacePolicy": "Delete", @@ -5804,7 +5867,7 @@ }, "ImageRecipeArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "AMILinuxarm64BuilderAmiRecipe4287E320", "Arn" ] }, @@ -5841,7 +5904,7 @@ }, "ImageRecipeArn": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "AMILinuxarm64BuilderAmiRecipe4287E320", "Arn" ] }, @@ -5895,10 +5958,17 @@ { "Ref": "AWS::AccountId" }, - ":image/github-runners-test-amilinuxarm64builder-amirecipe-9167b5ef/", + ":image/", { "Fn::GetAtt": [ - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", "Version" ] } @@ -6003,10 +6073,15 @@ "ResourceSelection": { "Recipes": [ { - "Name": "github-runners-test-AMILinuxarm64Builder-AmiRecipe-9167B5EF", + "Name": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Name" + ] + }, "SemanticVersion": { "Fn::GetAtt": [ - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "AMILinuxarm64BuilderAmiRecipe4287E320", "Version" ] } @@ -6316,7 +6391,7 @@ "Version": "1.0.0" } }, - "WindowsEC2BuilderAmiRecipe41A137FF": { + "WindowsEC2BuilderAmiRecipe9D687A09": { "Type": "AWS::ImageBuilder::ImageRecipe", "Properties": { "Components": [ @@ -6401,7 +6476,7 @@ } } ], - "Name": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", + "Name": "github-runners-test-windowsec2builder-amirecipe-a290749e", "ParentImage": { "Fn::Join": [ "", @@ -6429,7 +6504,20 @@ "WindowsEC2BuilderAmiLog126E54B2": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/imagebuilder/github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Name" + ] + } + ] + ] + }, "RetentionInDays": 30 }, "UpdateReplacePolicy": "Delete", @@ -6486,7 +6574,7 @@ }, "ImageRecipeArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderAmiRecipe41A137FF", + "WindowsEC2BuilderAmiRecipe9D687A09", "Arn" ] }, @@ -6523,7 +6611,7 @@ }, "ImageRecipeArn": { "Fn::GetAtt": [ - "WindowsEC2BuilderAmiRecipe41A137FF", + "WindowsEC2BuilderAmiRecipe9D687A09", "Arn" ] }, @@ -6577,10 +6665,17 @@ { "Ref": "AWS::AccountId" }, - ":image/github-runners-test-windowsec2builder-amirecipe-beda5750/", + ":image/", { "Fn::GetAtt": [ - "WindowsEC2BuilderAmiRecipe41A137FF", + "WindowsEC2BuilderAmiRecipe9D687A09", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", "Version" ] } @@ -6685,10 +6780,15 @@ "ResourceSelection": { "Recipes": [ { - "Name": "github-runners-test-WindowsEC2Builder-AmiRecipe-BEDA5750", + "Name": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Name" + ] + }, "SemanticVersion": { "Fn::GetAtt": [ - "WindowsEC2BuilderAmiRecipe41A137FF", + "WindowsEC2BuilderAmiRecipe9D687A09", "Version" ] } @@ -13137,7 +13237,7 @@ "AMILinuxBuilderAmiLog0DB16E38", "AMILinuxBuilderAMIPipelineEC5051DF", "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", - "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderAmiRecipeB7CF9599", "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", @@ -13369,7 +13469,7 @@ "AMILinuxBuilderAmiLog0DB16E38", "AMILinuxBuilderAMIPipelineEC5051DF", "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", - "AMILinuxBuilderAmiRecipe7C7ED6C7", + "AMILinuxBuilderAmiRecipeB7CF9599", "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", @@ -13564,7 +13664,7 @@ "AMILinuxarm64BuilderAMIImage40078F9E", "AMILinuxarm64BuilderAmiLog84A9D94A", "AMILinuxarm64BuilderAMIPipeline9CC1354C", - "AMILinuxarm64BuilderAmiRecipe6A6ED38F", + "AMILinuxarm64BuilderAmiRecipe4287E320", "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", @@ -13759,7 +13859,7 @@ "WindowsEC2BuilderAMIImage9D812188", "WindowsEC2BuilderAmiLog126E54B2", "WindowsEC2BuilderAMIPipelineE3836949", - "WindowsEC2BuilderAmiRecipe41A137FF", + "WindowsEC2BuilderAmiRecipe9D687A09", "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", diff --git a/yarn.lock b/yarn.lock index 460ab536..9b4d03ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,10 +23,10 @@ resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== -"@aws-cdk/aws-imagebuilder-alpha@2.227.0-alpha.0": - version "2.227.0-alpha.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.227.0-alpha.0.tgz#e3f50636068533139af5ccd0e0195752772d2449" - integrity sha512-1NcqF0hcHhj0wEpgXhvI0L9OsfzIbuF9PRSWtSy+hgcsV0nQvXTpsZoah9ymXxKMjAdlHq8WrMct9FIrlShpSA== +"@aws-cdk/aws-imagebuilder-alpha@2.229.0-alpha.0": + version "2.229.0-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.229.0-alpha.0.tgz#fa2718bf2b23615b8d0b57932f983b5e90a3b5b0" + integrity sha512-CiYwWHuHT6MwuV2LrZ1aWdva4LPrB0Dk//niglJ+RakDIKbO1lQmHvtpqD8civTr/n3jCU+ECh+TheEbxmvRqw== dependencies: yaml "1.10.2" @@ -3270,10 +3270,10 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.227.0: - version "2.227.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.227.0.tgz#e6cc5c84f3acecd2019d5c92944c27f38e8bcb77" - integrity sha512-55zrZrlmtV9IDwciqrqBfy4lV/ZbwZY4nKQosjKJmWC+Y+DYQbK3qO/NbaoeywNFxM5xHZ/bNFYdWqKXNkImWQ== +aws-cdk-lib@2.229.0: + version "2.229.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.229.0.tgz#31ea6ce6aeb478676ffedfa21201976747afcb34" + integrity sha512-Wsopzi0rf5oWxv+GDhO8+OYEsu2CAj+uuYxSqTO4LYqRsHoWCepWHK7q4tUFBRzo/j2YcVh2ezuSlaSA+41kQw== dependencies: "@aws-cdk/asset-awscli-v1" "2.2.242" "@aws-cdk/asset-node-proxy-agent-v6" "^2.1.0" From 2c27658b155f4d963272aa51eb6c8e4d0185a8b9 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Mon, 24 Nov 2025 17:00:57 -0500 Subject: [PATCH 12/19] workflow l2 --- .../aws-image-builder/builder.ts | 2 +- .../aws-image-builder/workflow.ts | 53 ++----------------- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index add67ddc..04b32583 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -603,7 +603,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { let executionRole: iam.IRole | undefined; if (this.dockerSetupCommands.length > 0) { workflows = [{ - workflowArn: generateBuildWorkflowWithDockerSetupCommands(this, 'Build', this.dockerSetupCommands).arn, + workflowArn: generateBuildWorkflowWithDockerSetupCommands(this, 'Build', this.dockerSetupCommands).workflowArn, }]; executionRole = iam.Role.fromRoleArn(this, 'Image Builder Role', cdk.Stack.of(this).formatArn({ service: 'iam', diff --git a/src/image-builders/aws-image-builder/workflow.ts b/src/image-builders/aws-image-builder/workflow.ts index dfd3c3a4..af225398 100644 --- a/src/image-builders/aws-image-builder/workflow.ts +++ b/src/image-builders/aws-image-builder/workflow.ts @@ -1,49 +1,6 @@ -import * as cdk from 'aws-cdk-lib'; -import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib'; +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import { Construct } from 'constructs'; -import { uniqueImageBuilderName } from '../common'; -/** - * Properties for Workflow construct. - * - * @internal - */ -export interface WorkflowProperties { - /** - * Workflow type. - */ - readonly type: 'BUILD' | 'TEST' | 'DISTRIBUTION'; - - /** - * YAML or JSON data for the workflow. - */ - readonly data: any; -} - -/** - * Image builder workflow. - * - * @internal - */ -export class Workflow extends cdk.Resource { - public readonly arn: string; - public readonly name: string; - - constructor(scope: Construct, id: string, props: WorkflowProperties) { - super(scope, id); - - this.name = uniqueImageBuilderName(this); - - const workflow = new imagebuilder.CfnWorkflow(this, 'Workflow', { - name: uniqueImageBuilderName(this), - version: '1.0.x', - type: props.type, - data: JSON.stringify(props.data), - }); - - this.arn = workflow.attrArn; - } -} /** * Returns a new build workflow based on arn:aws:imagebuilder:us-east-1:aws:workflow/build/build-container/1.0.1/1. @@ -53,9 +10,9 @@ export class Workflow extends cdk.Resource { * @internal */ export function generateBuildWorkflowWithDockerSetupCommands(scope: Construct, id: string, dockerSetupCommands: string[]) { - return new Workflow(scope, id, { - type: 'BUILD', - data: { + return new imagebuilder2.Workflow(scope, id, { + workflowType: imagebuilder2.WorkflowType.BUILD, + data: imagebuilder2.WorkflowData.fromJsonObject({ name: 'build-container', description: 'Workflow to build a container image', schemaVersion: 1, @@ -112,6 +69,6 @@ export function generateBuildWorkflowWithDockerSetupCommands(scope: Construct, i value: '$.stepOutputs.LaunchBuildInstance.instanceId', }, ], - }, + }), }); } From fbfa62b8a975b190907d872d677fa0a758255764 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Mon, 24 Nov 2025 17:28:15 -0500 Subject: [PATCH 13/19] remove empty abstraction --- .../aws-image-builder/builder.ts | 34 ++++---- .../aws-image-builder/container.ts | 81 ------------------- .../aws-image-builder/deprecated/container.ts | 23 +++--- .../github-runners-test.assets.json | 6 +- .../github-runners-test.template.json | 18 ++--- 5 files changed, 42 insertions(+), 120 deletions(-) diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index 04b32583..906fb3a6 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -21,7 +21,7 @@ import { TagMutability } from 'aws-cdk-lib/aws-ecr'; import { RetentionDays } from 'aws-cdk-lib/aws-logs'; import { Construct, IConstruct } from 'constructs'; import { AmiRecipe, defaultBaseAmi } from './ami'; -import { ContainerRecipe, defaultBaseDockerImage } from './container'; +import { defaultBaseDockerImage } from './container'; import { DeleteResourcesFunction } from './delete-resources-function'; import { DeleteResourcesProps } from './delete-resources.lambda'; import { FilterFailedBuildsFunction } from './filter-failed-builds-function'; @@ -369,10 +369,10 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { private platform() { if (this.os.is(Os.WINDOWS)) { - return 'Windows'; + return imagebuilder2.Platform.WINDOWS; } if (this.os.isIn(Os._ALL_LINUX_VERSIONS)) { - return 'Linux'; + return imagebuilder2.Platform.LINUX; } throw new Error(`OS ${this.os.name} is not supported by AWS Image Builder`); } @@ -414,27 +414,29 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { } } - const recipe = new ContainerRecipe(this, 'Container Recipe', { - platform: this.platform(), - components: this.bindComponents(), - targetRepository: repository, - dockerfileTemplate: dockerfileTemplate, - parentImage: this.baseImage, + const recipe = new imagebuilder2.ContainerRecipe(this, 'Recipe', { + baseImage: imagebuilder2.BaseContainerImage.fromString(this.baseImage), + osVersion: this.os.isIn(Os._ALL_LINUX_VERSIONS) ? imagebuilder2.OSVersion.LINUX : undefined, + components: this.bindComponents().map(c => { + return { component: c.component }; + }), + targetRepository: imagebuilder2.Repository.fromEcr(repository), + dockerfile: imagebuilder2.DockerfileData.fromInline(dockerfileTemplate), tags: this.tags, }); - const log = this.createLog('Docker Log', recipe.name); + const log = this.createLog('Docker Log', recipe.containerRecipeName); const infra = this.createInfrastructure([ iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore'), iam.ManagedPolicy.fromAwsManagedPolicyName('EC2InstanceProfileForImageBuilderECRContainerBuilds'), ]); if (this.waitOnDeploy) { - this.createImage(infra, dist, log, undefined, recipe.arn); + this.createImage(infra, dist, log, undefined, recipe.containerRecipeArn); } this.dockerImageCleaner(recipe, repository); - this.createPipeline(infra, dist, log, undefined, recipe.arn); + this.createPipeline(infra, dist, log, undefined, recipe.containerRecipeArn); this.boundDockerImage = { imageRepository: repository, @@ -449,7 +451,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { return this.boundDockerImage; } - private dockerImageCleaner(recipe: ContainerRecipe, repository: ecr.IRepository) { + private dockerImageCleaner(recipe: imagebuilder2.ContainerRecipe, repository: ecr.IRepository) { // this is here to provide safe upgrade from old cdk-github-runners versions // this lambda was used by a custom resource to delete all images builds on cleanup // if we remove the custom resource and the lambda, the old images will be deleted on update @@ -467,7 +469,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { })); // delete old version on update and on stack deletion - this.imageCleaner('Container', recipe.name, recipe.version); + this.imageCleaner('Container', recipe.containerRecipeName, recipe.containerRecipeVersion); // delete old docker images + IB resources daily new imagebuilder.CfnLifecyclePolicy(this, 'Lifecycle Policy Docker', { @@ -510,8 +512,8 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { resourceSelection: { recipes: [ { - name: recipe.name, - semanticVersion: recipe.version, + name: recipe.containerRecipeName, + semanticVersion: recipe.containerRecipeVersion, }, ], }, diff --git a/src/image-builders/aws-image-builder/container.ts b/src/image-builders/aws-image-builder/container.ts index 208cd5df..b148b324 100644 --- a/src/image-builders/aws-image-builder/container.ts +++ b/src/image-builders/aws-image-builder/container.ts @@ -1,86 +1,5 @@ -import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; -import * as cdk from 'aws-cdk-lib'; -import { aws_ecr as ecr } from 'aws-cdk-lib'; -import { Construct } from 'constructs'; -import { ImageBuilderComponent } from './builder'; import { Os } from '../../providers'; -/** - * Properties for ContainerRecipe construct. - * - * @internal - */ -export interface ContainerRecipeProperties { - /** - * Target platform. Must match builder platform. - */ - readonly platform: 'Linux' | 'Windows'; - - /** - * Components to add to target container image. - */ - readonly components: ImageBuilderComponent[]; - - /** - * ECR repository where resulting container image will be uploaded. - */ - readonly targetRepository: ecr.IRepository; - - /** - * Dockerfile template where all the components will be added. - * - * Must contain at least the following placeholders: - * - * ``` - * FROM {{{ imagebuilder:parentImage }}} - * {{{ imagebuilder:environments }}} - * {{{ imagebuilder:components }}} - * ``` - */ - readonly dockerfileTemplate: string; - - /** - * Parent image for the new Docker Image. - */ - readonly parentImage: string; - - /** - * Tags to apply to the recipe and image. - */ - readonly tags: { [key: string]: string }; -} - -/** - * Image builder recipe for a Docker container image. - * - * @internal - */ -export class ContainerRecipe extends cdk.Resource { - public readonly arn: string; - public readonly name: string; - public readonly version: string; - - constructor(scope: Construct, id: string, props: ContainerRecipeProperties) { - super(scope, id); - - const recipe = new imagebuilder2.ContainerRecipe(this, 'Recipe', { - baseImage: imagebuilder2.BaseContainerImage.fromString(props.parentImage), - osVersion: props.platform == 'Linux' ? imagebuilder2.OSVersion.LINUX : undefined, - components: props.components.map(c => { - return { component: c.component }; - }), - // containerType: 'DOCKER', - targetRepository: imagebuilder2.Repository.fromEcr(props.targetRepository), - dockerfile: imagebuilder2.DockerfileData.fromInline(props.dockerfileTemplate), - tags: props.tags, - }); - - this.arn = recipe.containerRecipeArn; - this.name = recipe.containerRecipeName; - this.version = recipe.containerRecipeVersion; - } -} - /** * Default base Docker image for given OS. * diff --git a/src/image-builders/aws-image-builder/deprecated/container.ts b/src/image-builders/aws-image-builder/deprecated/container.ts index 34eb7f2e..59a7f77a 100644 --- a/src/image-builders/aws-image-builder/deprecated/container.ts +++ b/src/image-builders/aws-image-builder/deprecated/container.ts @@ -1,3 +1,4 @@ +import * as imagebuilder2 from '@aws-cdk/aws-imagebuilder-alpha'; import * as cdk from 'aws-cdk-lib'; import { aws_ec2 as ec2, @@ -19,7 +20,6 @@ import { singletonLambda } from '../../../utils'; import { BuildImageFunction } from '../../build-image-function'; import { uniqueImageBuilderName } from '../../common'; import { ImageBuilderComponent } from '../builder'; -import { ContainerRecipe } from '../container'; const dockerfileTemplate = `FROM {{{ imagebuilder:parentImage }}} ENV RUNNER_VERSION=___RUNNER_VERSION___ @@ -267,22 +267,23 @@ export class ContainerImageBuilder extends ImageBuilderBase { ], }); - const recipe = new ContainerRecipe(this, 'Container Recipe', { - platform: this.platform, - components: this.components, - targetRepository: this.repository, - dockerfileTemplate: dockerfileTemplate.replace('___RUNNER_VERSION___', this.runnerVersion.version), - parentImage: this.parentImage, - tags: {}, + const recipe = new imagebuilder2.ContainerRecipe(this, 'Recipe', { + baseImage: imagebuilder2.BaseContainerImage.fromString(this.parentImage), + osVersion: this.os.isIn(Os._ALL_LINUX_VERSIONS) ? imagebuilder2.OSVersion.LINUX : undefined, + components: this.components.map(c => { + return { component: c.component }; + }), + targetRepository: imagebuilder2.Repository.fromEcr(this.repository), + dockerfile: imagebuilder2.DockerfileData.fromInline(dockerfileTemplate.replace('___RUNNER_VERSION___', this.runnerVersion.version)), }); - const log = this.createLog(recipe.name); + const log = this.createLog(recipe.containerRecipeName); const infra = this.createInfrastructure([ iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore'), iam.ManagedPolicy.fromAwsManagedPolicyName('EC2InstanceProfileForImageBuilderECRContainerBuilds'), ]); - this.createImage(infra, dist, log, undefined, recipe.arn); - this.createPipeline(infra, dist, log, undefined, recipe.arn); + this.createImage(infra, dist, log, undefined, recipe.containerRecipeArn); + this.createPipeline(infra, dist, log, undefined, recipe.containerRecipeArn); this.imageCleaner(); diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index 22837a09..e82d9eaa 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -225,16 +225,16 @@ } } }, - "4fe4bcbe6ddb55fb9566791820d487ce7ff6dad3b455340192009ee4f72a60d6": { + "fb76d634231deaf9b19a8737c050dfd8cf3e07aaacbcc42ed3744e91191fe4d8": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-c4bd05e9": { + "current_account-current_region-206c1d05": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "4fe4bcbe6ddb55fb9566791820d487ce7ff6dad3b455340192009ee4f72a60d6.json", + "objectKey": "fb76d634231deaf9b19a8737c050dfd8cf3e07aaacbcc42ed3744e91191fe4d8.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 6b1e0b2a..631cdb22 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2101,7 +2101,7 @@ "Version": "1.0.0" } }, - "WindowsImageBuilderContainerRecipeA75D476F": { + "WindowsImageBuilderRecipeB7F00629": { "Type": "AWS::ImageBuilder::ContainerRecipe", "Properties": { "Components": [ @@ -2172,7 +2172,7 @@ ], "ContainerType": "DOCKER", "DockerfileTemplateData": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\nENV RUNNER_VERSION=latest\n", - "Name": "github-runners-test-windowsimagebuilder-containerrecipe-f13be2cc", + "Name": "github-runners-test-windowsimagebuilder-recipe-f7042c5a", "ParentImage": "mcr.microsoft.com/windows/servercore:ltsc2019-amd64", "Tags": { "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", @@ -2197,7 +2197,7 @@ "/aws/imagebuilder/", { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Name" ] } @@ -2254,7 +2254,7 @@ "Properties": { "ContainerRecipeArn": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Arn" ] }, @@ -2314,14 +2314,14 @@ ":image/", { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Name" ] }, "/", { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Version" ] } @@ -2418,13 +2418,13 @@ { "Name": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Name" ] }, "SemanticVersion": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Version" ] } @@ -2439,7 +2439,7 @@ "Properties": { "ContainerRecipeArn": { "Fn::GetAtt": [ - "WindowsImageBuilderContainerRecipeA75D476F", + "WindowsImageBuilderRecipeB7F00629", "Arn" ] }, From 064e565defbe706918b6c586c79e02ba5a577899 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Wed, 26 Nov 2025 21:02:14 -0500 Subject: [PATCH 14/19] pipeline + lifecycle L2 --- .projen/deps.json | 2 +- .projenrc.js | 2 +- package.json | 8 +- src/image-builders/aws-image-builder/ami.ts | 2 + .../aws-image-builder/builder.ts | 106 +++++++----------- src/image-builders/common.ts | 1 + .../github-runners-test.assets.json | 6 +- .../github-runners-test.template.json | 48 ++++---- yarn.lock | 16 +-- 9 files changed, 83 insertions(+), 108 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 084ea677..4646457c 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -216,7 +216,7 @@ }, { "name": "aws-cdk-lib", - "version": "^2.229.0", + "version": "^2.230.0", "type": "peer" }, { diff --git a/.projenrc.js b/.projenrc.js index 0b5c8e2a..320dfccd 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amir Szekely', authorAddress: 'amir@cloudsnorkel.com', stability: Stability.EXPERIMENTAL, - cdkVersion: '2.229.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.227.0 for imagebuilder + cdkVersion: '2.230.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.230.0 for imagebuilder defaultReleaseBranch: 'main', name: '@cloudsnorkel/cdk-github-runners', repositoryUrl: 'https://github.com/CloudSnorkel/cdk-github-runners.git', diff --git a/package.json b/package.json index ed3f5347..955d1f41 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "organization": false }, "devDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "2.229.0-alpha.0", + "@aws-cdk/aws-imagebuilder-alpha": "2.230.0-alpha.0", "@aws-sdk/client-cloudformation": "^3.927.0", "@aws-sdk/client-codebuild": "^3.927.0", "@aws-sdk/client-ec2": "^3.927.0", @@ -94,7 +94,7 @@ "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", - "aws-cdk-lib": "2.229.0", + "aws-cdk-lib": "2.230.0", "bootstrap": "^5.2.0", "commit-and-tag-version": "^12", "constructs": "10.0.5", @@ -122,8 +122,8 @@ "vite-plugin-singlefile": "^2" }, "peerDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "^2.229.0-alpha.0", - "aws-cdk-lib": "^2.229.0", + "@aws-cdk/aws-imagebuilder-alpha": "^2.230.0-alpha.0", + "aws-cdk-lib": "^2.230.0", "constructs": "^10.0.5" }, "keywords": [ diff --git a/src/image-builders/aws-image-builder/ami.ts b/src/image-builders/aws-image-builder/ami.ts index eeb7f8a3..69908bff 100644 --- a/src/image-builders/aws-image-builder/ami.ts +++ b/src/image-builders/aws-image-builder/ami.ts @@ -47,6 +47,7 @@ interface AmiRecipeProperties { * @internal */ export class AmiRecipe extends cdk.Resource { + public readonly recipe: imagebuilder2.ImageRecipe; public readonly arn: string; public readonly name: string; public readonly version: string; @@ -89,6 +90,7 @@ export class AmiRecipe extends cdk.Resource { blockDevices: blockDeviceMappings, }); + this.recipe = recipe; this.arn = recipe.imageRecipeArn; this.name = recipe.imageRecipeName; this.version = recipe.imageRecipeVersion; diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index 906fb3a6..3dcf06ef 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -29,7 +29,7 @@ import { generateBuildWorkflowWithDockerSetupCommands } from './workflow'; import { Architecture, Os, RunnerAmi, RunnerImage, RunnerVersion } from '../../providers'; import { singletonLambda, singletonLogGroup, SingletonLogType } from '../../utils'; import { BuildImageFunction } from '../build-image-function'; -import { RunnerImageBuilderBase, RunnerImageBuilderProps, uniqueImageBuilderName } from '../common'; +import { RunnerImageBuilderBase, RunnerImageBuilderProps } from '../common'; export interface AwsImageBuilderRunnerImageBuilderProps { /** @@ -436,7 +436,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { } this.dockerImageCleaner(recipe, repository); - this.createPipeline(infra, dist, log, undefined, recipe.containerRecipeArn); + this.createPipeline(infra, dist, log, undefined, recipe); this.boundDockerImage = { imageRepository: repository, @@ -472,8 +472,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { this.imageCleaner('Container', recipe.containerRecipeName, recipe.containerRecipeVersion); // delete old docker images + IB resources daily - new imagebuilder.CfnLifecyclePolicy(this, 'Lifecycle Policy Docker', { - name: uniqueImageBuilderName(this), + new imagebuilder2.LifecyclePolicy(this, 'Lifecycle Policy Docker', { description: `Delete old GitHub Runner Docker images for ${this.node.path}`, executionRole: new iam.Role(this, 'Lifecycle Policy Docker Role', { assumedBy: new iam.ServicePrincipal('imagebuilder.amazonaws.com'), @@ -495,27 +494,21 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { ], }), }, - }).roleArn, - policyDetails: [{ + }), + details: [{ action: { - type: 'DELETE', - includeResources: { - containers: true, - }, + type: imagebuilder2.LifecyclePolicyActionType.DELETE, + includeContainers: true, }, filter: { - type: 'COUNT', - value: 2, + countFilter: { + count: 2, + }, }, }], - resourceType: 'CONTAINER_IMAGE', + resourceType: imagebuilder2.LifecyclePolicyResourceType.CONTAINER_IMAGE, resourceSelection: { - recipes: [ - { - name: recipe.containerRecipeName, - semanticVersion: recipe.containerRecipeVersion, - }, - ], + recipes: [recipe], }, }); } @@ -557,7 +550,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { protected createImage(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder2.DistributionConfiguration, log: logs.LogGroup, imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImage { - const image = new imagebuilder.CfnImage(this, this.amiOrContainerId('Image', imageRecipeArn, containerRecipeArn), { + const image = new imagebuilder.CfnImage(this, this.amiOrContainerId('Image', imageRecipeArn !== undefined), { infrastructureConfigurationArn: infra.infrastructureConfigurationArn, distributionConfigurationArn: dist.distributionConfigurationArn, imageRecipeArn, @@ -579,56 +572,42 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { return image; } - private amiOrContainerId(baseId: string, imageRecipeArn?: string, containerRecipeArn?: string) { - if (imageRecipeArn) { + private amiOrContainerId(baseId: string, ami: boolean) { + if (ami) { return `AMI ${baseId}`; - } - if (containerRecipeArn) { + } else { return `Docker ${baseId}`; } - throw new Error('Either imageRecipeArn or containerRecipeArn must be defined'); } protected createPipeline(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder2.DistributionConfiguration, log: logs.LogGroup, - imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImagePipeline { + imageRecipe?: imagebuilder2.ImageRecipe, containerRecipe?: imagebuilder2.ContainerRecipe) { // set schedule - let scheduleOptions: imagebuilder.CfnImagePipeline.ScheduleProperty | undefined; + let scheduleOptions: imagebuilder2.ImagePipelineSchedule | undefined; if (this.rebuildInterval.toDays() > 0) { scheduleOptions = { - scheduleExpression: events.Schedule.rate(this.rebuildInterval).expressionString, - pipelineExecutionStartCondition: 'EXPRESSION_MATCH_ONLY', + expression: events.Schedule.rate(this.rebuildInterval), + startCondition: imagebuilder2.ScheduleStartCondition.EXPRESSION_MATCH_ONLY, }; } // generate workflows, if needed - let workflows: imagebuilder.CfnImagePipeline.WorkflowConfigurationProperty[] | undefined; - let executionRole: iam.IRole | undefined; + let workflows: imagebuilder2.WorkflowConfiguration[] | undefined; if (this.dockerSetupCommands.length > 0) { workflows = [{ - workflowArn: generateBuildWorkflowWithDockerSetupCommands(this, 'Build', this.dockerSetupCommands).workflowArn, + workflow: generateBuildWorkflowWithDockerSetupCommands(this, 'Build', this.dockerSetupCommands), }]; - executionRole = iam.Role.fromRoleArn(this, 'Image Builder Role', cdk.Stack.of(this).formatArn({ - service: 'iam', - region: '', - resource: 'role', - resourceName: 'aws-service-role/imagebuilder.amazonaws.com/AWSServiceRoleForImageBuilder', - })); } // generate pipeline - const pipeline = new imagebuilder.CfnImagePipeline(this, this.amiOrContainerId('Pipeline', imageRecipeArn, containerRecipeArn), { - name: uniqueImageBuilderName(this), + const pipeline = new imagebuilder2.ImagePipeline(this, this.amiOrContainerId('Pipeline', imageRecipe !== undefined), { // description: this.description, - infrastructureConfigurationArn: infra.infrastructureConfigurationArn, - distributionConfigurationArn: dist.distributionConfigurationArn, - imageRecipeArn, - containerRecipeArn, + infrastructureConfiguration: infra, + distributionConfiguration: dist, + recipe: imageRecipe ?? containerRecipe!, schedule: scheduleOptions, - imageTestsConfiguration: { - imageTestsEnabled: false, - }, + imageTestsEnabled: false, workflows: workflows, - executionRole: executionRole?.roleArn, tags: this.tags, }); pipeline.node.addDependency(infra); @@ -759,7 +738,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { if (this.waitOnDeploy) { this.createImage(infra, dist, log, recipe.arn, undefined); } - this.createPipeline(infra, dist, log, recipe.arn, undefined); + this.createPipeline(infra, dist, log, recipe.recipe, undefined); this.boundAmi = { launchTemplate: launchTemplate, @@ -804,8 +783,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { this.imageCleaner('Image', recipe.name, recipe.version); // delete old AMIs + IB resources daily - new imagebuilder.CfnLifecyclePolicy(this, 'Lifecycle Policy AMI', { - name: uniqueImageBuilderName(this), + new imagebuilder2.LifecyclePolicy(this, 'Lifecycle Policy AMI', { description: `Delete old GitHub Runner AMIs for ${this.node.path}`, executionRole: new iam.Role(this, 'Lifecycle Policy AMI Role', { assumedBy: new iam.ServicePrincipal('imagebuilder.amazonaws.com'), @@ -837,28 +815,22 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { ], }), }, - }).roleArn, - policyDetails: [{ + }), + details: [{ action: { - type: 'DELETE', - includeResources: { - amis: true, - snapshots: true, - }, + type: imagebuilder2.LifecyclePolicyActionType.DELETE, + includeAmis: true, + includeSnapshots: true, }, filter: { - type: 'COUNT', - value: 2, + countFilter: { + count: 2, + }, }, }], - resourceType: 'AMI_IMAGE', + resourceType: imagebuilder2.LifecyclePolicyResourceType.AMI_IMAGE, resourceSelection: { - recipes: [ - { - name: recipe.name, - semanticVersion: recipe.version, // docs say it's optional, but it's not - }, - ], + recipes: [recipe.recipe], }, }); } diff --git a/src/image-builders/common.ts b/src/image-builders/common.ts index d6602920..63ff20f0 100644 --- a/src/image-builders/common.ts +++ b/src/image-builders/common.ts @@ -8,6 +8,7 @@ import { Architecture, Os, RunnerAmi, RunnerImage, RunnerVersion } from '../prov /** * @internal + * @deprecated */ export function uniqueImageBuilderName(scope: Construct): string { return cdk.Names.uniqueResourceName(scope, { diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index e82d9eaa..a5662317 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -225,16 +225,16 @@ } } }, - "fb76d634231deaf9b19a8737c050dfd8cf3e07aaacbcc42ed3744e91191fe4d8": { + "2600cf3c6c42715f40d21ead60031094bd400c5e58742adaa1afe8df29db6e0f": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-206c1d05": { + "current_account-current_region-9b0f623b": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fb76d634231deaf9b19a8737c050dfd8cf3e07aaacbcc42ed3744e91191fe4d8.json", + "objectKey": "2600cf3c6c42715f40d21ead60031094bd400c5e58742adaa1afe8df29db6e0f.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 631cdb22..4360e50d 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2388,7 +2388,7 @@ ] } }, - "WindowsImageBuilderLifecyclePolicyDockerB9CE4B0A": { + "WindowsImageBuilderLifecyclePolicyDockerA66ED7F5": { "Type": "AWS::ImageBuilder::LifecyclePolicy", "Properties": { "Description": "Delete old GitHub Runner Docker images for github-runners-test/Windows Image Builder", @@ -2398,7 +2398,7 @@ "Arn" ] }, - "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", + "Name": "github-runners-test-windowsimagebuilder-lifecyclepolicydocker-9b0d4781", "PolicyDetails": [ { "Action": { @@ -2434,7 +2434,7 @@ "ResourceType": "CONTAINER_IMAGE" } }, - "WindowsImageBuilderDockerPipeline3613721A": { + "WindowsImageBuilderDockerPipeline28661C47": { "Type": "AWS::ImageBuilder::ImagePipeline", "Properties": { "ContainerRecipeArn": { @@ -2458,7 +2458,7 @@ "Arn" ] }, - "Name": "github-runners-test-WindowsImageBuilder-18C0E1B2", + "Name": "github-runners-test-windowsimagebuilder-dockerpipeline-5343f5e8", "Schedule": { "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", "ScheduleExpression": "rate(7 days)" @@ -3023,7 +3023,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" }, - "AMILinuxBuilderAMIPipelineEC5051DF": { + "AMILinuxBuilderAMIPipeline77F9C0F7": { "Type": "AWS::ImageBuilder::ImagePipeline", "Properties": { "DistributionConfigurationArn": { @@ -3047,7 +3047,7 @@ "Arn" ] }, - "Name": "github-runners-test-AMILinuxBuilder-67243E6D", + "Name": "github-runners-test-amilinuxbuilder-amipipeline-c87c140b", "Schedule": { "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", "ScheduleExpression": "rate(7 days)" @@ -3174,7 +3174,7 @@ ] } }, - "AMILinuxBuilderLifecyclePolicyAMIFB556CB2": { + "AMILinuxBuilderLifecyclePolicyAMI9EC6A562": { "Type": "AWS::ImageBuilder::LifecyclePolicy", "Properties": { "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux Builder", @@ -3184,7 +3184,7 @@ "Arn" ] }, - "Name": "github-runners-test-AMILinuxBuilder-67243E6D", + "Name": "github-runners-test-amilinuxbuilder-lifecyclepolicyami-b13f2c24", "PolicyDetails": [ { "Action": { @@ -5893,7 +5893,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" }, - "AMILinuxarm64BuilderAMIPipeline9CC1354C": { + "AMILinuxarm64BuilderAMIPipeline462B4E1B": { "Type": "AWS::ImageBuilder::ImagePipeline", "Properties": { "DistributionConfigurationArn": { @@ -5917,7 +5917,7 @@ "Arn" ] }, - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", + "Name": "github-runners-test-amilinuxarm64builder-amipipeline-7f59e36e", "Schedule": { "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", "ScheduleExpression": "rate(7 days)" @@ -6044,7 +6044,7 @@ ] } }, - "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD": { + "AMILinuxarm64BuilderLifecyclePolicyAMI1941512F": { "Type": "AWS::ImageBuilder::LifecyclePolicy", "Properties": { "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux arm64 Builder", @@ -6054,7 +6054,7 @@ "Arn" ] }, - "Name": "github-runners-test-AMILinuxarm64Builder-3F449283", + "Name": "github-runners-test-amilinuxarm64builder-lifecyclepolicyami-80d1039e", "PolicyDetails": [ { "Action": { @@ -6600,7 +6600,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "RetainExceptOnCreate" }, - "WindowsEC2BuilderAMIPipelineE3836949": { + "WindowsEC2BuilderAMIPipeline445918BA": { "Type": "AWS::ImageBuilder::ImagePipeline", "Properties": { "DistributionConfigurationArn": { @@ -6624,7 +6624,7 @@ "Arn" ] }, - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", + "Name": "github-runners-test-windowsec2builder-amipipeline-fef0bbd5", "Schedule": { "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", "ScheduleExpression": "rate(7 days)" @@ -6751,7 +6751,7 @@ ] } }, - "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7": { + "WindowsEC2BuilderLifecyclePolicyAMI73E24E7A": { "Type": "AWS::ImageBuilder::LifecyclePolicy", "Properties": { "Description": "Delete old GitHub Runner AMIs for github-runners-test/Windows EC2 Builder", @@ -6761,7 +6761,7 @@ "Arn" ] }, - "Name": "github-runners-test-WindowsEC2Builder-5FAF8285", + "Name": "github-runners-test-windowsec2builder-lifecyclepolicyami-964d181f", "PolicyDetails": [ { "Action": { @@ -13235,7 +13235,7 @@ "AMILinuxBuilderAMIDistribution215F3A5C", "AMILinuxBuilderAMIImage93D83DE5", "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderAMIPipelineEC5051DF", + "AMILinuxBuilderAMIPipeline77F9C0F7", "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", "AMILinuxBuilderAmiRecipeB7CF9599", "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", @@ -13252,8 +13252,8 @@ "AMILinuxBuilderInfrastructureInstanceProfileB423D304", "AMILinuxBuilderInfrastructure069F0561", "AMILinuxBuilderLaunchtemplateA29452C4", - "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "AMILinuxBuilderLifecyclePolicyAMI9EC6A562", "AMILinuxBuilderRoleDefaultPolicy69ED051F", "AMILinuxBuilderRole0C42378A", "AMILinuxBuilderSGEDC86329" @@ -13467,7 +13467,7 @@ "AMILinuxBuilderAMIDistribution215F3A5C", "AMILinuxBuilderAMIImage93D83DE5", "AMILinuxBuilderAmiLog0DB16E38", - "AMILinuxBuilderAMIPipelineEC5051DF", + "AMILinuxBuilderAMIPipeline77F9C0F7", "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", "AMILinuxBuilderAmiRecipeB7CF9599", "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", @@ -13484,8 +13484,8 @@ "AMILinuxBuilderInfrastructureInstanceProfileB423D304", "AMILinuxBuilderInfrastructure069F0561", "AMILinuxBuilderLaunchtemplateA29452C4", - "AMILinuxBuilderLifecyclePolicyAMIFB556CB2", "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "AMILinuxBuilderLifecyclePolicyAMI9EC6A562", "AMILinuxBuilderRoleDefaultPolicy69ED051F", "AMILinuxBuilderRole0C42378A", "AMILinuxBuilderSGEDC86329" @@ -13663,7 +13663,7 @@ "AMILinuxarm64BuilderAMIDistributionE6989D01", "AMILinuxarm64BuilderAMIImage40078F9E", "AMILinuxarm64BuilderAmiLog84A9D94A", - "AMILinuxarm64BuilderAMIPipeline9CC1354C", + "AMILinuxarm64BuilderAMIPipeline462B4E1B", "AMILinuxarm64BuilderAmiRecipe4287E320", "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", @@ -13679,8 +13679,8 @@ "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", "AMILinuxarm64BuilderInfrastructureA97EB3DD", "AMILinuxarm64BuilderLaunchtemplate8F5EFF44", - "AMILinuxarm64BuilderLifecyclePolicyAMI44B6EABD", "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", + "AMILinuxarm64BuilderLifecyclePolicyAMI1941512F", "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", "AMILinuxarm64BuilderRole40D54E29", "AMILinuxarm64BuilderSG94315968" @@ -13858,7 +13858,7 @@ "WindowsEC2BuilderAMIDistribution6B33DD89", "WindowsEC2BuilderAMIImage9D812188", "WindowsEC2BuilderAmiLog126E54B2", - "WindowsEC2BuilderAMIPipelineE3836949", + "WindowsEC2BuilderAMIPipeline445918BA", "WindowsEC2BuilderAmiRecipe9D687A09", "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", @@ -13874,8 +13874,8 @@ "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", "WindowsEC2BuilderInfrastructure4289B6D2", "WindowsEC2BuilderLaunchtemplate0A66E9C2", - "WindowsEC2BuilderLifecyclePolicyAMIF732B3A7", "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", + "WindowsEC2BuilderLifecyclePolicyAMI73E24E7A", "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", "WindowsEC2BuilderRole1BA7D3E7", "WindowsEC2BuilderSGE3F67842" diff --git a/yarn.lock b/yarn.lock index 9b4d03ef..6e262926 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,10 +23,10 @@ resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== -"@aws-cdk/aws-imagebuilder-alpha@2.229.0-alpha.0": - version "2.229.0-alpha.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.229.0-alpha.0.tgz#fa2718bf2b23615b8d0b57932f983b5e90a3b5b0" - integrity sha512-CiYwWHuHT6MwuV2LrZ1aWdva4LPrB0Dk//niglJ+RakDIKbO1lQmHvtpqD8civTr/n3jCU+ECh+TheEbxmvRqw== +"@aws-cdk/aws-imagebuilder-alpha@2.230.0-alpha.0": + version "2.230.0-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.230.0-alpha.0.tgz#e28591c6050afd6f51d2eea41efec81449200e9b" + integrity sha512-U5TG5emaUwCgqods/Uk7t7B5geegngGP9DwwKurAN76AVFXSoo1rclEbH7jMlkV27F98YVAzKtD6oMuFPLj0nw== dependencies: yaml "1.10.2" @@ -3270,10 +3270,10 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.229.0: - version "2.229.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.229.0.tgz#31ea6ce6aeb478676ffedfa21201976747afcb34" - integrity sha512-Wsopzi0rf5oWxv+GDhO8+OYEsu2CAj+uuYxSqTO4LYqRsHoWCepWHK7q4tUFBRzo/j2YcVh2ezuSlaSA+41kQw== +aws-cdk-lib@2.230.0: + version "2.230.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.230.0.tgz#551a35de9e72ad9625484099f9d341b53930e894" + integrity sha512-hA1cWZAHpvrwJE55N77Km/aPUgN9NfbGm98vi91OeLKFgMVhdCXM57lJUAYTq0e8JHWFRWmsVlm9R8pq5jTJeA== dependencies: "@aws-cdk/asset-awscli-v1" "2.2.242" "@aws-cdk/asset-node-proxy-agent-v6" "^2.1.0" From baf937fcc33767c6330ada2fc68e65ca54e3e845 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Mon, 1 Dec 2025 18:14:24 -0500 Subject: [PATCH 15/19] image L2 --- .projen/deps.json | 2 +- .projenrc.js | 2 +- package.json | 8 ++++---- .../aws-image-builder/builder.ts | 19 ++++++++----------- .../github-runners-test.template.json | 16 ++++++++-------- yarn.lock | 16 ++++++++-------- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 4646457c..74e43a9f 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -216,7 +216,7 @@ }, { "name": "aws-cdk-lib", - "version": "^2.230.0", + "version": "^2.231.0", "type": "peer" }, { diff --git a/.projenrc.js b/.projenrc.js index 320dfccd..fcd4387f 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amir Szekely', authorAddress: 'amir@cloudsnorkel.com', stability: Stability.EXPERIMENTAL, - cdkVersion: '2.230.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.230.0 for imagebuilder + cdkVersion: '2.231.0', // 2.21.1 for lambda url, 2.29.0 for Names.uniqueResourceName(), 2.50.0 for JsonPath.base64Encode, 2.77.0 for node 16, 2.110.0 for ib lifecycle, 2.123.0 for lambda logs, 2.155.0 for launch template throughput, 2.231.0 for imagebuilder defaultReleaseBranch: 'main', name: '@cloudsnorkel/cdk-github-runners', repositoryUrl: 'https://github.com/CloudSnorkel/cdk-github-runners.git', diff --git a/package.json b/package.json index 955d1f41..17ee4bba 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "organization": false }, "devDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "2.230.0-alpha.0", + "@aws-cdk/aws-imagebuilder-alpha": "2.231.0-alpha.0", "@aws-sdk/client-cloudformation": "^3.927.0", "@aws-sdk/client-codebuild": "^3.927.0", "@aws-sdk/client-ec2": "^3.927.0", @@ -94,7 +94,7 @@ "@typescript-eslint/eslint-plugin": "^8", "@typescript-eslint/parser": "^8", "aws-cdk": "^2", - "aws-cdk-lib": "2.230.0", + "aws-cdk-lib": "2.231.0", "bootstrap": "^5.2.0", "commit-and-tag-version": "^12", "constructs": "10.0.5", @@ -122,8 +122,8 @@ "vite-plugin-singlefile": "^2" }, "peerDependencies": { - "@aws-cdk/aws-imagebuilder-alpha": "^2.230.0-alpha.0", - "aws-cdk-lib": "^2.230.0", + "@aws-cdk/aws-imagebuilder-alpha": "^2.231.0-alpha.0", + "aws-cdk-lib": "^2.231.0", "constructs": "^10.0.5" }, "keywords": [ diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index 3dcf06ef..4d87850a 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -432,7 +432,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { ]); if (this.waitOnDeploy) { - this.createImage(infra, dist, log, undefined, recipe.containerRecipeArn); + this.createImage(infra, dist, log, undefined, recipe); } this.dockerImageCleaner(recipe, repository); @@ -549,15 +549,12 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { } protected createImage(infra: imagebuilder2.InfrastructureConfiguration, dist: imagebuilder2.DistributionConfiguration, log: logs.LogGroup, - imageRecipeArn?: string, containerRecipeArn?: string): imagebuilder.CfnImage { - const image = new imagebuilder.CfnImage(this, this.amiOrContainerId('Image', imageRecipeArn !== undefined), { - infrastructureConfigurationArn: infra.infrastructureConfigurationArn, - distributionConfigurationArn: dist.distributionConfigurationArn, - imageRecipeArn, - containerRecipeArn, - imageTestsConfiguration: { - imageTestsEnabled: false, - }, + imageRecipe?: imagebuilder2.ImageRecipe, containerRecipe?: imagebuilder2.ContainerRecipe): imagebuilder2.Image { + const image = new imagebuilder2.Image(this, this.amiOrContainerId('Image', imageRecipe !== undefined), { + infrastructureConfiguration: infra, + distributionConfiguration: dist, + recipe: imageRecipe ?? containerRecipe!, + imageTestsEnabled: false, tags: this.tags, }); image.node.addDependency(infra); @@ -736,7 +733,7 @@ export class AwsImageBuilderRunnerImageBuilder extends RunnerImageBuilderBase { iam.ManagedPolicy.fromAwsManagedPolicyName('EC2InstanceProfileForImageBuilder'), ]); if (this.waitOnDeploy) { - this.createImage(infra, dist, log, recipe.arn, undefined); + this.createImage(infra, dist, log, recipe.recipe, undefined); } this.createPipeline(infra, dist, log, recipe.recipe, undefined); diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json index 4360e50d..ec3555d0 100644 --- a/test/default.integ.snapshot/github-runners-test.template.json +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -2249,7 +2249,7 @@ } } }, - "WindowsImageBuilderDockerImage8672CA3E": { + "WindowsImageBuilderDockerImage7F3526EA": { "Type": "AWS::ImageBuilder::Image", "Properties": { "ContainerRecipeArn": { @@ -2986,7 +2986,7 @@ } } }, - "AMILinuxBuilderAMIImage93D83DE5": { + "AMILinuxBuilderAMIImage8609B129": { "Type": "AWS::ImageBuilder::Image", "Properties": { "DistributionConfigurationArn": { @@ -5856,7 +5856,7 @@ } } }, - "AMILinuxarm64BuilderAMIImage40078F9E": { + "AMILinuxarm64BuilderAMIImageC529A482": { "Type": "AWS::ImageBuilder::Image", "Properties": { "DistributionConfigurationArn": { @@ -6563,7 +6563,7 @@ } } }, - "WindowsEC2BuilderAMIImage9D812188": { + "WindowsEC2BuilderAMIImageD1C73439": { "Type": "AWS::ImageBuilder::Image", "Properties": { "DistributionConfigurationArn": { @@ -13233,7 +13233,7 @@ }, "DependsOn": [ "AMILinuxBuilderAMIDistribution215F3A5C", - "AMILinuxBuilderAMIImage93D83DE5", + "AMILinuxBuilderAMIImage8609B129", "AMILinuxBuilderAmiLog0DB16E38", "AMILinuxBuilderAMIPipeline77F9C0F7", "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", @@ -13465,7 +13465,7 @@ }, "DependsOn": [ "AMILinuxBuilderAMIDistribution215F3A5C", - "AMILinuxBuilderAMIImage93D83DE5", + "AMILinuxBuilderAMIImage8609B129", "AMILinuxBuilderAmiLog0DB16E38", "AMILinuxBuilderAMIPipeline77F9C0F7", "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", @@ -13661,7 +13661,7 @@ }, "DependsOn": [ "AMILinuxarm64BuilderAMIDistributionE6989D01", - "AMILinuxarm64BuilderAMIImage40078F9E", + "AMILinuxarm64BuilderAMIImageC529A482", "AMILinuxarm64BuilderAmiLog84A9D94A", "AMILinuxarm64BuilderAMIPipeline462B4E1B", "AMILinuxarm64BuilderAmiRecipe4287E320", @@ -13856,7 +13856,7 @@ }, "DependsOn": [ "WindowsEC2BuilderAMIDistribution6B33DD89", - "WindowsEC2BuilderAMIImage9D812188", + "WindowsEC2BuilderAMIImageD1C73439", "WindowsEC2BuilderAmiLog126E54B2", "WindowsEC2BuilderAMIPipeline445918BA", "WindowsEC2BuilderAmiRecipe9D687A09", diff --git a/yarn.lock b/yarn.lock index 6e262926..bf6b3989 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,10 +23,10 @@ resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== -"@aws-cdk/aws-imagebuilder-alpha@2.230.0-alpha.0": - version "2.230.0-alpha.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.230.0-alpha.0.tgz#e28591c6050afd6f51d2eea41efec81449200e9b" - integrity sha512-U5TG5emaUwCgqods/Uk7t7B5geegngGP9DwwKurAN76AVFXSoo1rclEbH7jMlkV27F98YVAzKtD6oMuFPLj0nw== +"@aws-cdk/aws-imagebuilder-alpha@2.231.0-alpha.0": + version "2.231.0-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-imagebuilder-alpha/-/aws-imagebuilder-alpha-2.231.0-alpha.0.tgz#de3e575d2e26e82604e9422050728fcf4209b931" + integrity sha512-cfZ48Udz8wweTH6EaN8C6V+f5Odn2nu5m2tnRKs+fjYSBE/x6TG548Hks/Wo2iXIsyDONiB2MISXw1o7I3WdNg== dependencies: yaml "1.10.2" @@ -3270,10 +3270,10 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-cdk-lib@2.230.0: - version "2.230.0" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.230.0.tgz#551a35de9e72ad9625484099f9d341b53930e894" - integrity sha512-hA1cWZAHpvrwJE55N77Km/aPUgN9NfbGm98vi91OeLKFgMVhdCXM57lJUAYTq0e8JHWFRWmsVlm9R8pq5jTJeA== +aws-cdk-lib@2.231.0: + version "2.231.0" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.231.0.tgz#bed5a9664fd4b63bfdb2af11b6dbfa741eb865b2" + integrity sha512-RMt88F1vhsM28j81EjvIXRoPeYQdtk72EGh9xAP6LjuyF8df1hDBIy5cawUvagdp5eCBPVHrPJ2U0eaUUKtjFg== dependencies: "@aws-cdk/asset-awscli-v1" "2.2.242" "@aws-cdk/asset-node-proxy-agent-v6" "^2.1.0" From 9c7cad2d04f24cb494052b80ed6d65c67eb0ad5b Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Mon, 1 Dec 2025 21:13:35 -0500 Subject: [PATCH 16/19] oops one more --- test/default.integ.snapshot/github-runners-test.assets.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json index a5662317..e250c2f9 100644 --- a/test/default.integ.snapshot/github-runners-test.assets.json +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -225,16 +225,16 @@ } } }, - "2600cf3c6c42715f40d21ead60031094bd400c5e58742adaa1afe8df29db6e0f": { + "c37f08d0b179627c25d677bc9969e0db4b0309b8954bcef1b732b35044afb1ec": { "displayName": "github-runners-test Template", "source": { "path": "github-runners-test.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-9b0f623b": { + "current_account-current_region-3d1791aa": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2600cf3c6c42715f40d21ead60031094bd400c5e58742adaa1afe8df29db6e0f.json", + "objectKey": "c37f08d0b179627c25d677bc9969e0db4b0309b8954bcef1b732b35044afb1ec.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } From d6c0ab8a82c11cfd0cb01a93a80e1d81e41bf43b Mon Sep 17 00:00:00 2001 From: CloudSnorkel Bot <106900599+CloudSnorkelBot@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:33:14 -0500 Subject: [PATCH 17/19] chore(deps): update snapshot (#820) Update snapshot. See details in [workflow run]. [Workflow Run]: https://github.com/CloudSnorkel/cdk-github-runners/actions/runs/19904242461 ------ *Automatically created by projen via the "upgrade-snapshot" workflow* --- API.md | 28 +- .../github-runners-test.assets.json | 244 + .../github-runners-test.template.json | 19280 ++++++++++++++++ 3 files changed, 19539 insertions(+), 13 deletions(-) create mode 100644 test/default.integ.snapshot/github-runners-test.assets.json create mode 100644 test/default.integ.snapshot/github-runners-test.template.json diff --git a/API.md b/API.md index 339a2dfb..b1442345 100644 --- a/API.md +++ b/API.md @@ -3720,12 +3720,12 @@ Grants read permissions to the principal on the assets buckets. ##### ~~`prefixCommandsWithErrorHandling`~~ ```typescript -public prefixCommandsWithErrorHandling(platform: string, commands: string[]): string[] +public prefixCommandsWithErrorHandling(platform: Platform, commands: string[]): string[] ``` ###### `platform`Required -- *Type:* string +- *Type:* @aws-cdk/aws-imagebuilder-alpha.Platform --- @@ -3816,8 +3816,8 @@ Check whether the given construct is a Resource. | node | constructs.Node | The tree node. | | env | aws-cdk-lib.interfaces.ResourceEnvironment | The environment this resource belongs to. | | stack | aws-cdk-lib.Stack | The stack in which this resource is defined. | -| arn | string | Component ARN. | -| platform | string | Supported platform for the component. | +| component | @aws-cdk/aws-imagebuilder-alpha.Component | Actual component resource. | +| platform | @aws-cdk/aws-imagebuilder-alpha.Platform | Supported platform for the component. | --- @@ -3871,17 +3871,19 @@ The stack in which this resource is defined. --- -##### ~~`arn`~~Required +##### ~~`component`~~Required - *Deprecated:* Use `RunnerImageComponent` instead as this be internal soon. ```typescript -public readonly arn: string; +public readonly component: Component; ``` -- *Type:* string +- *Type:* @aws-cdk/aws-imagebuilder-alpha.Component + +Actual component resource. -Component ARN. +TODO replace this whole class with the new resource --- @@ -3890,10 +3892,10 @@ Component ARN. - *Deprecated:* Use `RunnerImageComponent` instead as this be internal soon. ```typescript -public readonly platform: string; +public readonly platform: Platform; ``` -- *Type:* string +- *Type:* @aws-cdk/aws-imagebuilder-alpha.Platform Supported platform for the component. @@ -7537,7 +7539,7 @@ const imageBuilderComponentProperties: ImageBuilderComponentProperties = { ... } | commands | string[] | Shell commands to run when adding this component to the image. | | description | string | Component description. | | displayName | string | Component display name. | -| platform | string | Component platform. | +| platform | @aws-cdk/aws-imagebuilder-alpha.Platform | Component platform. | | assets | ImageBuilderAsset[] | Optional assets to add to the built image. | | reboot | boolean | Require a reboot after installing this component. | @@ -7584,10 +7586,10 @@ Component display name. ##### `platform`Required ```typescript -public readonly platform: string; +public readonly platform: Platform; ``` -- *Type:* string +- *Type:* @aws-cdk/aws-imagebuilder-alpha.Platform Component platform. diff --git a/test/default.integ.snapshot/github-runners-test.assets.json b/test/default.integ.snapshot/github-runners-test.assets.json new file mode 100644 index 00000000..c0ffc57f --- /dev/null +++ b/test/default.integ.snapshot/github-runners-test.assets.json @@ -0,0 +1,244 @@ +{ + "version": "48.0.0", + "files": { + "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68": { + "displayName": "CodeBuild Image Builder/Component 7 Custom-Undefined Asset 0", + "source": { + "path": "asset.64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-ddf90974": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0": { + "displayName": "build-image-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-022085c0": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a": { + "displayName": "aws-image-builder-delete-resources-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-d6a52ecd": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c": { + "displayName": "AMI Root Device Reader-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-d9353ac7": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9": { + "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 0", + "source": { + "path": "asset.2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-07fa966c": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "d4d0d96c5b566f0a3ac0a1e539ba4c128b07704ec2678b99ce89af13b422a331": { + "displayName": "Lambda Image Builder x64/Component 6 Lambda-Entrypoint Asset 1", + "source": { + "path": "asset.d4d0d96c5b566f0a3ac0a1e539ba4c128b07704ec2678b99ce89af13b422a331.sh", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-53455d71": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "d4d0d96c5b566f0a3ac0a1e539ba4c128b07704ec2678b99ce89af13b422a331.sh", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625": { + "displayName": "AWS679f53fac002430cb0da5b7982bd2287/Code", + "source": { + "path": "asset.bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-d28f70a5": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea": { + "displayName": "update-lambda-dcc036c8-876b-451e-a2c1-552f9e06e9e1/Code", + "source": { + "path": "asset.aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-01742b58": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2": { + "displayName": "runners/token-retriever/Code", + "source": { + "path": "asset.2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-e26bf12f": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb": { + "displayName": "runners/delete-runner/Code", + "source": { + "path": "asset.27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-f69630e5": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364": { + "displayName": "runners/Idle Reaper/Code", + "source": { + "path": "asset.27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-4a8838bc": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56": { + "displayName": "runners/Webhook Handler/webhook-handler/Code", + "source": { + "path": "asset.12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-3229b282": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18": { + "displayName": "runners/Webhook Redelivery/Lambda/Code", + "source": { + "path": "asset.43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-4bd461a4": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "70f0e98b4442f9b1760db6ed6fae54fd00508308ddbd277c1e8c40a85b200dd5": { + "displayName": "runners/setup/Code", + "source": { + "path": "asset.70f0e98b4442f9b1760db6ed6fae54fd00508308ddbd277c1e8c40a85b200dd5.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-de5e816e": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "70f0e98b4442f9b1760db6ed6fae54fd00508308ddbd277c1e8c40a85b200dd5.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9": { + "displayName": "runners/status/Code", + "source": { + "path": "asset.b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-b1fd60d6": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122": { + "displayName": "runners/Image Builder Builds Filter/Code", + "source": { + "path": "asset.f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.lambda", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region-017eb7bb": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "b07691b60586c45baf84badbbbba44452288658d1dce669d94a324bb0d8ccfb1": { + "displayName": "github-runners-test Template", + "source": { + "path": "github-runners-test.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-288a2d1d": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b07691b60586c45baf84badbbbba44452288658d1dce669d94a324bb0d8ccfb1.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/default.integ.snapshot/github-runners-test.template.json b/test/default.integ.snapshot/github-runners-test.template.json new file mode 100644 index 00000000..f66ea834 --- /dev/null +++ b/test/default.integ.snapshot/github-runners-test.template.json @@ -0,0 +1,19280 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc" + } + ] + } + }, + "VpcPublicSubnet1Subnet5C2D37C4": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTable6C95E38E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTableAssociation97140677": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet2Subnet691E08A3": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTable94F7E489": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTableAssociationDD5762D8": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "VpcPublicSubnet2DefaultRoute97F91067": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcIGWD7BA715C": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Vpc" + } + ] + } + }, + "VpcVPCGWBF912B6E": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "cluster611F8AFF": { + "Type": "AWS::ECS::Cluster" + }, + "clusterA4C38409": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + "FARGATE", + "FARGATE_SPOT" + ], + "Cluster": { + "Ref": "cluster611F8AFF" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "FargatebuilderRoleDA300BCD": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderRoleDefaultPolicyE56CF8DA": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderLogs2F794091", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderCodeBuild4F182743" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderCodeBuild4F182743" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "FargatebuilderCodeBuild4F182743" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderRoleDefaultPolicyE56CF8DA", + "Roles": [ + { + "Ref": "FargatebuilderRoleDA300BCD" + } + ] + } + }, + "FargatebuilderRepository8F7BA13C": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderLogs2F794091": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderCodeBuild4F182743": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Fargate builder (Ubuntu Linux/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "FargatebuilderLogs2F794091" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "FargatebuilderRoleDA300BCD", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset6-Custom-Undefined-0\",\n \"cat > component6-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Custom-Undefined.sh\",\n \"cat > component7-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Custom-Undefined-0 FUNDING.yml\\nCOPY component6-Custom-Undefined.sh /tmp\\nRUN /tmp/component6-Custom-Undefined.sh\\n\\nCOPY component7-EnvironmentVariables.sh /tmp\\nRUN /tmp/component7-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "FargatebuilderCodeBuildEventsRole92F2259E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD", + "Roles": [ + { + "Ref": "FargatebuilderCodeBuildEventsRole92F2259E" + } + ] + } + }, + "FargatebuilderCodeBuildBuildFailed1D2D3785": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "githubrunnerstestFargatebuilderCodeBuildBuildFailed8BDBCD42", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "FargatebuilderCRPolicy22FB4B05": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderCRPolicy22FB4B05", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "FargatebuilderBuildWaitc91bc68c5e438864A5": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005" + }, + "Timeout": "3600" + } + }, + "FargatebuilderBuilder0834CD0B": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + "ProjectName": { + "Ref": "FargatebuilderCodeBuild4F182743" + }, + "WaitHandle": { + "Ref": "FargatebuilderBuildWaitHandlec91bc68c5e3FF5D005" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "FargatebuilderCodeBuildBuildFailed1D2D3785", + "FargatebuilderCodeBuildEventsRoleDefaultPolicyD2B048CD", + "FargatebuilderCodeBuildEventsRole92F2259E", + "FargatebuilderCodeBuild4F182743", + "FargatebuilderCRPolicy22FB4B05", + "FargatebuilderRoleDefaultPolicyE56CF8DA", + "FargatebuilderRoleDA300BCD" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderBuildSchedule0B083A73": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "FargatebuilderRepository8F7BA13C" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuild4F182743", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "FargatebuilderCodeBuildEventsRole92F2259E", + "Arn" + ] + } + } + ] + } + }, + "FargatebuilderarmRoleB6343E8F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderarmRoleDefaultPolicy89F1BA94": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmLogs63D60F4D", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderarmRoleDefaultPolicy89F1BA94", + "Roles": [ + { + "Ref": "FargatebuilderarmRoleB6343E8F" + } + ] + } + }, + "FargatebuilderarmRepository77DCC132": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderarmLogs63D60F4D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderarmCodeBuild0D30679A": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Fargate builder arm (Ubuntu Linux/ARM64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "FargatebuilderarmLogs63D60F4D" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "FargatebuilderarmRoleB6343E8F", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset6-Custom-Undefined-0\",\n \"cat > component6-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Custom-Undefined.sh\",\n \"cat > component7-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Custom-Undefined-0 FUNDING.yml\\nCOPY component6-Custom-Undefined.sh /tmp\\nRUN /tmp/component6-Custom-Undefined.sh\\n\\nCOPY component7-EnvironmentVariables.sh /tmp\\nRUN /tmp/component7-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "FargatebuilderarmCodeBuildEventsRole20E8CE66": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB", + "Roles": [ + { + "Ref": "FargatebuilderarmCodeBuildEventsRole20E8CE66" + } + ] + } + }, + "FargatebuilderarmCodeBuildBuildFailed264992E6": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "githubrunnerstestFargatebuilderarmCodeBuildBuildFailed60EDAF2B", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "FargatebuilderarmCRPolicyD241BB66": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatebuilderarmCRPolicyD241BB66", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "FargatebuilderarmBuildWait6310e519d75E2EEA1B": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1" + }, + "Timeout": "3600" + } + }, + "FargatebuilderarmBuilder48D1AF5A": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + "ProjectName": { + "Ref": "FargatebuilderarmCodeBuild0D30679A" + }, + "WaitHandle": { + "Ref": "FargatebuilderarmBuildWaitHandle6310e519d7466F43E1" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "FargatebuilderarmCodeBuildBuildFailed264992E6", + "FargatebuilderarmCodeBuildEventsRoleDefaultPolicy39CAA8CB", + "FargatebuilderarmCodeBuildEventsRole20E8CE66", + "FargatebuilderarmCodeBuild0D30679A", + "FargatebuilderarmCRPolicyD241BB66", + "FargatebuilderarmRoleDefaultPolicy89F1BA94", + "FargatebuilderarmRoleB6343E8F" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargatebuilderarmBuildSchedule854B2895": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "FargatebuilderarmRepository77DCC132" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuild0D30679A", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "FargatebuilderarmCodeBuildEventsRole20E8CE66", + "Arn" + ] + } + } + ] + } + }, + "LambdaImageBuilderx64RoleEE3EE1CB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Logs1C003BB4", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4", + "Roles": [ + { + "Ref": "LambdaImageBuilderx64RoleEE3EE1CB" + } + ] + } + }, + "LambdaImageBuilderx64Repository57F632F1": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + }, + "RepositoryPolicyText": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderx64RepositoryPushrule1C711F47": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": "Update GitHub Actions runner Lambda on ECR image push", + "EventPattern": { + "detail-type": [ + "ECR Image Action" + ], + "detail": { + "action-type": [ + "PUSH" + ], + "repository-name": [ + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + } + ], + "image-tag": [ + "latest" + ], + "result": [ + "SUCCESS" + ] + }, + "source": [ + "aws.ecr" + ] + }, + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Id": "Target0", + "Input": { + "Fn::Join": [ + "", + [ + "{\"lambdaName\":\"", + { + "Ref": "LambdaFunction9233991D" + }, + "\",\"repositoryUri\":\"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\"repositoryTag\":\"latest\"}" + ] + ] + } + } + ] + } + }, + "LambdaImageBuilderx64RepositoryPushruleAllowEventRulegithubrunnerstestupdatelambdadcc036c8876b451ea2c1552f9e06e9e17433A98EAF8930B2": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64RepositoryPushrule1C711F47", + "Arn" + ] + } + } + }, + "LambdaImageBuilderx64Logs1C003BB4": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderx64CodeBuild67DE14C8": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Lambda Image Builder x64 (Amazon Linux 2023/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "LambdaImageBuilderx64Logs1C003BB4" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64RoleEE3EE1CB", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf upgrade -y\\ndnf install -y jq tar gzip bzip2 which binutils zip unzip sudo shadow-utils findutils\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n/usr/sbin/groupadd runner\\n/usr/sbin/useradd --system --shell /usr/sbin/nologin --home-dir /home/runner --gid runner runner\\nmkdir -p /home/runner\\nchown runner /home/runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSSL https://cli.github.com/packages/rpm/gh-cli.repo -o /etc/yum.repos.d/gh-cli.repo\\ndnf install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\ndnf install -y openssl-libs krb5-libs zlib libicu-67.1\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh" + }, + " asset6-Lambda-Entrypoint-0\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d4d0d96c5b566f0a3ac0a1e539ba4c128b07704ec2678b99ce89af13b422a331.sh" + }, + " asset6-Lambda-Entrypoint-1\",\n \"cat > component6-Lambda-Entrypoint.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Lambda-Entrypoint.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/amazonlinux/amazonlinux:2023\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Lambda-Entrypoint-0 /bootstrap.sh\\nCOPY asset6-Lambda-Entrypoint-1 /runner.sh\\nCOPY component6-Lambda-Entrypoint.sh /tmp\\nRUN /tmp/component6-Lambda-Entrypoint.sh\\nLABEL DISABLE_SOCI=1\\nENTRYPOINT [\\\"bash\\\", \\\"/bootstrap.sh\\\"]\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997", + "Roles": [ + { + "Ref": "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21" + } + ] + } + }, + "LambdaImageBuilderx64CodeBuildBuildFailed7E839416": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "thubrunnerstestLambdaImageBuilderx64CodeBuildBuildFailedE326D971", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "LambdaImageBuilderx64CRPolicy6DBE0D1F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderx64CRPolicy6DBE0D1F", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "LambdaImageBuilderx64BuildWaitHandleb635ff63a2F03FDC82": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "LambdaImageBuilderx64BuildWaitb635ff63a25255D2B8": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "LambdaImageBuilderx64BuildWaitHandleb635ff63a2F03FDC82" + }, + "Timeout": "3600" + } + }, + "LambdaImageBuilderx64Builder42F384AF": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "ProjectName": { + "Ref": "LambdaImageBuilderx64CodeBuild67DE14C8" + }, + "WaitHandle": { + "Ref": "LambdaImageBuilderx64BuildWaitHandleb635ff63a2F03FDC82" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "LambdaImageBuilderx64CodeBuildBuildFailed7E839416", + "LambdaImageBuilderx64CodeBuildEventsRoleDefaultPolicy2B894997", + "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21", + "LambdaImageBuilderx64CodeBuild67DE14C8", + "LambdaImageBuilderx64CRPolicy6DBE0D1F", + "LambdaImageBuilderx64RoleDefaultPolicyC6AE2BE4", + "LambdaImageBuilderx64RoleEE3EE1CB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderx64BuildScheduleFA3DBF6A": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuild67DE14C8", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64CodeBuildEventsRoleF8B03C21", + "Arn" + ] + } + } + ] + } + }, + "WindowsImageBuilderSG5ACD1618": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Windows Image Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "WindowsImageBuilderRole717C46A6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilderECRContainerBuilds" + ] + ] + } + ] + } + }, + "WindowsImageBuilderRoleDefaultPolicy8BEB7BE3": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "WindowsImageBuilderRoleDefaultPolicy8BEB7BE3", + "Roles": [ + { + "Ref": "WindowsImageBuilderRole717C46A6" + } + ] + } + }, + "WindowsImageBuilderRepositoryA4CBB6D8": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsImageBuilderDockerDistributionE6B7F2F2": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "ContainerDistributionConfiguration": { + "ContainerTags": [ + "latest" + ], + "TargetRepository": { + "RepositoryName": { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + "Service": "ECR" + } + }, + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-windowsimagebuilder-dockerdistribution-8c41c0cd", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-windowsimagebuilder-component0requiredpackages-component-963beb47", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 1 RunnerUser", + "Name": "github-runners-test-windowsimagebuilder-component1runneruser-component-c4a9efb2", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent2GitComponent92ACFEF5": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", + "Description": "Component 2 Git", + "Name": "github-runners-test-windowsimagebuilder-component2git-component-f09bbd59", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent3GithubCliComponentF18685D5": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", + "Description": "Component 3 GithubCli", + "Name": "github-runners-test-windowsimagebuilder-component3githubcli-component-a0ec305e", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent4AwsCliComponent6654838D": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", + "Description": "Component 4 AwsCli", + "Name": "github-runners-test-windowsimagebuilder-component4awscli-component-c1cc638a", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", + "Description": "Component 5 GithubRunner", + "Name": "github-runners-test-windowsimagebuilder-component5githubrunner-component-c7c81d8e", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 6 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 6 Custom-Undefined", + "Name": "github-runners-test-windowsimagebuilder-component6custom-undefined-component-955efea2", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", + "Description": "Component 7 EnvironmentVariables", + "Name": "github-runners-test-windowsimagebuilder-component7environmentvariables-component-f73418d2", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsImageBuilderRecipeB7F00629": { + "Type": "AWS::ImageBuilder::ContainerRecipe", + "Properties": { + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent0RequiredPackagesComponentD2E668F3", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent1RunnerUserComponent0F4D4032", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent2GitComponent92ACFEF5", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent3GithubCliComponentF18685D5", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent4AwsCliComponent6654838D", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent5GithubRunnerComponentD618D2D1", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent6CustomUndefinedComponent5A5D8BCD", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderComponent7EnvironmentVariablesComponent9A931F09", + "Arn" + ] + } + } + ], + "ContainerType": "DOCKER", + "DockerfileTemplateData": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\nENV RUNNER_VERSION=latest\n", + "Name": "github-runners-test-windowsimagebuilder-recipe-f7042c5a", + "ParentImage": "mcr.microsoft.com/windows/servercore:ltsc2019-amd64", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "TargetRepository": { + "RepositoryName": { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + "Service": "ECR" + }, + "Version": "1.0.x" + } + }, + "WindowsImageBuilderDockerLogE660E23E": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Name" + ] + } + ] + ] + }, + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "WindowsImageBuilderRole717C46A6" + } + ] + } + }, + "WindowsImageBuilderInfrastructure14D24F2C": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "WindowsImageBuilderInfrastructureInstanceProfile253C95CE" + }, + "InstanceTypes": [ + "m6i.large" + ], + "Name": "github-runners-test-windowsimagebuilder-infrastructure-17f3ac1c", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "WindowsImageBuilderSG5ACD1618", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "WindowsImageBuilderDockerImage7F3526EA": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "ContainerRecipeArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Arn" + ] + }, + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderDockerDistributionE6B7F2F2", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderInfrastructure14D24F2C", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsImageBuilderDockerLogE660E23E", + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", + "WindowsImageBuilderInfrastructure14D24F2C" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "WindowsImageBuilderContainerCleaner9CB998CD": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsImageBuilderLifecyclePolicyDockerRole13C6E553": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchGetImage", + "ecr:BatchDeleteImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ecr" + } + ] + } + }, + "WindowsImageBuilderLifecyclePolicyDockerA66ED7F5": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner Docker images for github-runners-test/Windows Image Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "WindowsImageBuilderLifecyclePolicyDockerRole13C6E553", + "Arn" + ] + }, + "Name": "github-runners-test-windowsimagebuilder-lifecyclepolicydocker-9b0d4781", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Containers": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Name" + ] + }, + "SemanticVersion": { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Version" + ] + } + } + ] + }, + "ResourceType": "CONTAINER_IMAGE" + } + }, + "WindowsImageBuilderDockerPipeline28661C47": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "ContainerRecipeArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderRecipeB7F00629", + "Arn" + ] + }, + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderDockerDistributionE6B7F2F2", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsImageBuilderInfrastructure14D24F2C", + "Arn" + ] + }, + "Name": "github-runners-test-windowsimagebuilder-dockerpipeline-5343f5e8", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows Image Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsImageBuilderDockerLogE660E23E", + "WindowsImageBuilderInfrastructureInstanceProfile253C95CE", + "WindowsImageBuilderInfrastructure14D24F2C" + ] + }, + "AMILinuxBuilderSGEDC86329": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/AMI Linux Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "AMILinuxBuilderRole0C42378A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilder" + ] + ] + } + ] + } + }, + "AMILinuxBuilderRoleDefaultPolicy69ED051F": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AMILinuxBuilderRoleDefaultPolicy69ED051F", + "Roles": [ + { + "Ref": "AMILinuxBuilderRole0C42378A" + } + ] + } + }, + "AMILinuxBuilderLaunchtemplateA29452C4": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "MetadataOptions": { + "HttpTokens": "required" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux Builder/Launch template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux Builder/Launch template" + } + ] + } + ] + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux Builder/Launch template" + } + ] + } + ] + } + }, + "AMILinuxBuilderAMIDistribution215F3A5C": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "AmiDistributionConfiguration": { + "AmiTags": { + "Name": "AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test", + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" + } + }, + "LaunchTemplateConfigurations": [ + { + "LaunchTemplateId": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "SetDefaultVersion": true + } + ], + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-amilinuxbuilder-amidistribution-f27cc043", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-amilinuxbuilder-component0requiredpackages-component-ccd42ff5", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-amilinuxbuilder-component1cloudwatchagent-component-5545ba1f", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", + "Description": "Component 2 RunnerUser", + "Name": "github-runners-test-amilinuxbuilder-component2runneruser-component-b84742f0", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent3GitComponent9011E3AB": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", + "Description": "Component 3 Git", + "Name": "github-runners-test-amilinuxbuilder-component3git-component-5532a5f4", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent4GithubCliComponent602EE471": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", + "Description": "Component 4 GithubCli", + "Name": "github-runners-test-amilinuxbuilder-component4githubcli-component-7925b347", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent5AwsCliComponent72637C19": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", + "Description": "Component 5 AwsCli", + "Name": "github-runners-test-amilinuxbuilder-component5awscli-component-ea3524b1", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent6DockerComponent9E523A42": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", + "Description": "Component 6 Docker", + "Name": "github-runners-test-amilinuxbuilder-component6docker-component-c57d02ec", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", + "Description": "Component 7 GithubRunner", + "Name": "github-runners-test-amilinuxbuilder-component7githubrunner-component-dd50b576", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 8 Custom-Undefined", + "Name": "github-runners-test-amilinuxbuilder-component8custom-undefined-component-35d68e99", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-amilinuxbuilder-component9environmentvariables-component-c760ab8d", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/ubuntu-server-22-lts-x86/x.x.x" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxBuilderAmiRecipeB7CF9599": { + "Type": "AWS::ImageBuilder::ImageRecipe", + "Properties": { + "BlockDeviceMappings": [ + { + "DeviceName": { + "Ref": "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374" + }, + "Ebs": { + "DeleteOnTermination": true, + "VolumeSize": 33 + } + } + ], + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", + "Arn" + ] + } + } + ], + "Name": "github-runners-test-amilinuxbuilder-amirecipe-711bc2a3", + "ParentImage": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/ubuntu-server-22-lts-x86/x.x.x" + ] + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "Version": "1.0.x", + "WorkingDirectory": "/home/runner" + } + }, + "AMILinuxBuilderAmiLog0DB16E38": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Name" + ] + } + ] + ] + }, + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxBuilderInfrastructureInstanceProfileB423D304": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "AMILinuxBuilderRole0C42378A" + } + ] + } + }, + "AMILinuxBuilderInfrastructure069F0561": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "AMILinuxBuilderInfrastructureInstanceProfileB423D304" + }, + "InstanceTypes": [ + "m6i.large" + ], + "Name": "github-runners-test-amilinuxbuilder-infrastructure-52c63716", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "AMILinuxBuilderSGEDC86329", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "AMILinuxBuilderAMIImage8609B129": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderInfrastructure069F0561", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "AMILinuxBuilderAMIPipeline77F9C0F7": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxBuilderInfrastructure069F0561", + "Arn" + ] + }, + "Name": "github-runners-test-amilinuxbuilder-amipipeline-c87c140b", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561" + ] + }, + "AMILinuxBuilderImageCleanerF1745EF6": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/", + { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeImages", + "ec2:DescribeImageAttribute" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", + "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/AMI Linux Builder" + } + }, + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ami" + } + ] + } + }, + "AMILinuxBuilderLifecyclePolicyAMI9EC6A562": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "Arn" + ] + }, + "Name": "github-runners-test-amilinuxbuilder-lifecyclepolicyami-b13f2c24", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Amis": true, + "Snapshots": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Name" + ] + }, + "SemanticVersion": { + "Fn::GetAtt": [ + "AMILinuxBuilderAmiRecipeB7CF9599", + "Version" + ] + } + } + ] + }, + "ResourceType": "AMI_IMAGE" + } + }, + "CodeBuildImageBuilderRoleF1F34984": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderRoleDefaultPolicy6982821E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderLogsE4CADFCC", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderRoleDefaultPolicy6982821E", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderRoleF1F34984" + } + ] + } + }, + "CodeBuildImageBuilderRepository9DE3B6F0": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderLogsE4CADFCC": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderCodeBuild38ECAA44": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Image Builder (Ubuntu Linux/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildImageBuilderLogsE4CADFCC" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRoleF1F34984", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "CodeBuildImageBuilderCodeBuildEventsRole4277A55E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderCodeBuildEventsRole4277A55E" + } + ] + } + }, + "CodeBuildImageBuilderCodeBuildBuildFailed9B205D70": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "thubrunnerstestCodeBuildImageBuilderCodeBuildBuildFailed73942339", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "CodeBuildImageBuilderCRPolicyAFC63F28": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderCRPolicyAFC63F28", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "CodeBuildImageBuilderBuildWait6c559791c302D896CB": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C" + }, + "Timeout": "3600" + } + }, + "CodeBuildImageBuilderB8638EC8": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + "ProjectName": { + "Ref": "CodeBuildImageBuilderCodeBuild38ECAA44" + }, + "WaitHandle": { + "Ref": "CodeBuildImageBuilderBuildWaitHandle6c559791c31CDFC19C" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "CodeBuildImageBuilderCodeBuildBuildFailed9B205D70", + "CodeBuildImageBuilderCodeBuildEventsRoleDefaultPolicyF7AE539D", + "CodeBuildImageBuilderCodeBuildEventsRole4277A55E", + "CodeBuildImageBuilderCodeBuild38ECAA44", + "CodeBuildImageBuilderCRPolicyAFC63F28", + "CodeBuildImageBuilderRoleDefaultPolicy6982821E", + "CodeBuildImageBuilderRoleF1F34984" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderBuildSchedule66D9D18A": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuild38ECAA44", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderCodeBuildEventsRole4277A55E", + "Arn" + ] + } + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13", + "Roles": [ + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Ubuntu 2404 Image Builder (Ubuntu Linux 24.04/X86_64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:24.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_x86_64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8", + "Roles": [ + { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed90989099": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "stestCodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed22054A19", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "CodeBuildUbuntu2404ImageBuilderBuildWait869992dae157E3A527": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5" + }, + "Timeout": "3600" + } + }, + "CodeBuildUbuntu2404ImageBuilder2CDBC05E": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + "ProjectName": { + "Ref": "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46" + }, + "WaitHandle": { + "Ref": "CodeBuildUbuntu2404ImageBuilderBuildWaitHandle869992dae1E5A396D5" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "CodeBuildUbuntu2404ImageBuilderCodeBuildBuildFailed90989099", + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleDefaultPolicyF2D4B4E8", + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981", + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "CodeBuildUbuntu2404ImageBuilderCRPolicyFC9AACCB", + "CodeBuildUbuntu2404ImageBuilderRoleDefaultPolicyB8C45F13", + "CodeBuildUbuntu2404ImageBuilderRole4D16C9EB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404ImageBuilderBuildScheduleEDD400B0": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuild30AF5C46", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderCodeBuildEventsRoleA2F6A981", + "Arn" + ] + } + } + ] + } + }, + "CodeBuildImageBuilderarmRole96BC26FB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmLogs5A60CB81", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderarmRole96BC26FB" + } + ] + } + }, + "CodeBuildImageBuilderarmRepositoryE967421B": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderarmLogs5A60CB81": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderarmCodeBuildBFF1CF57": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/CodeBuild Image Builder arm (Ubuntu Linux/ARM64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRole96BC26FB", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get upgrade -y\\nDEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq bash zip unzip iptables software-properties-common ca-certificates\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\naddgroup runner\\nadduser --system --disabled-password --home /home/runner --ingroup runner runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nadd-apt-repository ppa:git-core/ppa\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-Docker.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg\\necho \\\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\\\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\\napt-get update\\nDEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\\nusermod -aG docker runner\\nln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-Docker.sh\",\n \"cat > component6-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\n/home/runner/bin/installdependencies.sh\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/lts/ubuntu:22.04\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-Docker.sh /tmp\\nRUN /tmp/component5-Docker.sh\\n\\nCOPY component6-GithubRunner.sh /tmp\\nRUN /tmp/component6-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D", + "Roles": [ + { + "Ref": "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89" + } + ] + } + }, + "CodeBuildImageBuilderarmCodeBuildBuildFailed7605ECB2": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "brunnerstestCodeBuildImageBuilderarmCodeBuildBuildFailedF9370687", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "CodeBuildImageBuilderarmCRPolicy75CB8D91": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildImageBuilderarmCRPolicy75CB8D91", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "CodeBuildImageBuilderarmBuildWaitf181c92a802A4BA349": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303" + }, + "Timeout": "3600" + } + }, + "CodeBuildImageBuilderarmBuilder755EB37D": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + "ProjectName": { + "Ref": "CodeBuildImageBuilderarmCodeBuildBFF1CF57" + }, + "WaitHandle": { + "Ref": "CodeBuildImageBuilderarmBuildWaitHandlef181c92a80A7DB5303" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "CodeBuildImageBuilderarmCodeBuildBuildFailed7605ECB2", + "CodeBuildImageBuilderarmCodeBuildEventsRoleDefaultPolicyEA24770D", + "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89", + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "CodeBuildImageBuilderarmCRPolicy75CB8D91", + "CodeBuildImageBuilderarmRoleDefaultPolicy540A8CDE", + "CodeBuildImageBuilderarmRole96BC26FB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildImageBuilderarmBuildSchedule909D75E9": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildBFF1CF57", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmCodeBuildEventsRole5ADCAD89", + "Arn" + ] + } + } + ] + } + }, + "LambdaImageBuilderzRole6F1A63E5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzLogsC9FB42C8", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + }, + "-*" + ] + ] + } + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + "ecr:CompleteLayerUpload", + "ecr:UploadLayerPart", + "ecr:InitiateLayerUpload", + "ecr:PutImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7", + "Roles": [ + { + "Ref": "LambdaImageBuilderzRole6F1A63E5" + } + ] + } + }, + "LambdaImageBuilderzRepository7C7AD146": { + "Type": "AWS::ECR::Repository", + "Properties": { + "EmptyOnDelete": true, + "ImageScanningConfiguration": { + "ScanOnPush": true + }, + "ImageTagMutability": "MUTABLE", + "LifecyclePolicy": { + "LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove soci indexes for replaced images\",\"selection\":{\"tagStatus\":\"tagged\",\"tagPrefixList\":[\"sha256-\"],\"countType\":\"imageCountMoreThan\",\"countNumber\":1},\"action\":{\"type\":\"expire\"}},{\"rulePriority\":2,\"description\":\"Remove untagged images that have been replaced by CodeBuild\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countNumber\":1,\"countUnit\":\"days\"},\"action\":{\"type\":\"expire\"}}]}" + }, + "RepositoryPolicyText": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderzRepositoryPushruleA1F1B44F": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": "Update GitHub Actions runner Lambda on ECR image push", + "EventPattern": { + "detail-type": [ + "ECR Image Action" + ], + "detail": { + "action-type": [ + "PUSH" + ], + "repository-name": [ + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + } + ], + "image-tag": [ + "latest" + ], + "result": [ + "SUCCESS" + ] + }, + "source": [ + "aws.ecr" + ] + }, + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Id": "Target0", + "Input": { + "Fn::Join": [ + "", + [ + "{\"lambdaName\":\"", + { + "Ref": "LambdaARMFunctionDD4B5FF7" + }, + "\",\"repositoryUri\":\"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\"repositoryTag\":\"latest\"}" + ] + ] + } + } + ] + } + }, + "LambdaImageBuilderzRepositoryPushruleAllowEventRulegithubrunnerstestupdatelambdadcc036c8876b451ea2c1552f9e06e9e17433A98E002B5DB7": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepositoryPushruleA1F1B44F", + "Arn" + ] + } + } + }, + "LambdaImageBuilderzLogsC9FB42C8": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderzCodeBuild73AB6718": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "Build docker image for self-hosted GitHub runner github-runners-test/Lambda Image Builderz (Amazon Linux 2023/ARM64)", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0", + "ImagePullCredentialsType": "CODEBUILD", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "LambdaImageBuilderzLogsC9FB42C8" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRole6F1A63E5", + "Arn" + ] + }, + "Source": { + "BuildSpec": { + "Fn::Join": [ + "", + [ + "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"REPO_ARN\": \"", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + }, + "\",\n \"REPO_URI\": \"", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\n \"WAIT_HANDLE\": \"unspecified\",\n \"BASH_ENV\": \"codebuild-log.sh\"\n },\n \"shell\": \"bash\"\n },\n \"phases\": {\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"exec > >(tee -a /tmp/codebuild.log) 2>&1\\\" > codebuild-log.sh\",\n \"aws ecr get-login-password --region \\\"$AWS_DEFAULT_REGION\\\" | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cat > component0-RequiredPackages.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf upgrade -y\\ndnf install -y jq tar gzip bzip2 which binutils zip unzip sudo shadow-utils findutils\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component0-RequiredPackages.sh\",\n \"cat > component1-RunnerUser.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n/usr/sbin/groupadd runner\\n/usr/sbin/useradd --system --shell /usr/sbin/nologin --home-dir /home/runner --gid runner runner\\nmkdir -p /home/runner\\nchown runner /home/runner\\necho \\\"%runner ALL=(ALL:ALL) NOPASSWD: ALL\\\" > /etc/sudoers.d/runner\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component1-RunnerUser.sh\",\n \"cat > component2-Git.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ndnf install -y git\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component2-Git.sh\",\n \"cat > component3-GithubCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSSL https://cli.github.com/packages/rpm/gh-cli.repo -o /etc/yum.repos.d/gh-cli.repo\\ndnf install -y gh\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component3-GithubCli.sh\",\n \"cat > component4-AwsCli.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ncurl -fsSL \\\"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\\\" -o awscliv2.zip\\nunzip -q awscliv2.zip\\n./aws/install\\nrm -rf awscliv2.zip aws\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component4-AwsCli.sh\",\n \"cat > component5-GithubRunner.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\nRUNNER_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/actions/runner/releases/latest | grep -oE \\\"[^/v]+$\\\"`\\ncurl -fsSLO \\\"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\ntar -C /home/runner -xzf \\\"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\\"\\nrm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\\necho -n latest > /home/runner/RUNNER_VERSION\\ndnf install -y openssl-libs krb5-libs zlib libicu-67.1\\nmkdir -p /opt/hostedtoolcache\\nchown runner /opt/hostedtoolcache\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component5-GithubRunner.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fc3b84da69dcc5adb6dc4721b50c1166474fa7e5fd5f242e833d12ac28e09d9.sh" + }, + " asset6-Lambda-Entrypoint-0\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d4d0d96c5b566f0a3ac0a1e539ba4c128b07704ec2678b99ce89af13b422a331.sh" + }, + " asset6-Lambda-Entrypoint-1\",\n \"cat > component6-Lambda-Entrypoint.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component6-Lambda-Entrypoint.sh\",\n \"aws s3 cp ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + " asset7-Custom-Undefined-0\",\n \"cat > component7-Custom-Undefined.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\ntouch /custom-file\\nmkdir /custom-dir\\nmv FUNDING.yml /custom-dir\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component7-Custom-Undefined.sh\",\n \"cat > component8-EnvironmentVariables.sh <<'EOFGITHUBRUNNERSDOCKERFILE'\\n#!/bin/bash\\nset -exuo pipefail\\necho 'HELLO=world' >> /home/runner/.env\\necho 'FOO=bar' >> /home/runner/.env\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"chmod +x component8-EnvironmentVariables.sh\",\n \"cat > Dockerfile <<'EOFGITHUBRUNNERSDOCKERFILE'\\nFROM public.ecr.aws/amazonlinux/amazonlinux:2023\\nVOLUME /var/lib/docker\\nCOPY component0-RequiredPackages.sh /tmp\\nRUN /tmp/component0-RequiredPackages.sh\\n\\nCOPY component1-RunnerUser.sh /tmp\\nRUN /tmp/component1-RunnerUser.sh\\n\\nCOPY component2-Git.sh /tmp\\nRUN /tmp/component2-Git.sh\\n\\nCOPY component3-GithubCli.sh /tmp\\nRUN /tmp/component3-GithubCli.sh\\n\\nCOPY component4-AwsCli.sh /tmp\\nRUN /tmp/component4-AwsCli.sh\\n\\nCOPY component5-GithubRunner.sh /tmp\\nRUN /tmp/component5-GithubRunner.sh\\nENV RUNNER_VERSION=latest\\nCOPY asset6-Lambda-Entrypoint-0 /bootstrap.sh\\nCOPY asset6-Lambda-Entrypoint-1 /runner.sh\\nCOPY component6-Lambda-Entrypoint.sh /tmp\\nRUN /tmp/component6-Lambda-Entrypoint.sh\\nLABEL DISABLE_SOCI=1\\nENTRYPOINT [\\\"bash\\\", \\\"/bootstrap.sh\\\"]\\nCOPY asset7-Custom-Undefined-0 FUNDING.yml\\nCOPY component7-Custom-Undefined.sh /tmp\\nRUN /tmp/component7-Custom-Undefined.sh\\n\\nCOPY component8-EnvironmentVariables.sh /tmp\\nRUN /tmp/component8-EnvironmentVariables.sh\\n\\n\\nEOFGITHUBRUNNERSDOCKERFILE\",\n \"docker build --progress plain . -t \\\"$REPO_URI\\\"\",\n \"docker push \\\"$REPO_URI\\\"\"\n ]\n },\n \"post_build\": {\n \"commands\": [\n \"rm -f codebuild-log.sh && STATUS=\\\"SUCCESS\\\"\",\n \"if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ]; then STATUS=\\\"FAILURE\\\"; fi\",\n \"cat < /tmp/payload.json\\n{\\n \\\"Status\\\": \\\"$STATUS\\\",\\n \\\"UniqueId\\\": \\\"build\\\",\\n \\\"Reason\\\": `sed 's/[^[:print:]]//g' /tmp/codebuild.log | tail -c 400 | jq -Rsa .`,\\n \\\"Data\\\": \\\"$RANDOM\\\"\\n}\\nEOF\",\n \"if [ \\\"$WAIT_HANDLE\\\" != \\\"unspecified\\\" ]; then jq . /tmp/payload.json; curl -fsSL -X PUT -H \\\"Content-Type:\\\" -d \\\"@/tmp/payload.json\\\" \\\"$WAIT_HANDLE\\\"; fi\",\n \"if [ `docker inspect --format='{{json .Config.Labels.DISABLE_SOCI}}' \\\"$REPO_URI\\\"` = \\\"null\\\" ]; then\\ndocker rmi \\\"$REPO_URI\\\"\\nLATEST_SOCI_VERSION=`curl -w \\\"%{redirect_url}\\\" -fsS https://github.com/CloudSnorkel/standalone-soci-indexer/releases/latest | grep -oE \\\"[^/]+$\\\"`\\ncurl -fsSL https://github.com/CloudSnorkel/standalone-soci-indexer/releases/download/${LATEST_SOCI_VERSION}/standalone-soci-indexer_Linux_arm64.tar.gz | tar xz\\n./standalone-soci-indexer \\\"$REPO_URI\\\"\\nfi\"\n ]\n }\n }\n}" + ] + ] + }, + "Type": "NO_SOURCE" + }, + "TimeoutInMinutes": 60 + } + }, + "LambdaImageBuilderzCodeBuildEventsRoleE9E50664": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23", + "Roles": [ + { + "Ref": "LambdaImageBuilderzCodeBuildEventsRoleE9E50664" + } + ] + } + }, + "LambdaImageBuilderzCodeBuildBuildFailedFBCC1CE8": { + "Type": "AWS::CodeStarNotifications::NotificationRule", + "Properties": { + "DetailType": "FULL", + "EventTypeIds": [ + "codebuild-project-build-state-failed" + ], + "Name": "githubrunnerstestLambdaImageBuilderzCodeBuildBuildFailedD221038C", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + }, + "Targets": [ + { + "TargetAddress": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "TargetType": "SNS" + } + ] + } + }, + "LambdaImageBuilderzCRPolicyC9B09855": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "codebuild:StartBuild", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageBuilderzCRPolicyC9B09855", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "LambdaImageBuilderzBuildWaitHandlea0b480332770D3313C": { + "Type": "AWS::CloudFormation::WaitConditionHandle" + }, + "LambdaImageBuilderzBuildWaita0b4803327B88D22EC": { + "Type": "AWS::CloudFormation::WaitCondition", + "Properties": { + "Count": 1, + "Handle": { + "Ref": "LambdaImageBuilderzBuildWaitHandlea0b480332770D3313C" + }, + "Timeout": "3600" + } + }, + "LambdaImageBuilderzBuilder235DD147": { + "Type": "Custom::ImageBuilder", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "Arn" + ] + }, + "RepoName": { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "ProjectName": { + "Ref": "LambdaImageBuilderzCodeBuild73AB6718" + }, + "WaitHandle": { + "Ref": "LambdaImageBuilderzBuildWaitHandlea0b480332770D3313C" + } + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "LambdaImageBuilderzCodeBuildBuildFailedFBCC1CE8", + "LambdaImageBuilderzCodeBuildEventsRoleDefaultPolicyE0DB8E23", + "LambdaImageBuilderzCodeBuildEventsRoleE9E50664", + "LambdaImageBuilderzCodeBuild73AB6718", + "LambdaImageBuilderzCRPolicyC9B09855", + "LambdaImageBuilderzRoleDefaultPolicy06ABB0C7", + "LambdaImageBuilderzRole6F1A63E5" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaImageBuilderzBuildSchedule81F79A6A": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Rebuild runner image for ", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + } + ] + ] + }, + "ScheduleExpression": "rate(7 days)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuild73AB6718", + "Arn" + ] + }, + "Id": "Target0", + "RoleArn": { + "Fn::GetAtt": [ + "LambdaImageBuilderzCodeBuildEventsRoleE9E50664", + "Arn" + ] + } + } + ] + } + }, + "AMILinuxarm64BuilderSG94315968": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/AMI Linux arm64 Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "AMILinuxarm64BuilderRole40D54E29": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilder" + ] + ] + } + ] + } + }, + "AMILinuxarm64BuilderRoleDefaultPolicy113305EE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", + "Roles": [ + { + "Ref": "AMILinuxarm64BuilderRole40D54E29" + } + ] + } + }, + "AMILinuxarm64BuilderLaunchtemplate8F5EFF44": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "MetadataOptions": { + "HttpTokens": "required" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" + } + ] + } + ] + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/AMI Linux arm64 Builder/Launch template" + } + ] + } + ] + } + }, + "AMILinuxarm64BuilderAMIDistributionE6989D01": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "AmiDistributionConfiguration": { + "AmiTags": { + "Name": "AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test", + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" + } + }, + "LaunchTemplateConfigurations": [ + { + "LaunchTemplateId": { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "SetDefaultVersion": true + } + ], + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-amilinuxarm64builder-amidistribution-64ec726d", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y\n - DEBIAN_FRONTEND=noninteractive apt-get install -y curl sudo jq\n bash zip unzip iptables software-properties-common ca-certificates\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-amilinuxarm64builder-component0requiredpackages-component-24f2e247", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -sfLo /tmp/amazon-cloudwatch-agent.deb\n https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb\n - dpkg -i -E /tmp/amazon-cloudwatch-agent.deb\n - rm /tmp/amazon-cloudwatch-agent.deb\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-amilinuxarm64builder-component1cloudwatchagent-component-9127095a", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - addgroup runner\n - adduser --system --disabled-password --home /home/runner --ingroup\n runner runner\n - 'echo \"%runner ALL=(ALL:ALL) NOPASSWD: ALL\" >\n /etc/sudoers.d/runner'\n", + "Description": "Component 2 RunnerUser", + "Name": "github-runners-test-amilinuxarm64builder-component2runneruser-component-360117bd", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - add-apt-repository ppa:git-core/ppa\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y git\n", + "Description": "Component 3 Git", + "Name": "github-runners-test-amilinuxarm64builder-component3git-component-c3215149", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n https://cli.github.com/packages/githubcli-archive-keyring.gpg |\n sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages\n stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list >\n /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y gh\n", + "Description": "Component 4 GithubCli", + "Name": "github-runners-test-amilinuxarm64builder-component4githubcli-component-585d1ee4", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL\n \"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\" -o\n awscliv2.zip\n - unzip -q awscliv2.zip\n - ./aws/install\n - rm -rf awscliv2.zip aws\n", + "Description": "Component 5 AwsCli", + "Name": "github-runners-test-amilinuxarm64builder-component5awscli-component-706b4769", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg\n --dearmor -o /usr/share/keyrings/docker.gpg\n - echo \"deb [arch=$(dpkg --print-architecture)\n signed-by=/usr/share/keyrings/docker.gpg]\n https://download.docker.com/linux/ubuntu $(lsb_release -cs)\n stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null\n - apt-get update\n - DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce\n docker-ce-cli containerd.io docker-compose-plugin\n - usermod -aG docker runner\n - ln -s /usr/libexec/docker/cli-plugins/docker-compose\n /usr/bin/docker-compose\n", + "Description": "Component 6 Docker", + "Name": "github-runners-test-amilinuxarm64builder-component6docker-component-4c582cde", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - RUNNER_VERSION=`curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest | grep -oE\n \"[^/v]+$\"`\n - curl -fsSLO\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - tar -C /home/runner -xzf\n \"actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\"\n - rm actions-runner-linux-arm64-${RUNNER_VERSION}.tar.gz\n - echo -n latest > /home/runner/RUNNER_VERSION\n - /home/runner/bin/installdependencies.sh\n - mkdir -p /opt/hostedtoolcache\n - chown runner /opt/hostedtoolcache\n", + "Description": "Component 7 GithubRunner", + "Name": "github-runners-test-amilinuxarm64builder-component7githubrunner-component-bdc80137", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - touch /custom-file\n - mkdir /custom-dir\n - mv FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 8 Custom-Undefined", + "Name": "github-runners-test-amilinuxarm64builder-component8custom-undefined-component-e23d33b6", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecuteBash\n inputs:\n commands:\n - set -ex\n - echo 'HELLO=world' >> /home/runner/.env\n - echo 'FOO=bar' >> /home/runner/.env\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-amilinuxarm64builder-component9environmentvariables-component-25ee7189", + "Platform": "Linux", + "Version": "1.0.0" + } + }, + "AMILinuxarm64BuilderAmiRecipe4287E320": { + "Type": "AWS::ImageBuilder::ImageRecipe", + "Properties": { + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", + "Arn" + ] + } + } + ], + "Name": "github-runners-test-amilinuxarm64builder-amirecipe-841295f9", + "ParentImage": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/ubuntu-server-22-lts-arm64/x.x.x" + ] + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "Version": "1.0.x", + "WorkingDirectory": "/home/runner" + } + }, + "AMILinuxarm64BuilderAmiLog84A9D94A": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Name" + ] + } + ] + ] + }, + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "AMILinuxarm64BuilderRole40D54E29" + } + ] + } + }, + "AMILinuxarm64BuilderInfrastructureA97EB3DD": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7" + }, + "InstanceTypes": [ + "m6g.large" + ], + "Name": "github-runners-test-amilinuxarm64builder-infrastructure-4dd30f96", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderSG94315968", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "AMILinuxarm64BuilderAMIImageC529A482": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAMIDistributionE6989D01", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderInfrastructureA97EB3DD", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxarm64BuilderAmiLog84A9D94A", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "AMILinuxarm64BuilderAMIPipeline462B4E1B": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAMIDistributionE6989D01", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderInfrastructureA97EB3DD", + "Arn" + ] + }, + "Name": "github-runners-test-amilinuxarm64builder-amipipeline-7f59e36e", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "AMILinuxarm64BuilderAmiLog84A9D94A", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD" + ] + }, + "AMILinuxarm64BuilderImageCleanerA5DDFE7A": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/", + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeImages", + "ec2:DescribeImageAttribute" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", + "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/AMI Linux arm64 Builder" + } + }, + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ami" + } + ] + } + }, + "AMILinuxarm64BuilderLifecyclePolicyAMI1941512F": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner AMIs for github-runners-test/AMI Linux arm64 Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", + "Arn" + ] + }, + "Name": "github-runners-test-amilinuxarm64builder-lifecyclepolicyami-80d1039e", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Amis": true, + "Snapshots": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Name" + ] + }, + "SemanticVersion": { + "Fn::GetAtt": [ + "AMILinuxarm64BuilderAmiRecipe4287E320", + "Version" + ] + } + } + ] + }, + "ResourceType": "AMI_IMAGE" + } + }, + "WindowsEC2BuilderSGE3F67842": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Windows EC2 Builder/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "WindowsEC2BuilderRole1BA7D3E7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/EC2InstanceProfileForImageBuilder" + ] + ] + } + ] + } + }, + "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", + "Roles": [ + { + "Ref": "WindowsEC2BuilderRole1BA7D3E7" + } + ] + } + }, + "WindowsEC2BuilderLaunchtemplate0A66E9C2": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "MetadataOptions": { + "HttpTokens": "required" + }, + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Windows EC2 Builder/Launch template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Windows EC2 Builder/Launch template" + } + ] + } + ] + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "github-runners-test/Windows EC2 Builder/Launch template" + } + ] + } + ] + } + }, + "WindowsEC2BuilderAMIDistribution6B33DD89": { + "Type": "AWS::ImageBuilder::DistributionConfiguration", + "Properties": { + "Distributions": [ + { + "AmiDistributionConfiguration": { + "AmiTags": { + "Name": "Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test", + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" + } + }, + "LaunchTemplateConfigurations": [ + { + "LaunchTemplateId": { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "SetDefaultVersion": true + } + ], + "Region": { + "Ref": "AWS::Region" + } + } + ], + "Name": "github-runners-test-windowsec2builder-amidistribution-f20c96b4", + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + } + }, + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 0 RequiredPackages\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 0 RequiredPackages", + "Name": "github-runners-test-windowsec2builder-component0requiredpackages-component-bee13031", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 1 CloudWatchAgent\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi\n /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", + "Description": "Component 1 CloudWatchAgent", + "Name": "github-runners-test-windowsec2builder-component1cloudwatchagent-component-64d3d72a", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 2 RunnerUser\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n", + "Description": "Component 2 RunnerUser", + "Name": "github-runners-test-windowsec2builder-component2runneruser-component-91981b9f", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent3GitComponent4F86AE54": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 3 Git\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/git-for-windows/git/releases/latest >\n $Env:TEMP\\latest-git\n - $LatestUrl = Get-Content $Env:TEMP\\latest-git\n - $GIT_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - $GIT_VERSION_SHORT = ($GIT_VERSION -Split '.windows.')[0]\n - $GIT_REVISION = ($GIT_VERSION -Split '.windows.')[1]\n - If ($GIT_REVISION -gt 1) {$GIT_VERSION_SHORT =\n \"$GIT_VERSION_SHORT.$GIT_REVISION\"}\n - Invoke-WebRequest -UseBasicParsing -Uri\n https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}/Git-${GIT_VERSION_SHORT}-64-bit.exe\n -OutFile git-setup.exe\n - $p = Start-Process git-setup.exe -PassThru -Wait -ArgumentList\n '/VERYSILENT'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del git-setup.exe\n", + "Description": "Component 3 Git", + "Name": "github-runners-test-windowsec2builder-component3git-component-cc6f418c", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 4 GithubCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/cli/cli/releases/latest > $Env:TEMP\\latest-gh\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gh\n - $GH_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi\"\n -OutFile gh.msi\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n gh.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n - del gh.msi\n", + "Description": "Component 4 GithubCli", + "Name": "github-runners-test-windowsec2builder-component4githubcli-component-860aefc0", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 5 AwsCli\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $p = Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/i\n https://awscli.amazonaws.com/AWSCLIV2.msi /qn'\n - if ($p.ExitCode -ne 0) { throw \"Exit code is $p.ExitCode\" }\n", + "Description": "Component 5 AwsCli", + "Name": "github-runners-test-windowsec2builder-component5awscli-component-c6a315bd", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 6 Docker\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - $BaseUrl = \"https://download.docker.com/win/static/stable/x86_64/\"\n - $html = Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl\n - $files = $html.Links.href | Where-Object { $_ -match\n '^docker-[0-9\\.]+\\.zip$' }\n - if (-not $files) { Write-Error \"No docker-*.zip files found.\" ;\n exit 1 }\n - $latest = $files | Sort-Object { try { [Version]($_ -replace\n '^docker-|\\.zip$') } catch { [Version]\"0.0.0\" } } -Descending |\n Select-Object -First 1\n - Invoke-WebRequest -UseBasicParsing -Uri $BaseUrl$latest -OutFile\n docker.zip\n - Expand-Archive docker.zip -DestinationPath \"$Env:ProgramFiles\"\n - del docker.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";$Env:ProgramFiles\\Docker\",\n [EnvironmentVariableTarget]::Machine)'\n - $env:PATH = $env:PATH + \";$Env:ProgramFiles\\Docker\"\n - dockerd --register-service\n - if ($LASTEXITCODE -ne 0) { throw \"Exit code is $LASTEXITCODE\" }\n - Enable-WindowsOptionalFeature -Online -FeatureName containers -All\n -NoRestart\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/docker/compose/releases/latest >\n $Env:TEMP\\latest-docker-compose\n - $LatestUrl = Get-Content $Env:TEMP\\latest-docker-compose\n - $LatestDockerCompose = ($LatestUrl -Split '/')[-1]\n - Invoke-WebRequest -UseBasicParsing\n -Uri \"https://github.com/docker/compose/releases/download/${LatestDockerCompose}/docker-compose-Windows-x86_64.exe\"\n -OutFile $Env:ProgramFiles\\Docker\\docker-compose.exe\n - New-Item -ItemType directory -Path\n \"$Env:ProgramFiles\\Docker\\cli-plugins\"\n - Copy-Item -Path \"$Env:ProgramFiles\\Docker\\docker-compose.exe\"\n -Destination\n \"$Env:ProgramFiles\\Docker\\cli-plugins\\docker-compose.exe\"\n - name: Reboot\n action: Reboot\n inputs: {}\n", + "Description": "Component 6 Docker", + "Name": "github-runners-test-windowsec2builder-component6docker-component-69981091", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 7 GithubRunner\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/actions/runner/releases/latest >\n $Env:TEMP\\latest-gha\n - $LatestUrl = Get-Content $Env:TEMP\\latest-gha\n - $RUNNER_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - mkdir C:\\hostedtoolcache\\windows\n - mkdir C:\\tools\n - cmd /c curl -w \"%{redirect_url}\" -fsS\n https://github.com/facebook/zstd/releases/latest >\n $Env:TEMP\\latest-zstd\n - $LatestUrl = Get-Content $Env:TEMP\\latest-zstd\n - $ZSTD_VERSION = ($LatestUrl -Split '/')[-1].substring(1)\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip\"\n -OutFile zstd.zip\n - Expand-Archive zstd.zip -DestinationPath C:\\tools\n - Move-Item -Path C:\\tools\\zstd-v$ZSTD_VERSION-win64\\zstd.exe\n C:\\tools\n - Remove-Item -LiteralPath \"C:\\tools\\zstd-v$ZSTD_VERSION-win64\"\n -Force -Recurse\n - del zstd.zip\n - $persistedPaths = [Environment]::GetEnvironmentVariable('Path',\n [EnvironmentVariableTarget]::Machine)\n - '[Environment]::SetEnvironmentVariable(\"PATH\", $persistedPaths +\n \";C:\\tools\", [EnvironmentVariableTarget]::Machine)'\n - Invoke-WebRequest -UseBasicParsing -Uri\n \"https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip\"\n -OutFile actions.zip\n - Expand-Archive actions.zip -DestinationPath C:\\actions\n - del actions.zip\n - echo latest | Out-File -Encoding ASCII -NoNewline\n C:\\actions\\RUNNER_VERSION\n", + "Description": "Component 7 GithubRunner", + "Name": "github-runners-test-windowsec2builder-component7githubrunner-component-a31c580e", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": { + "Fn::Join": [ + "", + [ + "name: Component 8 Custom-Undefined\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs:\n - source: ", + { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64f83fc47e69ce862669fca14d759c3034fdbed3686b66dcf7bf9ff166f65c68.yml" + }, + "\n destination: FUNDING.yml\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - New-Item -ItemType file -Path / -Name custom-file\n - New-Item -ItemType directory -Path / -Name custom-dir\n - Move-Item FUNDING.yml /custom-dir\n" + ] + ] + }, + "Description": "Component 8 Custom-Undefined", + "Name": "github-runners-test-windowsec2builder-component8custom-undefined-component-c961cd3a", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0": { + "Type": "AWS::ImageBuilder::Component", + "Properties": { + "Data": "name: Component 9 EnvironmentVariables\nschemaVersion: \"1.0\"\nphases:\n - name: build\n steps:\n - name: Download\n action: S3Download\n inputs: []\n - name: Run\n action: ExecutePowerShell\n inputs:\n commands:\n - $ErrorActionPreference = 'Stop'\n - $ProgressPreference = 'SilentlyContinue'\n - Set-PSDebug -Trace 1\n - Add-Content -Path C:\\actions\\.env -Value 'HELLO=world'\n - Add-Content -Path C:\\actions\\.env -Value 'FOO=bar'\n", + "Description": "Component 9 EnvironmentVariables", + "Name": "github-runners-test-windowsec2builder-component9environmentvariables-component-9fb8d548", + "Platform": "Windows", + "Version": "1.0.0" + } + }, + "WindowsEC2BuilderAmiRecipe9D687A09": { + "Type": "AWS::ImageBuilder::ImageRecipe", + "Properties": { + "Components": [ + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent3GitComponent4F86AE54", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", + "Arn" + ] + } + }, + { + "ComponentArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", + "Arn" + ] + } + } + ], + "Name": "github-runners-test-windowsec2builder-amirecipe-a290749e", + "ParentImage": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":aws:image/windows-server-2022-english-full-base-x86/x.x.x" + ] + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + }, + "Version": "1.0.x", + "WorkingDirectory": "C:/" + } + }, + "WindowsEC2BuilderAmiLog126E54B2": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/imagebuilder/", + { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Name" + ] + } + ] + ] + }, + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "WindowsEC2BuilderRole1BA7D3E7" + } + ] + } + }, + "WindowsEC2BuilderInfrastructure4289B6D2": { + "Type": "AWS::ImageBuilder::InfrastructureConfiguration", + "Properties": { + "InstanceMetadataOptions": { + "HttpPutResponseHopLimit": 2, + "HttpTokens": "required" + }, + "InstanceProfileName": { + "Ref": "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA" + }, + "InstanceTypes": [ + "m6i.large" + ], + "Name": "github-runners-test-windowsec2builder-infrastructure-8e08e175", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "WindowsEC2BuilderSGE3F67842", + "GroupId" + ] + } + ], + "SnsTopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "WindowsEC2BuilderAMIImageD1C73439": { + "Type": "AWS::ImageBuilder::Image", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAMIDistribution6B33DD89", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderInfrastructure4289B6D2", + "Arn" + ] + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsEC2BuilderAmiLog126E54B2", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "RetainExceptOnCreate" + }, + "WindowsEC2BuilderAMIPipeline445918BA": { + "Type": "AWS::ImageBuilder::ImagePipeline", + "Properties": { + "DistributionConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAMIDistribution6B33DD89", + "Arn" + ] + }, + "ImageRecipeArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Arn" + ] + }, + "ImageTestsConfiguration": { + "ImageTestsEnabled": false + }, + "InfrastructureConfigurationArn": { + "Fn::GetAtt": [ + "WindowsEC2BuilderInfrastructure4289B6D2", + "Arn" + ] + }, + "Name": "github-runners-test-windowsec2builder-amipipeline-fef0bbd5", + "Schedule": { + "PipelineExecutionStartCondition": "EXPRESSION_MATCH_ONLY", + "ScheduleExpression": "rate(7 days)" + }, + "Tags": { + "GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder", + "GitHubRunners:Stack": "github-runners-test" + } + }, + "DependsOn": [ + "WindowsEC2BuilderAmiLog126E54B2", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2" + ] + }, + "WindowsEC2BuilderImageCleanerEF537850": { + "Type": "Custom::ImageBuilder-Delete-Resources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382", + "Arn" + ] + }, + "ImageVersionArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":imagebuilder:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":image/", + { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Name" + ] + }, + "/", + { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Version" + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "imagebuilder.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "tag:GetResources", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ib" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeImages", + "ec2:DescribeImageAttribute" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test", + "aws:ResourceTag/GitHubRunners:Builder": "github-runners-test/Windows EC2 Builder" + } + }, + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ami" + } + ] + } + }, + "WindowsEC2BuilderLifecyclePolicyAMI73E24E7A": { + "Type": "AWS::ImageBuilder::LifecyclePolicy", + "Properties": { + "Description": "Delete old GitHub Runner AMIs for github-runners-test/Windows EC2 Builder", + "ExecutionRole": { + "Fn::GetAtt": [ + "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", + "Arn" + ] + }, + "Name": "github-runners-test-windowsec2builder-lifecyclepolicyami-964d181f", + "PolicyDetails": [ + { + "Action": { + "IncludeResources": { + "Amis": true, + "Snapshots": true + }, + "Type": "DELETE" + }, + "Filter": { + "Type": "COUNT", + "Value": 2 + } + } + ], + "ResourceSelection": { + "Recipes": [ + { + "Name": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Name" + ] + }, + "SemanticVersion": { + "Fn::GetAtt": [ + "WindowsEC2BuilderAmiRecipe9D687A09", + "Version" + ] + } + } + ] + }, + "ResourceType": "AMI_IMAGE" + } + }, + "CodeBuildx64LogsA21ECD59": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildx64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildx64LogsLogsfilter915A4B6F": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildx64LogsA21ECD59" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildx64CodeBuildRole32E5C764": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildx64" + } + ] + } + }, + "CodeBuildx64CodeBuildRoleDefaultPolicy221DA642": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildx64LogsA21ECD59", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildx64CodeBuildRoleDefaultPolicy221DA642", + "Roles": [ + { + "Ref": "CodeBuildx64CodeBuildRole32E5C764" + } + ] + } + }, + "CodeBuildx64CodeBuild7DC01A1E": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild-x64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildx64LogsA21ECD59" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildx64CodeBuildRole32E5C764", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\",\n \"RUNNER_GROUP\": \"\",\n \"DEFAULT_LABELS\": \"\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP} ${DEFAULT_LABELS}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildx64" + } + ], + "TimeoutInMinutes": 60 + } + }, + "RunnerImageBuildHelpersLog13186633": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "imagebuilder:DeleteImage", + "Effect": "Deny", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "Roles": [ + { + "Ref": "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + } + ] + } + }, + "buildimagedcc036c8876b451ea2c1552f9e06e9e173B4162A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "2c61df9d7754f7f3edb5a4779da56c846513991ec9a4b73bb8a76ab1dfeb45f0.zip" + }, + "Description": "Custom resource handler that triggers CodeBuild to build runner images", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 180 + }, + "DependsOn": [ + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy0553A55C", + "buildimagedcc036c8876b451ea2c1552f9e06e9e1ServiceRoleC3DE4837" + ] + }, + "CodeBuildUbuntu2404x64Logs27D26829": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildUbuntu2404x64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildUbuntu2404x64LogsLogsfilter5AD0BDC2": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildUbuntu2404x64Logs27D26829" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildUbuntu2404x64" + } + ] + } + }, + "CodeBuildUbuntu2404x64CodeBuildRoleDefaultPolicy378D5938": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64Logs27D26829", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildUbuntu2404x64CodeBuildRoleDefaultPolicy378D5938", + "Roles": [ + { + "Ref": "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92" + } + ] + } + }, + "CodeBuildUbuntu2404x64CodeBuild261399A8": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild-ubuntu-2404-x64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": true, + "Type": "LINUX_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildUbuntu2404x64Logs27D26829" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\",\n \"RUNNER_GROUP\": \"\",\n \"DEFAULT_LABELS\": \"\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP} ${DEFAULT_LABELS}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildUbuntu2404x64" + } + ], + "TimeoutInMinutes": 60 + } + }, + "CodeBuildARMLogs7C7FC5A7": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildARM" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildARMLogsLogsfilter32B5122B": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildARMLogs7C7FC5A7" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildARMCodeBuildRole74DB4985": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildARM" + } + ] + } + }, + "CodeBuildARMCodeBuildRoleDefaultPolicyFC84CEAE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildARMLogs7C7FC5A7", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildARMCodeBuildRoleDefaultPolicyFC84CEAE", + "Roles": [ + { + "Ref": "CodeBuildARMCodeBuildRole74DB4985" + } + ] + } + }, + "CodeBuildARMCodeBuildC5F301F2": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild,linux,arm64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_SMALL", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": true, + "Type": "ARM_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildARMLogs7C7FC5A7" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildARMCodeBuildRole74DB4985", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\",\n \"RUNNER_GROUP\": \"\",\n \"DEFAULT_LABELS\": \"\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"nohup dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &\",\n \"timeout 15 sh -c \\\"until docker info; do echo .; sleep 1; done\\\"\",\n \"if [ \\\"${RUNNER_VERSION}\\\" = \\\"latest\\\" ]; then RUNNER_FLAGS=\\\"\\\"; else RUNNER_FLAGS=\\\"--disableupdate\\\"; fi\",\n \"sudo -Hu runner /home/runner/config.sh --unattended --url \\\"${REGISTRATION_URL}\\\" --token \\\"${RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${RUNNER_LABEL},cdkghr:started:`date +%s`\\\" ${RUNNER_FLAGS} --name \\\"${RUNNER_NAME}\\\" ${RUNNER_GROUP} ${DEFAULT_LABELS}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"sudo --preserve-env=AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_DEFAULT_REGION,AWS_REGION -Hu runner /home/runner/run.sh\",\n \"STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: \\\\K.*\\\" /home/runner/_diag/ | tail -n1)\",\n \"[ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$RUNNER_LABEL\\\" \\\"$STATUS\\\"\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildARM" + } + ], + "TimeoutInMinutes": 60 + } + }, + "CodeBuildWindowsLogsF4DD93A5": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildWindows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CodeBuildWindowsLogsLogsfilterC0A33A89": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "CodeBuildWindowsLogsF4DD93A5" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "CodeBuildWindowsCodeBuildRoleDC93697E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "codebuild.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildWindows" + } + ] + } + }, + "CodeBuildWindowsCodeBuildRoleDefaultPolicyA932AC4D": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildWindowsLogsF4DD93A5", + "Arn" + ] + } + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/codebuild/", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:CreateReportGroup", + "codebuild:CreateReport", + "codebuild:UpdateReport", + "codebuild:BatchPutTestCases", + "codebuild:BatchPutCodeCoverages" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":codebuild:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":report-group/", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + }, + "-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CodeBuildWindowsCodeBuildRoleDefaultPolicyA932AC4D", + "Roles": [ + { + "Ref": "CodeBuildWindowsCodeBuildRoleDC93697E" + } + ] + } + }, + "CodeBuildWindowsCodeBuildC39F35C1": { + "Type": "AWS::CodeBuild::Project", + "Properties": { + "Artifacts": { + "Type": "NO_ARTIFACTS" + }, + "Cache": { + "Type": "NO_CACHE" + }, + "Description": "GitHub Actions self-hosted runner for labels codebuild,windows,x64", + "EncryptionKey": "alias/aws/s3", + "Environment": { + "ComputeType": "BUILD_GENERAL1_MEDIUM", + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest" + ] + ] + }, + "ImagePullCredentialsType": "SERVICE_ROLE", + "PrivilegedMode": false, + "Type": "WINDOWS_SERVER_2019_CONTAINER" + }, + "LogsConfig": { + "CloudWatchLogs": { + "GroupName": { + "Ref": "CodeBuildWindowsLogsF4DD93A5" + }, + "Status": "ENABLED" + } + }, + "ServiceRole": { + "Fn::GetAtt": [ + "CodeBuildWindowsCodeBuildRoleDC93697E", + "Arn" + ] + }, + "Source": { + "BuildSpec": "{\n \"version\": 0.2,\n \"env\": {\n \"variables\": {\n \"RUNNER_TOKEN\": \"unspecified\",\n \"RUNNER_NAME\": \"unspecified\",\n \"RUNNER_LABEL\": \"unspecified\",\n \"OWNER\": \"unspecified\",\n \"REPO\": \"unspecified\",\n \"GITHUB_DOMAIN\": \"github.com\",\n \"REGISTRATION_URL\": \"unspecified\",\n \"RUNNER_GROUP\": \"\",\n \"DEFAULT_LABELS\": \"\"\n }\n },\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"cd \\\\actions\",\n \"if (${Env:RUNNER_VERSION} -eq \\\"latest\\\") { $RunnerFlags = \\\"\\\" } else { $RunnerFlags = \\\"--disableupdate\\\" }\",\n \"./config.cmd --unattended --url \\\"${Env:REGISTRATION_URL}\\\" --token \\\"${Env:RUNNER_TOKEN}\\\" --ephemeral --work _work --labels \\\"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat %s)\\\" ${RunnerFlags} --name \\\"${Env:RUNNER_NAME}\\\" ${Env:RUNNER_GROUP} ${Env:DEFAULT_LABELS}\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"cd \\\\actions\",\n \"./run.cmd\",\n \"$STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1\",\n \"if ($STATUS) { echo \\\"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\\\" }\"\n ]\n }\n }\n}", + "Type": "NO_SOURCE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/CodeBuildWindows" + } + ], + "TimeoutInMinutes": 60 + } + }, + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "imagebuilder:ListImageBuildVersions", + "imagebuilder:DeleteImage" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "ec2:DescribeImages", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/GitHubRunners:Stack": "github-runners-test" + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "ecr:BatchDeleteImage", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E", + "Roles": [ + { + "Ref": "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C" + } + ] + } + }, + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e18E1C8382": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip" + }, + "Description": "Custom resource handler that deletes resources of old versions of EC2 Image Builder images", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 600 + }, + "DependsOn": [ + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy83DD2A7E", + "awsimagebuilderdeleteresourcesdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleB6525E5C" + ] + }, + "ECSsecuritygroup76605212": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECScluster20BC0B82": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECScluster9E223943": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSCapacityProviderABF1B146" + } + ], + "Cluster": { + "Ref": "ECScluster20BC0B82" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSAMIRootDevice35683156": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSLaunchTemplateRole3D54417B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECSLaunchTemplateRoleDefaultPolicyA6578409": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECScluster20BC0B82", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECScluster20BC0B82", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSLaunchTemplateRoleDefaultPolicyA6578409", + "Roles": [ + { + "Ref": "ECSLaunchTemplateRole3D54417B" + } + ] + } + }, + "ECSLaunchTemplateProfileC7A3F149": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSLaunchTemplateRole3D54417B" + } + ] + } + }, + "ECSLaunchTemplate3A132D2F": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "BlockDeviceMappings": [ + { + "DeviceName": { + "Ref": "ECSAMIRootDevice35683156" + }, + "Ebs": { + "DeleteOnTermination": true, + "Iops": 1500, + "Throughput": 150, + "VolumeSize": 40, + "VolumeType": "gp3" + } + } + ], + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSLaunchTemplateProfileC7A3F149", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id", + "InstanceMarketOptions": { + "MarketType": "spot", + "SpotOptions": { + "SpotInstanceType": "one-time" + } + }, + "InstanceType": "m6i.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSsecuritygroup76605212", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", + { + "Ref": "AWS::Region" + }, + " | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\ndocker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", + { + "Ref": "ECScluster20BC0B82" + }, + " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSLaunchTemplateRoleDefaultPolicyA6578409", + "ECSLaunchTemplateRole3D54417B" + ] + }, + "ECSAutoScalingGroupASG88763D9A": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSLaunchTemplate3A132D2F" + }, + "Version": { + "Fn::GetAtt": [ + "ECSLaunchTemplate3A132D2F", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSCapacityProviderABF1B146": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSAutoScalingGroupASG88763D9A" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECSlogs71446134": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSlogslogsfilterC744F425": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSlogs71446134" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECStaskTaskRoleFE831ECD": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECStaskTaskRoleDefaultPolicy46A3CB3A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECStaskTaskRoleDefaultPolicy46A3CB3A", + "Roles": [ + { + "Ref": "ECStaskTaskRoleFE831ECD" + } + ] + } + }, + "ECStask8F0DD550": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSlogs71446134" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": true, + "User": "runner" + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECStaskExecutionRole1A6D19A5", + "Arn" + ] + }, + "Family": "githubrunnerstestECStaskCE74CC84", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECStaskTaskRoleFE831ECD", + "Arn" + ] + } + } + }, + "ECStaskExecutionRole1A6D19A5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS" + } + ] + } + }, + "ECStaskExecutionRoleDefaultPolicy564C1271": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSlogs71446134", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECStaskExecutionRoleDefaultPolicy564C1271", + "Roles": [ + { + "Ref": "ECStaskExecutionRole1A6D19A5" + } + ] + } + }, + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssm:GetParameter", + "ec2:DescribeImages", + "ec2:DescribeLaunchTemplateVersions", + "imagebuilder:GetImage" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6", + "Roles": [ + { + "Ref": "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36" + } + ] + } + }, + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "88cc171bf3103a3b98ba0006fc7e5c6fdfd338c03591b344bb4cf60f1a9da18c.zip" + }, + "Description": "Custom resource handler that discovers the boot drive device name for a given AMI", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 60 + }, + "DependsOn": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicyDC1762B6", + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1ServiceRole69906A36" + ] + }, + "ECSUbuntu2404securitygroupEE405C76": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS Ubuntu 2404/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECSUbuntu2404cluster21C05FA1": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404cluster0A1E8926": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSUbuntu2404CapacityProviderFAE73340" + } + ], + "Cluster": { + "Ref": "ECSUbuntu2404cluster21C05FA1" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSUbuntu2404AMIRootDevice9455BDF7": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSUbuntu2404LaunchTemplateRole77926CCA": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSUbuntu2404cluster21C05FA1", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECSUbuntu2404cluster21C05FA1", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94", + "Roles": [ + { + "Ref": "ECSUbuntu2404LaunchTemplateRole77926CCA" + } + ] + } + }, + "ECSUbuntu2404LaunchTemplateProfile7CCE115D": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSUbuntu2404LaunchTemplateRole77926CCA" + } + ] + } + }, + "ECSUbuntu2404LaunchTemplate360B1216": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "BlockDeviceMappings": [ + { + "DeviceName": { + "Ref": "ECSUbuntu2404AMIRootDevice9455BDF7" + }, + "Ebs": { + "DeleteOnTermination": true, + "Iops": 1500, + "Throughput": 150, + "VolumeSize": 40, + "VolumeType": "gp3" + } + } + ], + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSUbuntu2404LaunchTemplateProfile7CCE115D", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id", + "InstanceMarketOptions": { + "MarketType": "spot", + "SpotOptions": { + "SpotInstanceType": "one-time" + } + }, + "InstanceType": "m6i.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSUbuntu2404securitygroupEE405C76", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", + { + "Ref": "AWS::Region" + }, + " | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\ndocker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", + { + "Ref": "ECSUbuntu2404cluster21C05FA1" + }, + " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Ubuntu 2404/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSUbuntu2404LaunchTemplateRoleDefaultPolicyA6CD4F94", + "ECSUbuntu2404LaunchTemplateRole77926CCA" + ] + }, + "ECSUbuntu2404AutoScalingGroupASG40115790": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSUbuntu2404LaunchTemplate360B1216" + }, + "Version": { + "Fn::GetAtt": [ + "ECSUbuntu2404LaunchTemplate360B1216", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSUbuntu2404CapacityProviderFAE73340": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSUbuntu2404AutoScalingGroupASG40115790" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404logsFB15C25B": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSUbuntu2404logslogsfilterEAA30ADB": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSUbuntu2404logsFB15C25B" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECSUbuntu2404taskTaskRoleDF683F3B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404taskTaskRoleDefaultPolicyEA2F978C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSUbuntu2404taskTaskRoleDefaultPolicyEA2F978C", + "Roles": [ + { + "Ref": "ECSUbuntu2404taskTaskRoleDF683F3B" + } + ] + } + }, + "ECSUbuntu2404taskFC90B155": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSUbuntu2404logsFB15C25B" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": true, + "User": "runner" + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECSUbuntu2404taskExecutionRoleC5FEA726", + "Arn" + ] + }, + "Family": "githubrunnerstestECSUbuntu2404taskB7D564C7", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECSUbuntu2404taskTaskRoleDF683F3B", + "Arn" + ] + } + } + }, + "ECSUbuntu2404taskExecutionRoleC5FEA726": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Ubuntu 2404" + } + ] + } + }, + "ECSUbuntu2404taskExecutionRoleDefaultPolicy580200B4": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSUbuntu2404logsFB15C25B", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSUbuntu2404taskExecutionRoleDefaultPolicy580200B4", + "Roles": [ + { + "Ref": "ECSUbuntu2404taskExecutionRoleC5FEA726" + } + ] + } + }, + "ECSARM64securitygroup281D94B2": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS ARM64/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECSARM64cluster4ECAA083": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64cluster43E75409": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSARM64CapacityProvider8627FEF9" + } + ], + "Cluster": { + "Ref": "ECSARM64cluster4ECAA083" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSARM64LaunchTemplateRole9D1574E2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSARM64cluster4ECAA083", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECSARM64cluster4ECAA083", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA", + "Roles": [ + { + "Ref": "ECSARM64LaunchTemplateRole9D1574E2" + } + ] + } + }, + "ECSARM64LaunchTemplateProfileBF272018": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSARM64LaunchTemplateRole9D1574E2" + } + ] + } + }, + "ECSARM64LaunchTemplateC44F6059": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSARM64LaunchTemplateProfileBF272018", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/arm64/recommended/image_id", + "InstanceType": "m6g.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSARM64securitygroup281D94B2", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS ARM64/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS ARM64/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "#!/bin/bash\nyum install -y awscli || dnf install -y awscli\naws ecr get-login-password --region ", + { + "Ref": "AWS::Region" + }, + " | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\ndocker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + ":latest &\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=5s >> /etc/ecs/ecs.config\necho ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER=5s >> /etc/ecs/ecs.config\necho ECS_CLUSTER=", + { + "Ref": "ECSARM64cluster4ECAA083" + }, + " >> /etc/ecs/ecs.config\nsudo iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP\nsudo service iptables save\necho ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS ARM64/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSARM64LaunchTemplateRoleDefaultPolicy0705A7AA", + "ECSARM64LaunchTemplateRole9D1574E2" + ] + }, + "ECSARM64AutoScalingGroupASGA19FC118": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSARM64LaunchTemplateC44F6059" + }, + "Version": { + "Fn::GetAtt": [ + "ECSARM64LaunchTemplateC44F6059", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS ARM64" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSARM64CapacityProvider8627FEF9": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSARM64AutoScalingGroupASGA19FC118" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64logs1A2F1E00": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSARM64logslogsfilter6914CFA1": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSARM64logs1A2F1E00" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECSARM64taskTaskRole23B1CB4E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64taskTaskRoleDefaultPolicyD893D7DC": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSARM64taskTaskRoleDefaultPolicyD893D7DC", + "Roles": [ + { + "Ref": "ECSARM64taskTaskRole23B1CB4E" + } + ] + } + }, + "ECSARM64task27EB8443": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "nohup sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSARM64logs1A2F1E00" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": true, + "User": "runner" + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECSARM64taskExecutionRoleBF2AE76F", + "Arn" + ] + }, + "Family": "githubrunnerstestECSARM64taskE94E43A3", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECSARM64taskTaskRole23B1CB4E", + "Arn" + ] + } + } + }, + "ECSARM64taskExecutionRoleBF2AE76F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS ARM64" + } + ] + } + }, + "ECSARM64taskExecutionRoleDefaultPolicy17294239": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSARM64logs1A2F1E00", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSARM64taskExecutionRoleDefaultPolicy17294239", + "Roles": [ + { + "Ref": "ECSARM64taskExecutionRoleBF2AE76F" + } + ] + } + }, + "ECSWindowssecuritygroupB4EE54DA": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/ECS Windows/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ECSWindowscluster14061F74": { + "Type": "AWS::ECS::Cluster", + "Properties": { + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowscluster49B54894": { + "Type": "AWS::ECS::ClusterCapacityProviderAssociations", + "Properties": { + "CapacityProviders": [ + { + "Ref": "ECSWindowsCapacityProvider8F8896A5" + } + ], + "Cluster": { + "Ref": "ECSWindowscluster14061F74" + }, + "DefaultCapacityProviderStrategy": [] + } + }, + "ECSWindowsLaunchTemplateRole610E9A88": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSWindowscluster14061F74", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ECSWindowscluster14061F74", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:DiscoverPollEndpoint", + "ecr:GetAuthorizationToken", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459", + "Roles": [ + { + "Ref": "ECSWindowsLaunchTemplateRole610E9A88" + } + ] + } + }, + "ECSWindowsLaunchTemplateProfile4B6AA05B": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ECSWindowsLaunchTemplateRole610E9A88" + } + ] + } + }, + "ECSWindowsLaunchTemplateA6BF5C73": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ECSWindowsLaunchTemplateProfile4B6AA05B", + "Arn" + ] + } + }, + "ImageId": "resolve:ssm:/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized/image_id", + "InstanceType": "m6i.large", + "MetadataOptions": { + "HttpTokens": "required" + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ECSWindowssecuritygroupB4EE54DA", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Windows/Launch Template" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Windows/Launch Template" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "(Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin ", + { + "Ref": "AWS::AccountId" + }, + ".dkr.ecr.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com\nStart-Job -ScriptBlock { docker pull ", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest }\n[Environment]::SetEnvironmentVariable(\"ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION\", \"5s\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION_JITTER\", \"5s\", \"Machine\")\nRemove-Item -Recurse C:\\ProgramData\\Amazon\\ECS\\Cache\nImport-Module ECSTools\n[Environment]::SetEnvironmentVariable(\"ECS_CLUSTER\", \"", + { + "Ref": "ECSWindowscluster14061F74" + }, + "\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE\", \"true\", \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_AVAILABLE_LOGGING_DRIVERS\", '[\"json-file\",\"awslogs\"]', \"Machine\")\n[Environment]::SetEnvironmentVariable(\"ECS_ENABLE_TASK_IAM_ROLE\", \"true\", \"Machine\")\nInitialize-ECSAgent -Cluster '", + { + "Ref": "ECSWindowscluster14061F74" + }, + "' -EnableTaskIAMRole" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + }, + { + "Key": "Name", + "Value": "github-runners-test/ECS Windows/Launch Template" + } + ] + } + ] + }, + "DependsOn": [ + "ECSWindowsLaunchTemplateRoleDefaultPolicy48457459", + "ECSWindowsLaunchTemplateRole610E9A88" + ] + }, + "ECSWindowsAutoScalingGroupASG864E3AAF": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ECSWindowsLaunchTemplateA6BF5C73" + }, + "Version": { + "Fn::GetAtt": [ + "ECSWindowsLaunchTemplateA6BF5C73", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "NewInstancesProtectedFromScaleIn": true, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "PropagateAtLaunch": true, + "Value": "github-runners-test/ECS Windows" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ECSWindowsCapacityProvider8F8896A5": { + "Type": "AWS::ECS::CapacityProvider", + "Properties": { + "AutoScalingGroupProvider": { + "AutoScalingGroupArn": { + "Ref": "ECSWindowsAutoScalingGroupASG864E3AAF" + }, + "ManagedScaling": { + "Status": "ENABLED", + "TargetCapacity": 100 + }, + "ManagedTerminationProtection": "ENABLED" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowslogs83D9D352": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ECSWindowslogslogsfilterA25F0C55": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "ECSWindowslogs83D9D352" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "ECSWindowstaskTaskRole17C8DA48": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowstaskTaskRoleDefaultPolicy529AC984": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSWindowstaskTaskRoleDefaultPolicy529AC984", + "Roles": [ + { + "Ref": "ECSWindowstaskTaskRole17C8DA48" + } + ] + } + }, + "ECSWindowstask73A31B6C": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "powershell", + "-Command", + "cd \\actions ;\n if ($Env:RUNNER_VERSION -eq \"latest\") { $RunnerFlags = \"\" } else { $RunnerFlags = \"--disableupdate\" } ;\n ./config.cmd --unattended --url \"${Env:REGISTRATION_URL}\" --token \"${Env:RUNNER_TOKEN}\" --ephemeral --work _work --labels \"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat +%s)\" $RunnerFlags --name \"${Env:RUNNER_NAME}\" ${Env:RUNNER_GROUP} ${Env:DEFAULT_LABELS} ;\n ./run.cmd ;\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1 ;\n if ($STATUS) { echo \"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\" }" + ], + "Cpu": 1024, + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ECSWindowslogs83D9D352" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Memory": 3500, + "Name": "runner", + "Privileged": false + } + ], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ECSWindowstaskExecutionRoleF164B5BF", + "Arn" + ] + }, + "Family": "githubrunnerstestECSWindowstask6B1D5861", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EC2" + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ECSWindowstaskTaskRole17C8DA48", + "Arn" + ] + } + } + }, + "ECSWindowstaskExecutionRoleF164B5BF": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/ECS Windows" + } + ] + } + }, + "ECSWindowstaskExecutionRoleDefaultPolicyA46C9687": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ECSWindowslogs83D9D352", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ECSWindowstaskExecutionRoleDefaultPolicyA46C9687", + "Roles": [ + { + "Ref": "ECSWindowstaskExecutionRoleF164B5BF" + } + ] + } + }, + "LambdaImageDigestReaderE0842577": { + "Type": "Custom::EcrImageDigest", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "Arn" + ] + }, + "Create": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Update": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Delete": { + "Fn::Join": [ + "", + [ + "{\"service\":\"fake\",\"action\":\"fake\",\"parameters\":{\"version\":1,\"labels\":[\"lambda\",\"x64\"],\"architecture\":\"x86_64\",\"dependable\":\"", + { + "Ref": "LambdaImageBuilderx64BuildWaitb635ff63a25255D2B8" + }, + "\"}}" + ] + ] + }, + "InstallLatestAwsSdk": false + }, + "DependsOn": [ + "LambdaImageDigestReaderCustomResourcePolicyE8E146E6" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "LambdaImageDigestReaderCustomResourcePolicyE8E146E6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + }, + { + "Action": "fake:Fake", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaImageDigestReaderCustomResourcePolicyE8E146E6", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "LambdaLog2764B04F": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Lambda" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaLogLogfilter1003281A": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "LambdaLog2764B04F" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "LambdaFunctionServiceRoleB1826A50": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Lambda" + } + ] + } + }, + "LambdaFunction9233991D": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Architectures": [ + "x86_64" + ], + "Code": { + "ImageUri": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + }, + "@sha256:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageDigestReaderE0842577", + "imageDetails.0.imageDigest" + ] + } + ] + } + ] + } + ] + ] + } + }, + "Description": "GitHub Actions runner for labels lambda,x64", + "EphemeralStorage": { + "Size": 10240 + }, + "LoggingConfig": { + "LogGroup": { + "Ref": "LambdaLog2764B04F" + } + }, + "MemorySize": 2048, + "PackageType": "Image", + "Role": { + "Fn::GetAtt": [ + "LambdaFunctionServiceRoleB1826A50", + "Arn" + ] + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Lambda" + } + ], + "Timeout": 900 + }, + "DependsOn": [ + "LambdaFunctionServiceRoleB1826A50" + ] + }, + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "bc8ef58951f4c88e641dd23090e9d2e2e61c7530a07960e767522941e959b625.zip" + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 120 + }, + "DependsOn": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + ] + }, + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:UpdateFunctionCode", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + } + }, + { + "Action": "lambda:UpdateFunctionCode", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6", + "Roles": [ + { + "Ref": "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA" + } + ] + } + }, + "updatelambdadcc036c8876b451ea2c1552f9e06e9e180810ABA": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "aa9b0a3f0625b484074bb9cb369382960e95d5721493cc6f1c6dc46797cd3aea.zip" + }, + "Description": "Function that updates a GitHub Actions runner function with the latest image digest after the image has been rebuilt", + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 900 + }, + "DependsOn": [ + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleDefaultPolicy1EF644A6", + "updatelambdadcc036c8876b451ea2c1552f9e06e9e1ServiceRoleE163ADCA" + ] + }, + "LambdaARMImageDigestReaderF3DD55C4": { + "Type": "Custom::EcrImageDigest", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "Arn" + ] + }, + "Create": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Update": { + "Fn::Join": [ + "", + [ + "{\"service\":\"ECR\",\"action\":\"describeImages\",\"parameters\":{\"repositoryName\":\"", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "\",\"imageIds\":[{\"imageTag\":\"latest\"}]},\"physicalResourceId\":{\"id\":\"ImageDigest\"}}" + ] + ] + }, + "Delete": { + "Fn::Join": [ + "", + [ + "{\"service\":\"fake\",\"action\":\"fake\",\"parameters\":{\"version\":1,\"labels\":[\"lambda\",\"arm64\"],\"architecture\":\"arm64\",\"dependable\":\"", + { + "Ref": "LambdaImageBuilderzBuildWaita0b4803327B88D22EC" + }, + "\"}}" + ] + ] + }, + "InstallLatestAwsSdk": false + }, + "DependsOn": [ + "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + }, + { + "Action": "fake:Fake", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaARMImageDigestReaderCustomResourcePolicy2980B36A", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "LambdaARMLogAA2DA09F": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/LambdaARM" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaARMLogLogfilterE0BE5E30": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "LambdaARMLogAA2DA09F" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "LambdaARMFunctionServiceRole136069A0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/LambdaARM" + } + ] + } + }, + "LambdaARMFunctionDD4B5FF7": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Architectures": [ + "arm64" + ], + "Code": { + "ImageUri": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + }, + "@sha256:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaARMImageDigestReaderF3DD55C4", + "imageDetails.0.imageDigest" + ] + } + ] + } + ] + } + ] + ] + } + }, + "Description": "GitHub Actions runner for labels lambda,arm64", + "EphemeralStorage": { + "Size": 10240 + }, + "LoggingConfig": { + "LogGroup": { + "Ref": "LambdaARMLogAA2DA09F" + } + }, + "MemorySize": 2048, + "PackageType": "Image", + "Role": { + "Fn::GetAtt": [ + "LambdaARMFunctionServiceRole136069A0", + "Arn" + ] + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/LambdaARM" + } + ], + "Timeout": 900 + }, + "DependsOn": [ + "LambdaARMFunctionServiceRole136069A0" + ] + }, + "FargatesecuritygroupAFCAFD34": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "FargatelogsCB753638": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatelogslogsfilter89D6A772": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "FargatelogsCB753638" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "FargatetaskTaskRoleEFFCDAF8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ] + } + }, + "FargatetaskTaskRoleDefaultPolicy4E176780": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatetaskTaskRoleDefaultPolicy4E176780", + "Roles": [ + { + "Ref": "FargatetaskTaskRoleEFFCDAF8" + } + ] + } + }, + "FargatetaskFDFF3302": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "FargatelogsCB753638" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "FargatetaskExecutionRole88A42307", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatetaskA755E0CE", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "FargatetaskTaskRoleEFFCDAF8", + "Arn" + ] + } + } + }, + "FargatetaskExecutionRole88A42307": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate" + } + ] + } + }, + "FargatetaskExecutionRoleDefaultPolicy72A5073A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatelogsCB753638", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargatetaskExecutionRoleDefaultPolicy72A5073A", + "Roles": [ + { + "Ref": "FargatetaskExecutionRole88A42307" + } + ] + } + }, + "Fargatex64spotsecuritygroup2A9F4299": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-x64-spot/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "Fargatex64spotlogs0BCF618B": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatex64spotlogslogsfilter6590358B": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "Fargatex64spotlogs0BCF618B" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "Fargatex64spottaskTaskRole02893C25": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ] + } + }, + "Fargatex64spottaskTaskRoleDefaultPolicyDBB9916E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatex64spottaskTaskRoleDefaultPolicyDBB9916E", + "Roles": [ + { + "Ref": "Fargatex64spottaskTaskRole02893C25" + } + ] + } + }, + "Fargatex64spottask4C8B023D": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "Fargatex64spotlogs0BCF618B" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "Fargatex64spottaskExecutionRoleD0E0B7D6", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatex64spottask7B2E300E", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Fargatex64spottaskTaskRole02893C25", + "Arn" + ] + } + } + }, + "Fargatex64spottaskExecutionRoleD0E0B7D6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-x64-spot" + } + ] + } + }, + "Fargatex64spottaskExecutionRoleDefaultPolicyA51A696A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Fargatex64spotlogs0BCF618B", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatex64spottaskExecutionRoleDefaultPolicyA51A696A", + "Roles": [ + { + "Ref": "Fargatex64spottaskExecutionRoleD0E0B7D6" + } + ] + } + }, + "Fargatearm64securitygroup08ABAD9E": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-arm64/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "Fargatearm64logs00171A52": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatearm64logslogsfilter4A2869DC": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "Fargatearm64logs00171A52" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "Fargatearm64taskTaskRoleD3C2CD58": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ] + } + }, + "Fargatearm64taskTaskRoleDefaultPolicy0D37729A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64taskTaskRoleDefaultPolicy0D37729A", + "Roles": [ + { + "Ref": "Fargatearm64taskTaskRoleD3C2CD58" + } + ] + } + }, + "Fargatearm64taskECD67399": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "Fargatearm64logs00171A52" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64taskExecutionRoleD10B61DC", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatearm64task6B95C05B", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "ARM64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64taskTaskRoleD3C2CD58", + "Arn" + ] + } + } + }, + "Fargatearm64taskExecutionRoleD10B61DC": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64" + } + ] + } + }, + "Fargatearm64taskExecutionRoleDefaultPolicy0E3D42DB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Fargatearm64logs00171A52", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64taskExecutionRoleDefaultPolicy0E3D42DB", + "Roles": [ + { + "Ref": "Fargatearm64taskExecutionRoleD10B61DC" + } + ] + } + }, + "Fargatearm64spotsecuritygroup20C885E4": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-arm64-spot/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "Fargatearm64spotlogsEFCCEC59": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Fargatearm64spotlogslogsfilter7E2CFF7B": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "Fargatearm64spotlogsEFCCEC59" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "Fargatearm64spottaskTaskRole0F078C81": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ] + } + }, + "Fargatearm64spottaskTaskRoleDefaultPolicyB8772E50": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64spottaskTaskRoleDefaultPolicyB8772E50", + "Roles": [ + { + "Ref": "Fargatearm64spottaskTaskRole0F078C81" + } + ] + } + }, + "Fargatearm64spottaskD21E60F2": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "sh", + "-c", + "\n cd /home/runner &&\n if [ \"$RUNNER_VERSION\" = \"latest\" ]; then RUNNER_FLAGS=\"\"; else RUNNER_FLAGS=\"--disableupdate\"; fi &&\n ./config.sh --unattended --url \"$REGISTRATION_URL\" --token \"$RUNNER_TOKEN\" --ephemeral --work _work --labels \"$RUNNER_LABEL,cdkghr:started:`date +%s`\" $RUNNER_FLAGS --name \"$RUNNER_NAME\" $RUNNER_GROUP $DEFAULT_LABELS &&\n ./run.sh &&\n STATUS=$(grep -Phors \"finish job request for job [0-9a-f\\-]+ with result: \\K.*\" _diag/ | tail -n1) &&\n [ -n \"$STATUS\" ] && echo CDKGHA JOB DONE \"$RUNNER_LABEL\" \"$STATUS\"" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "Fargatearm64spotlogsEFCCEC59" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner", + "User": "runner" + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 25 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64spottaskExecutionRole90E5A05B", + "Arn" + ] + }, + "Family": "githubrunnerstestFargatearm64spottaskF9ADF192", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "ARM64", + "OperatingSystemFamily": "LINUX" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "Fargatearm64spottaskTaskRole0F078C81", + "Arn" + ] + } + } + }, + "Fargatearm64spottaskExecutionRole90E5A05B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-arm64-spot" + } + ] + } + }, + "Fargatearm64spottaskExecutionRoleDefaultPolicyB9BB282A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "Fargatearm64spotlogsEFCCEC59", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "Fargatearm64spottaskExecutionRoleDefaultPolicyB9BB282A", + "Roles": [ + { + "Ref": "Fargatearm64spottaskExecutionRole90E5A05B" + } + ] + } + }, + "FargateWindowssecuritygroupE684A7B0": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/Fargate-Windows/security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "FargateWindowslogs52881DBF": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "FargateWindowslogslogsfilterB5B72E7C": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "FargateWindowslogs52881DBF" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "FargateWindowstaskTaskRole364508C8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ] + } + }, + "FargateWindowstaskTaskRoleDefaultPolicy17F0249C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargateWindowstaskTaskRoleDefaultPolicy17F0249C", + "Roles": [ + { + "Ref": "FargateWindowstaskTaskRole364508C8" + } + ] + } + }, + "FargateWindowstask9F9B942D": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "powershell", + "-Command", + "cd \\actions ;\n if ($Env:RUNNER_VERSION -eq \"latest\") { $RunnerFlags = \"\" } else { $RunnerFlags = \"--disableupdate\" } ;\n ./config.cmd --unattended --url \"${Env:REGISTRATION_URL}\" --token \"${Env:RUNNER_TOKEN}\" --ephemeral --work _work --labels \"${Env:RUNNER_LABEL},cdkghr:started:$(Get-Date -UFormat +%s)\" $RunnerFlags --name \"${Env:RUNNER_NAME}\" ${Env:RUNNER_GROUP} ${Env:DEFAULT_LABELS} ;\n ./run.cmd ;\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\-]+ with result: (.*)' | %{$_.Matches.Groups[1].Value} | Select-Object -Last 1 ;\n if ($STATUS) { echo \"CDKGHA JOB DONE ${Env:RUNNER_LABEL} $STATUS\" }" + ], + "Essential": true, + "Image": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + }, + ":latest" + ] + ] + }, + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "FargateWindowslogs52881DBF" + }, + "awslogs-stream-prefix": "runner", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "runner" + } + ], + "Cpu": "1024", + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "FargateWindowstaskExecutionRoleEE562927", + "Arn" + ] + }, + "Family": "githubrunnerstestFargateWindowstask95BB2245", + "Memory": "2048", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "WINDOWS_SERVER_2019_CORE" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "FargateWindowstaskTaskRole364508C8", + "Arn" + ] + } + } + }, + "FargateWindowstaskExecutionRoleEE562927": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/Fargate-Windows" + } + ] + } + }, + "FargateWindowstaskExecutionRoleDefaultPolicy2EF7D3FD": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargateWindowslogs52881DBF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "FargateWindowstaskExecutionRoleDefaultPolicy2EF7D3FD", + "Roles": [ + { + "Ref": "FargateWindowstaskExecutionRoleEE562927" + } + ] + } + }, + "EC2LinuxSGF5B89300": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Linux/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2LinuxRole8B6519A2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux" + } + ] + } + }, + "EC2LinuxRoleDefaultPolicy1369791B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2LinuxLogsC4CD8F14", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2LinuxRoleDefaultPolicy1369791B", + "Roles": [ + { + "Ref": "EC2LinuxRole8B6519A2" + } + ] + } + }, + "EC2LinuxLogsC4CD8F14": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2LinuxLogsLogsfilter186C2AB7": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2LinuxInstanceProfile2D2BB473": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2LinuxRole8B6519A2" + } + ] + } + }, + "EC2LinuxAMIRootDevice26D5E56E": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + } + }, + "DependsOn": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "AMILinuxBuilderAMIImage8609B129", + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderAMIPipeline77F9C0F7", + "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", + "AMILinuxBuilderAmiRecipeB7CF9599", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", + "AMILinuxBuilderImageCleanerF1745EF6", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561", + "AMILinuxBuilderLaunchtemplateA29452C4", + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "AMILinuxBuilderLifecyclePolicyAMI9EC6A562", + "AMILinuxBuilderRoleDefaultPolicy69ED051F", + "AMILinuxBuilderRole0C42378A", + "AMILinuxBuilderSGEDC86329" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "deleteamidcc036c8876b451ea2c1552f9e06e9e1ServiceRole1CC58A6F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Description": "Empty role to prevent deletion of AMIs on cdk-github-runners upgrade", + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DeregisterImage", + "ec2:DeleteSnapshot" + ], + "Effect": "Deny", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "deny" + } + ] + } + }, + "EC2SpotLinuxSG8D846B64": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Spot Linux/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Spot Linux" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2SpotLinuxRole86333E5D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Spot Linux" + } + ] + } + }, + "EC2SpotLinuxRoleDefaultPolicy061AD1D0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2SpotLinuxLogsF78D5F0E", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2SpotLinuxRoleDefaultPolicy061AD1D0", + "Roles": [ + { + "Ref": "EC2SpotLinuxRole86333E5D" + } + ] + } + }, + "EC2SpotLinuxLogsF78D5F0E": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Spot Linux" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2SpotLinuxLogsLogsfilter89CE719F": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2SpotLinuxInstanceProfileB12320D4": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2SpotLinuxRole86333E5D" + } + ] + } + }, + "EC2SpotLinuxAMIRootDeviceC8A06843": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + } + }, + "DependsOn": [ + "AMILinuxBuilderAMIDistribution215F3A5C", + "AMILinuxBuilderAMIImage8609B129", + "AMILinuxBuilderAmiLog0DB16E38", + "AMILinuxBuilderAMIPipeline77F9C0F7", + "AMILinuxBuilderAmiRecipeAMIRootDevice7FF39374", + "AMILinuxBuilderAmiRecipeB7CF9599", + "AMILinuxBuilderComponent0RequiredPackagesComponent74077CC6", + "AMILinuxBuilderComponent1CloudWatchAgentComponentE997701A", + "AMILinuxBuilderComponent2RunnerUserComponentCDE71073", + "AMILinuxBuilderComponent3GitComponent9011E3AB", + "AMILinuxBuilderComponent4GithubCliComponent602EE471", + "AMILinuxBuilderComponent5AwsCliComponent72637C19", + "AMILinuxBuilderComponent6DockerComponent9E523A42", + "AMILinuxBuilderComponent7GithubRunnerComponentD0CD7066", + "AMILinuxBuilderComponent8CustomUndefinedComponent746EA99F", + "AMILinuxBuilderComponent9EnvironmentVariablesComponent31538DDD", + "AMILinuxBuilderImageCleanerF1745EF6", + "AMILinuxBuilderInfrastructureInstanceProfileB423D304", + "AMILinuxBuilderInfrastructure069F0561", + "AMILinuxBuilderLaunchtemplateA29452C4", + "AMILinuxBuilderLifecyclePolicyAMIRole7BBFF711", + "AMILinuxBuilderLifecyclePolicyAMI9EC6A562", + "AMILinuxBuilderRoleDefaultPolicy69ED051F", + "AMILinuxBuilderRole0C42378A", + "AMILinuxBuilderSGEDC86329" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2Linuxarm64SG550ECD6C": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Linux arm64/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux arm64" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2Linuxarm64Role242F68FF": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux arm64" + } + ] + } + }, + "EC2Linuxarm64RoleDefaultPolicyDE9193C3": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2Linuxarm64Logs577E371E", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2Linuxarm64RoleDefaultPolicyDE9193C3", + "Roles": [ + { + "Ref": "EC2Linuxarm64Role242F68FF" + } + ] + } + }, + "EC2Linuxarm64Logs577E371E": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Linux arm64" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2Linuxarm64LogsLogsfilter0A247938": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2Linuxarm64InstanceProfile1E6F8D53": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2Linuxarm64Role242F68FF" + } + ] + } + }, + "EC2Linuxarm64AMIRootDevice3046D37D": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + } + }, + "DependsOn": [ + "AMILinuxarm64BuilderAMIDistributionE6989D01", + "AMILinuxarm64BuilderAMIImageC529A482", + "AMILinuxarm64BuilderAmiLog84A9D94A", + "AMILinuxarm64BuilderAMIPipeline462B4E1B", + "AMILinuxarm64BuilderAmiRecipe4287E320", + "AMILinuxarm64BuilderComponent0RequiredPackagesComponentBADF7D60", + "AMILinuxarm64BuilderComponent1CloudWatchAgentComponentC4EC4BFB", + "AMILinuxarm64BuilderComponent2RunnerUserComponent50218DEA", + "AMILinuxarm64BuilderComponent3GitComponent4F72CDB4", + "AMILinuxarm64BuilderComponent4GithubCliComponent8F555A41", + "AMILinuxarm64BuilderComponent5AwsCliComponentA8EC9E97", + "AMILinuxarm64BuilderComponent6DockerComponentE31D0222", + "AMILinuxarm64BuilderComponent7GithubRunnerComponentAFBEE3CB", + "AMILinuxarm64BuilderComponent8CustomUndefinedComponent08FD8437", + "AMILinuxarm64BuilderComponent9EnvironmentVariablesComponent589AD395", + "AMILinuxarm64BuilderImageCleanerA5DDFE7A", + "AMILinuxarm64BuilderInfrastructureInstanceProfile7C4D69A7", + "AMILinuxarm64BuilderInfrastructureA97EB3DD", + "AMILinuxarm64BuilderLaunchtemplate8F5EFF44", + "AMILinuxarm64BuilderLifecyclePolicyAMIRole1D81BF43", + "AMILinuxarm64BuilderLifecyclePolicyAMI1941512F", + "AMILinuxarm64BuilderRoleDefaultPolicy113305EE", + "AMILinuxarm64BuilderRole40D54E29", + "AMILinuxarm64BuilderSG94315968" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2WindowsSG13E24976": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "github-runners-test/EC2 Windows/SG", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Windows" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EC2WindowsRoleC0D850D2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Windows" + } + ] + } + }, + "EC2WindowsRoleDefaultPolicyB6A15409": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "states:SendTaskFailure", + "states:SendTaskSuccess", + "states:SendTaskHeartbeat" + ], + "Condition": { + "StringEquals": { + "aws:ResourceTag/aws:cloudformation:stack-id": { + "Ref": "AWS::StackId" + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ssmmessages:CreateControlChannel", + "ssmmessages:CreateDataChannel", + "ssmmessages:OpenControlChannel", + "ssmmessages:OpenDataChannel", + "s3:GetEncryptionConfiguration", + "ssm:UpdateInstanceInformation" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2WindowsLogsDC1F2ABF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "EC2WindowsRoleDefaultPolicyB6A15409", + "Roles": [ + { + "Ref": "EC2WindowsRoleC0D850D2" + } + ] + } + }, + "EC2WindowsLogsDC1F2ABF": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30, + "Tags": [ + { + "Key": "GitHubRunners:Provider", + "Value": "github-runners-test/EC2 Windows" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "EC2WindowsLogsLogsfilter253E4D4D": { + "Type": "AWS::Logs::MetricFilter", + "Properties": { + "FilterPattern": "[..., marker = \"CDKGHA\", job = \"JOB\", done = \"DONE\", labels, status = \"Succeeded\" || status = \"SucceededWithIssues\" || status = \"Failed\" || status = \"Canceled\" || status = \"Skipped\" || status = \"Abandoned\"]", + "LogGroupName": { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "MetricTransformations": [ + { + "Dimensions": [ + { + "Key": "ProviderLabels", + "Value": "$labels" + }, + { + "Key": "Status", + "Value": "$status" + } + ], + "MetricName": "JobCompleted", + "MetricNamespace": "GitHubRunners", + "MetricValue": "1", + "Unit": "Count" + } + ] + } + }, + "EC2WindowsInstanceProfileDCA59D9C": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2WindowsRoleC0D850D2" + } + ] + } + }, + "EC2WindowsAMIRootDevice9FFC971A": { + "Type": "Custom::AmiRootDevice", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AMIRootDeviceReaderdcc036c8876b451ea2c1552f9e06e9e1C64D247C", + "Arn" + ] + }, + "Ami": { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + } + }, + "DependsOn": [ + "WindowsEC2BuilderAMIDistribution6B33DD89", + "WindowsEC2BuilderAMIImageD1C73439", + "WindowsEC2BuilderAmiLog126E54B2", + "WindowsEC2BuilderAMIPipeline445918BA", + "WindowsEC2BuilderAmiRecipe9D687A09", + "WindowsEC2BuilderComponent0RequiredPackagesComponentC058987B", + "WindowsEC2BuilderComponent1CloudWatchAgentComponent7BB918AA", + "WindowsEC2BuilderComponent2RunnerUserComponentDF4429CD", + "WindowsEC2BuilderComponent3GitComponent4F86AE54", + "WindowsEC2BuilderComponent4GithubCliComponent0B2AA45F", + "WindowsEC2BuilderComponent5AwsCliComponent4CFA39A7", + "WindowsEC2BuilderComponent6DockerComponent3B0B9BA0", + "WindowsEC2BuilderComponent7GithubRunnerComponentB34D30BC", + "WindowsEC2BuilderComponent8CustomUndefinedComponent4833E552", + "WindowsEC2BuilderComponent9EnvironmentVariablesComponentB3C3A7C0", + "WindowsEC2BuilderImageCleanerEF537850", + "WindowsEC2BuilderInfrastructureInstanceProfile8A9DECBA", + "WindowsEC2BuilderInfrastructure4289B6D2", + "WindowsEC2BuilderLaunchtemplate0A66E9C2", + "WindowsEC2BuilderLifecyclePolicyAMIRoleE85A7F2C", + "WindowsEC2BuilderLifecyclePolicyAMI73E24E7A", + "WindowsEC2BuilderRoleDefaultPolicy8A5B4E85", + "WindowsEC2BuilderRole1BA7D3E7", + "WindowsEC2BuilderSGE3F67842" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsWebhook7AF0D74E": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludePunctuation": true, + "GenerateStringKey": "webhookSecret", + "IncludeSpace": false, + "SecretStringTemplate": "{}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsGitHubEFD96479": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludePunctuation": true, + "GenerateStringKey": "dummy", + "IncludeSpace": false, + "SecretStringTemplate": "{\"domain\":\"github.com\",\"appId\":\"\",\"personalAuthToken\":\"\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsGitHubPrivateKey79498F91": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "SecretString": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersSecretsSetup692A93B1": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludePunctuation": true, + "GenerateStringKey": "token", + "IncludeSpace": false, + "SecretStringTemplate": "{\"token\":\"\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnerstokenretrieverServiceRole6099F71C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnerstokenretrieverServiceRoleDefaultPolicy24965D29": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnerstokenretrieverServiceRoleDefaultPolicy24965D29", + "Roles": [ + { + "Ref": "runnerstokenretrieverServiceRole6099F71C" + } + ] + } + }, + "runnerstokenretrieverD5E8392A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "2ff4713074c133dfff9146c0b79d668687e846e2a43ec12c9f097fa39e6a91b2.zip" + }, + "Description": "Get token from GitHub Actions used to start new self-hosted runner", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnerstokenretrieverServiceRole6099F71C", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 30 + }, + "DependsOn": [ + "runnerstokenretrieverServiceRoleDefaultPolicy24965D29", + "runnerstokenretrieverServiceRole6099F71C" + ] + }, + "runnersdeleterunnerServiceRole35856967": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7", + "Roles": [ + { + "Ref": "runnersdeleterunnerServiceRole35856967" + } + ] + } + }, + "runnersdeleterunner7F8D5293": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "27c23e97f087082e485f85bfae31f09925e083d4bff1868616a56a1e2cc0e5cb.zip" + }, + "Description": "Delete failed GitHub Actions runner on error", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersdeleterunnerServiceRole35856967", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 30 + }, + "DependsOn": [ + "runnersdeleterunnerServiceRoleDefaultPolicyECFB6BF7", + "runnersdeleterunnerServiceRole35856967" + ] + }, + "runnersIdleReaperServiceRoleA775758D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:ReceiveMessage", + "sqs:ChangeMessageVisibility", + "sqs:GetQueueUrl", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "runnersIdleReaperQueue117EFB9F", + "Arn" + ] + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": [ + "states:ListExecutions", + "states:ListStateMachines" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + }, + { + "Action": [ + "states:DescribeExecution", + "states:DescribeStateMachineForExecution", + "states:GetExecutionHistory" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":states:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": [ + "states:ListActivities", + "states:DescribeStateMachine", + "states:DescribeActivity" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "states:StopExecution", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":states:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + ] + } + ] + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0", + "Roles": [ + { + "Ref": "runnersIdleReaperServiceRoleA775758D" + } + ] + } + }, + "runnersIdleReaper6FBF63A3": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "27183e380a4a6bde72c00c642ca4ee7a6f44a8032b60f5e37b4c5eadcb89d364.zip" + }, + "Description": "Stop idle GitHub runners to avoid paying for runners when the job was already canceled", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersIdleReaperServiceRoleA775758D", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 300 + }, + "DependsOn": [ + "runnersIdleReaperServiceRoleDefaultPolicyE05BFDF0", + "runnersIdleReaperServiceRoleA775758D" + ] + }, + "runnersIdleReaperSqsEventSourcegithubrunnerstestrunnersIdleReaperQueue5E84F4E4B0DB6768": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": { + "Fn::GetAtt": [ + "runnersIdleReaperQueue117EFB9F", + "Arn" + ] + }, + "FunctionName": { + "Ref": "runnersIdleReaper6FBF63A3" + }, + "FunctionResponseTypes": [ + "ReportBatchItemFailures" + ], + "MaximumBatchingWindowInSeconds": 60 + } + }, + "runnersIdleReaperQueue117EFB9F": { + "Type": "AWS::SQS::Queue", + "Properties": { + "DelaySeconds": 600, + "VisibilityTimeout": 600 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersRunnerOrchestratorRole5D220AD7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sqs:SendMessage", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "runnersIdleReaperQueue117EFB9F", + "Arn" + ] + } + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "runnersdeleterunner7F8D5293", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "runnersdeleterunner7F8D5293", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "runnerstokenretrieverD5E8392A", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "runnerstokenretrieverD5E8392A", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildx64CodeBuild7DC01A1E", + "Arn" + ] + } + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":events:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":rule/StepFunctionsGetEventForCodeBuildStartBuildRule" + ] + ] + } + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64CodeBuild261399A8", + "Arn" + ] + } + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildARMCodeBuildC5F301F2", + "Arn" + ] + } + }, + { + "Action": [ + "codebuild:StartBuild", + "codebuild:StopBuild", + "codebuild:BatchGetBuilds", + "codebuild:BatchGetReports" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildWindowsCodeBuildC39F35C1", + "Arn" + ] + } + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECStask8F0DD550" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": [ + "ecs:StopTask", + "ecs:DescribeTasks" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECStaskTaskRoleFE831ECD", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECStaskExecutionRole1A6D19A5", + "Arn" + ] + } + ] + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":events:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":rule/StepFunctionsGetEventsForECSTaskRule" + ] + ] + } + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSUbuntu2404taskFC90B155" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECSUbuntu2404taskTaskRoleDF683F3B", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECSUbuntu2404taskExecutionRoleC5FEA726", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSARM64task27EB8443" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECSARM64taskTaskRole23B1CB4E", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECSARM64taskExecutionRoleBF2AE76F", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "ECSWindowstask73A31B6C" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ECSWindowstaskTaskRole17C8DA48", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "ECSWindowstaskExecutionRoleF164B5BF", + "Arn" + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargatetaskFDFF3302" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "FargatetaskTaskRoleEFFCDAF8", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "FargatetaskExecutionRole88A42307", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatex64spottask4C8B023D" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Fargatex64spottaskTaskRole02893C25", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "Fargatex64spottaskExecutionRoleD0E0B7D6", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64taskECD67399" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Fargatearm64taskTaskRoleD3C2CD58", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "Fargatearm64taskExecutionRoleD10B61DC", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "Fargatearm64spottaskD21E60F2" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Fargatearm64spottaskTaskRole0F078C81", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "Fargatearm64spottaskExecutionRole90E5A05B", + "Arn" + ] + } + ] + }, + { + "Action": "ecs:RunTask", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + }, + ":", + { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Ref": "FargateWindowstask9F9B942D" + } + ] + } + ] + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:PassRole", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "FargateWindowstaskTaskRole364508C8", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "FargateWindowstaskExecutionRoleEE562927", + "Arn" + ] + } + ] + }, + { + "Action": "ec2:runInstances", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2LinuxRole8B6519A2", + "Arn" + ] + } + }, + { + "Action": "ec2:createTags", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + }, + { + "Action": "iam:CreateServiceLinkedRole", + "Condition": { + "StringEquals": { + "iam:AWSServiceName": "spot.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2SpotLinuxRole86333E5D", + "Arn" + ] + } + }, + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2Linuxarm64Role242F68FF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61", + "Roles": [ + { + "Ref": "runnersRunnerOrchestratorRole5D220AD7" + } + ] + } + }, + "runnersRunnerOrchestratorRoleOverflowPolicy11A794735": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "Description": "Part of the policies for github-runners-test/runners/Runner Orchestrator/Role", + "Path": "/", + "PolicyDocument": { + "Statement": [ + { + "Action": "iam:PassRole", + "Condition": { + "StringEquals": { + "iam:PassedToService": "ec2.amazonaws.com" + } + }, + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "EC2WindowsRoleC0D850D2", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "Roles": [ + { + "Ref": "runnersRunnerOrchestratorRole5D220AD7" + } + ] + } + }, + "runnersRunnerOrchestratorF9B66EBA": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"Queue Idle Reaper\",\"States\":{\"Queue Idle Reaper\":{\"Next\":\"Run Providers\",\"Type\":\"Task\",\"ResultPath\":null,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::sqs:sendMessage\",\"Parameters\":{\"QueueUrl\":\"", + { + "Ref": "runnersIdleReaperQueue117EFB9F" + }, + "\",\"MessageBody\":{\"executionArn.$\":\"$$.Execution.Id\",\"runnerName.$\":\"$$.Execution.Name\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"installationId.$\":\"$.installationId\",\"maxIdleSeconds\":300}}},\"Run Providers\":{\"Type\":\"Parallel\",\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":60,\"MaxAttempts\":23,\"BackoffRate\":1.3}],\"Branches\":[{\"StartAt\":\"Error Handler\",\"States\":{\"Error Handler\":{\"Type\":\"Parallel\",\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"ResultPath\":\"$.error\",\"Next\":\"Delete Failed Runner\"}],\"Branches\":[{\"StartAt\":\"Get Runner Token\",\"States\":{\"Get Runner Token\":{\"Next\":\"Choose provider\",\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"ResultPath\":\"$.runner\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "runnerstokenretrieverD5E8392A", + "Arn" + ] + }, + "\"},\"Choose provider\":{\"Type\":\"Choice\",\"Choices\":[{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildx64\"}],\"Next\":\"codebuild-x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildUbuntu2404x64\"}],\"Next\":\"codebuild-ubuntu-2404-x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildARM\"}],\"Next\":\"codebuild, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/CodeBuildWindows\"}],\"Next\":\"codebuild, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS\"}],\"Next\":\"ecs, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS Ubuntu 2404\"}],\"Next\":\"ecs-ubuntu-2404, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS ARM64\"}],\"Next\":\"ecs, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/ECS Windows\"}],\"Next\":\"ecs, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Lambda\"}],\"Next\":\"lambda, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/LambdaARM\"}],\"Next\":\"lambda, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate\"}],\"Next\":\"fargate, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-x64-spot\"}],\"Next\":\"fargate-spot, linux, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-arm64\"}],\"Next\":\"fargate, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-arm64-spot\"}],\"Next\":\"fargate-spot, linux, arm64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/Fargate-Windows\"}],\"Next\":\"fargate, windows, x64\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Linux\"}],\"Next\":\"ec2, linux, x64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Spot Linux\"}],\"Next\":\"ec2-spot, linux, x64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Linux arm64\"}],\"Next\":\"ec2, linux, arm64 data\"},{\"And\":[{\"Variable\":\"$.provider\",\"StringEquals\":\"github-runners-test/EC2 Windows\"}],\"Next\":\"ec2, windows, x64 data\"}],\"Default\":\"Unknown label\"},\"Unknown label\":{\"Type\":\"Succeed\"},\"codebuild-x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildx64CodeBuild7DC01A1E" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild-x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild-ubuntu-2404-x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildUbuntu2404x64CodeBuild261399A8" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild-ubuntu-2404-x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildARMCodeBuildC5F301F2" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"codebuild, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::codebuild:startBuild.sync\",\"Parameters\":{\"ProjectName\":\"", + { + "Ref": "CodeBuildWindowsCodeBuildC39F35C1" + }, + "\",\"EnvironmentVariablesOverride\":[{\"Name\":\"RUNNER_TOKEN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Type\":\"PLAINTEXT\",\"Value\":\"codebuild,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Type\":\"PLAINTEXT\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Type\":\"PLAINTEXT\",\"Value.$\":\"$.runner.registrationUrl\"}]}},\"ecs, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECScluster20BC0B82", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECStaskCE74CC84\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSCapacityProviderABF1B146" + }, + "\"}],\"EnableExecuteCommand\":true}},\"ecs-ubuntu-2404, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECSUbuntu2404cluster21C05FA1", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECSUbuntu2404taskB7D564C7\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs-ubuntu-2404,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSUbuntu2404CapacityProviderFAE73340" + }, + "\"}],\"EnableExecuteCommand\":true}},\"ecs, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECSARM64cluster4ECAA083", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECSARM64taskE94E43A3\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSARM64CapacityProvider8627FEF9" + }, + "\"}],\"EnableExecuteCommand\":true}},\"ecs, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "ECSWindowscluster14061F74", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestECSWindowstask6B1D5861\",\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"ecs,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"", + { + "Ref": "ECSWindowsCapacityProvider8F8896A5" + }, + "\"}],\"EnableExecuteCommand\":false}},\"lambda, x64\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "LambdaFunction9233991D", + "Arn" + ] + }, + "\",\"Payload\":{\"token.$\":\"$.runner.token\",\"runnerName.$\":\"$$.Execution.Name\",\"label\":\"lambda,x64\",\"githubDomain.$\":\"$.runner.domain\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"registrationUrl.$\":\"$.runner.registrationUrl\",\"group\":\"\",\"defaultLabels\":\"\"}}},\"lambda, arm64\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "LambdaARMFunctionDD4B5FF7", + "Arn" + ] + }, + "\",\"Payload\":{\"token.$\":\"$.runner.token\",\"runnerName.$\":\"$$.Execution.Name\",\"label\":\"lambda,arm64\",\"githubDomain.$\":\"$.runner.domain\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"registrationUrl.$\":\"$.runner.registrationUrl\",\"group\":\"\",\"defaultLabels\":\"\"}}},\"fargate, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatetaskA755E0CE\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "FargatesecuritygroupAFCAFD34", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":true}},\"fargate-spot, linux, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatex64spottask7B2E300E\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "Fargatex64spotsecuritygroup2A9F4299", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate-spot,linux,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE_SPOT\"}],\"EnableExecuteCommand\":true}},\"fargate, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatearm64task6B95C05B\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "Fargatearm64securitygroup08ABAD9E", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":true}},\"fargate-spot, linux, arm64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargatearm64spottaskF9ADF192\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "Fargatearm64spotsecuritygroup20C885E4", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate-spot,linux,arm64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE_SPOT\"}],\"EnableExecuteCommand\":true}},\"fargate, windows, x64\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::ecs:runTask.sync\",\"Parameters\":{\"Cluster\":\"", + { + "Fn::GetAtt": [ + "cluster611F8AFF", + "Arn" + ] + }, + "\",\"TaskDefinition\":\"githubrunnerstestFargateWindowstask95BB2245\",\"NetworkConfiguration\":{\"AwsvpcConfiguration\":{\"AssignPublicIp\":\"ENABLED\",\"Subnets\":[\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\"],\"SecurityGroups\":[\"", + { + "Fn::GetAtt": [ + "FargateWindowssecuritygroupE684A7B0", + "GroupId" + ] + }, + "\"]}},\"Overrides\":{\"ContainerOverrides\":[{\"Name\":\"runner\",\"Environment\":[{\"Name\":\"RUNNER_TOKEN\",\"Value.$\":\"$.runner.token\"},{\"Name\":\"RUNNER_NAME\",\"Value.$\":\"$$.Execution.Name\"},{\"Name\":\"RUNNER_LABEL\",\"Value\":\"fargate,windows,x64\"},{\"Name\":\"RUNNER_GROUP\",\"Value\":\"\"},{\"Name\":\"DEFAULT_LABELS\",\"Value\":\"\"},{\"Name\":\"GITHUB_DOMAIN\",\"Value.$\":\"$.runner.domain\"},{\"Name\":\"OWNER\",\"Value.$\":\"$.owner\"},{\"Name\":\"REPO\",\"Value.$\":\"$.repo\"},{\"Name\":\"REGISTRATION_URL\",\"Value.$\":\"$.runner.registrationUrl\"}]}]},\"PropagateTags\":\"TASK_DEFINITION\",\"CapacityProviderStrategy\":[{\"CapacityProvider\":\"FARGATE\"}],\"EnableExecuteCommand\":false}},\"ec2, linux, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\ndefaultLabels=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup $defaultLabels || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2, linux, x64 subnet1\"},\"ec2, linux, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, linux, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,x64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2LinuxInstanceProfile2D2BB473", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2LinuxSGF5B89300", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2LinuxAMIRootDevice26D5E56E" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40,\"VolumeType\":\"gp3\",\"Iops\":3000,\"Throughput\":200}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]}]}},\"ec2, linux, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,x64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2LinuxInstanceProfile2D2BB473", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2LinuxSGF5B89300", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2LinuxAMIRootDevice26D5E56E" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40,\"VolumeType\":\"gp3\",\"Iops\":3000,\"Throughput\":200}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux\"}]}]}},\"ec2-spot, linux, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\ndefaultLabels=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup $defaultLabels || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2-spot, linux, x64 subnet1\"},\"ec2-spot, linux, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2-spot, linux, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2-spot,linux,x64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxInstanceProfileB12320D4", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxSG8D846B64", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2SpotLinuxAMIRootDeviceC8A06843" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40}}],\"InstanceMarketOptions\":{\"MarketType\":\"spot\",\"SpotOptions\":{\"SpotInstanceType\":\"one-time\"}},\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]}]}},\"ec2-spot, linux, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2-spot,linux,x64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxInstanceProfileB12320D4", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2SpotLinuxSG8D846B64", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2SpotLinuxAMIRootDeviceC8A06843" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":40}}],\"InstanceMarketOptions\":{\"MarketType\":\"spot\",\"SpotOptions\":{\"SpotInstanceType\":\"one-time\"}},\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Spot Linux\"}]}]}},\"ec2, linux, arm64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"#!/bin/bash -x\\nTASK_TOKEN=\\\"{}\\\"\\nlogGroupName=\\\"{}\\\"\\nrunnerNamePath=\\\"{}\\\"\\ngithubDomainPath=\\\"{}\\\"\\nownerPath=\\\"{}\\\"\\nrepoPath=\\\"{}\\\"\\nrunnerTokenPath=\\\"{}\\\"\\nlabels=\\\"{}\\\"\\nregistrationURL=\\\"{}\\\"\\nrunnerGroup=\\\"{}\\\"\\ndefaultLabels=\\\"{}\\\"\\n\\nheartbeat () \\\\{\\n while true; do\\n aws stepfunctions send-task-heartbeat --task-token \\\"$TASK_TOKEN\\\"\\n sleep 60\\n done\\n\\\\}\\nsetup_logs () \\\\{\\n cat < /tmp/log.conf || exit 1\\n \\\\{\\n \\\"logs\\\": \\\\{\\n \\\"log_stream_name\\\": \\\"unknown\\\",\\n \\\"logs_collected\\\": \\\\{\\n \\\"files\\\": \\\\{\\n \\\"collect_list\\\": [\\n \\\\{\\n \\\"file_path\\\": \\\"/var/log/runner.log\\\",\\n \\\"log_group_name\\\": \\\"$logGroupName\\\",\\n \\\"log_stream_name\\\": \\\"$runnerNamePath\\\",\\n \\\"timezone\\\": \\\"UTC\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\nEOF\\n /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/tmp/log.conf || exit 2\\n\\\\}\\naction () \\\\{\\n # Determine the value of RUNNER_FLAGS\\n if [ \\\"$(< /home/runner/RUNNER_VERSION)\\\" = \\\"latest\\\" ]; then\\n RUNNER_FLAGS=\\\"\\\"\\n else\\n RUNNER_FLAGS=\\\"--disableupdate\\\"\\n fi\\n\\n labelsTemplate=\\\"$labels,cdkghr:started:$(date +%s)\\\"\\n\\n # Execute the configuration command for runner registration\\n sudo -Hu runner /home/runner/config.sh --unattended --url \\\"$registrationURL\\\" --token \\\"$runnerTokenPath\\\" --ephemeral --work _work --labels \\\"$labelsTemplate\\\" $RUNNER_FLAGS --name \\\"$runnerNamePath\\\" $runnerGroup $defaultLabels || exit 1\\n\\n # Execute the run command\\n sudo --preserve-env=AWS_REGION -Hu runner /home/runner/run.sh || exit 2\\n\\n # Retrieve the status\\n STATUS=$(grep -Phors \\\"finish job request for job [0-9a-f\\\\-]+ with result: K.*\\\" /home/runner/_diag/ | tail -n1)\\n\\n # Check and print the job status\\n [ -n \\\"$STATUS\\\" ] && echo CDKGHA JOB DONE \\\"$labels\\\" \\\"$STATUS\\\"\\n\\\\}\\nheartbeat &\\nif setup_logs && action | tee /var/log/runner.log 2>&1; then\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{\\\"ok\\\": true\\\\}'\\nelse\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\nfi\\nsleep 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\npoweroff\\n\"},\"Next\":\"ec2, linux, arm64 subnet1\"},\"ec2, linux, arm64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, linux, arm64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6g.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,arm64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64InstanceProfile1E6F8D53", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64SG550ECD6C", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2Linuxarm64AMIRootDevice3046D37D" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]}]}},\"ec2, linux, arm64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6g.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,linux,arm64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64InstanceProfile1E6F8D53", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2Linuxarm64SG550ECD6C", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2Linuxarm64AMIRootDevice3046D37D" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Linux arm64\"}]}]}},\"ec2, windows, x64 data\":{\"Type\":\"Pass\",\"ResultPath\":\"$.ec2\",\"Parameters\":{\"userdataTemplate\":\"\\n$TASK_TOKEN = \\\"{}\\\"\\n$logGroupName=\\\"{}\\\"\\n$runnerNamePath=\\\"{}\\\"\\n$githubDomainPath=\\\"{}\\\"\\n$ownerPath=\\\"{}\\\"\\n$repoPath=\\\"{}\\\"\\n$runnerTokenPath=\\\"{}\\\"\\n$labels=\\\"{}\\\"\\n$registrationURL=\\\"{}\\\"\\n$runnerGroup=\\\"{}\\\"\\n$defaultLabels=\\\"{}\\\"\\n\\n# EC2Launch only starts ssm agent after user data is done, so we need to start it ourselves (it is disabled by default)\\nSet-Service -StartupType Manual AmazonSSMAgent\\nStart-Service AmazonSSMAgent\\n\\nStart-Job -ScriptBlock \\\\{\\n while (1) \\\\{\\n aws stepfunctions send-task-heartbeat --task-token \\\"$using:TASK_TOKEN\\\"\\n sleep 60\\n \\\\}\\n\\\\}\\nfunction setup_logs () \\\\{\\n echo \\\"\\\\{\\n `\\\"logs`\\\": \\\\{\\n `\\\"log_stream_name`\\\": `\\\"unknown`\\\",\\n `\\\"logs_collected`\\\": \\\\{\\n `\\\"files`\\\": \\\\{\\n `\\\"collect_list`\\\": [\\n \\\\{\\n `\\\"file_path`\\\": `\\\"/actions/runner.log`\\\",\\n `\\\"log_group_name`\\\": `\\\"$logGroupName`\\\",\\n `\\\"log_stream_name`\\\": `\\\"$runnerNamePath`\\\",\\n `\\\"timezone`\\\": `\\\"UTC`\\\"\\n \\\\}\\n ]\\n \\\\}\\n \\\\}\\n \\\\}\\n \\\\}\\\" | Out-File -Encoding ASCII $Env:TEMP/log.conf\\n & \\\"C:/Program Files/Amazon/AmazonCloudWatchAgent/amazon-cloudwatch-agent-ctl.ps1\\\" -a fetch-config -m ec2 -s -c file:$Env:TEMP/log.conf\\n\\\\}\\nfunction action () \\\\{\\n cd /actions\\n $RunnerVersion = Get-Content /actions/RUNNER_VERSION -Raw\\n if ($RunnerVersion -eq \\\"latest\\\") \\\\{ $RunnerFlags = \\\"\\\" \\\\} else \\\\{ $RunnerFlags = \\\"--disableupdate\\\" \\\\}\\n ./config.cmd --unattended --url \\\"$\\\\{registrationUrl\\\\}\\\" --token \\\"$\\\\{runnerTokenPath\\\\}\\\" --ephemeral --work _work --labels \\\"$\\\\{labels\\\\},cdkghr:started:$(Get-Date -UFormat +%s)\\\" $RunnerFlags --name \\\"$\\\\{runnerNamePath\\\\}\\\" $\\\\{runnerGroup\\\\} $\\\\{defaultLabels\\\\} 2>&1 | Out-File -Encoding ASCII -Append /actions/runner.log\\n\\n if ($LASTEXITCODE -ne 0) \\\\{ return 1 \\\\}\\n ./run.cmd 2>&1 | Out-File -Encoding ASCII -Append /actions/runner.log\\n if ($LASTEXITCODE -ne 0) \\\\{ return 2 \\\\}\\n\\n $STATUS = Select-String -Path './_diag/*.log' -Pattern 'finish job request for job [0-9a-f\\\\-]+ with result: (.*)' | %\\\\{$_.Matches.Groups[1].Value\\\\} | Select-Object -Last 1\\n\\n if ($STATUS) \\\\{\\n echo \\\"CDKGHA JOB DONE $\\\\{labels\\\\} $STATUS\\\" | Out-File -Encoding ASCII -Append /actions/runner.log\\n \\\\}\\n\\n return 0\\n\\\\}\\nsetup_logs\\n$r = action\\nif ($r -eq 0) \\\\{\\n aws stepfunctions send-task-success --task-token \\\"$TASK_TOKEN\\\" --task-output '\\\\{ \\\\}'\\n\\\\} else \\\\{\\n aws stepfunctions send-task-failure --task-token \\\"$TASK_TOKEN\\\"\\n\\\\}\\nStart-Sleep -Seconds 10 # give cloudwatch agent its default 5 seconds buffer duration to upload logs\\nStop-Computer -ComputerName localhost -Force\\n\\n\"},\"Next\":\"ec2, windows, x64 subnet1\"},\"ec2, windows, x64 subnet1\":{\"End\":true,\"Catch\":[{\"ErrorEquals\":[\"Ec2.Ec2Exception\",\"States.Timeout\"],\"ResultPath\":\"$.lastSubnetError\",\"Next\":\"ec2, windows, x64 subnet2\"}],\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,windows,x64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2WindowsInstanceProfileDCA59D9C", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2WindowsSG13E24976", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2WindowsAMIRootDevice9FFC971A" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]}]}},\"ec2, windows, x64 subnet2\":{\"End\":true,\"Type\":\"Task\",\"Comment\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"HeartbeatSeconds\":600,\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::aws-sdk:ec2:runInstances.waitForTaskToken\",\"Parameters\":{\"LaunchTemplate\":{\"LaunchTemplateId\":\"", + { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "\"},\"MinCount\":1,\"MaxCount\":1,\"InstanceType\":\"m6i.large\",\"UserData.$\":\"States.Base64Encode(States.Format($.ec2.userdataTemplate, $$.Task.Token, '", + { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "', $$.Execution.Name, $.runner.domain, $.owner, $.repo, $.runner.token, 'ec2,windows,x64', $.runner.registrationUrl, '', ''))\",\"InstanceInitiatedShutdownBehavior\":\"terminate\",\"IamInstanceProfile\":{\"Arn\":\"", + { + "Fn::GetAtt": [ + "EC2WindowsInstanceProfileDCA59D9C", + "Arn" + ] + }, + "\"},\"MetadataOptions\":{\"HttpTokens\":\"required\"},\"SecurityGroupIds\":[\"", + { + "Fn::GetAtt": [ + "EC2WindowsSG13E24976", + "GroupId" + ] + }, + "\"],\"SubnetId\":\"", + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "\",\"BlockDeviceMappings\":[{\"DeviceName\":\"", + { + "Ref": "EC2WindowsAMIRootDevice9FFC971A" + }, + "\",\"Ebs\":{\"DeleteOnTermination\":true,\"VolumeSize\":30}}],\"TagSpecifications\":[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]},{\"ResourceType\":\"volume\",\"Tags\":[{\"Key\":\"GitHubRunners:Provider\",\"Value\":\"github-runners-test/EC2 Windows\"}]}]}}}}]},\"Delete Failed Runner\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2},{\"ErrorEquals\":[\"RunnerBusy\"],\"IntervalSeconds\":60,\"MaxAttempts\":60,\"BackoffRate\":1}],\"Type\":\"Task\",\"ResultPath\":\"$.delete\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "runnersdeleterunner7F8D5293", + "Arn" + ] + }, + "\",\"Parameters\":{\"runnerName.$\":\"$$.Execution.Name\",\"owner.$\":\"$.owner\",\"repo.$\":\"$.repo\",\"installationId.$\":\"$.installationId\",\"error.$\":\"$.error\"}}}}]}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "runnersRunnerOrchestratorRole5D220AD7", + "Arn" + ] + } + }, + "DependsOn": [ + "runnersRunnerOrchestratorRoleDefaultPolicyD1C26D61", + "runnersRunnerOrchestratorRoleOverflowPolicy11A794735", + "runnersRunnerOrchestratorRole5D220AD7" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsWebhook7AF0D74E" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C", + "Roles": [ + { + "Ref": "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2" + } + ] + } + }, + "runnersWebhookHandlerwebhookhandler22779A81": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "12f9637d96532b9e702983a56208fdc8a9f5b4a1b92048e909ce9ba4a1e8fa56.zip" + }, + "Description": "Handle GitHub webhook and start runner orchestrator", + "Environment": { + "Variables": { + "STEP_FUNCTION_ARN": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + }, + "WEBHOOK_SECRET_ARN": { + "Ref": "runnersSecretsWebhook7AF0D74E" + }, + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "SUPPORTED_LABELS": "[{\"provider\":\"github-runners-test/CodeBuildx64\",\"labels\":[\"codebuild-x64\"]},{\"provider\":\"github-runners-test/CodeBuildUbuntu2404x64\",\"labels\":[\"codebuild-ubuntu-2404-x64\"]},{\"provider\":\"github-runners-test/CodeBuildARM\",\"labels\":[\"codebuild\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/CodeBuildWindows\",\"labels\":[\"codebuild\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/ECS\",\"labels\":[\"ecs\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/ECS Ubuntu 2404\",\"labels\":[\"ecs-ubuntu-2404\",\"x64\"]},{\"provider\":\"github-runners-test/ECS ARM64\",\"labels\":[\"ecs\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/ECS Windows\",\"labels\":[\"ecs\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/Lambda\",\"labels\":[\"lambda\",\"x64\"]},{\"provider\":\"github-runners-test/LambdaARM\",\"labels\":[\"lambda\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate\",\"labels\":[\"fargate\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/Fargate-x64-spot\",\"labels\":[\"fargate-spot\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/Fargate-arm64\",\"labels\":[\"fargate\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate-arm64-spot\",\"labels\":[\"fargate-spot\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/Fargate-Windows\",\"labels\":[\"fargate\",\"windows\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Linux\",\"labels\":[\"ec2\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Spot Linux\",\"labels\":[\"ec2-spot\",\"linux\",\"x64\"]},{\"provider\":\"github-runners-test/EC2 Linux arm64\",\"labels\":[\"ec2\",\"linux\",\"arm64\"]},{\"provider\":\"github-runners-test/EC2 Windows\",\"labels\":[\"ec2\",\"windows\",\"x64\"]}]", + "REQUIRE_SELF_HOSTED_LABEL": "1", + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 31 + }, + "DependsOn": [ + "runnersWebhookHandlerwebhookhandlerServiceRoleDefaultPolicy1600452C", + "runnersWebhookHandlerwebhookhandlerServiceRole03DB58D2" + ] + }, + "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17": { + "Type": "AWS::Lambda::Url", + "Properties": { + "AuthType": "NONE", + "TargetFunctionArn": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + } + } + }, + "runnersWebhookHandlerwebhookhandlerinvokefunctionurl871AC245": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunctionUrl", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + "FunctionUrlAuthType": "NONE", + "Principal": "*" + } + }, + "runnersWebhookHandlerwebhookhandlerinvokefunction76559985": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + "InvokedViaFunctionUrl": true, + "Principal": "*" + } + }, + "runnersWebhookRedeliveryLambdaServiceRole464CDD30": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640", + "Roles": [ + { + "Ref": "runnersWebhookRedeliveryLambdaServiceRole464CDD30" + } + ] + } + }, + "runnersWebhookRedeliveryLambdaCF5EE41B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "43d1c41a4d46ac4fe14ab076e83579caf4adb34ca59c1dfcaeb14dc6ccc54a18.zip" + }, + "Description": "Check for GitHub webhook delivery failures and redeliver them", + "Environment": { + "Variables": { + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "OrchestratorLogFB9610E7" + } + }, + "ReservedConcurrentExecutions": 1, + "Role": { + "Fn::GetAtt": [ + "runnersWebhookRedeliveryLambdaServiceRole464CDD30", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 270 + }, + "DependsOn": [ + "runnersWebhookRedeliveryLambdaServiceRoleDefaultPolicyEC808640", + "runnersWebhookRedeliveryLambdaServiceRole464CDD30" + ] + }, + "runnersWebhookRedeliverySchedule88D0314C": { + "Type": "AWS::Events::Rule", + "Properties": { + "Description": "Schedule to run the webhook redelivery lambda every 5 minutes", + "ScheduleExpression": "rate(5 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "runnersWebhookRedeliveryLambdaCF5EE41B", + "Arn" + ] + }, + "Id": "Target0", + "RetryPolicy": { + "MaximumRetryAttempts": 0 + } + } + ] + } + }, + "runnersWebhookRedeliveryScheduleAllowEventRulegithubrunnerstestrunnersWebhookRedeliveryLambdaC352F4E1E8F30E7D": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersWebhookRedeliveryLambdaCF5EE41B", + "Arn" + ] + }, + "Principal": "events.amazonaws.com", + "SourceArn": { + "Fn::GetAtt": [ + "runnersWebhookRedeliverySchedule88D0314C", + "Arn" + ] + } + } + }, + "runnerssetupServiceRole588BFE9A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnerssetupServiceRoleDefaultPolicy40EF213B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsWebhook7AF0D74E" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsSetup692A93B1" + } + }, + { + "Action": [ + "secretsmanager:PutSecretValue", + "secretsmanager:UpdateSecret", + "secretsmanager:UpdateSecretVersionStage" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsSetup692A93B1" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnerssetupServiceRoleDefaultPolicy40EF213B", + "Roles": [ + { + "Ref": "runnerssetupServiceRole588BFE9A" + } + ] + } + }, + "runnerssetup9896CB59": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "70f0e98b4442f9b1760db6ed6fae54fd00508308ddbd277c1e8c40a85b200dd5.zip" + }, + "Description": "Setup GitHub Actions integration with self-hosted runners", + "Environment": { + "Variables": { + "SETUP_SECRET_ARN": { + "Ref": "runnersSecretsSetup692A93B1" + }, + "WEBHOOK_SECRET_ARN": { + "Ref": "runnersSecretsWebhook7AF0D74E" + }, + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "WEBHOOK_URL": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17", + "FunctionUrl" + ] + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "SetupLog8A8B0E5C" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnerssetupServiceRole588BFE9A", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 180 + }, + "DependsOn": [ + "runnerssetupServiceRoleDefaultPolicy40EF213B", + "runnerssetupServiceRole588BFE9A" + ] + }, + "runnerssetupFunctionUrlB8BC43E8": { + "Type": "AWS::Lambda::Url", + "Properties": { + "AuthType": "NONE", + "TargetFunctionArn": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + } + } + }, + "runnerssetupinvokefunctionurl5F3B865C": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunctionUrl", + "FunctionName": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + }, + "FunctionUrlAuthType": "NONE", + "Principal": "*" + } + }, + "runnerssetupinvokefunctionC1E3C6E6": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnerssetup9896CB59", + "Arn" + ] + }, + "InvokedViaFunctionUrl": true, + "Principal": "*" + } + }, + "runnersstatusServiceRole71A1ADB6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersstatusServiceRoleDefaultPolicyBD4E619B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + }, + { + "Action": "ecr:DescribeImages", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + }, + { + "Action": "ec2:DescribeLaunchTemplateVersions", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "cloudformation:DescribeStackResource", + "Effect": "Allow", + "Resource": { + "Ref": "AWS::StackId" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsWebhook7AF0D74E" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubEFD96479" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + } + }, + { + "Action": [ + "secretsmanager:GetSecretValue", + "secretsmanager:DescribeSecret" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersSecretsSetup692A93B1" + } + }, + { + "Action": [ + "states:ListExecutions", + "states:ListStateMachines" + ], + "Effect": "Allow", + "Resource": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + }, + { + "Action": [ + "states:DescribeExecution", + "states:DescribeStateMachineForExecution", + "states:GetExecutionHistory" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":states:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + } + ] + } + ] + }, + ":*" + ] + ] + } + }, + { + "Action": [ + "states:ListActivities", + "states:DescribeStateMachine", + "states:DescribeActivity" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersstatusServiceRoleDefaultPolicyBD4E619B", + "Roles": [ + { + "Ref": "runnersstatusServiceRole71A1ADB6" + } + ] + } + }, + "runnersstatus1A5771C0": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b51bdaeb29dde378d0ed7dd22232b6d0941545402571d7277eb42b358459d6d9.zip" + }, + "Description": "Provide user with status about self-hosted GitHub Actions runners", + "Environment": { + "Variables": { + "WEBHOOK_SECRET_ARN": { + "Ref": "runnersSecretsWebhook7AF0D74E" + }, + "GITHUB_SECRET_ARN": { + "Ref": "runnersSecretsGitHubEFD96479" + }, + "GITHUB_PRIVATE_KEY_SECRET_ARN": { + "Ref": "runnersSecretsGitHubPrivateKey79498F91" + }, + "SETUP_SECRET_ARN": { + "Ref": "runnersSecretsSetup692A93B1" + }, + "WEBHOOK_URL": { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandlerFunctionUrlC8FB3D17", + "FunctionUrl" + ] + }, + "WEBHOOK_HANDLER_ARN": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "runnersWebhookHandlerwebhookhandler22779A81", + "Arn" + ] + }, + ":$LATEST" + ] + ] + }, + "STEP_FUNCTION_ARN": { + "Ref": "runnersRunnerOrchestratorF9B66EBA" + }, + "STEP_FUNCTION_LOG_GROUP": "", + "SETUP_FUNCTION_URL": { + "Fn::GetAtt": [ + "runnerssetupFunctionUrlB8BC43E8", + "FunctionUrl" + ] + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1", + "LOGICAL_ID": "runnersstatus1A5771C0", + "STACK_NAME": "github-runners-test" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "SetupLog8A8B0E5C" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersstatusServiceRole71A1ADB6", + "Arn" + ] + }, + "Runtime": "nodejs22.x", + "Timeout": 180 + }, + "DependsOn": [ + "runnersstatusServiceRoleDefaultPolicyBD4E619B", + "runnersstatusServiceRole71A1ADB6" + ], + "Metadata": { + "providers": [ + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild-x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildx64CodeBuildRole32E5C764", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildx64LogsA21ECD59" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderLogsE4CADFCC" + } + } + }, + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild-ubuntu-2404-x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404x64CodeBuildRoleD05C8D92", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildUbuntu2404x64Logs27D26829" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" + } + } + }, + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild", + "linux", + "arm64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildARMCodeBuildRole74DB4985", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildARMLogs7C7FC5A7" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" + } + } + }, + { + "type": "CodeBuildRunnerProvider", + "labels": [ + "codebuild", + "windows", + "x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "CodeBuildWindowsCodeBuildRoleDC93697E", + "Arn" + ] + }, + "logGroup": { + "Ref": "CodeBuildWindowsLogsF4DD93A5" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "WindowsImageBuilderDockerLogE660E23E" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs", + "linux", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSsecuritygroup76605212", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECStaskTaskRoleFE831ECD", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSlogs71446134" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderRepository9DE3B6F0", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderRepository9DE3B6F0" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderLogsE4CADFCC" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs-ubuntu-2404", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSUbuntu2404securitygroupEE405C76", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECSUbuntu2404taskTaskRoleDF683F3B", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSUbuntu2404logsFB15C25B" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildUbuntu2404ImageBuilderRepositoryFA75695E" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildUbuntu2404ImageBuilderLogsAD7DFF28" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs", + "linux", + "arm64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSARM64securitygroup281D94B2", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECSARM64taskTaskRole23B1CB4E", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSARM64logs1A2F1E00" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "CodeBuildImageBuilderarmRepositoryE967421B", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "CodeBuildImageBuilderarmRepositoryE967421B" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "CodeBuildImageBuilderarmLogs5A60CB81" + } + } + }, + { + "type": "EcsRunnerProvider", + "labels": [ + "ecs", + "windows", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "ECSWindowssecuritygroupB4EE54DA", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "ECSWindowstaskTaskRole17C8DA48", + "Arn" + ] + }, + "logGroup": { + "Ref": "ECSWindowslogs83D9D352" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "WindowsImageBuilderDockerLogE660E23E" + } + } + }, + { + "type": "LambdaRunnerProvider", + "labels": [ + "lambda", + "x64" + ], + "roleArn": { + "Fn::GetAtt": [ + "LambdaFunctionServiceRoleB1826A50", + "Arn" + ] + }, + "logGroup": { + "Ref": "LambdaLog2764B04F" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderx64Repository57F632F1", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderx64Repository57F632F1" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "LambdaImageBuilderx64Logs1C003BB4" + } + } + }, + { + "type": "LambdaRunnerProvider", + "labels": [ + "lambda", + "arm64" + ], + "roleArn": { + "Fn::GetAtt": [ + "LambdaARMFunctionServiceRole136069A0", + "Arn" + ] + }, + "logGroup": { + "Ref": "LambdaARMLogAA2DA09F" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "LambdaImageBuilderzRepository7C7AD146", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "LambdaImageBuilderzRepository7C7AD146" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "LambdaImageBuilderzLogsC9FB42C8" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate", + "linux", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "FargatesecuritygroupAFCAFD34", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "FargatetaskTaskRoleEFFCDAF8", + "Arn" + ] + }, + "logGroup": { + "Ref": "FargatelogsCB753638" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderLogs2F794091" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate-spot", + "linux", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "Fargatex64spotsecuritygroup2A9F4299", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "Fargatex64spottaskTaskRole02893C25", + "Arn" + ] + }, + "logGroup": { + "Ref": "Fargatex64spotlogs0BCF618B" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderRepository8F7BA13C", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderRepository8F7BA13C" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderLogs2F794091" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate", + "linux", + "arm64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "Fargatearm64securitygroup08ABAD9E", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "Fargatearm64taskTaskRoleD3C2CD58", + "Arn" + ] + }, + "logGroup": { + "Ref": "Fargatearm64logs00171A52" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderarmLogs63D60F4D" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate-spot", + "linux", + "arm64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "Fargatearm64spotsecuritygroup20C885E4", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "Fargatearm64spottaskTaskRole0F078C81", + "Arn" + ] + }, + "logGroup": { + "Ref": "Fargatearm64spotlogsEFCCEC59" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "FargatebuilderarmRepository77DCC132", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "FargatebuilderarmRepository77DCC132" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "FargatebuilderarmLogs63D60F4D" + } + } + }, + { + "type": "FargateRunnerProvider", + "labels": [ + "fargate", + "windows", + "x64" + ], + "vpcArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":vpc/", + { + "Ref": "Vpc8378EB38" + } + ] + ] + }, + "securityGroups": [ + { + "Fn::GetAtt": [ + "FargateWindowssecuritygroupE684A7B0", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "FargateWindowstaskTaskRole364508C8", + "Arn" + ] + }, + "logGroup": { + "Ref": "FargateWindowslogs52881DBF" + }, + "image": { + "imageRepository": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 4, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".dkr.ecr.", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "WindowsImageBuilderRepositoryA4CBB6D8", + "Arn" + ] + } + ] + } + ] + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "WindowsImageBuilderRepositoryA4CBB6D8" + } + ] + ] + }, + "imageTag": "latest", + "imageBuilderLogGroup": { + "Ref": "WindowsImageBuilderDockerLogE660E23E" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2", + "linux", + "x64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2LinuxSGF5B89300", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2LinuxRole8B6519A2", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2LinuxLogsC4CD8F14" + }, + "ami": { + "launchTemplate": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "amiBuilderLogGroup": { + "Ref": "AMILinuxBuilderAmiLog0DB16E38" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2-spot", + "linux", + "x64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2SpotLinuxSG8D846B64", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2SpotLinuxRole86333E5D", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2SpotLinuxLogsF78D5F0E" + }, + "ami": { + "launchTemplate": { + "Ref": "AMILinuxBuilderLaunchtemplateA29452C4" + }, + "amiBuilderLogGroup": { + "Ref": "AMILinuxBuilderAmiLog0DB16E38" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2", + "linux", + "arm64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2Linuxarm64SG550ECD6C", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2Linuxarm64Role242F68FF", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2Linuxarm64Logs577E371E" + }, + "ami": { + "launchTemplate": { + "Ref": "AMILinuxarm64BuilderLaunchtemplate8F5EFF44" + }, + "amiBuilderLogGroup": { + "Ref": "AMILinuxarm64BuilderAmiLog84A9D94A" + } + } + }, + { + "type": "Ec2RunnerProvider", + "labels": [ + "ec2", + "windows", + "x64" + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "EC2WindowsSG13E24976", + "GroupId" + ] + } + ], + "roleArn": { + "Fn::GetAtt": [ + "EC2WindowsRoleC0D850D2", + "Arn" + ] + }, + "logGroup": { + "Ref": "EC2WindowsLogsDC1F2ABF" + }, + "ami": { + "launchTemplate": { + "Ref": "WindowsEC2BuilderLaunchtemplate0A66E9C2" + }, + "amiBuilderLogGroup": { + "Ref": "WindowsEC2BuilderAmiLog126E54B2" + } + } + } + ] + } + }, + "runnersFailedRunnerImageBuilds233D2237": { + "Type": "AWS::SNS::Topic" + }, + "runnersFailedRunnerImageBuildsPolicyC1C99AF8": { + "Type": "AWS::SNS::TopicPolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Principal": { + "Service": "codestar-notifications.amazonaws.com" + }, + "Resource": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "Sid": "0" + } + ], + "Version": "2012-10-17" + }, + "Topics": [ + { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + } + ] + } + }, + "runnersImageBuilderBuildsDF5A50E4": { + "Type": "AWS::SNS::Topic" + }, + "runnersImageBuilderBuildsFilterServiceRoleED82BC5F": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1", + "Roles": [ + { + "Ref": "runnersImageBuilderBuildsFilterServiceRoleED82BC5F" + } + ] + } + }, + "runnersImageBuilderBuildsFilterD708AA06": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "f07c60cc451d4f0c652f687a1c8cd6cf21a2a8f6cd7ab6807e6ee06606ea4122.zip" + }, + "Description": "src/image-builders/aws-image-builder/filter-failed-builds.lambda.ts", + "Environment": { + "Variables": { + "TARGET_TOPIC_ARN": { + "Ref": "runnersFailedRunnerImageBuilds233D2237" + }, + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "LoggingConfig": { + "LogFormat": "JSON", + "LogGroup": { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + }, + "Role": { + "Fn::GetAtt": [ + "runnersImageBuilderBuildsFilterServiceRoleED82BC5F", + "Arn" + ] + }, + "Runtime": "nodejs22.x" + }, + "DependsOn": [ + "runnersImageBuilderBuildsFilterServiceRoleDefaultPolicy4525F6C1", + "runnersImageBuilderBuildsFilterServiceRoleED82BC5F" + ] + }, + "runnersImageBuilderBuildsFilterAllowInvokegithubrunnerstestrunnersImageBuilderBuilds109FC9E855AB30DD": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "runnersImageBuilderBuildsFilterD708AA06", + "Arn" + ] + }, + "Principal": "sns.amazonaws.com", + "SourceArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + } + } + }, + "runnersImageBuilderBuildsFilterImageBuilderBuilds7F42F563": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Fn::GetAtt": [ + "runnersImageBuilderBuildsFilterD708AA06", + "Arn" + ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "runnersImageBuilderBuildsDF5A50E4" + } + } + }, + "runnersWebhookerrors72F5BFF3": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Webhook errors", + "QueryString": { + "Fn::Join": [ + "", + [ + "filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersOrchestrationerrors9EFE206B": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Orchestration errors", + "QueryString": "filter level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" + } + }, + "runnersRunnerimagebuilderrorsC1D423F8": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "RunnerImageBuildHelpersLog13186633" + } + ], + "Name": "GitHub Runners/Runner image build errors", + "QueryString": "filter strcontains(message, \"error\") or strcontains(message, \"ERROR\") or strcontains(message, \"Error\") or level = \"ERROR\"\n| sort @timestamp desc\n| limit 100" + } + }, + "runnersIgnoredwebhooksAD368063": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Ignored webhooks", + "QueryString": { + "Fn::Join": [ + "", + [ + "fields @timestamp, message.notice\n| filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter strcontains(message.notice, \"Ignoring\")\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersIgnoredjobsbasedonlabels120F3D1A": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Ignored jobs based on labels", + "QueryString": { + "Fn::Join": [ + "", + [ + "fields @timestamp, message.notice\n| filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter strcontains(message.notice, \"Ignoring labels\")\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersWebhookstartedrunners63776EDF": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Webhook started runners", + "QueryString": { + "Fn::Join": [ + "", + [ + "fields @timestamp, message.sfnInput.jobUrl, message.sfnInput.labels, message.sfnInput.provider\n| filter strcontains(@logStream, \"", + { + "Ref": "runnersWebhookHandlerwebhookhandler22779A81" + }, + "\")\n| filter message.sfnInput.jobUrl like /http.*/\n| sort @timestamp desc\n| limit 100" + ] + ] + } + } + }, + "runnersWebhookredeliveriesD3F14437": { + "Type": "AWS::Logs::QueryDefinition", + "Properties": { + "LogGroupNames": [ + { + "Ref": "OrchestratorLogFB9610E7" + } + ], + "Name": "GitHub Runners/Webhook redeliveries", + "QueryString": "fields @timestamp, message.notice, message.deliveryId, message.guid\n| filter isPresent(message.deliveryId)\n| sort @timestamp desc\n| limit 100" + } + }, + "OrchestratorLogFB9610E7": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SetupLog8A8B0E5C": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "RetentionInDays": 30 + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id" + }, + "SsmParameterValueawsserviceecsoptimizedamiamazonlinux2arm64recommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended/image_id" + }, + "SsmParameterValueawsserviceamiwindowslatestWindowsServer2019EnglishFullECSOptimizedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized/image_id" + }, + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Outputs": { + "runnersstatuscommand4A30F0F5": { + "Value": { + "Fn::Join": [ + "", + [ + "aws --region ", + { + "Ref": "AWS::Region" + }, + " lambda invoke --function-name ", + { + "Ref": "runnersstatus1A5771C0" + }, + " status.json" + ] + ] + } + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file From 0afa8bcae24bcd8e8ce3614c83ffe3cc350d88a3 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Wed, 17 Dec 2025 19:41:28 -0500 Subject: [PATCH 18/19] done --- src/image-builders/aws-image-builder/deprecated/common.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/image-builders/aws-image-builder/deprecated/common.ts b/src/image-builders/aws-image-builder/deprecated/common.ts index cb3eea92..69d73378 100644 --- a/src/image-builders/aws-image-builder/deprecated/common.ts +++ b/src/image-builders/aws-image-builder/deprecated/common.ts @@ -87,7 +87,6 @@ export abstract class ImageBuilderBase extends Construct implements IRunnerImage } protected createLog(recipeName: string): logs.LogGroup { - // TODO make image depend on the log group so it is created first return new logs.LogGroup(this, 'Log', { logGroupName: `/aws/imagebuilder/${recipeName}`, retention: this.logRetention, From baecb139c55ea0f05f6467b80db47e1c2b3a10d0 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Wed, 17 Dec 2025 19:52:20 -0500 Subject: [PATCH 19/19] add detail to todo --- src/image-builders/aws-image-builder/builder.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/image-builders/aws-image-builder/builder.ts b/src/image-builders/aws-image-builder/builder.ts index c07fa963..6a195859 100644 --- a/src/image-builders/aws-image-builder/builder.ts +++ b/src/image-builders/aws-image-builder/builder.ts @@ -925,7 +925,8 @@ export class AwsImageBuilderFailedBuildNotifier implements cdk.IAspect { } } - // TODO + // AWS dev says we can also use this filter on EventBridge directly + // We will have to filter it further down by recipe // { // "detail-type": ["EC2 Image Builder Image State Change"], // "source": ["aws.imagebuilder"],