diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8852ea9b..81c54678 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Push new jenkins docker image on: push: - paths: + paths: - docker/** workflow_dispatch: @@ -26,4 +26,4 @@ jobs: platforms: linux/amd64,linux/arm64 context: "{{defaultContext}}:docker" push: true - tags: opensearchstaging/jenkins:2.332.2-lts,opensearchstaging/jenkins:latest \ No newline at end of file + tags: opensearchstaging/jenkins:2.332.3-lts,opensearchstaging/jenkins:latest diff --git a/lib/compute/agent-node-config.ts b/lib/compute/agent-node-config.ts index 572d6f59..3a67ffe3 100644 --- a/lib/compute/agent-node-config.ts +++ b/lib/compute/agent-node-config.ts @@ -10,7 +10,7 @@ import { Role, ManagedPolicy, PolicyStatement, Effect, CfnInstanceProfile, ServicePrincipal, } from '@aws-cdk/aws-iam'; import { - Fn, Stack, Tags, CfnParameter, + Fn, Stack, Tags, CfnOutput, } from '@aws-cdk/core'; import { KeyPair } from 'cdk-ec2-key-pair'; import { readFileSync } from 'fs'; @@ -116,6 +116,11 @@ export class AgentNodeConfig { const AgentNodeInstanceProfile = new CfnInstanceProfile(stack, 'JenkinsAgentNodeInstanceProfile', { roles: [AgentNodeRole.roleName] }); this.AgentNodeInstanceProfileArn = AgentNodeInstanceProfile.attrArn.toString(); this.SSHEC2KeySecretId = Fn.join('/', ['ec2-ssh-key', key.keyPairName.toString(), 'private']); + + new CfnOutput(stack, 'Jenkins Agent Node Role Arn', { + value: `${AgentNodeRole.roleArn}`, + exportName: 'agentNodeRoleArn', + }); } public addAgentConfigToJenkinsYaml(templates: AgentNodeProps[], props: AgentNodeNetworkProps): any { diff --git a/lib/compute/jenkins-main-node.ts b/lib/compute/jenkins-main-node.ts index 44e864cb..4bc72b60 100644 --- a/lib/compute/jenkins-main-node.ts +++ b/lib/compute/jenkins-main-node.ts @@ -6,7 +6,7 @@ * compatible open source license. */ -import { Duration, Stack } from '@aws-cdk/core'; +import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; import { AmazonLinuxGeneration, BlockDeviceVolume, @@ -153,6 +153,11 @@ export class JenkinsMainNode { JenkinsMainNode.createPoliciesForMainNode(stack).map( (policy) => this.ec2Instance.role.addManagedPolicy(policy), ); + + new CfnOutput(stack, 'Jenkins Main Node Role Arn', { + value: this.ec2Instance.role.roleArn, + exportName: 'mainNodeRoleArn', + }); } public static createPoliciesForMainNode(stack: Stack): (IManagedPolicy | ManagedPolicy)[] {