Now, what you've seen now that you've seen helps create an audience instance in the cult, so let's
have a go at doing it.
Terrible.
Now let's go to our explore and let's create a new folder.
I'm going to call this all this.
I don't want to create a new file, which is going to be Main Dalt, see if we can minimize this.
Now, what we can do is set a provider.
This case is going to be eight of us in the region.
I'm gonna say.
My case is going to be EU dash w dash to send out to set up our resource resource NWS on the school,
DBI on the school instance and I'm gonna call with my all the.
So we're gonna get a name for it.
I'm gonna call it my D.V..
Next we're gonna set B identify that we'll set was equal to my dash.
First dash all the s next we're gonna set the instance class sort size we want this to be.
This is what we're going to set the size of a DV instance.
So to keep it free to let's use DV dot t to dot micra.
Before we proceed any further, I want to quickly recap what these two options do.
And this is a bit of good, a W.S. knowledge.
So the identifier is a unique name, for instance, and this will go as part of B, F, Q Ed.
This is a unique reference for our server.
The name, on the other hand, is the name of the database.
It's going to create inside the all this instance.
This might be customers, for example, and you might call this pearled customer database server.
Now let's proceed.
The engine can we switch can be required field.
And we said we're going to use Maria DBI to set an engine version.
We can pick one at random.
So we do tend to dot twenty one.
Next we say a username and password again.
We can see these also required fields.
You say a username of BOPE and a password of password once a year.
Obviously something really important.
I want to mention here that this is not good practice to leave it inside your code.
You shouldn't do this.
You're always doing this in terraform, such as secret injection, which is a bit beyond the scope of
this course.
And that's how you can link up to other Hershey court products like vaults and literally inject the
secret into you.
Also, one of the other important things to note is that even if you inject a secret inside, it then
gets stored inside the state vault, which means the state vault now has sensitive information.
A bit later on, we're going to cover remote backings and how they work and you want to treat it if
you are storing passwords like this.
You want to treat it as sensitive information.
You want to make sure it's encrypted.
Any limit be access to it.
Again, but some good A.W. US and terrible knowledge of a quarter to use.
I'm giving you.
So make sure you avoid any mistakes going forward.
Next, we need to ports so we use a default one which is free for eight of six.
Next, we got allocated storage and as we said, we it is to 10 gigs, but we'd want to be set it to
a minimum of 20 before we go ahead and run.
Terraforming it and run.
This is one more option.
I want you to add, which is Skipp final snapshots and set that equal to true.
The reason we're setting this is if you were to set this up in the console, when you go to deletes
it, it's going to ask you to take a snapshot.
Now, normally we can set, cancel or avoid it.
But what we do in TerraForm, we don't have the option when we come to destroy it.
Maybe when we run terraform destroyed, it tries to destroy the obvious instance, but it fails because
it tries to take a snapshot.
By setting this, we're saying when destroying the audience instance, Skip taking any snapshots and
go ahead and delete it.
Now we've got our terrorism code in place.
Let's go ahead and run it.
Let's go to you.
Go to terminal and let's see into all the S.
Now let's run.
Terrible in its.
And now it's run, terrible reply.
Excellent.
So no errors, but looks good and it's going to create our own Yes instance.
So let's go ahead and answer.
Yes.
And this can take a while to set up.
So if you want to go and grab a tea and coffee and come back.
Excellent.
So all this instance is set up.
Now, if we go back, what we can do is cancel out of the set up.
We can see we have my audio systems, as I mentioned.
Identify is the name of the audience instance.
It's a bit confusing.
Think the name would be the name instead of the identify.
And if we click on it.
We can see we've got our ports you identify as part of the F Kudi N, which is in the endpoints.
So look at configuration.
So we've got.
Teach.
You don't like her 20 gigs of storage.
The engine version is ten point two point twenty one.
The DBI name is my DBI.
And there we go.
That's a set up, an obvious instance.
And also make sure we don't get any more cost.
That's from terrible and destroyed.
And again, this can also take a while to destroy the audience instance and say, yes, OK, that wraps
up this section.
We're going to leave it to run and destroy the infrastructure.
And that wraps up this section on creating audience instances.
I look forward to seeing you in the next lesson.