Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using an Azure region name instead of AWS region.
✗ Incorrect
The AWS region for EC2 agents must be a valid AWS region like 'us-west-2'.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using AWS or GCP cloud names in Azure agent configuration.
✗ Incorrect
The Azure cloud name must be set to 'azure-cloud' to provision agents in Azure.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Azure or Docker labels for EC2 agents.
✗ Incorrect
The label for EC2 agents should reflect EC2, such as 'ec2-agent'.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing AWS and Azure names in the same config.
✗ Incorrect
The Azure cloud name is 'azure-cloud' and the label should be 'azure-agent' for clarity.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Azure labels or regions in EC2 config.
✗ Incorrect
The EC2 agent label is 'ec2-agent', region is 'us-east-1', and AMI ID is a valid AWS AMI like 'ami-0abcdef1234567890'.