vortiju.blogg.se

Sqlectron aws
Sqlectron aws







sqlectron aws

  • Allow at least 5 minutes before making the Database connection as it requires time to install the packages in AWS EC2 instance.
  • Terraform apply -auto-approve – To deploy the infrastructure.
  • Terraform plan – To view what changes will be made.
  • Terraform init – To download the necessary plugins.
  • Open ‘ Providers.tf’ file and provide the AWS credentials.
  • Make sure you have installed Terraform already and install ‘GIT BASH’ for Windows.
  • These values can be over-written using Terrafrom.tfvars file or by passing inline parameters while executing the Terraform template. The ‘ variable.tf’ is populated with default values. Also, the script will create a new DB user and set its password, thereby the user can make connection to it from outside. Once the AWS EC2 instance is deployed the bootstrap script (User Data) will be initiated to install the MySQL community version and resetting to root password with the provided value. The main purpose of creating Key with this project is as there is no need or overhead in managing extra keys in AWS because they also get deleted while deleting the infrastructure.Ī new security group will be created allowing all outbound connections from the EC2 and allowing inbound connection to ports 3306 and 22 to the EC2. Then with the Public Key, an AWS Key pair will be created which in return mapped to the AWS EC2 instance. So, the user can save it in any name he/she likes. The name of the Private Key is passed as variable.

    sqlectron aws

    Resources that will be created as part of Terraform template,įirst of all, Terraform will create TLS Key pair (Public/Private) and will save the Private Key with “.pem” extension. Therefore, in this blog I have shared the Terraform script which I used to deploy it. Terraform is a ‘Infrastructure as Code (IaC)’ tool which is used to implement disposable infrastructure.

    sqlectron aws

    This time I thought of using Terraform to deploy the MYSQL database in AWS EC2 instance. Recently I used MySQL as the backend database for my Django project which is hosted in AWS EC2 instance, which was created manually.









    Sqlectron aws