WEBVTT

00:00.480 --> 00:01.680
In this lecture,

00:01.680 --> 00:04.880
we will take a look at meta arguments in Terraform.

00:04.880 --> 00:06.880
Until now,

00:07.250 --> 00:08.710
we have been able to create

00:08.710 --> 00:09.800
single resources

00:09.970 --> 00:10.880
such as

00:10.880 --> 00:11.880
a local file

00:11.880 --> 00:14.420
and a random pet resource using Terraform,

00:14.820 --> 00:15.710
but

00:15.770 --> 00:17.000
what if you want to create

00:17.000 --> 00:19.620
multiple instances of the same resource,

00:19.770 --> 00:20.450
say,

00:20.600 --> 00:22.310
three local files for example?

00:23.050 --> 00:25.020
If we were using a shell script

00:25.020 --> 00:26.770
or some other programming language,

00:26.940 --> 00:29.510
we could create multiple files like this.

00:30.340 --> 00:31.650
In this example,

00:31.820 --> 00:34.080
we have created a bash script called

00:34.080 --> 00:35.600
create files.sh,

00:35.600 --> 00:37.600
which uses a four-loop to create

00:37.600 --> 00:40.310
empty files inside the root directory.

00:40.850 --> 00:42.820
The files will be called pet,

00:42.820 --> 00:46.050
followed by the range from one to three.

00:46.370 --> 00:48.280
While we cannot use the same script

00:48.280 --> 00:50.280
as it is within the resource block,

00:50.280 --> 00:52.280
Terraform offers several alternatives

00:52.280 --> 00:54.280
to achieve the same goal,

00:54.940 --> 00:55.970
and these can be done

00:55.970 --> 00:59.620
by making use of specific meta arguments in Terraform.

01:00.310 --> 01:02.310
Meta arguments can be used within

01:02.310 --> 01:03.340
any resource block

01:03.340 --> 01:05.850
to change the behavior of resources.

01:07.000 --> 01:08.480
We've already seen two types

01:08.480 --> 01:10.650
of meta arguments already in this course.

01:10.880 --> 01:12.310
That depends on

01:12.370 --> 01:15.450
for defining explicit dependency between resources

01:15.450 --> 01:16.910
and the lifecycle rules

01:16.910 --> 01:19.620
which define how the resources should be created,

01:19.620 --> 01:21.650
updated, and destroyed within Terraform.

01:22.740 --> 01:23.620
Now,

01:23.620 --> 01:25.620
let us look at some more meta arguments

01:25.620 --> 01:28.850
specifically related to loops in Terraform.

