Skip to content

Conversation

@marcoieni
Copy link
Member

@marcoieni marcoieni commented Mar 27, 2025

sync-team now runs from the team repo in GitHub Actions.

Plan


Terraform will perform the following actions:

  # aws_codebuild_project.sync_team will be destroyed
  # (because aws_codebuild_project.sync_team is not in configuration)
  - resource "aws_codebuild_project" "sync_team" {
      - arn                    = "arn:aws:codebuild:us-west-1:890664054962:project/sync-team" -> null
      - badge_enabled          = false -> null
      - build_timeout          = 30 -> null
      - concurrent_build_limit = 0 -> null
      - description            = "Execution of rust-lang/sync-team with production credentials." -> null
      - encryption_key         = "arn:aws:kms:us-west-1:890664054962:alias/aws/s3" -> null
      - id                     = "arn:aws:codebuild:us-west-1:890664054962:project/sync-team" -> null
      - name                   = "sync-team" -> null
      - project_visibility     = "PRIVATE" -> null
      - queued_timeout         = 480 -> null
      - service_role           = "arn:aws:iam::890664054962:role/codebuild--sync-team" -> null
      - tags                   = {} -> null
      - tags_all               = {} -> null

      - artifacts {
          - encryption_disabled    = false -> null
          - override_artifact_name = false -> null
          - type                   = "NO_ARTIFACTS" -> null
        }

      - cache {
          - modes = [] -> null
          - type  = "NO_CACHE" -> null
        }

      - environment {
          - compute_type                = "BUILD_GENERAL1_SMALL" -> null
          - image                       = "890664054962.dkr.ecr.us-west-1.amazonaws.com/sync-team" -> null
          - image_pull_credentials_type = "SERVICE_ROLE" -> null
          - privileged_mode             = false -> null
          - type                        = "LINUX_CONTAINER" -> null

          - environment_variable {
              - name  = "GITHUB_TOKEN" -> null
              - type  = "PARAMETER_STORE" -> null
              - value = "/prod/sync-team/github-token" -> null
            }
          - environment_variable {
              - name  = "MAILGUN_API_TOKEN" -> null
              - type  = "PARAMETER_STORE" -> null
              - value = "/prod/sync-team/mailgun-api-token" -> null
            }
          - environment_variable {
              - name  = "EMAIL_ENCRYPTION_KEY" -> null
              - type  = "PARAMETER_STORE" -> null
              - value = "/prod/sync-team/email-encryption-key" -> null
            }
          - environment_variable {
              - name  = "ZULIP_USERNAME" -> null
              - type  = "PARAMETER_STORE" -> null
              - value = "/prod/sync-team/zulip-username" -> null
            }
          - environment_variable {
              - name  = "ZULIP_API_TOKEN" -> null
              - type  = "PARAMETER_STORE" -> null
              - value = "/prod/sync-team/zulip-api-token" -> null
            }
        }

      - logs_config {
          - cloudwatch_logs {
              - group_name = "/sync-team" -> null
              - status     = "ENABLED" -> null
            }
          - s3_logs {
              - encryption_disabled = false -> null
              - status              = "DISABLED" -> null
            }
        }

      - source {
          - buildspec           = <<-EOT
                ---
                version: 0.2
                phases:
                  build:
                    commands:
                      - sync-team apply
            EOT -> null
          - git_clone_depth     = 0 -> null
          - insecure_ssl        = false -> null
          - report_build_status = false -> null
          - type                = "NO_SOURCE" -> null
        }
    }

  # aws_iam_policy.start_sync_team_policy will be destroyed
  # (because aws_iam_policy.start_sync_team_policy is not in configuration)
  - resource "aws_iam_policy" "start_sync_team_policy" {
      - arn              = "arn:aws:iam::890664054962:policy/start-sync-team-policy" -> null
      - attachment_count = 2 -> null
      - id               = "arn:aws:iam::890664054962:policy/start-sync-team-policy" -> null
      - name             = "start-sync-team-policy" -> null
      - path             = "/" -> null
      - policy           = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = "lambda:InvokeFunction"
                      - Effect   = "Allow"
                      - Resource = "arn:aws:lambda:us-west-1:890664054962:function:start-sync-team"
                      - Sid      = "InvokeLambda"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - policy_id        = "ANPA46X5W6CZJYRYHZ6LQ" -> null
      - tags             = {} -> null
      - tags_all         = {} -> null
    }

  # aws_iam_role.start_execution will be destroyed
  # (because aws_iam_role.start_execution is not in configuration)
  - resource "aws_iam_role" "start_execution" {
      - arn                   = "arn:aws:iam::890664054962:role/start-sync-team" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRole"
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = [
                              - "lambda.amazonaws.com",
                              - "events.amazonaws.com",
                            ]
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2020-06-25T12:47:12Z" -> null
      - force_detach_policies = false -> null
      - id                    = "start-sync-team" -> null
      - managed_policy_arns   = [] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "start-sync-team" -> null
      - path                  = "/" -> null
      - tags                  = {} -> null
      - tags_all              = {} -> null
      - unique_id             = "AROA46X5W6CZKKFSH4TQ4" -> null

      - inline_policy {
          - name   = "terraform-20200625124712761900000001" -> null
          - policy = jsonencode(
                {
                  - Statement = [
                      - {
                          - Action   = "codebuild:StartBuild"
                          - Effect   = "Allow"
                          - Resource = "arn:aws:codebuild:us-west-1:890664054962:project/sync-team"
                          - Sid      = "AllowStartBuild"
                        },
                    ]
                  - Version   = "2012-10-17"
                }
            ) -> null
        }
    }

  # aws_iam_role.sync_team will be destroyed
  # (because aws_iam_role.sync_team is not in configuration)
  - resource "aws_iam_role" "sync_team" {
      - arn                   = "arn:aws:iam::890664054962:role/codebuild--sync-team" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRole"
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "codebuild.amazonaws.com"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2020-06-25T13:37:28Z" -> null
      - force_detach_policies = false -> null
      - id                    = "codebuild--sync-team" -> null
      - managed_policy_arns   = [
          - "arn:aws:iam::890664054962:policy/ecr-pull-sync-team",
        ] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "codebuild--sync-team" -> null
      - path                  = "/" -> null
      - tags                  = {} -> null
      - tags_all              = {} -> null
      - unique_id             = "AROA46X5W6CZDWHD5NNNQ" -> null

      - inline_policy {
          - name   = "terraform-20200625133731042200000004" -> null
          - policy = jsonencode(
                {
                  - Statement = [
                      - {
                          - Action   = "ssm:GetParameters"
                          - Effect   = "Allow"
                          - Resource = [
                              - "arn:aws:ssm:us-west-1:890664054962:parameter/prod/sync-team/*",
                            ]
                          - Sid      = "AllowParameterStore"
                        },
                      - {
                          - Action   = [
                              - "logs:PutLogEvents",
                              - "logs:CreateLogStream",
                            ]
                          - Effect   = "Allow"
                          - Resource = "arn:aws:logs:us-west-1:890664054962:log-group:/sync-team:*"
                          - Sid      = "AllowLogs"
                        },
                    ]
                  - Version   = "2012-10-17"
                }
            ) -> null
        }
    }

  # aws_iam_role_policy.start_execution will be destroyed
  # (because aws_iam_role_policy.start_execution is not in configuration)
  - resource "aws_iam_role_policy" "start_execution" {
      - id          = "start-sync-team:terraform-20200625124712761900000001" -> null
      - name        = "terraform-20200625124712761900000001" -> null
      - name_prefix = "terraform-" -> null
      - policy      = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = "codebuild:StartBuild"
                      - Effect   = "Allow"
                      - Resource = "arn:aws:codebuild:us-west-1:890664054962:project/sync-team"
                      - Sid      = "AllowStartBuild"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - role        = "start-sync-team" -> null
    }

  # aws_iam_role_policy.sync_team will be destroyed
  # (because aws_iam_role_policy.sync_team is not in configuration)
  - resource "aws_iam_role_policy" "sync_team" {
      - id          = "codebuild--sync-team:terraform-20200625133731042200000004" -> null
      - name        = "terraform-20200625133731042200000004" -> null
      - name_prefix = "terraform-" -> null
      - policy      = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = "ssm:GetParameters"
                      - Effect   = "Allow"
                      - Resource = [
                          - "arn:aws:ssm:us-west-1:890664054962:parameter/prod/sync-team/*",
                        ]
                      - Sid      = "AllowParameterStore"
                    },
                  - {
                      - Action   = [
                          - "logs:PutLogEvents",
                          - "logs:CreateLogStream",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:logs:us-west-1:890664054962:log-group:/sync-team:*"
                      - Sid      = "AllowLogs"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - role        = "codebuild--sync-team" -> null
    }

  # aws_iam_role_policy_attachment.ci_sync_team_pull will be destroyed
  # (because aws_iam_role_policy_attachment.ci_sync_team_pull is not in configuration)
  - resource "aws_iam_role_policy_attachment" "ci_sync_team_pull" {
      - id         = "ci--rust-lang--sync-team-20220920221651251100000001" -> null
      - policy_arn = "arn:aws:iam::890664054962:policy/ecr-pull-sync-team" -> null
      - role       = "ci--rust-lang--sync-team" -> null
    }

  # aws_iam_role_policy_attachment.ci_sync_team_push will be destroyed
  # (because aws_iam_role_policy_attachment.ci_sync_team_push is not in configuration)
  - resource "aws_iam_role_policy_attachment" "ci_sync_team_push" {
      - id         = "ci--rust-lang--sync-team-20220920221651252400000002" -> null
      - policy_arn = "arn:aws:iam::890664054962:policy/ecr-push-sync-team" -> null
      - role       = "ci--rust-lang--sync-team" -> null
    }

  # aws_iam_role_policy_attachment.start_sync_team_sync_team_repo will be destroyed
  # (because aws_iam_role_policy_attachment.start_sync_team_sync_team_repo is not in configuration)
  - resource "aws_iam_role_policy_attachment" "start_sync_team_sync_team_repo" {
      - id         = "ci--rust-lang--sync-team-20221007125927303600000001" -> null
      - policy_arn = "arn:aws:iam::890664054962:policy/start-sync-team-policy" -> null
      - role       = "ci--rust-lang--sync-team" -> null
    }

  # aws_iam_role_policy_attachment.start_sync_team_team_repo will be destroyed
  # (because aws_iam_role_policy_attachment.start_sync_team_team_repo is not in configuration)
  - resource "aws_iam_role_policy_attachment" "start_sync_team_team_repo" {
      - id         = "ci--rust-lang--team-20221007125927353800000002" -> null
      - policy_arn = "arn:aws:iam::890664054962:policy/start-sync-team-policy" -> null
      - role       = "ci--rust-lang--team" -> null
    }

  # aws_iam_role_policy_attachment.sync_team_pull_ecr will be destroyed
  # (because aws_iam_role_policy_attachment.sync_team_pull_ecr is not in configuration)
  - resource "aws_iam_role_policy_attachment" "sync_team_pull_ecr" {
      - id         = "codebuild--sync-team-20200625133729822500000003" -> null
      - policy_arn = "arn:aws:iam::890664054962:policy/ecr-pull-sync-team" -> null
      - role       = "codebuild--sync-team" -> null
    }

  # module.ci_sync_team.aws_iam_role.ci_role will be destroyed
  # (because aws_iam_role.ci_role is not in configuration)
  - resource "aws_iam_role" "ci_role" {
      - arn                   = "arn:aws:iam::890664054962:role/ci--rust-lang--sync-team" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringEquals = {
                              - "token.actions.githubusercontent.com:sub" = "repo:rust-lang/sync-team:environment:deploy"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Federated = "arn:aws:iam::890664054962:oidc-provider/token.actions.githubusercontent.com"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2022-09-20T22:15:22Z" -> null
      - force_detach_policies = false -> null
      - id                    = "ci--rust-lang--sync-team" -> null
      - managed_policy_arns   = [
          - "arn:aws:iam::890664054962:policy/ecr-pull-sync-team",
          - "arn:aws:iam::890664054962:policy/ecr-push-sync-team",
          - "arn:aws:iam::890664054962:policy/start-sync-team-policy",
        ] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "ci--rust-lang--sync-team" -> null
      - path                  = "/" -> null
      - tags                  = {} -> null
      - tags_all              = {} -> null
      - unique_id             = "AROA46X5W6CZJL5A6CKAZ" -> null
    }

  # module.ci_team.aws_iam_role.ci_role will be destroyed
  # (because aws_iam_role.ci_role is not in configuration)
  - resource "aws_iam_role" "ci_role" {
      - arn                   = "arn:aws:iam::890664054962:role/ci--rust-lang--team" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringEquals = {
                              - "token.actions.githubusercontent.com:sub" = "repo:rust-lang/team:environment:deploy"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Federated = "arn:aws:iam::890664054962:oidc-provider/token.actions.githubusercontent.com"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2022-09-20T22:15:22Z" -> null
      - force_detach_policies = false -> null
      - id                    = "ci--rust-lang--team" -> null
      - managed_policy_arns   = [
          - "arn:aws:iam::890664054962:policy/start-sync-team-policy",
        ] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "ci--rust-lang--team" -> null
      - path                  = "/" -> null
      - tags                  = {} -> null
      - tags_all              = {} -> null
      - unique_id             = "AROA46X5W6CZJDLCGSN7I" -> null
    }

  # module.lambda_start_sync_team.aws_lambda_function.lambda will be destroyed
  # (because aws_lambda_function.lambda is not in configuration)
  - resource "aws_lambda_function" "lambda" {
      - architectures                  = [
          - "x86_64",
        ] -> null
      - arn                            = "arn:aws:lambda:us-west-1:890664054962:function:start-sync-team" -> null
      - code_sha256                    = "/kPb7jMhyhWKwCG4CW8pScpB+aHx3OrrGEaIRSWAzvU=" -> null
      - filename                       = "../shared/modules/lambda/packages/us-west-1/start-sync-team.zip" -> null
      - function_name                  = "start-sync-team" -> null
      - handler                        = "index.handler" -> null
      - id                             = "start-sync-team" -> null
      - invoke_arn                     = "arn:aws:apigateway:us-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-1:890664054962:function:start-sync-team/invocations" -> null
      - last_modified                  = "2024-10-01T12:49:37.000+0000" -> null
      - layers                         = [] -> null
      - memory_size                    = 128 -> null
      - package_type                   = "Zip" -> null
      - publish                        = true -> null
      - qualified_arn                  = "arn:aws:lambda:us-west-1:890664054962:function:start-sync-team:3" -> null
      - qualified_invoke_arn           = "arn:aws:apigateway:us-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-1:890664054962:function:start-sync-team:3/invocations" -> null
      - reserved_concurrent_executions = -1 -> null
      - role                           = "arn:aws:iam::890664054962:role/start-sync-team" -> null
      - runtime                        = "nodejs20.x" -> null
      - skip_destroy                   = false -> null
      - source_code_hash               = "/kPb7jMhyhWKwCG4CW8pScpB+aHx3OrrGEaIRSWAzvU=" -> null
      - source_code_size               = 285 -> null
      - tags                           = {} -> null
      - tags_all                       = {} -> null
      - timeout                        = 3 -> null
      - version                        = "3" -> null

      - ephemeral_storage {
          - size = 512 -> null
        }

      - logging_config {
          - log_format = "Text" -> null
          - log_group  = "/aws/lambda/start-sync-team" -> null
        }

      - tracing_config {
          - mode = "PassThrough" -> null
        }
    }

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

@marcoieni marcoieni force-pushed the remove-sync-team-aws-lambda branch from ec215eb to be0f2c5 Compare March 28, 2025 09:55
@marcoieni marcoieni marked this pull request as ready for review April 1, 2025 14:14
@marcoieni
Copy link
Member Author

Apply complete! Resources: 0 added, 0 changed, 14 destroyed.

@marcoieni marcoieni merged commit bf4afde into master Apr 1, 2025
3 checks passed
@marcoieni marcoieni deleted the remove-sync-team-aws-lambda branch April 1, 2025 14:20
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.

1 participant