This repository was archived by the owner on Jul 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Expand file tree Collapse file tree 2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,31 @@ module "nat" {
4040```
4141
4242
43+ ### Extra configuration
44+
45+ You can open SSH port to the NAT instance.
46+
47+ ``` tf
48+ resource "aws_security_group_rule" "nat_ssh" {
49+ security_group_id = module.nat.sg_id
50+ type = "ingress"
51+ cidr_blocks = ["0.0.0.0/0"]
52+ from_port = 22
53+ to_port = 22
54+ protocol = "tcp"
55+ }
56+ ```
57+
58+ You can attach an extra policy to the IAM role of the NAT instance.
59+
60+ ``` tf
61+ resource "aws_iam_role_policy_attachment" "nat_iam_example" {
62+ policy_arn = "arn:aws:iam::aws:policy/SOME_POLICY_NAME"
63+ role = module.nat.iam_role_name
64+ }
65+ ```
66+
67+
4368## How it works
4469
4570This module will create the following resources:
Original file line number Diff line number Diff line change @@ -25,16 +25,6 @@ resource "aws_security_group_rule" "ingress" {
2525 protocol = " tcp"
2626}
2727
28- resource "aws_security_group_rule" "ssh" {
29- count = var. key_name == " " ? 0 : 1
30- security_group_id = aws_security_group. this . id
31- type = " ingress"
32- cidr_blocks = [" 0.0.0.0/0" ]
33- from_port = 22
34- to_port = 22
35- protocol = " tcp"
36- }
37-
3828resource "aws_network_interface" "this" {
3929 security_groups = [aws_security_group . this . id ]
4030 subnet_id = var. public_subnet
You can’t perform that action at this time.
0 commit comments