Skip to content

Feat/#92: KMS 분리 후 모듈화, CI 코드 수정#97

Closed
imyourhopeee wants to merge 7 commits intomainfrom
feat/#92
Closed

Feat/#92: KMS 분리 후 모듈화, CI 코드 수정#97
imyourhopeee wants to merge 7 commits intomainfrom
feat/#92

Conversation

@imyourhopeee
Copy link
Contributor

#️⃣ Related Issues

e.g. #92

📝 Work Summary

  • state/s3 main.tf에서 kms 리소스 부분을 분리해 모듈화 진행
  • CI 코드에서 tfsec을 통해 low,medium을 감지하기 위해 다시 실행되는 tfsec 스캔 부분 수정, infracost comment 변경

@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory management-team-account/state/S3
Executed At 2025-07-28 05:32:21 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
      - is_enabled                         = true -> null
      - key_id                             = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::433331841346:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "433331841346"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-management-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::433331841346:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "433331841346"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory identity-team-account/state/S3
Executed At 2025-07-28 05:32:22 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
      - is_enabled                         = true -> null
      - key_id                             = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::193186106478:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "193186106478"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-identity-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::193186106478:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "193186106478"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory operation-team-account/state/S3
Executed At 2025-07-28 05:32:21 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
      - is_enabled                         = true -> null
      - key_id                             = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::502676416967:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "502676416967"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-operation-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::502676416967:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "502676416967"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory stage-team-account/state/S3
Executed At 2025-07-28 05:32:21 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null
      - is_enabled                         = true -> null
      - key_id                             = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::929368846645:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "929368846645"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-stage-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::929368846645:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "929368846645"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory dev-team-account/state/S3
Executed At 2025-07-28 05:32:24 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
      - is_enabled                         = true -> null
      - key_id                             = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::926943999891:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "926943999891"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-dev-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::926943999891:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "926943999891"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory security-team-account/state/S3
Executed At 2025-07-28 05:32:22 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
      - is_enabled                         = true -> null
      - key_id                             = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::694318440367:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "694318440367"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-security-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::694318440367:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "694318440367"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory prod-team-account/state/S3
Executed At 2025-07-28 05:32:22 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
      - is_enabled                         = true -> null
      - key_id                             = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::243359234795:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "243359234795"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-prod-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::243359234795:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "243359234795"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

github-actions bot commented Jul 28, 2025

💰 Infracost report

Monthly estimate increased by - 📈

This comment will be updated when code changes.

@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory identity-team-account/state/S3
Executed At 2025-07-28 05:45:48 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
      - is_enabled                         = true -> null
      - key_id                             = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::193186106478:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "193186106478"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-identity-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::193186106478:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "193186106478"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory prod-team-account/state/S3
Executed At 2025-07-28 05:45:48 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
      - is_enabled                         = true -> null
      - key_id                             = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::243359234795:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "243359234795"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-prod-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::243359234795:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "243359234795"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory stage-team-account/state/S3
Executed At 2025-07-28 05:45:48 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null
      - is_enabled                         = true -> null
      - key_id                             = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::929368846645:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "929368846645"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-stage-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::929368846645:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "929368846645"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory security-team-account/state/S3
Executed At 2025-07-28 05:45:49 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
      - is_enabled                         = true -> null
      - key_id                             = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::694318440367:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "694318440367"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-security-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::694318440367:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "694318440367"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory dev-team-account/state/S3
Executed At 2025-07-28 05:45:50 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
      - is_enabled                         = true -> null
      - key_id                             = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::926943999891:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "926943999891"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-dev-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::926943999891:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "926943999891"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory management-team-account/state/S3
Executed At 2025-07-28 05:45:47 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
      - is_enabled                         = true -> null
      - key_id                             = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::433331841346:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "433331841346"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-management-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::433331841346:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "433331841346"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory operation-team-account/state/S3
Executed At 2025-07-28 05:45:47 UTC

Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_kms_key.s3_key will be destroyed
  # (because aws_kms_key.s3_key is not in configuration)
  - resource "aws_kms_key" "s3_key" {
      - arn                                = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
      - bypass_policy_lockout_safety_check = false -> null
      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null
      - description                        = "KMS key for S3 encryption" -> null
      - enable_key_rotation                = true -> null
      - id                                 = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
      - is_enabled                         = true -> null
      - key_id                             = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
      - key_usage                          = "ENCRYPT_DECRYPT" -> null
      - multi_region                       = false -> null
      - policy                             = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "kms:*"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = "arn:aws:iam::502676416967:root"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowRootAccountFullAccess"
                    },
                  - {
                      - Action    = [
                          - "kms:Encrypt",
                          - "kms:Decrypt",
                          - "kms:ReEncrypt*",
                          - "kms:GenerateDataKey*",
                          - "kms:DescribeKey",
                        ]
                      - Condition = {
                          - StringEquals = {
                              - "aws:SourceAccount" = "502676416967"
                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "s3.amazonaws.com"
                        }
                      - Resource  = "*"
                      - Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - region                             = "ap-northeast-2" -> null
      - rotation_period_in_days            = 365 -> null
      - tags                               = {} -> null
      - tags_all                           = {} -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place
  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
        id     = "cloudfence-operation-state"
        # (2 unchanged attributes hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null
              - sse_algorithm     = "aws:kms" -> null
            }
        }
      + rule {
          + apply_server_side_encryption_by_default {
              + kms_master_key_id = (known after apply)
              + sse_algorithm     = "aws:kms"
            }
        }
    }

  # module.s3_kms.aws_kms_key.this will be created
  + resource "aws_kms_key" "this" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "KMS key for S3 encryption"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + multi_region                       = (known after apply)
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::502676416967:root"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowRootAccountFullAccess"
                    },
                  + {
                      + Action    = [
                          + "kms:Encrypt",
                          + "kms:Decrypt",
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:DescribeKey",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:SourceAccount" = "502676416967"
                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "s3.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "AllowS3ServicePrincipal"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + region                             = "ap-northeast-2"
      + rotation_period_in_days            = (known after apply)
      + tags_all                           = (known after apply)
    }

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

Plan Error (if any)


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