Skip to content

Conversation

@bentoluizv
Copy link
Contributor

Refactor the default project name for consistency, add a lock file for AWS provider versioning, and remove unused S3 bucket permissions for clarity.

@github-actions
Copy link

Terraform Plan (dev)

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the
last "terraform apply" which may have affected this plan:

  # module.s3.aws_s3_bucket.certificates_bucket has been deleted
  - resource "aws_s3_bucket" "certificates_bucket" {
      - id            = "tech-floripa-certificates-dev-bucket" -> null
        tags          = {
            "Environment" = "dev"
            "Name"        = "tech-floripa-certificates-dev-bucket"
            "Project"     = "tech-floripa-certificates"
            "Region"      = "us-east-1"
        }
        # (4 unchanged attributes hidden)
    }


Unless you have made equivalent changes to your configuration, or ignored the
relevant attributes using ignore_changes, the following plan may include
actions to undo or respond to these changes.

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

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:

  # module.s3.aws_s3_bucket.certificates_bucket will be created
  + resource "aws_s3_bucket" "certificates_bucket" {
      + acceleration_status         = (known after apply)
      + acl                         = (known after apply)
      + arn                         = (known after apply)
      + bucket                      = "certificates-tech-floripa-dev-bucket"
      + bucket_domain_name          = (known after apply)
      + bucket_prefix               = (known after apply)
      + bucket_region               = (known after apply)
      + bucket_regional_domain_name = (known after apply)
      + force_destroy               = true
      + hosted_zone_id              = (known after apply)
      + id                          = (known after apply)
      + object_lock_enabled         = (known after apply)
      + policy                      = (known after apply)
      + region                      = "us-east-1"
      + request_payer               = (known after apply)
      + tags                        = {
          + "Environment" = "dev"
          + "Name"        = "certificates-tech-floripa-dev-bucket"
          + "Project"     = "certificates-tech-floripa"
          + "Region"      = "us-east-1"
        }
      + tags_all                    = {
          + "Environment" = "dev"
          + "ManagedBy"   = "terraform"
          + "Name"        = "certificates-tech-floripa-dev-bucket"
          + "Project"     = "certificates-tech-floripa"
          + "Region"      = "us-east-1"
        }
      + website_domain              = (known after apply)
      + website_endpoint            = (known after apply)

      + cors_rule (known after apply)

      + grant (known after apply)

      + lifecycle_rule (known after apply)

      + logging (known after apply)

      + object_lock_configuration (known after apply)

      + replication_configuration (known after apply)

      + server_side_encryption_configuration (known after apply)

      + versioning (known after apply)

      + website (known after apply)
    }

  # module.s3.aws_s3_bucket_lifecycle_configuration.certificates_bucket_lifecycle_config[0] will be created
  + resource "aws_s3_bucket_lifecycle_configuration" "certificates_bucket_lifecycle_config" {
      + bucket                                 = (known after apply)
      + expected_bucket_owner                  = (known after apply)
      + id                                     = (known after apply)
      + region                                 = "us-east-1"
      + transition_default_minimum_object_size = "all_storage_classes_128K"

      + rule {
          + id     = "lifecycle-rule"
          + status = "Enabled"
            # (1 unchanged attribute hidden)

          + expiration {
              + days                         = 90
              + expired_object_delete_marker = false
            }

          + filter {
              + prefix = "certificates/"
            }
        }
    }

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

Changes to Outputs:
  + s3_bucket_arn  = (known after apply)
  + s3_bucket_name = (known after apply)

@github-actions
Copy link

Terraform Plan (shared)

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place
 <= read (data resources)

