Skip to content

feat: S3 버킷에서 KMS 모듈 분리#93

Closed
maybSubin wants to merge 31 commits intomainfrom
feat/#92
Closed

feat: S3 버킷에서 KMS 모듈 분리#93
maybSubin wants to merge 31 commits intomainfrom
feat/#92

Conversation

@maybSubin
Copy link
Contributor

#️⃣ Related Issues

e.g. #92

📝 Work Summary

state/s3 main.tf에서 kms 리소스 부분을 분리해 모듈화 진행함.

@github-actions
Copy link

Terraform Plan Output for operation-team-account/state/S3

[command]/home/runner/work/_temp/3037e715-6fa9-4c61-bda8-d72da3d5ca22/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for management-team-account/state/S3

[command]/home/runner/work/_temp/b17dd3a0-b474-40c0-9670-8496abc87145/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for security-team-account/state/S3

[command]/home/runner/work/_temp/b20c871a-3a56-4b23-9668-74e17da34ee9/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for stage-team-account/state/S3

[command]/home/runner/work/_temp/5edaac84-6a70-45ab-902a-d2e1f740e7e8/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for dev-team-account/state/S3

[command]/home/runner/work/_temp/b7eeda96-6c84-44c7-9502-5c18cb17d3b9/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

github-actions bot commented Jul 17, 2025

💰 Infracost report

Monthly estimate generated

This comment will be updated when code changes.

@github-actions
Copy link

Terraform Plan Output for prod-team-account/state/S3

[command]/home/runner/work/_temp/b8765651-bf12-4c29-8fae-299e14e9f948/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for identity-team-account/state/S3

[command]/home/runner/work/_temp/c3564ebc-8469-4252-afff-02e9e29f3b9e/terraform-bin show -no-color tfplan.binary

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
::debug::Terraform exited with code 0.
::debug::stdout: %0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ANo changes. Your infrastructure matches the configuration.%0A%0ATerraform has compared your real infrastructure against your configuration%0Aand found no differences, so no changes are needed.%0A

::set-output name=stderr::

::set-output name=exitcode::0

rnjsdbwlsqwer and others added 9 commits July 18, 2025 16:42
* OIDC 코드화

* OIDC 코드화

* 포맷 체크

* prod 수정

* no changes 수정, ci 코드 수정

* 폴더 이름 변경

* 폴더 이름 변경

* 폴더 이름 변경

* 폴더 이름 변경

* pr comment 글자 깨짐 수정

* pr comment 글자 깨짐 수정
@github-actions
Copy link

Terraform Plan Output for stage-team-account/state/S3

[command]/home/runner/work/_temp/6715012e-7738-48a9-a91d-e2caf6ea5e34/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::929368846645:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "929368846645"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-stage-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::929368846645:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "929368846645"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::929368846645:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "929368846645"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-stage-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:929368846645:key/c8435eb8-8f67-4099-8458-408b257cf98f" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::929368846645:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "929368846645"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-stage-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for prod-team-account/state/S3

[command]/home/runner/work/_temp/16f757e5-724a-49fd-a7e1-8b235be81196/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::243359234795:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "243359234795"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-prod-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::243359234795:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "243359234795"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::243359234795:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "243359234795"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-prod-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:243359234795:key/59bd9d62-c3a3-4ee1-8a07-3ff29240bda6" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::243359234795:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "243359234795"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-prod-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for dev-team-account/state/S3

[command]/home/runner/work/_temp/921f7f32-a1a8-4ae3-8afd-94c7715ab815/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::926943999891:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "926943999891"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-dev-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::926943999891:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "926943999891"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::926943999891:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "926943999891"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-dev-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:926943999891:key/07eb38dc-876f-4e2e-aa3f-5696eb002c4e" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::926943999891:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "926943999891"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-dev-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for management-team-account/state/S3

[command]/home/runner/work/_temp/fd27888c-1208-49f8-925f-5c3048ab1d4a/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::433331841346:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "433331841346"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-management-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::433331841346:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "433331841346"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::433331841346:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "433331841346"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-management-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:433331841346:key/3a397c36-771b-4098-aca9-fa207dbe78bf" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::433331841346:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "433331841346"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-management-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for identity-team-account/state/S3

[command]/home/runner/work/_temp/e93e1fca-d0ce-4658-a84d-af7f150a3a1b/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::193186106478:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "193186106478"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-identity-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::193186106478:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "193186106478"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::193186106478:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "193186106478"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-identity-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:193186106478:key/e71febcc-95fb-47b6-806d-d2c4f1736852" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::193186106478:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "193186106478"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-identity-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for security-team-account/state/S3

[command]/home/runner/work/_temp/c1065a3e-a5ba-499f-823b-c740e5aba2f7/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::694318440367:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "694318440367"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-security-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::694318440367:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "694318440367"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::694318440367:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "694318440367"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-security-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:694318440367:key/6639b83c-63a8-46bd-8c81-ffa92ccd0e5e" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::694318440367:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "694318440367"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-security-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

Terraform Plan Output for operation-team-account/state/S3

[command]/home/runner/work/_temp/fbd25065-235f-4d94-8ce4-822c9df1bf26/terraform-bin show -no-color tfplan.binary

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.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::502676416967:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "502676416967"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-operation-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::502676416967:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "502676416967"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

