Terraform File:
resource “null_resource” “user” {
provisioner “local-exec” {
command = “useradd demo”
}
}
Use terraform init command to initialize the provider.
Check the changes using the terraform plan command.
Terraform plan
To apply those changes use terraform apply command.
terraform apply
Check if the user is created or not using the id command.
$ id demo
uid=1001(demo) gid=1001(demo) groups=1001(demo)
Task by Trainer:
Task 5:
Create a Linux user harry.