Terraform will perform the following actions:

  # data.aws_iam_policy_document.github_action_assume_role will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_iam_policy_document" "github_action_assume_role" {
      + id            = (known after apply)
      + json          = (known after apply)
      + minified_json = (known after apply)

      + statement {
          + actions = [
              + "sts:AssumeRoleWithWebIdentity",
            ]
          + effect  = "Allow"

          + condition {
              + test     = "StringEquals"
              + values   = [
                  + "sts.amazonaws.com",
                ]
              + variable = "token.actions.githubusercontent.com:aud"
            }
          + condition {
              + test     = "StringLike"
              + values   = [
                  + "repo:PythonFloripa/certified-builder-infra-py:*",
                ]
              + variable = "token.actions.githubusercontent.com:sub"
            }

          + principals {
              + identifiers = [
                  + "arn:aws:iam::334318883918:oidc-provider/token.actions.githubusercontent.com",
                ]
              + type        = "Federated"
            }
        }
    }

  # aws_iam_openid_connect_provider.github_provider will be updated in-place
  ~ resource "aws_iam_openid_connect_provider" "github_provider" {
        id              = "arn:aws:iam::334318883918:oidc-provider/token.actions.githubusercontent.com"
      ~ tags            = {
          - "Project" = "tech-floripa-certificates" -> null
        }
      ~ tags_all        = {
          ~ "Project"     = "tech-floripa-certificates" -> "certificates-tech-floripa"
            # (2 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)
    }

  # aws_iam_policy.github_actions_policy will be updated in-place
  ~ resource "aws_iam_policy" "github_actions_policy" {
        id               = "arn:aws:iam::334318883918:policy/github-actions-policy"
        name             = "github-actions-policy"
      ~ policy           = jsonencode(
          ~ {
              ~ Statement = [
                    {
                        Action   = [
                            "iam:UntagRole",
                            "iam:TagRole",
                            "iam:SetDefaultPolicyVersion",
                            "iam:PutRolePolicy",
                            "iam:ListRolePolicies",
                            "iam:ListPolicyVersions",
                            "iam:ListAttachedRolePolicies",
                            "iam:GetRole",
                            "iam:GetPolicyVersion",
                            "iam:GetPolicy",
                            "iam:GetOpenIDConnectProvider",
                            "iam:DetachRolePolicy",
                            "iam:DeleteRolePolicy",
                            "iam:DeleteRole",
                            "iam:DeletePolicyVersion",
                            "iam:CreateRole",
                            "iam:CreatePolicyVersion",
                            "iam:AttachRolePolicy",
                        ]
                        Effect   = "Allow"
                        Resource = "*"
                    },
                  ~ {
                      ~ Resource = [
                          - "arn:aws:s3:::tech-floripa-plan-artifacts/*",
                          - "arn:aws:s3:::tech-floripa-plan-artifacts",
                          - "arn:aws:s3:::tech-floripa-certificates-dev-state/*",
                          - "arn:aws:s3:::tech-floripa-certificates-dev-state",
                          - "arn:aws:s3:::tech-floripa-certificates-dev-bucket/*",
                          - "arn:aws:s3:::tech-floripa-certificates-dev-bucket",
                          + "arn:aws:s3:::certificates-tech-floripa-dev-state/*",
                          + "arn:aws:s3:::certificates-tech-floripa-dev-state",
                          + "arn:aws:s3:::certificates-tech-floripa-dev-bucket/*",
                          + "arn:aws:s3:::certificates-tech-floripa-dev-bucket",
                        ]
                        # (2 unchanged attributes hidden)
                    },
                    {
                        Action   = [
                            "ecr:UntagResource",
                            "ecr:TagResource",
                            "ecr:PutLifecyclePolicy",
                            "ecr:PutImageTagMutability",
                            "ecr:PutImageScanningConfiguration",
                            "ecr:ListTagsForResource",
                            "ecr:GetLifecyclePolicy",
                            "ecr:DeleteRepository",
                            "ecr:DeleteLifecyclePolicy",
                            "ecr:CreateRepository",
                        ]
                        Effect   = "Allow"
                        Resource = [
                            "arn:aws:ecr:us-east-1:334318883918:repository/tech-floripa-certificates-notification-dev",
                            "arn:aws:ecr:us-east-1:334318883918:repository/tech-floripa-certificates-builder-dev",
                            "arn:aws:ecr:us-east-1:334318883918:repository/tech-floripa-certificates-api-dev",
                        ]
                    },
                    # (4 unchanged elements hidden)
                    {
                        Action   = "dynamodb:ListTables"
                        Effect   = "Allow"
                        Resource = "*"
                    },
                  ~ {
                      ~ Resource = [
                          ~ "arn:aws:lambda:us-east-1:334318883918:function:tech-floripa-certificates-notification-dev" -> "arn:aws:lambda:us-east-1:334318883918:function:certificates-tech-floripa-notification-dev",
                          ~ "arn:aws:lambda:us-east-1:334318883918:function:tech-floripa-certificates-builder-dev" -> "arn:aws:lambda:us-east-1:334318883918:function:certificates-tech-floripa-builder-dev",
                          ~ "arn:aws:lambda:us-east-1:334318883918:function:tech-floripa-certificates-api-dev" -> "arn:aws:lambda:us-east-1:334318883918:function:certificates-tech-floripa-api-dev",
                        ]
                        # (2 unchanged attributes hidden)
                    },
                    {
                        Action   = [
                            "lambda:ListTags",
                            "lambda:ListEventSourceMappings",
                        ]
                        Effect   = "Allow"
                        Resource = "*"
                    },
                    {
                        Action   = [
                            "apigateway:PUT",
                            "apigateway:POST",
                            "apigateway:PATCH",
                            "apigateway:GET",
                            "apigateway:DELETE",
                        ]
                        Effect   = "Allow"
                        Resource = "arn:aws:apigateway:us-east-1::/restapis/*"
                    },
                  ~ {
                      ~ Resource = [
                          ~ "arn:aws:logs:us-east-1:334318883918:log-group:/aws/lambda/tech-floripa-certificates-notification-dev" -> "arn:aws:logs:us-east-1:334318883918:log-group:/aws/lambda/certificates-tech-floripa-notification-dev",
                          ~ "arn:aws:logs:us-east-1:334318883918:log-group:/aws/lambda/tech-floripa-certificates-builder-dev" -> "arn:aws:logs:us-east-1:334318883918:log-group:/aws/lambda/certificates-tech-floripa-builder-dev",
                          ~ "arn:aws:logs:us-east-1:334318883918:log-group:/aws/lambda/tech-floripa-certificates-api-dev" -> "arn:aws:logs:us-east-1:334318883918:log-group:/aws/lambda/certificates-tech-floripa-api-dev",
                        ]
                        # (2 unchanged attributes hidden)
                    },
                    {
                        Action   = "logs:DescribeLogGroups"
                        Effect   = "Allow"
                        Resource = "*"
                    },
                    # (1 unchanged element hidden)
                ]
                # (1 unchanged attribute hidden)
            }
        )
      ~ tags             = {
          - "Project" = "tech-floripa-certificates" -> null
        }
      ~ tags_all         = {
          ~ "Project"     = "tech-floripa-certificates" -> "certificates-tech-floripa"
            # (2 unchanged elements hidden)
        }
        # (6 unchanged attributes hidden)
    }

  # aws_iam_role.github_actions_assume_role will be updated in-place
  ~ resource "aws_iam_role" "github_actions_assume_role" {
      ~ assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringEquals = {
                              - "token.actions.githubusercontent.com:aud" = "sts.amazonaws.com"
                            }
                          - StringLike   = {
                              - "token.actions.githubusercontent.com:sub" = "repo:PythonFloripa/certified-builder-infra-py:*"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Federated = "arn:aws:iam::334318883918:oidc-provider/token.actions.githubusercontent.com"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> (known after apply)
        id                    = "github-actions-assume-role"
        name                  = "github-actions-assume-role"
      ~ tags                  = {
          - "Project" = "tech-floripa-certificates" -> null
        }
      ~ tags_all              = {
          ~ "Project"     = "tech-floripa-certificates" -> "certificates-tech-floripa"
            # (2 unchanged elements hidden)
        }
        # (10 unchanged attributes hidden)
    }

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

@bentoluizv bentoluizv merged commit 859e93c into main Nov 30, 2025
2 checks passed
@maxsonferovante maxsonferovante deleted the fix-s3-bucket-dev branch November 30, 2025 23:34
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