First of all, note that, unlike the more popular shape with a kosumi instead of a keima, this shape carries a lot more aji and is vulnerable to yose tesuji and approach moves.
$$ A lot less aji
$$ ---------
$$ -........
$$ -........
$$ -.....X..
$$ -...X....
$$ -..X.....
$$ -........
$$ -........
Oh, and by the way, an invasion is supposed to live in gote. Invading and living in sente is something you definitely don't want your opponent to be able to. In a shape with 3 (!) black stones vs a single white stone, living has to be super hard, and even a ko is a success for white.
Killing the invasion
The shape you showed, as is, is indeed save against an invasion. It involves a tesuji you need to remember though, and you also need to be able to read tsumego at, I guess, strong kyu level to be able to kill.
$$Wcm1 The invasion
$$ ---------
$$ -........
$$ -....2...
$$ -..1..X..
$$ -...X....
$$ -........
$$ -..X.....
$$ -........
B2 is tesuji to kill.
$$Wcm1 White can't live
$$ ---------
$$ -.98.....
$$ -.5..X...
$$ -0.O..X..
$$ -.7.X....
$$ -6134....
$$ -.2X.....
$$ -........
Why can't black simply block?
$$Wcm1 Black fails - white gets a ko
$$ ---------
$$ -..98....
$$ -.7.56...
$$ -..12.X..
$$ -..3X....
$$ -..4.....
$$ -..X.....
$$ -........
Aji
How is this shape dependent on the outside? Well, first, any approach move is virtually sente:
$$Wcm1 If black tenukies, the invasion becomes a huge danger again. But answering locally likely leads to overconcentration.
$$ ----------
$$ -.........
$$ -.........
$$ -.....X.1.
$$ -...X.....
$$ -.........
$$ -..X......
$$ -.........
Also, even nearby stones affect the tsumego severly:
$$Wcm1 Thanks to nearby stones, the fight is tough for black, he should not have tried to kill white in the corner.
$$ ------------
$$ -.OX........
$$ -XO..X......
$$ -X.O56X...Q.
$$ -OO.X79.....
$$ -XOOX8......
$$ -.XX13......
$$ -...........
$$ -..2.4......
$$ -...........
$$ -..Q........
$$ -...........
In short, the shape works, but it's so packed with aji that usually, it's better to hold back a little and play more solid.