0
0
Jenkinsdevops~10 mins

Cloud agent provisioning (EC2, Azure) in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the AWS region for the EC2 agent.

Jenkins
pipeline {
  agent {
    ec2 {
      label 'my-agent'
      region '[1]'
    }
  }
  stages {
    stage('Build') {
      steps {
        echo 'Building on EC2 agent'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aeu-central-1
Bazure-eastus
Cus-west-2
Dasia-south1
Attempts:
3 left
💡 Hint
Common Mistakes
Using an Azure region name instead of AWS region.
2fill in blank
medium

Complete the code to specify the Azure cloud for the agent.

Jenkins
pipeline {
  agent {
    azure {
      cloudName '[1]'
      label 'azure-agent'
    }
  }
  stages {
    stage('Test') {
      steps {
        echo 'Running tests on Azure agent'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aazure-cloud
Baws-cloud
Cgcp-cloud
Dlocal-cloud
Attempts:
3 left
💡 Hint
Common Mistakes
Using AWS or GCP cloud names in Azure agent configuration.
3fill in blank
hard

Fix the error in the EC2 agent label configuration.

Jenkins
pipeline {
  agent {
    ec2 {
      label '[1]'
      region 'us-east-1'
    }
  }
  stages {
    stage('Deploy') {
      steps {
        echo 'Deploying on EC2 agent'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aec2-agent
Bazure-agent
Cdocker-agent
Dlocal-agent
Attempts:
3 left
💡 Hint
Common Mistakes
Using Azure or Docker labels for EC2 agents.
4fill in blank
hard

Fill both blanks to configure the Azure agent with correct cloud name and label.

Jenkins
pipeline {
  agent {
    azure {
      cloudName '[1]'
      label '[2]'
    }
  }
  stages {
    stage('Integration') {
      steps {
        echo 'Running integration tests on Azure agent'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aazure-cloud
Bec2-agent
Cazure-agent
Dgcp-cloud
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing AWS and Azure names in the same config.
5fill in blank
hard

Fill all three blanks to create an EC2 agent with label, region, and AMI ID.

Jenkins
pipeline {
  agent {
    ec2 {
      label '[1]'
      region '[2]'
      ami '[3]'
    }
  }
  stages {
    stage('Package') {
      steps {
        echo 'Packaging on EC2 agent'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aec2-agent
Bus-east-1
Cami-0abcdef1234567890
Dazure-agent
Attempts:
3 left
💡 Hint
Common Mistakes
Using Azure labels or regions in EC2 config.