We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 894a5be commit 27d2183Copy full SHA for 27d2183
terraform/examples/1. basic_ec2
@@ -0,0 +1,32 @@
1
+### vim main.tf
2
+
3
+provider "aws" {
4
+ region = "us-east-1"
5
+ access_key = "AKIAVATL2WTVUK7H5HK2"
6
+ secret_key = "OTqK1muo2tHxbizUKZc7E01oUfxsaahthir4RCaB"
7
+}
8
9
+resource "aws_instance" "test-instances" {
10
+ ami = "ami-02aa7f3de34db391a"
11
+ count = "4"
12
+ instance_type = "t2.micro"
13
+ key_name = "du-devops"
14
+ user_data = <<-EOF
15
+ #! /bin/bash
16
+ sudo apt-get update
17
+ sudo git clone http://github.com/lerndevops/labs
18
+ sudo chmod -R 775 labs
19
+ sudo labs/cloud/setup-user.sh
20
+ EOF
21
22
+ tags = {
23
+ Name = "test${count.index + 1}"
24
+ training = "devops"
25
+ }
26
27
28
29
30
+#terraform init
31
+#terraform plan
32
+#terraform apply
0 commit comments