Skip to content

Commit 8093ed6

Browse files
committed
Zmiana zawiera 3 uaktualnienia:
* instancja AWS RDS otrzymała PostgreSQL minor upgrade z 13.18 do 13.20 * komenda ssh zamiast być zahadrkodowana, jest interpolowana jako terraform output * usuwam ze stanu terraformowego access keys administratorów (sam musiałem swój klucz przerotować - zrobiłem to ręcznie, a jednocześnie nie ma powodu by jeden administrator miał dostęp do credentiali innych administratorów)
1 parent 0e4d29f commit 8093ed6

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

admin/main.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ resource "aws_iam_user" "user" {
99
name = var.name
1010
}
1111

12-
resource "aws_iam_access_key" "access_key" {
13-
user = aws_iam_user.user.name
14-
}
15-
1612
resource "aws_iam_user_policy_attachment" "policy_attachment" {
1713
policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
1814
user = aws_iam_user.user.name

database/main.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ variable "name" {
44

55
variable "db_instance" {}
66

7-
8-
// https://github.com/hashicorp/terraform/issues/8367
9-
// before running terraform create a ssh tunel
10-
// ssh [email protected] -L 15432:main-postgres.ct6cadodkpjm.eu-west-1.rds.amazonaws.com:5432
117
provider "postgresql" {
128
host = "127.0.0.1" // var.db_instance.address
139
port = "15432" // var.db_instance.port

db.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ resource "aws_db_instance" "db" {
1616
identifier = "main-postgres"
1717

1818
engine = "postgres"
19-
engine_version = "13.18"
19+
engine_version = "13.20"
2020

2121
instance_class = "db.t3.micro"
2222
allocated_storage = 8

outputs.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
output "ssh_tunnel" {
2+
value = "ubuntu@${aws_route53_record.bastion.name} -L 15432:${aws_db_instance.db.address}:${aws_db_instance.db.port}"
3+
description = <<-DESCRIPTION
4+
https://github.com/hashicorp/terraform/issues/8367
5+
before running terraform create a ssh tunel
6+
DESCRIPTION
7+
}

0 commit comments

Comments
 (0)