Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating dev dns manager AWS role #1538

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

ben851
Copy link
Contributor

@ben851 ben851 commented Sep 13, 2024

Summary | Résumé

This will hopefully allow github dev plan to talk to staging DNS

Related Issues | Cartes liées

TF Var environment consolidation

Before merging this PR

Read code suggestions left by the
cds-ai-codereviewer bot. Address
valid suggestions and shortly write down reasons to not address others. To help
with the classification of the comments, please use these reactions on each of the
comments made by the AI review:

Classification Reaction Emoticon
Useful +1 👍
Noisy eyes 👀
Hallucination confused 😕
Wrong but teachable rocket 🚀
Wrong and incorrect -1 👎

The classifications will be extracted and summarized into an analysis of how helpful
or not the AI code review really is.

Test instructions | Instructions pour tester la modification

TF Apply works
Test TF plan in environment consolidation branch

Release Instructions | Instructions pour le déploiement

None.

Reviewer checklist | Liste de vérification du réviseur

  • This PR does not break existing functionality.
  • This PR does not violate GCNotify's privacy policies.
  • This PR does not raise new security concerns. Refer to our GC Notify Risk Register document on our Google drive.
  • This PR does not significantly alter performance.
  • Additional required documentation resulting of these changes is covered (such as the README, setup instructions, a related ADR or the technical documentation).

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

@ben851 ben851 requested a review from a team September 13, 2024 14:59
@@ -157,21 +157,23 @@ resource "aws_iam_role" "dev_dns_manager" {
count = var.env == "staging" ? 1 : 0
name = "dev_dns_manager_role"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The count argument is set to 1 only if var.env is staging. If the intention is to update the dev DNS manager role, ensure that this condition aligns with the intended environment. Otherwise, consider adjusting the condition to include the development environment.

Principal = {
AWS = [
"800095993820",
"arn:aws:iam::800095993820:role/notification-terraform-apply",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ARN arn:aws:sts::800095993820:assumed-role/notification-terraform-plan/NotifyTerraformPlan seems to be an assumed role ARN. Verify that this ARN is correct and intended for the Principal section.

Copy link

Staging: dns

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 0 to add, 1 to change, 0 to destroy
Show summary
CHANGE NAME
update aws_iam_role.dev_dns_manager[0]
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_iam_role.dev_dns_manager[0] will be updated in-place
  ~ resource "aws_iam_role" "dev_dns_manager" {
      ~ assume_role_policy    = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Principal = {
                          ~ AWS = "800095993820" -> [
                              + "800095993820",
                              + "arn:aws:iam::800095993820:role/notification-terraform-apply",
                              + "arn:aws:iam::800095993820:role/notification-terraform-plan",
                              + "arn:aws:sts::800095993820:assumed-role/notification-terraform-plan/NotifyTerraformPlan",
                            ]
                        }
                      - Sid       = ""
                        # (2 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        id                    = "dev_dns_manager_role"
        name                  = "dev_dns_manager_role"
        tags                  = {}
        # (8 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.internal_dns"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.dev_dns_manager[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.production_dns_manager[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.sandbox_dns_manager[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.scratch_dns_manager[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.staging_dns_manager[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_route53_zone.internal_dns"]
WARN - plan.json - main - Missing Common Tags: ["aws_route53_zone.notification-sandbox[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.internal_dns_cert_base64"]
WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.internal_dns_fqdn"]
WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.internal_dns_key_base64"]

30 tests, 19 passed, 11 warnings, 0 failures, 0 exceptions

Copy link
Contributor

@P0NDER0SA P0NDER0SA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I'll use variables for the account ids in my PR once i pull this in :)

@P0NDER0SA P0NDER0SA merged commit bc4d861 into main Sep 13, 2024
26 checks passed
@P0NDER0SA P0NDER0SA deleted the dev-dns-manager-role-update branch September 13, 2024 15:02
@ben851
Copy link
Contributor Author

ben851 commented Sep 13, 2024

Awesome! I'll use variables for the account ids in my PR once i pull this in :)

Yeah I was lazy and wanted to make sure this worked first

ben851 added a commit that referenced this pull request Sep 13, 2024
P0NDER0SA pushed a commit that referenced this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants