DevOps Classroom notes 06/Jan/2025

Terraform Functions

  • Terraform provides inbuilt functions around
    Preview
  • Example
    Preview

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 Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube