Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL on Elastic Beanstalk (Amazon Linux 2)

With former generation of Amazon Linux, all I needed to do is add the following in .ebextensions in order to use PostgreSQL:

packages:
    yum:
        postgresql93-devel: []

Now when I deploy on EB with the following platform: Python 3.7 running on 64bit Amazon Linux 2/3.0.0

I get the following error on deployment:

[ERROR] Error occurred during build: Yum does not have postgresql93-devel available for installation

Therefore it is impossible to deploy as I need to connect to a PostgreSQL database in RDS.

What config in .ebextensions do I need to do?

like image 486
eagle28 Avatar asked Apr 10 '20 21:04

eagle28


People also ask

How connect AWS Postgres to Linux?

Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/ . Open the RDS console and then choose Databases to display a list of your DB instances. Choose the PostgreSQL DB instance name to display its details. On the Connectivity & security tab, copy the endpoint.

Is Elastic Beanstalk deprecated?

On July 18, 2022 Elastic Beanstalk set the status of all platform branches based on Amazon Linux AMI (AL1) to retired. For more information, see AL1 platform retirement FAQ in the AWS Elastic Beanstalk Developer Guide. The following sections provide information about all retiring platform versions.

Which operating systems does AWS Elastic Beanstalk support?

Elastic Beanstalk only supports platform versions based on Amazon Linux 2. For details about supported platform versions, see Elastic Beanstalk supported platforms. Some key improvements in Amazon Linux 2 compared to Amazon Linux AMI are: Amazon Linux 2 offers long-term support.


1 Answers

The following works:

packages:
    yum:
        amazon-linux-extras: []

commands:
    01_postgres_activate:
        command: sudo amazon-linux-extras enable postgresql10
    02_postgres_install:
        command: sudo yum install -y postgresql-devel
like image 83
eagle28 Avatar answered Sep 17 '22 19:09

eagle28