Skip to content

Basic Terraform module for provisioning a Chainlink EC2 instance.

License

Notifications You must be signed in to change notification settings

jleeh/chainlink-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chainlink Terraform

Basic Terraform module for provisioning a Chainlink EC2 instance.

Dependencies

How to Use

  1. Firstly install the Terraform cli from the official website and add it to your PATH:

    https://www.terraform.io/downloads.html

  2. Download your AWS programmatic credentials and place them in your user directory ~/.aws:

    https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

  3. In your AWS console, create a new SSH key pair called chainlink-tf and download it

  4. Run terraform init in this repository directory

  5. Run terraform apply in this repository directory. Once prompted for confirmation, enter yes.

  6. If successful, an output similar to below will be shown:

    Apply complete! Resources: 6 added, 0 changed, 0 destroyed.
    
    Outputs:
    
    public_ip = 1.2.3.4
    
  7. To then access your node, just SSH into the IP shown with the key pair you downloaded:

    ssh -i chainlink-tf.pem -L 6688:localhost:6688 [email protected]

  8. Credentials are generated randomly and stored in /root/.chainlink/api_pw, to get them run:

    cat /root/.chainlink/api_pw

  9. Browse to http://localhost:6688 on your machine, and then enter the credentials from the file.

All done!

Configuration

To edit configuration for the Chainlink instance being created, you can edit the defaults found in variables.tf.

You can also change the variables when running terraform in your CLI. For example, this would restrict SSH access to just your IP:

terraform apply -var 'allowed_cidr=["1.2.3.4/32"]'

Or using a previous Chainlink version:

terraform apply -var 'image_tag=0.5.1'

Or using a different AWS region:

terraform apply -var 'region=eu-west-1'

Updating

Any further updates to this repository can be applied to your own AWS account by re-running terraform apply.

Important: If you're applying changes and notice that the aws_instance is being recreated, this will cause you to loose all your data. If this is shown, backup your /root/.chainlink folder on the instance and copy it to the new one.

Deleting

To destroy the Chainlink EC2 instance and all subsequent resources, run:

terraform destroy

Viewing Logs

If you browse to CloudWatch in the AWS console and click "Logs", you should then see a chainlink-tf group with logs inside it for your Chainlink node.

License

MIT License

About

Basic Terraform module for provisioning a Chainlink EC2 instance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published