From bfbde9b8f0b039ba0b99d373cb05fe35508f1885 Mon Sep 17 00:00:00 2001 From: Guslington Date: Wed, 16 Mar 2022 10:59:09 +1100 Subject: [PATCH] create parameters for efs id and cache access point id --- jenkins-ec2-agents.cfhighlander.rb | 2 ++ jenkins-ec2-agents.cfndsl.rb | 24 ++++++++++++++++++++++++ lambdas/ami_finder/app.py | 3 --- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/jenkins-ec2-agents.cfhighlander.rb b/jenkins-ec2-agents.cfhighlander.rb index c6c968d..81cf5d5 100644 --- a/jenkins-ec2-agents.cfhighlander.rb +++ b/jenkins-ec2-agents.cfhighlander.rb @@ -11,6 +11,8 @@ ComponentParam 'VPCId', type: 'AWS::EC2::VPC::Id' ComponentParam 'JenkinsMasterSecurityGroup', type: 'AWS::EC2::SecurityGroup::Id' ComponentParam 'Subnets', type: 'CommaDelimitedList' + ComponentParam 'JenkinsFileSystem', '' + ComponentParam 'JenkinsAgentCacheAccessPoint', '' end LambdaFunctions 'ami_finder_custom_resources' diff --git a/jenkins-ec2-agents.cfndsl.rb b/jenkins-ec2-agents.cfndsl.rb index f1fddb4..c5b1057 100644 --- a/jenkins-ec2-agents.cfndsl.rb +++ b/jenkins-ec2-agents.cfndsl.rb @@ -113,5 +113,29 @@ EnvironmentName: Ref(:EnvironmentName) }) } + + SSM_Parameter(:JenkinsEFSParameter) { + Description "Jenkins EFS ID" + Name FnSub("/ciinabox/${EnvironmentName}/agent/efs") + Property('Tier','Standard') + Type 'String' + Value Ref(:JenkinsFileSystem) + Property('Tags',{ + Name: "#{external_parameters[:component_name]}-efs-id", + EnvironmentName: Ref(:EnvironmentName) + }) + } + + SSM_Parameter(:JenkinsAgentCacheAccessPointParameter) { + Description "Jenkins EFS agent access point ID for the Jenkins linux agent to attach in userdata for caching builds" + Name FnSub("/ciinabox/${EnvironmentName}/agent/cache-ap") + Property('Tier','Standard') + Type 'String' + Value Ref(:JenkinsAgentCacheAccessPoint) + Property('Tags',{ + Name: "#{external_parameters[:component_name]}-efs-cache-access-point", + EnvironmentName: Ref(:EnvironmentName) + }) + } end diff --git a/lambdas/ami_finder/app.py b/lambdas/ami_finder/app.py index ca7a9e7..1c63434 100644 --- a/lambdas/ami_finder/app.py +++ b/lambdas/ami_finder/app.py @@ -36,6 +36,3 @@ def get_latest_ami(name): def handler(event, context): helper(event, context) - - - 'Amzn2_Linux_Jenkins_Agent-*' \ No newline at end of file