0

I am new to AWS and Jenkins. I am trying to connect an ec2 instance that has Jenkins installed to the AWS cloud plugin but for some reason, I am unsure why i am getting the following issue '

Failed to obtain credentials from EC2 instance profile: The requested metadata is not found at 'http://169.254.169.254/latest/meta-data/iam/security-credentials/

'

enter image description here

4
  • 1
    Have you attached the IAM role to the EC2 instance?
    – hazmei
    Dec 17, 2022 at 8:20
  • I see that the IAM Role is showing - for the intance . How do i attach the iam role to the ec2 instance?@hazmei Dec 18, 2022 at 3:34
  • docs.aws.amazon.com/AWSEC2/latest/UserGuide/… A simple google search will bring up this url.
    – hazmei
    Dec 19, 2022 at 5:37
  • @hazmei you are correct thanks but i run into another issue where jenkins produce this error Dec 21, 2022 at 2:16

1 Answer 1

0

It looks like you are trying to use the AWS Cloud Plugin for Jenkins to connect an EC2 instance with Jenkins installed to the AWS Cloud. It seems that the plugin is unable to obtain the necessary credentials to connect to AWS from the EC2 instance profile.

There are a few potential reasons why this error might be occurring:

The EC2 instance might not have an IAM role associated with it. In order to use the AWS Cloud Plugin, the EC2 instance needs to have an IAM role that allows it to access AWS resources. You can check the IAM roles that are associated with the EC2 instance by going to the EC2 dashboard in the AWS Management Console and selecting the instance.

The EC2 instance might not have the correct permissions to access the metadata service at 'http://169.254.169.254/latest/meta-data/iam/security-credentials/'. This service is used to retrieve the IAM role and credentials associated with the instance. Make sure that the instance has the necessary permissions to access this service.

There might be a problem with the network configuration of the EC2 instance. Make sure that the instance has a valid network interface and that it is able to reach the metadata service.

There might be a problem with the AWS Cloud Plugin itself. Make sure that you are using the latest version of the plugin and that it is configured correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.