SeaGL / seagl-terraform

Terraform used to maintain SeaGL's VMs, RDS database, DNS, etc.
GNU Affero General Public License v3.0
1 stars 2 forks source link

Move the OSEM db into a module #15

Closed strugee closed 1 year ago

strugee commented 1 year ago

This is in preparation to set up a second OSEM for sandbox purposes.

github-actions[bot] commented 1 year ago

Terraform Format and Style 🖌``

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan ``` terraform module.prod_db.random_password.osem_db_master_pass: Refreshing state... [id=none] aws_route53_record.route_53_root_txt: Refreshing state... [id=Z0173878287JIU5M4KB8R__TXT] aws_route53_record.stats-2022: Refreshing state... [id=Z0173878287JIU5M4KB8R_stats.2022.seagl.org_A] aws_route53_record.alias: Refreshing state... [id=Z0173878287JIU5M4KB8R_alias.seagl.org_CNAME] data.aws_vpc.vpc: Reading... aws_route53_record.meet: Refreshing state... [id=Z0173878287JIU5M4KB8R_meet.seagl.org_A] module.prod_db.aws_db_subnet_group.osem: Refreshing state... [id=osem] aws_route53_record.matrix-2022: Refreshing state... [id=Z0173878287JIU5M4KB8R_matrix.2022.seagl.org_A] aws_ses_domain_identity.seagl: Refreshing state... [id=seagl.org] aws_route53_record.osem-static: Refreshing state... [id=Z0173878287JIU5M4KB8R_osem-static.seagl.org_CNAME] module.prod_db.aws_secretsmanager_secret.osem-db-pass: Refreshing state... [id=arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS] aws_instance.dokku: Refreshing state... [id=i-02ee81d4bd0860d30] aws_s3_bucket.state: Refreshing state... [id=seagl-terraform] aws_route53_record.route_53_dmarc_txt: Refreshing state... [id=Z0173878287JIU5M4KB8R__dmarc.seagl.org_TXT] aws_ses_domain_identity.email_domain_identity: Refreshing state... [id=seagl.org] aws_ses_email_identity.email: Refreshing state... [id=sre@seagl.org] aws_route53_record.seagl_amazonses_verification_record: Refreshing state... [id=Z0173878287JIU5M4KB8R__amazonses.seagl.org_TXT] module.prod_db.aws_secretsmanager_secret_version.osem-db-pass-val: Refreshing state... [id=arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS|5E8ED816-E9AA-4E8E-A382-2EEE9FC74A66] aws_ses_domain_dkim.email_dkim: Refreshing state... [id=seagl.org] aws_route53_record.email_dkim_records[2]: Refreshing state... [id=Z0173878287JIU5M4KB8R_o7o3tsrrlwgkmmx3a7f5njkrvi75woso._domainkey.seagl.org_CNAME] aws_route53_record.email_dkim_records[0]: Refreshing state... [id=Z0173878287JIU5M4KB8R_nldzqxeyq5fyslu3tzvj4ltbwbexupuj._domainkey.seagl.org_CNAME] aws_route53_record.email_dkim_records[1]: Refreshing state... [id=Z0173878287JIU5M4KB8R_zjerfwsrr5wpwp5p5klnsrrzp6ralpcp._domainkey.seagl.org_CNAME] data.aws_vpc.vpc: Read complete after 2s [id=vpc-231ecb46] module.prod_db.aws_security_group.osem_rds_security_group: Refreshing state... [id=sg-006c493d98f3c7f1a] module.prod_db.aws_security_group_rule.private_in: Refreshing state... [id=sgrule-3182957500] module.prod_db.aws_db_instance.osem: Refreshing state... [id=osem] module.prod_db.aws_security_group_rule.private_out: Refreshing state... [id=sgrule-1612436969] aws_s3_bucket_public_access_block.state: Refreshing state... [id=seagl-terraform] aws_s3_bucket_versioning.state: Refreshing state... [id=seagl-terraform] Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: # aws_route53_record.matrix-2022 will be created + resource "aws_route53_record" "matrix-2022" { + allow_overwrite = (known after apply) + fqdn = (known after apply) + id = (known after apply) + name = "matrix.2022.seagl.org" + records = [ + "140.211.166.230", ] + ttl = 300 + type = "A" + zone_id = "Z0173878287JIU5M4KB8R" } # aws_route53_record.meet will be created + resource "aws_route53_record" "meet" { + allow_overwrite = (known after apply) + fqdn = (known after apply) + id = (known after apply) + name = "meet.seagl.org" + records = [ + "165.232.147.20", ] + ttl = 300 + type = "A" + zone_id = "Z0173878287JIU5M4KB8R" } # aws_route53_record.osem-static will be created + resource "aws_route53_record" "osem-static" { + allow_overwrite = (known after apply) + fqdn = (known after apply) + id = (known after apply) + name = "osem-static.seagl.org" + records = [ + "seagl.github.io.", ] + ttl = 300 + type = "CNAME" + zone_id = "Z0173878287JIU5M4KB8R" } # aws_route53_record.stats-2022 will be created + resource "aws_route53_record" "stats-2022" { + allow_overwrite = (known after apply) + fqdn = (known after apply) + id = (known after apply) + name = "stats.2022.seagl.org" + records = [ + "140.211.166.230", ] + ttl = 300 + type = "A" + zone_id = "Z0173878287JIU5M4KB8R" } # aws_db_instance.osem has moved to module.prod_db.aws_db_instance.osem resource "aws_db_instance" "osem" { id = "osem" name = "osem" tags = {} # (56 unchanged attributes hidden) } # aws_db_subnet_group.osem has moved to module.prod_db.aws_db_subnet_group.osem resource "aws_db_subnet_group" "osem" { id = "osem" name = "osem" tags = {} # (4 unchanged attributes hidden) } # aws_secretsmanager_secret.osem-db-pass has moved to module.prod_db.aws_secretsmanager_secret.osem-db-pass resource "aws_secretsmanager_secret" "osem-db-pass" { id = "arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS" name = "db-pass-osem" tags = {} # (5 unchanged attributes hidden) } # aws_secretsmanager_secret_version.osem-db-pass-val has moved to module.prod_db.aws_secretsmanager_secret_version.osem-db-pass-val resource "aws_secretsmanager_secret_version" "osem-db-pass-val" { id = "arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS|5E8ED816-E9AA-4E8E-A382-2EEE9FC74A66" # (6 unchanged attributes hidden) } # aws_security_group.osem_rds_security_group has moved to module.prod_db.aws_security_group.osem_rds_security_group resource "aws_security_group" "osem_rds_security_group" { id = "sg-006c493d98f3c7f1a" name = "osem-private-sg" tags = { "ManagedBy" = "terraform" "Name" = "osem--private-sg" "Role" = "private" } # (8 unchanged attributes hidden) } # aws_security_group_rule.private_in has moved to module.prod_db.aws_security_group_rule.private_in resource "aws_security_group_rule" "private_in" { id = "sgrule-3182957500" # (9 unchanged attributes hidden) } # aws_security_group_rule.private_out has moved to module.prod_db.aws_security_group_rule.private_out resource "aws_security_group_rule" "private_out" { id = "sgrule-1612436969" # (9 unchanged attributes hidden) } # random_password.osem_db_master_pass has moved to module.prod_db.random_password.osem_db_master_pass resource "random_password" "osem_db_master_pass" { id = "none" # (14 unchanged attributes hidden) } Plan: 4 to add, 0 to change, 0 to destroy. Warning: Argument is deprecated with aws_s3_bucket.state, on s3.tf line 1, in resource "aws_s3_bucket" "state": 1: resource "aws_s3_bucket" "state" { Use the aws_s3_bucket_versioning resource instead (and 3 more similar warnings elsewhere) ───────────────────────────────────────────────────────────────────────────── Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now. ```

