# NOKEY Error while using Terraform on AWS

**URL:** https://community.jenkins.io/t/nokey-error-while-using-terraform-on-aws/15890
**Category:** Using Jenkins
**Created:** [June 11, 2024, 4:33pm UTC](https://community.jenkins.io/t/nokey-error-while-using-terraform-on-aws/15890 "2024-06-11T16:33:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mcd](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mcd/32/8602_2.png) [@mcd](https://community.jenkins.io/u/mcd)
#### Post date: [June 11, 2024, 4:33pm UTC](https://community.jenkins.io/t/nokey-error-while-using-terraform-on-aws/15890/1 "2024-06-11T16:33:32Z")

</div>

When creating Amazon 2 Linux server with Terraform code the following error messages are received:

```auto
null_resource.name (remote-exec): warning: /var/cache/yum/x86_64/2/jenkins/packages/jenkins-2.462-1.1.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID ef5975ca: NOKEY
null_resource.name (remote-exec): Public key for jenkins-2.462-1.1.noarch.rpm is not installed
null_resource.name (remote-exec): jenkins-2.462-1.1. | 89 MB 00:03
null_resource.name (remote-exec): Public key for jenkins-2.462-1.1.noarch.rpm is not installed

```

How can I resolve this issue?

---

<div class="post-metadata">

### Author: ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)
#### Post date: [June 11, 2024, 5:09pm UTC](https://community.jenkins.io/t/nokey-error-while-using-terraform-on-aws/15890/2 "2024-06-11T17:09:40Z")

</div>

> [@mcd](#):
>
> Amazon 2 Linux server

Amazon Linux 2 is no longer supported by the Jenkins project. A [May 2023 blog post](https://www.jenkins.io/blog/2023/05/30/operating-system-end-of-life/#red-hat-enterprise-linux-7-and-derivatives) announced that derivatives of Red Hat Enterprise Linux 7 would no longer be supported by the Jenkins project after 16 Nov 2023.

Amazon has stated that “[Amazon Linux 2 offers will be supported until June 30, 2025 with security and maintenance updates](https://aws.amazon.com/amazon-linux-2/faqs/)” . Installing Amazon Linux 2 now means that the Jenkins project does not support or test that operating system and that in less than 12 months the operating system vendor will stop supporting it. Please use a newer operating system like Amazon Linux 2023 or Red Hat Enterprise Linux 9 or AlmaLinux 9 or Rocky Linux 9.

> [@mcd](#):
>
> `Public key for jenkins-2.462-1.1.noarch.rpm is not installed`

That indicates that `yum` cannot find the public key for the RPM package that you are trying to install. The [Jenkins installation guide for Red Hat / Alma / Rocky](https://www.jenkins.io/doc/book/installing/linux/#red-hat-centos) says that you need to run the following commands:

```auto
sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install fontconfig java-17-openjdk
sudo yum install jenkins

```
