Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Dso/add install git windows component #709

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

robertsweetman
Copy link
Contributor

  • add windows git install component
    • we're going to replace user-data scripts (mostly) by calling powershell modules from the modernisation-platform-configuration-management repo instead so need to run git commands on the Windows EC2 instances
  • remove failing parameters from 'powershell-core-server-2012' component
    • these packages/flags aren't available for server 2012 r2 (just tidies up the log output in EC2 Image Builder)
  • update the version(s) of everything so it'll all work

@robertsweetman robertsweetman requested review from a team as code owners February 12, 2024 09:40
Copy link
Contributor

commonimages/components terraform plan on pull_request event #244

data.aws_secretsmanager_secret.environment_management: Reading...
data.aws_secretsmanager_secret.environment_management: Read complete after 0s [id=<REDACTED>]
data.aws_secretsmanager_secret_version.environment_management: Reading...
data.aws_secretsmanager_secret_version.environment_management: Read complete after 0s [id=<REDACTED>]
data.aws_caller_identity.current: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=<REDACTED>]
data.aws_kms_key.hmpps_ebs_encryption_cmk: Reading...
data.aws_kms_key.hmpps_ebs_encryption_cmk: Read complete after 0s [id=<REDACTED>]
aws_imagebuilder_component.this["git_windows.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["python_3_6.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["psreadline_fix.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["prometheus_windows_exporter.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["powershell_core_server_2012.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["yum_packages.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["python_3_9.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["aws_cli.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["ansible.yml"]: Refreshing state... [id=<REDACTED>]

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

Terraform will perform the following actions:

  # aws_imagebuilder_component.this["ansible.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/ansible/0.0.11/1"
        name                  = "ansible"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["aws_cli.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/aws-cli/0.0.4/1"
        name                  = "aws_cli"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["chocolatey.yml"] will be created
  + resource "aws_imagebuilder_component" "this" {
      + arn          = (known after apply)
      + data         = <<-EOT
            ---
            name: chocolatey
            description: Component to install chocolatey
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
                  default: 0.0.4
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
            phases:
              - name: build
                steps:
                  - name: InstallChocolatey
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          if (Get-Command choco.exe -ErrorAction SilentlyContinue) {
                            Write-Host "Chocolatey already installed"
                            [System.Environment]::Exit(0)
                          } else {
                            Write-Host "Installing Chocolatey"
                            Set-ExecutionPolicy Bypass -Scope Process -Force
                            [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
                            Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
                            [System.Environment]::Exit(3010)
                          }
        EOT
      + date_created = (known after apply)
      + description  = "Component to install chocolatey"
      + encrypted    = (known after apply)
      + id           = (known after apply)
      + kms_key_id   = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
      + name         = "chocolatey"
      + owner        = (known after apply)
      + platform     = "Windows"
      + skip_destroy = false
      + tags         = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + tags_all     = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + type         = (known after apply)
      + version      = "0.0.4"
    }

  # aws_imagebuilder_component.this["git_windows.yml"] must be replaced
+/- resource "aws_imagebuilder_component" "this" {
      ~ arn                   = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.1/1" -> (known after apply)
      ~ data                  = <<-EOT # forces replacement
            ---
            name: git_windows
            description: Component to install Git for Windows
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
          -       default: 0.0.1
          +       default: 0.0.2
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
            phases:
              - name: build
                steps:
                  - name: InstallGitForWindows
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          choco install git.install -y
        EOT
      ~ date_created          = "2024-02-09T16:27:47.148Z" -> (known after apply)
      ~ encrypted             = true -> (known after apply)
      ~ id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.1/1" -> (known after apply)
        name                  = "git_windows"
      ~ owner                 = "374269020027" -> (known after apply)
      - supported_os_versions = [] -> null
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
      ~ type                  = "BUILD" -> (known after apply)
      ~ version               = "0.0.1" -> "0.0.2" # forces replacement
        # (4 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["powershell_core.yml"] will be created
  + resource "aws_imagebuilder_component" "this" {
      + arn          = (known after apply)
      + data         = <<-EOT
            ---
            name: powershell_core
            description: Component to upgrade to using PowerShell Core
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
                  default: 0.4.0
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
              - PowerShellCoreVersion:
                  type: string
                  default: 7.4.1
                  description: Version of the PowerShell Core to install
            phases:
              - name: build
                steps:
                  - name: InstallPowerShellCore
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          choco install -y chocolatey-core.extension
                          choco install -y kb3118401
                          choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=1"'
        EOT
      + date_created = (known after apply)
      + description  = "Component to upgrade to using PowerShell Core"
      + encrypted    = (known after apply)
      + id           = (known after apply)
      + kms_key_id   = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
      + name         = "powershell_core"
      + owner        = (known after apply)
      + platform     = "Windows"
      + skip_destroy = false
      + tags         = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + tags_all     = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + type         = (known after apply)
      + version      = "0.4.0"
    }

  # aws_imagebuilder_component.this["powershell_core_server_2012.yml"] must be replaced
+/- resource "aws_imagebuilder_component" "this" {
      ~ arn                   = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.3/1" -> (known after apply)
      ~ data                  = <<-EOT # forces replacement
            ---
            name: powershell_core_server_2012
            description: Component to install PowerShell Core on Windows Server 2012, has different command line flags as there are not supported packages for this version since Windows Server 2012 r2 is nearing EOL
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
          -       default: 0.0.3
          +       default: 0.4.0
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
              - PowerShellCoreVersion:
                  type: string
                  default: 7.4.1
                  description: Version of the PowerShell Core to install
            phases:
              - name: build
                steps:
                  - name: InstallPowerShellCore
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          choco install -y chocolatey-core.extension
                          choco install -y kb3118401
          -               choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 USE_MU=0 ENABLE_MU=0 ADD_PATH=1 DISABLE_TELEMETRY"'
          +               choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1"'
        EOT
      ~ date_created          = "2024-01-29T09:54:05.531Z" -> (known after apply)
      ~ encrypted             = true -> (known after apply)
      ~ id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.3/1" -> (known after apply)
        name                  = "powershell_core_server_2012"
      ~ owner                 = "374269020027" -> (known after apply)
      - supported_os_versions = [] -> null
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
      ~ type                  = "BUILD" -> (known after apply)
      ~ version               = "0.0.3" -> "0.4.0" # forces replacement
        # (4 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["prometheus_windows_exporter.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/prometheus-windows-exporter/1.1.7/1"
        name                  = "prometheus_windows_exporter"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["psreadline_fix.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/psreadline-fix/0.0.4/1"
        name                  = "psreadline_fix"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["python_3_6.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/python-3-6/0.0.4/1"
        name                  = "python_3_6"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["python_3_9.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/python-3-9/0.0.3/1"
        name                  = "python_3_9"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["yum_packages.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/yum-packages/0.0.1/1"
        name                  = "yum_packages"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

Plan: 4 to add, 7 to change, 2 to destroy.

Warning: Value for undeclared variable

The root module does not declare a variable named "account_to_distribute_ami"
but a value was found in file "terraform.tfvars". If you meant to use this
value, add a "variable" block to the configuration.

To silence these warnings, use TF_VAR_... environment variables to provide
certain "global" settings to all configurations in your organization. To
reduce the verbosity of these warnings, use the -compact-warnings option.

Copy link
Contributor

commonimages/base/windows_2012_r2 terragrunt plan on pull_request event #495

module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Reading...
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Reading...
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Read complete after 2s
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Read complete after 3s
module.imagebuilder.data.aws_caller_identity.current: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Reading...
module.imagebuilder.data.aws_ami.parent[0]: Reading...
module.imagebuilder.data.aws_caller_identity.current: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Reading...
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_ami.parent[0]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_recipe.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_distribution_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_pipeline.this: Refreshing state... [id=<REDACTED>]

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

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be updated in-place
  ~ resource "aws_imagebuilder_distribution_configuration" "this" {
        id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2"
        name         = "base_windows_server_2012_r2"
      ~ tags         = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all     = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      - distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
      + distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_pipeline.this must be replaced
-/+ resource "aws_imagebuilder_image_pipeline" "this" {
      ~ arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2" -> (known after apply)
      ~ date_created                     = "2024-02-09T16:31:14.246Z" -> (known after apply)
      ~ date_last_run                    = "2024-02-09T16:31:43.457Z" -> (known after apply)
      ~ date_next_run                    = "2024-03-01T00:00:00.000Z" -> (known after apply)
      ~ date_updated                     = "2024-02-09T16:31:14.246Z" -> (known after apply)
      ~ id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2" -> (known after apply)
      ~ image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.0" # forces replacement -> (known after apply) # forces replacement
      ~ infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-0" -> (known after apply)
        name                             = "base_windows_server_2012_r2"
      ~ platform                         = "Windows" -> (known after apply)
      ~ tags                             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all                         = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      ~ schedule {
          + timezone                           = (known after apply)
            # (2 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this must be replaced
+/- resource "aws_imagebuilder_image_recipe" "this" {
      ~ arn              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.0" -> (known after apply)
      ~ date_created     = "2024-02-09T16:31:13.232Z" -> (known after apply)
      ~ id               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.0" -> (known after apply)
        name             = "base_windows_server_2012_r2"
      ~ owner            = "374269020027" -> (known after apply)
      ~ platform         = "Windows" -> (known after apply)
      ~ tags             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all         = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
      + user_data_base64 = (known after apply)
      ~ version          = "0.2.0" -> "0.2.1" # forces replacement
        # (2 unchanged attributes hidden)

      - block_device_mapping {
          - device_name = "/dev/sda1" -> null
          - no_device   = false -> null

          - ebs {
              - delete_on_termination = "true" -> null
              - encrypted             = "true" -> null
              - iops                  = 0 -> null
              - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
              - throughput            = 0 -> null
              - volume_size           = 128 -> null
              - volume_type           = "gp3" -> null
            }
        }
      - block_device_mapping {
          - device_name = "/dev/sdb" -> null
          - no_device   = false -> null

          - ebs {
              - delete_on_termination = "true" -> null
              - encrypted             = "true" -> null
              - iops                  = 0 -> null
              - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
              - throughput            = 0 -> null
              - volume_size           = 100 -> null
              - volume_type           = "gp3" -> null
            }
        }
      + block_device_mapping {
          + device_name = "/dev/sda1"

          + ebs {
              + delete_on_termination = "true"
              + encrypted             = "true"
              + kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
              + volume_size           = 128
              + volume_type           = "gp3"
            }
        }
      + block_device_mapping {
          + device_name = "/dev/sdb"

          + ebs {
              + delete_on_termination = "true"
              + encrypted             = "true"
              + kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
              + volume_size           = 100
              + volume_type           = "gp3"
            }
        }

      ~ component {
          ~ component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.3" -> "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.4" # forces replacement
        }
      ~ component {
          ~ component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.1" -> "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.2" # forces replacement
        }

        # (3 unchanged blocks hidden)
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this must be replaced
-/+ resource "aws_imagebuilder_infrastructure_configuration" "this" {
      ~ arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-0" -> (known after apply)
      ~ date_created                  = "2024-02-09T16:31:12.717Z" -> (known after apply)
      + date_updated                  = (known after apply)
      ~ id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-0" -> (known after apply)
      ~ name                          = "base_windows_server_2012_r2_0_2_0" -> "base_windows_server_2012_r2_0_2_1" # forces replacement
      ~ resource_tags                 = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
      ~ tags                          = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all                      = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
        # (6 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

Copy link
Contributor

teams/hmpps/windows_server_2022 terragrunt plan on pull_request event #159

module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Reading...
module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Reading...
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Read complete after 1s
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Reading...
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Read complete after 2s
module.imagebuilder.data.aws_caller_identity.current: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["ec2launch-v2-windows"]: Reading...
module.imagebuilder.data.aws_caller_identity.current: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Reading...
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["ec2launch-v2-windows"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_recipe.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_distribution_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_pipeline.this: Refreshing state... [id=<REDACTED>]

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

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be updated in-place
  ~ resource "aws_imagebuilder_distribution_configuration" "this" {
        id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/hmpps-windows-server-2022"
        name         = "hmpps_windows_server_2022"
      ~ tags         = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all     = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      - distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
      + distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_pipeline.this must be replaced
-/+ resource "aws_imagebuilder_image_pipeline" "this" {
      ~ arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/hmpps-windows-server-2022" -> (known after apply)
      ~ date_created                     = "2024-01-29T14:19:44.916Z" -> (known after apply)
      ~ date_last_run                    = "2024-02-02T00:00:04.661Z" -> (known after apply)
      ~ date_next_run                    = "2024-03-02T00:00:00.000Z" -> (known after apply)
      ~ date_updated                     = "2024-01-29T14:19:44.916Z" -> (known after apply)
      ~ id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/hmpps-windows-server-2022" -> (known after apply)
      ~ image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/hmpps-windows-server-2022/0.1.8" # forces replacement -> (known after apply) # forces replacement
      ~ infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/hmpps-windows-server-2022-0-1-8" -> (known after apply)
        name                             = "hmpps_windows_server_2022"
      ~ platform                         = "Windows" -> (known after apply)
      ~ tags                             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all                         = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      ~ schedule {
          + timezone                           = (known after apply)
            # (2 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this must be replaced
+/- resource "aws_imagebuilder_image_recipe" "this" {
      ~ arn              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/hmpps-windows-server-2022/0.1.8" -> (known after apply)
      ~ date_created     = "2024-01-29T14:19:44.044Z" -> (known after apply)
      ~ id               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/hmpps-windows-server-2022/0.1.8" -> (known after apply)
        name             = "hmpps_windows_server_2022"
      ~ owner            = "374269020027" -> (known after apply)
      ~ platform         = "Windows" -> (known after apply)
      ~ tags             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all         = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
      + user_data_base64 = (known after apply)
      ~ version          = "0.1.8" -> "0.2.0" # forces replacement
        # (2 unchanged attributes hidden)

      - block_device_mapping {
          - device_name = "/dev/sda1" -> null
          - no_device   = false -> null

          - ebs {
              - delete_on_termination = "true" -> null
              - encrypted             = "true" -> null
              - iops                  = 0 -> null
              - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
              - throughput            = 0 -> null
              - volume_size           = 30 -> null
              - volume_type           = "gp3" -> null
            }
        }
      + block_device_mapping {
          + device_name = "/dev/sda1"

          + ebs {
              + delete_on_termination = "true"
              + encrypted             = "true"
              + kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
              + volume_size           = 30
              + volume_type           = "gp3"
            }
        }

      + component { # forces replacement
          + component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.2" # forces replacement
        }

        # (5 unchanged blocks hidden)
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this must be replaced
-/+ resource "aws_imagebuilder_infrastructure_configuration" "this" {
      ~ arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/hmpps-windows-server-2022-0-1-8" -> (known after apply)
      ~ date_created                  = "2024-01-29T14:19:43.548Z" -> (known after apply)
      + date_updated                  = (known after apply)
      ~ id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/hmpps-windows-server-2022-0-1-8" -> (known after apply)
      ~ name                          = "hmpps_windows_server_2022_0_1_8" -> "hmpps_windows_server_2022_0_2_0" # forces replacement
      ~ resource_tags                 = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
      ~ tags                          = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all                      = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
        # (6 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

@robertsweetman robertsweetman merged commit f798227 into main Feb 12, 2024
10 checks passed
@robertsweetman robertsweetman deleted the dso/add-install-git-windows-component branch February 12, 2024 10:03
Copy link
Contributor

commonimages/components terraform plan on push event #245

data.aws_secretsmanager_secret.environment_management: Reading...
data.aws_secretsmanager_secret.environment_management: Read complete after 1s [id=<REDACTED>]
data.aws_secretsmanager_secret_version.environment_management: Reading...
data.aws_secretsmanager_secret_version.environment_management: Read complete after 0s [id=<REDACTED>]
data.aws_caller_identity.current: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=<REDACTED>]
data.aws_kms_key.hmpps_ebs_encryption_cmk: Reading...
data.aws_kms_key.hmpps_ebs_encryption_cmk: Read complete after 1s [id=<REDACTED>]
aws_imagebuilder_component.this["psreadline_fix.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["yum_packages.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["python_3_9.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["git_windows.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["prometheus_windows_exporter.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["powershell_core_server_2012.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["python_3_6.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["ansible.yml"]: Refreshing state... [id=<REDACTED>]
aws_imagebuilder_component.this["aws_cli.yml"]: Refreshing state... [id=<REDACTED>]

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

Terraform will perform the following actions:

  # aws_imagebuilder_component.this["ansible.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/ansible/0.0.11/1"
        name                  = "ansible"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["aws_cli.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/aws-cli/0.0.4/1"
        name                  = "aws_cli"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["chocolatey.yml"] will be created
  + resource "aws_imagebuilder_component" "this" {
      + arn          = (known after apply)
      + data         = <<-EOT
            ---
            name: chocolatey
            description: Component to install chocolatey
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
                  default: 0.0.4
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
            phases:
              - name: build
                steps:
                  - name: InstallChocolatey
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          if (Get-Command choco.exe -ErrorAction SilentlyContinue) {
                            Write-Host "Chocolatey already installed"
                            [System.Environment]::Exit(0)
                          } else {
                            Write-Host "Installing Chocolatey"
                            Set-ExecutionPolicy Bypass -Scope Process -Force
                            [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
                            Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
                            [System.Environment]::Exit(3010)
                          }
        EOT
      + date_created = (known after apply)
      + description  = "Component to install chocolatey"
      + encrypted    = (known after apply)
      + id           = (known after apply)
      + kms_key_id   = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
      + name         = "chocolatey"
      + owner        = (known after apply)
      + platform     = "Windows"
      + skip_destroy = false
      + tags         = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + tags_all     = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + type         = (known after apply)
      + version      = "0.0.4"
    }

  # aws_imagebuilder_component.this["git_windows.yml"] must be replaced
+/- resource "aws_imagebuilder_component" "this" {
      ~ arn                   = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.1/1" -> (known after apply)
      ~ data                  = <<-EOT # forces replacement
            ---
            name: git_windows
            description: Component to install Git for Windows
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
          -       default: 0.0.1
          +       default: 0.0.2
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
            phases:
              - name: build
                steps:
                  - name: InstallGitForWindows
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          choco install git.install -y
        EOT
      ~ date_created          = "2024-02-09T16:27:47.148Z" -> (known after apply)
      ~ encrypted             = true -> (known after apply)
      ~ id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.1/1" -> (known after apply)
        name                  = "git_windows"
      ~ owner                 = "374269020027" -> (known after apply)
      - supported_os_versions = [] -> null
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
      ~ type                  = "BUILD" -> (known after apply)
      ~ version               = "0.0.1" -> "0.0.2" # forces replacement
        # (4 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["powershell_core.yml"] will be created
  + resource "aws_imagebuilder_component" "this" {
      + arn          = (known after apply)
      + data         = <<-EOT
            ---
            name: powershell_core
            description: Component to upgrade to using PowerShell Core
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
                  default: 0.4.0
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
              - PowerShellCoreVersion:
                  type: string
                  default: 7.4.1
                  description: Version of the PowerShell Core to install
            phases:
              - name: build
                steps:
                  - name: InstallPowerShellCore
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          choco install -y chocolatey-core.extension
                          choco install -y kb3118401
                          choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=1"'
        EOT
      + date_created = (known after apply)
      + description  = "Component to upgrade to using PowerShell Core"
      + encrypted    = (known after apply)
      + id           = (known after apply)
      + kms_key_id   = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
      + name         = "powershell_core"
      + owner        = (known after apply)
      + platform     = "Windows"
      + skip_destroy = false
      + tags         = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + tags_all     = {
          + "application"   = "n/a"
          + "branch"        = "main"
          + "business-unit" = "HMPPS"
          + "is-production" = "true"
          + "owner"         = "[email protected]"
          + "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      + type         = (known after apply)
      + version      = "0.4.0"
    }

  # aws_imagebuilder_component.this["powershell_core_server_2012.yml"] must be replaced
+/- resource "aws_imagebuilder_component" "this" {
      ~ arn                   = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.3/1" -> (known after apply)
      ~ data                  = <<-EOT # forces replacement
            ---
            name: powershell_core_server_2012
            description: Component to install PowerShell Core on Windows Server 2012, has different command line flags as there are not supported packages for this version since Windows Server 2012 r2 is nearing EOL
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
          -       default: 0.0.3
          +       default: 0.4.0
                  description: Component version (update this each time the file changes)
              - Platform:
                  type: string
                  default: "Windows"
                  description: Platform.
              - PowerShellCoreVersion:
                  type: string
                  default: 7.4.1
                  description: Version of the PowerShell Core to install
            phases:
              - name: build
                steps:
                  - name: InstallPowerShellCore
                    action: ExecutePowerShell
                    inputs:
                      commands:
                        - |
                          choco install -y chocolatey-core.extension
                          choco install -y kb3118401
          -               choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 USE_MU=0 ENABLE_MU=0 ADD_PATH=1 DISABLE_TELEMETRY"'
          +               choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1"'
        EOT
      ~ date_created          = "2024-01-29T09:54:05.531Z" -> (known after apply)
      ~ encrypted             = true -> (known after apply)
      ~ id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.3/1" -> (known after apply)
        name                  = "powershell_core_server_2012"
      ~ owner                 = "374269020027" -> (known after apply)
      - supported_os_versions = [] -> null
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
      ~ type                  = "BUILD" -> (known after apply)
      ~ version               = "0.0.3" -> "0.4.0" # forces replacement
        # (4 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["prometheus_windows_exporter.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/prometheus-windows-exporter/1.1.7/1"
        name                  = "prometheus_windows_exporter"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["psreadline_fix.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/psreadline-fix/0.0.4/1"
        name                  = "psreadline_fix"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["python_3_6.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/python-3-6/0.0.4/1"
        name                  = "python_3_6"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["python_3_9.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/python-3-9/0.0.3/1"
        name                  = "python_3_9"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

  # aws_imagebuilder_component.this["yum_packages.yml"] will be updated in-place
  ~ resource "aws_imagebuilder_component" "this" {
        id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/yum-packages/0.0.1/1"
        name                  = "yum_packages"
      ~ tags                  = {
            "application"   = "n/a"
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
            "business-unit" = "HMPPS"
          ~ "is-production" = "false" -> "true"
            "owner"         = "[email protected]"
            "source-code"   = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/components"
        }
      ~ tags_all              = {
          ~ "branch"        = "dso/add-install-git-windows-component" -> "main"
          ~ "is-production" = "false" -> "true"
            # (4 unchanged elements hidden)
        }
        # (12 unchanged attributes hidden)
    }

Plan: 4 to add, 7 to change, 2 to destroy.

Warning: Value for undeclared variable

The root module does not declare a variable named "account_to_distribute_ami"
but a value was found in file "terraform.tfvars". If you meant to use this
value, add a "variable" block to the configuration.

To silence these warnings, use TF_VAR_... environment variables to provide
certain "global" settings to all configurations in your organization. To
reduce the verbosity of these warnings, use the -compact-warnings option.

Copy link
Contributor

commonimages/base/windows_2012_r2 terragrunt plan on push event #496

module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Read complete after 1s
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Reading...
module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Read complete after 1s
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Reading...
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_caller_identity.current: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Reading...
module.imagebuilder.data.aws_ami.parent[0]: Reading...
module.imagebuilder.data.aws_caller_identity.current: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Reading...
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_ami.parent[0]: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_recipe.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_distribution_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_pipeline.this: Refreshing state... [id=<REDACTED>]

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

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be updated in-place
  ~ resource "aws_imagebuilder_distribution_configuration" "this" {
        id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2"
        name         = "base_windows_server_2012_r2"
      ~ tags         = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all     = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      - distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
      + distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_pipeline.this must be replaced
-/+ resource "aws_imagebuilder_image_pipeline" "this" {
      ~ arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2" -> (known after apply)
      ~ date_created                     = "2024-02-09T16:31:14.246Z" -> (known after apply)
      ~ date_last_run                    = "2024-02-09T16:31:43.457Z" -> (known after apply)
      ~ date_next_run                    = "2024-03-01T00:00:00.000Z" -> (known after apply)
      ~ date_updated                     = "2024-02-09T16:31:14.246Z" -> (known after apply)
      ~ id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2" -> (known after apply)
      ~ image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.0" # forces replacement -> (known after apply) # forces replacement
      ~ infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-0" -> (known after apply)
        name                             = "base_windows_server_2012_r2"
      ~ platform                         = "Windows" -> (known after apply)
      ~ tags                             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all                         = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      ~ schedule {
          + timezone                           = (known after apply)
            # (2 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this must be replaced
+/- resource "aws_imagebuilder_image_recipe" "this" {
      ~ arn              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.0" -> (known after apply)
      ~ date_created     = "2024-02-09T16:31:13.232Z" -> (known after apply)
      ~ id               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.0" -> (known after apply)
        name             = "base_windows_server_2012_r2"
      ~ owner            = "374269020027" -> (known after apply)
      ~ platform         = "Windows" -> (known after apply)
      ~ tags             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all         = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
      + user_data_base64 = (known after apply)
      ~ version          = "0.2.0" -> "0.2.1" # forces replacement
        # (2 unchanged attributes hidden)

      - block_device_mapping {
          - device_name = "/dev/sda1" -> null
          - no_device   = false -> null

          - ebs {
              - delete_on_termination = "true" -> null
              - encrypted             = "true" -> null
              - iops                  = 0 -> null
              - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
              - throughput            = 0 -> null
              - volume_size           = 128 -> null
              - volume_type           = "gp3" -> null
            }
        }
      - block_device_mapping {
          - device_name = "/dev/sdb" -> null
          - no_device   = false -> null

          - ebs {
              - delete_on_termination = "true" -> null
              - encrypted             = "true" -> null
              - iops                  = 0 -> null
              - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
              - throughput            = 0 -> null
              - volume_size           = 100 -> null
              - volume_type           = "gp3" -> null
            }
        }
      + block_device_mapping {
          + device_name = "/dev/sda1"

          + ebs {
              + delete_on_termination = "true"
              + encrypted             = "true"
              + kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
              + volume_size           = 128
              + volume_type           = "gp3"
            }
        }
      + block_device_mapping {
          + device_name = "/dev/sdb"

          + ebs {
              + delete_on_termination = "true"
              + encrypted             = "true"
              + kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
              + volume_size           = 100
              + volume_type           = "gp3"
            }
        }

      ~ component {
          ~ component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.3" -> "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.0.4" # forces replacement
        }
      ~ component {
          ~ component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.1" -> "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.2" # forces replacement
        }

        # (3 unchanged blocks hidden)
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this must be replaced
-/+ resource "aws_imagebuilder_infrastructure_configuration" "this" {
      ~ arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-0" -> (known after apply)
      ~ date_created                  = "2024-02-09T16:31:12.717Z" -> (known after apply)
      + date_updated                  = (known after apply)
      ~ id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-0" -> (known after apply)
      ~ name                          = "base_windows_server_2012_r2_0_2_0" -> "base_windows_server_2012_r2_0_2_1" # forces replacement
      ~ resource_tags                 = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
      ~ tags                          = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "n/a"
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
            "business-unit"                           = "HMPPS"
            "image-pipeline"                          = "base_windows_server_2012_r2"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
            "os-version"                              = "windows server 2012 r2"
          ~ "release-or-patch"                        = "test" -> "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        }
      ~ tags_all                      = {
          ~ "branch"                                  = "dso/add-install-git-windows-component" -> "main"
          ~ "image-recipe"                            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.0" -> "base_windows_server_2012_r2/0.2.1"
          ~ "is-production"                           = "false" -> "true"
          ~ "release-or-patch"                        = "test" -> "release"
            # (6 unchanged elements hidden)
        }
        # (6 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

Copy link
Contributor

teams/hmpps/windows_server_2022 terragrunt plan on push event #160

module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Reading...
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Reading...
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Reading...
module.imagebuilder.data.terraform_remote_state.imagebuilder_mp: Read complete after 2s
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Read complete after 3s
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["ec2launch-v2-windows"]: Reading...
module.imagebuilder.data.aws_caller_identity.current: Reading...
module.imagebuilder.data.aws_caller_identity.current: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Reading...
module.imagebuilder.data.aws_kms_key.hmpps_ebs_encryption_cmk: Read complete after 0s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["ec2launch-v2-windows"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_distribution_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_recipe.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_pipeline.this: Refreshing state... [id=<REDACTED>]

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

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be updated in-place
  ~ resource "aws_imagebuilder_distribution_configuration" "this" {
        id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/hmpps-windows-server-2022"
        name         = "hmpps_windows_server_2022"
      ~ tags         = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all     = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      - distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
      + distribution {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_pipeline.this must be replaced
-/+ resource "aws_imagebuilder_image_pipeline" "this" {
      ~ arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/hmpps-windows-server-2022" -> (known after apply)
      ~ date_created                     = "2024-01-29T14:19:44.916Z" -> (known after apply)
      ~ date_last_run                    = "2024-02-02T00:00:04.661Z" -> (known after apply)
      ~ date_next_run                    = "2024-03-02T00:00:00.000Z" -> (known after apply)
      ~ date_updated                     = "2024-01-29T14:19:44.916Z" -> (known after apply)
      ~ id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/hmpps-windows-server-2022" -> (known after apply)
      ~ image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/hmpps-windows-server-2022/0.1.8" # forces replacement -> (known after apply) # forces replacement
      ~ infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/hmpps-windows-server-2022-0-1-8" -> (known after apply)
        name                             = "hmpps_windows_server_2022"
      ~ platform                         = "Windows" -> (known after apply)
      ~ tags                             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all                         = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

      ~ schedule {
          + timezone                           = (known after apply)
            # (2 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this must be replaced
+/- resource "aws_imagebuilder_image_recipe" "this" {
      ~ arn              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/hmpps-windows-server-2022/0.1.8" -> (known after apply)
      ~ date_created     = "2024-01-29T14:19:44.044Z" -> (known after apply)
      ~ id               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/hmpps-windows-server-2022/0.1.8" -> (known after apply)
        name             = "hmpps_windows_server_2022"
      ~ owner            = "374269020027" -> (known after apply)
      ~ platform         = "Windows" -> (known after apply)
      ~ tags             = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all         = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
      + user_data_base64 = (known after apply)
      ~ version          = "0.1.8" -> "0.2.0" # forces replacement
        # (2 unchanged attributes hidden)

      - block_device_mapping {
          - device_name = "/dev/sda1" -> null
          - no_device   = false -> null

          - ebs {
              - delete_on_termination = "true" -> null
              - encrypted             = "true" -> null
              - iops                  = 0 -> null
              - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
              - throughput            = 0 -> null
              - volume_size           = 30 -> null
              - volume_type           = "gp3" -> null
            }
        }
      + block_device_mapping {
          + device_name = "/dev/sda1"

          + ebs {
              + delete_on_termination = "true"
              + encrypted             = "true"
              + kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691"
              + volume_size           = 30
              + volume_type           = "gp3"
            }
        }

      + component { # forces replacement
          + component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.2" # forces replacement
        }

        # (5 unchanged blocks hidden)
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this must be replaced
-/+ resource "aws_imagebuilder_infrastructure_configuration" "this" {
      ~ arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/hmpps-windows-server-2022-0-1-8" -> (known after apply)
      ~ date_created                  = "2024-01-29T14:19:43.548Z" -> (known after apply)
      + date_updated                  = (known after apply)
      ~ id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/hmpps-windows-server-2022-0-1-8" -> (known after apply)
      ~ name                          = "hmpps_windows_server_2022_0_1_8" -> "hmpps_windows_server_2022_0_2_0" # forces replacement
      ~ resource_tags                 = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
      ~ tags                          = {
            "amazon-cloudwatch-agent-windows-version" = "1.0.0"
            "application"                             = "NOMIS"
            "branch"                                  = "main"
            "business-unit"                           = "HMPPS"
            "ec2launch-v2-windows-version"            = "1.0.0"
            "image-pipeline"                          = "hmpps_windows_server_2022"
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            "is-production"                           = "true"
            "os-version"                              = "windows server 2022"
            "owner"                                   = "DSO: [email protected]"
            "release-or-patch"                        = "release"
            "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/teams/nomis"
        }
      ~ tags_all                      = {
          ~ "image-recipe"                            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
          ~ "infrastructure-configuration"            = "hmpps_windows_server_2022/0.1.8" -> "hmpps_windows_server_2022/0.2.0"
            # (11 unchanged elements hidden)
        }
        # (6 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

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