Pushed by: @strugee, Action: pull_request

github-actions[bot] commented 1 year ago

Terraform Format and Style 🖌``

Terraform Initialization ⚙️success

Terraform Plan 📖failure

Terraform Validation 🤖success

Show Plan ``` terraform module.prod_db.random_password.osem_db_master_pass: Refreshing state... [id=none] aws_ses_email_identity.email: Refreshing state... [id=sre@seagl.org] module.prod_db.aws_secretsmanager_secret.osem-db-pass: Refreshing state... [id=arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS] aws_route53_record.route_53_dmarc_txt: Refreshing state... [id=Z0173878287JIU5M4KB8R__dmarc.seagl.org_TXT] aws_instance.dokku: Refreshing state... [id=i-02ee81d4bd0860d30] module.prod_db.aws_db_subnet_group.osem: Refreshing state... [id=osem] aws_ses_domain_identity.seagl: Refreshing state... [id=seagl.org] aws_ses_domain_identity.email_domain_identity: Refreshing state... [id=seagl.org] data.aws_vpc.vpc: Reading... aws_route53_record.route_53_root_txt: Refreshing state... [id=Z0173878287JIU5M4KB8R__TXT] aws_route53_record.alias: Refreshing state... [id=Z0173878287JIU5M4KB8R_alias.seagl.org_CNAME] aws_s3_bucket.state: Refreshing state... [id=seagl-terraform] aws_ses_domain_dkim.email_dkim: Refreshing state... [id=seagl.org] aws_route53_record.seagl_amazonses_verification_record: Refreshing state... [id=Z0173878287JIU5M4KB8R__amazonses.seagl.org_TXT] module.prod_db.aws_secretsmanager_secret_version.osem-db-pass-val: Refreshing state... [id=arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS|5E8ED816-E9AA-4E8E-A382-2EEE9FC74A66] aws_route53_record.email_dkim_records[2]: Refreshing state... [id=Z0173878287JIU5M4KB8R_o7o3tsrrlwgkmmx3a7f5njkrvi75woso._domainkey.seagl.org_CNAME] aws_route53_record.email_dkim_records[0]: Refreshing state... [id=Z0173878287JIU5M4KB8R_nldzqxeyq5fyslu3tzvj4ltbwbexupuj._domainkey.seagl.org_CNAME] aws_route53_record.email_dkim_records[1]: Refreshing state... [id=Z0173878287JIU5M4KB8R_zjerfwsrr5wpwp5p5klnsrrzp6ralpcp._domainkey.seagl.org_CNAME] data.aws_vpc.vpc: Read complete after 1s [id=vpc-231ecb46] module.prod_db.aws_security_group.osem_rds_security_group: Refreshing state... [id=sg-006c493d98f3c7f1a] module.prod_db.aws_security_group_rule.private_out: Refreshing state... [id=sgrule-1612436969] module.prod_db.aws_security_group_rule.private_in: Refreshing state... [id=sgrule-3182957500] module.prod_db.aws_db_instance.osem: Refreshing state... [id=osem] Warning: Argument is deprecated with aws_s3_bucket.state, on s3.tf line 1, in resource "aws_s3_bucket" "state": 1: resource "aws_s3_bucket" "state" { Use the aws_s3_bucket_versioning resource instead (and one more similar warning elsewhere) ```

