Jenkins Master -> key pair -> Build server ->IAM->ec2 or EBS or S3 instance
Create IAM role for the build server
Login to your AWS console, search for IAM on the AWS consoleIn the left pane select 'Roles' menu item. In the right side, click on the "Create role " blue button.
select the type of trusted entity as "AWS service" that is default one.
Now choose the service that will use this role: click on "EC2" Link.
Click on the 'Permissions' bottom right side button, proceed further to attach the policy.
AWS Create Role - Attach permission policies |
Under Create Role you could see the button Create a policy
Filter policies with elasticbeanstalk
Let us search result select the 'AWSElasticBeanstalkFullAccess', click that to get the details of that policy which is already defined. this will have 18 services shown in the summary.
Ignore tag page, Click on review button at the bottom.
Review page enter the following values
Role name: build-server-role
Des: Elastic beanstalk full access
In the bottom click on create
AWS Instance Create Role - Review page |
Create a key-pair for a build-server
In the AWS Dashboard -> Under Network and security -> KeypairChoose the button Create key pair for build-server with the name as: build-server-keys.pem
It will automatically download the key-pair that you have created. Let's open the 'build-server-keys.pem' file in notepad++
Create AWS Linux 2 instance
AWS services search for EC2 dashboard, click on the button 'Launch Instance', which opens the 7 steps wizard. Choose the Amazon Linux 2, free-tier (t2-micro) configure the instance.AWS instance type selection |
Create a Security Group
Enter the following values for the Security group that will be having only SSH that allows us to connect from the Jenkins Master.Name: build-server-sg
Des: SSH only for Jenkins
same desc in the inbound rule
no need to changes for an outbound rule
Click on create button
Selecting the security group for build-server |
All set to review and launch the instance. Click on the 'Launch' button.
Select an existing key pair for Instance which was already created.
Select an existing key pair |
Configuration of Jenkins Credential
Now the Jenkins Credential configuration, go to the Jenkins admin consoleClick on the Credentials
-> System
Global Credentials
Jenkins Credentials configuration |
Kind: SSH Username with the private key
Scope: Global (Jenkins Nodes, items and all child items etc)
Enter the values for Username: ec2-user
Password -> private key
Enter it from the build-sever-keys.pem file content which was already opened in the Notepad++.
ignore password, ID, Des optional.
Jenkins Credentials RSA key authentication |
Remember that the Private DNS name/private IP for the build-server required, it will save the cost for internal network access.
Now select the "Manage nodes" link
Node creation on Jenkins master |
Slave server configuration on Jenkins master |
You may be interested to view our other knowledgable technical blog articles:
No comments:
Post a Comment