DevOps Classroom notes 06/Jan/2025

Terraform Functions

  • Terraform provides inbuilt functions around
  • Example

Activity 3 continued

  • Lets import a ssh key (public key)
  • Assumption is you already have a key pair ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub which is generated by executing ssh-keygen -t rsa
  • Refer Here for the changes done
  • Now lets create an ec2 instance with ubuntu 24.04
  • The inputs required are
    • ami id
    • instance type
    • key pair
    • subnet
    • public ip
    • security group
  • Refer Here for the changes

Datasource

  • Datasource is used to search in the provider to fetch some values
  • Syntax is
data "type" "id" {
    arg1 = value
    argn = value
}
  • To use the attribute syntax is data.type.id.attribute
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%