Hi, Adrian, and welcome back.
Now, in the earlier video we were discussing about the architecture where a private hosted zone can
be associated with a VPC of another account.
So in today's video, we'll go ahead and look into it from a practical point of view.
Now, when we discuss about the practical steps at this stage, you should know that the approach is
not possible through G.
So you will have to make use of the CLI here.
So when we discuss about CLI, there are two important steps that you have to deploy.
First one is you have to use the Create VPC Association authorization to authorize the association between
the private hosted zone in account A and the VPC in account B.
So first step is you have to authorize the association.
Second step is you have to associate the VPC with the private hosted zone.
So these are the two important ones.
Let's look into step by step approach.
Now the step one is you have to find the hosted zone ID, whatever private hosted zone that you have
created.
You have to find the ID so you can run the Route 53 List hosted Zone Click Command to find the ID or
you can even get it through the G.
So the ID ends with 3k8.
The second step is you have to create the VPC association authorization and when you do that, you run
this command in the account where the private hosted zone is created.
So you see you run the Route 53, create VPC Association authorization, you specify the hosted zone
ID of your private hosted zone, you specify the VPC region and the VPC ID.
So this is the VPC ID of another US account.
Once this is done, the step three is to associate the VPC with the hosted zone.
So what do you do?
You specify the hosted zone ID again, the same set of commands VPC Region and VPC ID.
However, you have the associate VPC with hosted Zone.
And where do you run this command?
You run this command in the external account that is hosting the specified VPC.
So these are the three primary steps.
Let's go ahead and try it out now from the Route 53 console.
First step, let's go ahead and quickly create a new private hosted zone.
Let's just call it as example DOT internal.
This should be a private hosted zone and you can just associate it with the VPC.
Let's select the Virginia VPC, the default VPC, whatever you have, you can just associate it over
here.
This does not matter.
Now let's go ahead and also create a sample record.
I'll say zero one and you can just add an IP 192 168 1.10 once, then you can create a record.
So what you want this record should be resolvable in the VPC that belongs to another account.
Now the step one is you have to find the hosted zone ID.
This is quite simple.
You can get it from here as well.
So you see this is the hosted zone ID or you can get it through the C command as well.
Now for simplicity, I have two sets of access and secret keys that I created.
One access secret key that you see over here belongs to the account where the private hosted zone is
created.
And second set of access and secret key is in the account where the VPC is associated.
So first we'll be using the set of access and secret keys.
So let's copy this from my CLA.
I'll just quickly do a configure.
Let's replace it with the new set of keys.
Make sure that you have the appropriate access.
In my case, this keys have the administrator access.
All right.
So now let's clear the screen.
I'll say a Route 53 list hosted Zunes.
At this stage, there are two hosted zones that are shown.
One is the Cpsc's internal and second one is the example.
Internal example.
Internal is what we are interested in.
And this ends with eight deep.
So what we'll do, we'll copy the hosted zone ID and what I'll do, I'll temporarily add it to a text
file.
The step number two is to create the VPC Association authorization.
So again, for this I have a sample command.
We can go ahead and replace the hosted zone ID along with the VPC region and so on.
So again, I'll be adding this command after this video so that you can also reference to it.
So first I'll go ahead and replace the hosted zone ID here.
All right.
The next thing is the VPC ID.
So in our sandbox account, where our EC two instances running, let's go back and we'll go to the VPC
console.
Or for simplicity, you can just copy the VPC ID from here.
Again, this is running in the Mumbai region.
So within here let's replace the VPC ID and here the region remains to be the same, which is AP South
one.
This is the region where the VPC is present.
All right.
And then you specify the region of US East one.
So let's copy this.
Let's add it here.
I right.
And this is the output now at this stage from the sandbox account, if you try to resolve the domain,
I'll say 01. example dot internal.
You see it is not working.
So our step number three is still pending.
So what is that?
Step number three, it is to associate the VPC with the hosted zone and you run this in the external
account.
So let me also write it down.
I'll say external account and I'll paste the appropriate command, which is to associate VPC with the
hosted zone.
Again, make sure to replace the host, the Zone ID and the VPC region and the VPC ID.
All these are the only thing that you'll have to replace and also make sure that you have the latest
credentials associated with the external account.
So for a sandbox account also I have created a set of access and secret keys that will quickly use.
So let's go ahead and run the configure once more.
I'll add the new set of access keys, the new set of Secret key, and I'll press enter.
Now, again, one thing to note is that to keep things simple, I'm doing this approach.
The better approach would be to use the profile parameter where you have multiple set of profiles based
on the accounts.
So let's do one thing.
Let's copy the last command.
Let's add it over here.
And great.
That's about it.
So if you want to verify, you can quickly do that.
So at this stage it states associated VPC, which is USC two one.
Let's refresh it.
This time.
You also see one more VPC in the AP South one region and from the EC two instance of the Sandbox account.
Let's try to resolve that domain one more time and you'll see we are getting the appropriate resolution.
Now note that this can take four or 5 minutes after you have associated.
So in case if you're not able to resolve it immediately, wait for four or 5 minutes post which the
resolution should work.
Great.
So that's the very high level overview about the practicals related to associating a private hosted
zone with another accounts VPC.
And with this will conclude today's video.