Pushed by: @strugee, Action: pull_request

strugee commented 1 year ago

plan output is incomplete for some reason - here's what I got locally:

Terraform will perform the following actions:

  # aws_db_instance.osem has moved to module.prod_db.aws_db_instance.osem
    resource "aws_db_instance" "osem" {
        id                                    = "osem"
        name                                  = "osem"
        tags                                  = {}
        # (56 unchanged attributes hidden)
    }

  # aws_db_subnet_group.osem has moved to module.prod_db.aws_db_subnet_group.osem
    resource "aws_db_subnet_group" "osem" {
        id          = "osem"
        name        = "osem"
        tags        = {}
        # (4 unchanged attributes hidden)
    }

  # aws_secretsmanager_secret.osem-db-pass has moved to module.prod_db.aws_secretsmanager_secret.osem-db-pass
    resource "aws_secretsmanager_secret" "osem-db-pass" {
        id                             = "arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS"
        name                           = "db-pass-osem"
        tags                           = {}
        # (5 unchanged attributes hidden)
    }

  # aws_secretsmanager_secret_version.osem-db-pass-val has moved to module.prod_db.aws_secretsmanager_secret_version.osem-db-pass-val
    resource "aws_secretsmanager_secret_version" "osem-db-pass-val" {
        id             = "arn:aws:secretsmanager:us-west-2:663166083306:secret:db-pass-osem-5KW1mS|5E8ED816-E9AA-4E8E-A382-2EEE9FC74A66"
        # (6 unchanged attributes hidden)
    }

  # aws_security_group.osem_rds_security_group has moved to module.prod_db.aws_security_group.osem_rds_security_group
    resource "aws_security_group" "osem_rds_security_group" {
        id                     = "sg-006c493d98f3c7f1a"
        name                   = "osem-private-sg"
        tags                   = {
            "ManagedBy" = "terraform"
            "Name"      = "osem--private-sg"
            "Role"      = "private"
        }
        # (8 unchanged attributes hidden)
    }

  # aws_security_group_rule.private_in has moved to module.prod_db.aws_security_group_rule.private_in
    resource "aws_security_group_rule" "private_in" {
        id                = "sgrule-3182957500"
        # (9 unchanged attributes hidden)
    }

  # aws_security_group_rule.private_out has moved to module.prod_db.aws_security_group_rule.private_out
    resource "aws_security_group_rule" "private_out" {
        id                = "sgrule-1612436969"
        # (9 unchanged attributes hidden)
    }

  # random_password.osem_db_master_pass has moved to module.prod_db.random_password.osem_db_master_pass
    resource "random_password" "osem_db_master_pass" {
        id               = "none"
        # (14 unchanged attributes hidden)
    }

Plan: 0 to add, 0 to change, 0 to destroy.