::set-output name=stdout::%0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A  - destroy%0A%0ATerraform will perform the following actions:%0A%0A  # aws_kms_key.s3_key will be destroyed%0A  # (because aws_kms_key.s3_key is not in configuration)%0A  - resource "aws_kms_key" "s3_key" {%0A      - arn                                = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A      - bypass_policy_lockout_safety_check = false -> null%0A      - customer_master_key_spec           = "SYMMETRIC_DEFAULT" -> null%0A      - description                        = "KMS key for S3 encryption" -> null%0A      - enable_key_rotation                = true -> null%0A      - id                                 = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A      - is_enabled                         = true -> null%0A      - key_id                             = "f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A      - key_usage                          = "ENCRYPT_DECRYPT" -> null%0A      - multi_region                       = false -> null%0A      - policy                             = jsonencode(%0A            {%0A              - Statement = [%0A                  - {%0A                      - Action    = "kms:*"%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - AWS = "arn:aws:iam::502676416967:root"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  - {%0A                      - Action    = [%0A                          - "kms:Encrypt",%0A                          - "kms:Decrypt",%0A                          - "kms:ReEncrypt*",%0A                          - "kms:GenerateDataKey*",%0A                          - "kms:DescribeKey",%0A                        ]%0A                      - Condition = {%0A                          - StringEquals = {%0A                              - "aws:SourceAccount" = "502676416967"%0A                              - "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"%0A                            }%0A                        }%0A                      - Effect    = "Allow"%0A                      - Principal = {%0A                          - Service = "s3.amazonaws.com"%0A                        }%0A                      - Resource  = "*"%0A                      - Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              - Version   = "2012-10-17"%0A            }%0A        ) -> null%0A      - region                             = "ap-northeast-2" -> null%0A      - rotation_period_in_days            = 365 -> null%0A      - tags                               = {} -> null%0A      - tags_all                           = {} -> null%0A    }%0A%0A  # aws_s3_bucket_server_side_encryption_configuration.encryption will be updated in-place%0A  ~ resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {%0A        id     = "cloudfence-operation-state"%0A        # (2 unchanged attributes hidden)%0A%0A      - rule {%0A          - bucket_key_enabled = false -> null%0A%0A          - apply_server_side_encryption_by_default {%0A              - kms_master_key_id = "arn:aws:kms:ap-northeast-2:502676416967:key/f24ee61f-bbd1-40b9-8dd4-042d14e585b7" -> null%0A              - sse_algorithm     = "aws:kms" -> null%0A            }%0A        }%0A      + rule {%0A          + apply_server_side_encryption_by_default {%0A              + kms_master_key_id = (known after apply)%0A              + sse_algorithm     = "aws:kms"%0A            }%0A        }%0A    }%0A%0A  # module.s3_kms.aws_kms_key.this will be created%0A  + resource "aws_kms_key" "this" {%0A      + arn                                = (known after apply)%0A      + bypass_policy_lockout_safety_check = false%0A      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"%0A      + description                        = "KMS key for S3 encryption"%0A      + enable_key_rotation                = true%0A      + id                                 = (known after apply)%0A      + is_enabled                         = true%0A      + key_id                             = (known after apply)%0A      + key_usage                          = "ENCRYPT_DECRYPT"%0A      + multi_region                       = (known after apply)%0A      + policy                             = jsonencode(%0A            {%0A              + Statement = [%0A                  + {%0A                      + Action    = "kms:*"%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + AWS = "arn:aws:iam::502676416967:root"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowRootAccountFullAccess"%0A                    },%0A                  + {%0A                      + Action    = [%0A                          + "kms:Encrypt",%0A                          + "kms:Decrypt",%0A                          + "kms:ReEncrypt*",%0A                          + "kms:GenerateDataKey*",%0A                          + "kms:DescribeKey",%0A                        ]%0A                      + Condition = {%0A                          + StringEquals = {%0A                              + "aws:SourceAccount" = "502676416967"%0A                              + "aws:SourceArn"     = "arn:aws:s3:::cloudfence-operation-state"%0A                            }%0A                        }%0A                      + Effect    = "Allow"%0A                      + Principal = {%0A                          + Service = "s3.amazonaws.com"%0A                        }%0A                      + Resource  = "*"%0A                      + Sid       = "AllowS3ServicePrincipal"%0A                    },%0A                ]%0A              + Version   = "2012-10-17"%0A            }%0A        )%0A      + region                             = "ap-northeast-2"%0A      + rotation_period_in_days            = (known after apply)%0A      + tags_all                           = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A

::set-output name=stderr::

::set-output name=exitcode::0

@github-actions
Copy link

[Terraform Plan Summary]

항목
Status success
Directory management-team-account/state/S3
Executed At 2025-07-28 05:01:09 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:01:11 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:01:11 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 identity-team-account/state/S3
Executed At 2025-07-28 05:01:11 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 security-team-account/state/S3
Executed At 2025-07-28 05:01:12 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:01:15 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 prod-team-account/state/S3
Executed At 2025-07-28 05:01:14 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)


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.

3 participants