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

re-enable the hcl file #716

Closed
wants to merge 7 commits into from

Conversation

robertsweetman
Copy link
Contributor

  • should make the pipeline runnable

@robertsweetman robertsweetman requested a review from a team as a code owner February 15, 2024 12:36

This comment has been minimized.

@robertsweetman robertsweetman force-pushed the DSO/DSOS-2557/put-terragrunt-file-back branch from 7eadb42 to 83e2be5 Compare February 15, 2024 13:57

This comment has been minimized.

@robertsweetman robertsweetman force-pushed the DSO/DSOS-2557/put-terragrunt-file-back branch from bb64b32 to 83e2be5 Compare February 15, 2024 16:39

This comment has been minimized.

@robertsweetman robertsweetman force-pushed the DSO/DSOS-2557/put-terragrunt-file-back branch from 83e2be5 to bf86430 Compare February 15, 2024 16:40

This comment has been minimized.

Copy link
Contributor

commonimages/base/rhel_7_9 terragrunt plan on pull_request event #528

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.terraform_remote_state.core_shared_services_production: Read complete after 1s
module.imagebuilder.data.aws_secretsmanager_secret_version.environment_management: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_caller_identity.current: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["stig-build-linux-medium"]: Reading...
module.imagebuilder.data.aws_ami.parent[0]: Reading...
module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["update-linux"]: Reading...
module.imagebuilder.aws_imagebuilder_image_pipeline.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.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["update-linux"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_imagebuilder_component.this["stig-build-linux-medium"]: Read complete after 1s [id=<REDACTED>]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be destroyed
  # (because aws_imagebuilder_distribution_configuration.this is not in configuration)
  - resource "aws_imagebuilder_distribution_configuration" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-rhel-7-9" -> null
      - date_created = "2022-11-16T11:57:48.402Z" -> null
      - date_updated = "2024-01-23T09:50:17.122Z" -> null
      - description  = "shared rhel 7.9 base image" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-rhel-7-9" -> null
      - name         = "base_rhel_7_9" -> null
      - tags         = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - tags_all     = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null

      - 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 will be destroyed
  # (because aws_imagebuilder_image_pipeline.this is not in configuration)
  - resource "aws_imagebuilder_image_pipeline" "this" {
      - arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-rhel-7-9" -> null
      - date_created                     = "2024-01-23T09:50:19.355Z" -> null
      - date_last_run                    = "2024-02-01T00:00:34.457Z" -> null
      - date_next_run                    = "2024-03-01T00:00:00.000Z" -> null
      - date_updated                     = "2024-01-23T09:50:19.355Z" -> null
      - description                      = "shared rhel 7.9 base image" -> null
      - distribution_configuration_arn   = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-rhel-7-9" -> null
      - enhanced_image_metadata_enabled  = true -> null
      - id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-rhel-7-9" -> null
      - image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-rhel-7-9/0.1.2" -> null
      - infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-rhel-7-9-0-1-2" -> null
      - name                             = "base_rhel_7_9" -> null
      - platform                         = "Linux" -> null
      - status                           = "ENABLED" -> null
      - tags                             = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - tags_all                         = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null

      - image_tests_configuration {
          - image_tests_enabled = false -> null
          - timeout_minutes     = 720 -> null
        }

      - schedule {
          - pipeline_execution_start_condition = "EXPRESSION_MATCH_ONLY" -> null
          - schedule_expression                = "cron(0 0 1 * ? *)" -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this will be destroyed
  # (because aws_imagebuilder_image_recipe.this is not in configuration)
  - resource "aws_imagebuilder_image_recipe" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-rhel-7-9/0.1.2" -> null
      - date_created = "2024-01-23T09:50:18.412Z" -> null
      - description  = "shared rhel 7.9 base image" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-rhel-7-9/0.1.2" -> null
      - name         = "base_rhel_7_9" -> null
      - owner        = "374269020027" -> null
      - parent_image = "ami-0c2f9865057c3dfe1" -> null
      - platform     = "Linux" -> null
      - tags         = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - tags_all     = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - version      = "0.1.2" -> null

      - 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
            }
        }

      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:aws:component/update-linux/x.x.x" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:aws:component/stig-build-linux-medium/x.x.x" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/python-3-9/0.0.3" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/ansible/0.0.11" -> null

          - parameter {
              - name  = "Ami" -> null
              - value = "base_rhel_7_9" -> null
            }
          - parameter {
              - name  = "Branch" -> null
              - value = "main" -> null
            }
        }

      - systems_manager_agent {
          - uninstall_after_build = false -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this will be destroyed
  # (because aws_imagebuilder_infrastructure_configuration.this is not in configuration)
  - resource "aws_imagebuilder_infrastructure_configuration" "this" {
      - arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-rhel-7-9-0-1-2" -> null
      - date_created                  = "2024-01-23T09:50:17.397Z" -> null
      - description                   = "shared rhel 7.9 base image" -> null
      - id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-rhel-7-9-0-1-2" -> null
      - instance_profile_name         = "ImageBuilder" -> null
      - instance_types                = [
          - "t3.medium",
        ] -> null
      - name                          = "base_rhel_7_9_0_1_2" -> null
      - resource_tags                 = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - security_group_ids            = [
          - "sg-0ee607811d7668f33",
        ] -> null
      - subnet_id                     = "subnet-014d083e052388b2a" -> null
      - tags                          = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - tags_all                      = {
          - "application"                     = "n/a"
          - "branch"                          = "main"
          - "business-unit"                   = "HMPPS"
          - "image-pipeline"                  = "base_rhel_7_9"
          - "image-recipe"                    = "base_rhel_7_9/0.1.2"
          - "infrastructure-configuration"    = "base_rhel_7_9/0.1.2"
          - "is-production"                   = "true"
          - "os-version"                      = "rhel 7.9"
          - "owner"                           = "[email protected]"
          - "release-or-patch"                = "n/a"
          - "source-code"                     = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_7_9"
          - "stig-build-linux-medium-version" = "2023.4.0"
          - "update-linux-version"            = "1.0.2"
        } -> null
      - terminate_instance_on_failure = true -> null

      - logging {
          - s3_logs {
              - s3_bucket_name = "ec2-image-builder-logs-20211019134837153100000001" -> null
              - s3_key_prefix  = "base" -> null
            }
        }
    }

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

Copy link
Contributor

commonimages/base/windows_2012_r2_SQL_2014 terragrunt plan on pull_request event #528

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

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be destroyed
  # (because aws_imagebuilder_distribution_configuration.this is not in configuration)
  - resource "aws_imagebuilder_distribution_configuration" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2-sql-2014-enterprise" -> null
      - date_created = "2023-10-09T14:31:50.329Z" -> null
      - date_updated = "2023-11-03T12:58:36.520Z" -> null
      - description  = "Windows Server 2012 R2 with SQL 2014 Enterprise" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2-sql-2014-enterprise" -> null
      - name         = "base_windows_server_2012_r2_SQL_2014_enterprise" -> null
      - tags         = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - tags_all     = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null

      - 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 will be destroyed
  # (because aws_imagebuilder_image_pipeline.this is not in configuration)
  - resource "aws_imagebuilder_image_pipeline" "this" {
      - arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2-sql-2014-enterprise" -> null
      - date_created                     = "2023-11-03T12:58:38.261Z" -> null
      - date_last_run                    = "2024-02-01T00:00:37.657Z" -> null
      - date_next_run                    = "2024-03-01T00:00:00.000Z" -> null
      - date_updated                     = "2023-11-03T12:58:38.261Z" -> null
      - description                      = "Windows Server 2012 R2 with SQL 2014 Enterprise" -> null
      - distribution_configuration_arn   = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2-sql-2014-enterprise" -> null
      - enhanced_image_metadata_enabled  = true -> null
      - id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2-sql-2014-enterprise" -> null
      - image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2-sql-2014-enterprise/0.0.6" -> null
      - infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-sql-2014-enterprise-0-0-6" -> null
      - name                             = "base_windows_server_2012_r2_SQL_2014_enterprise" -> null
      - platform                         = "Windows" -> null
      - status                           = "ENABLED" -> null
      - tags                             = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - tags_all                         = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null

      - image_tests_configuration {
          - image_tests_enabled = false -> null
          - timeout_minutes     = 720 -> null
        }

      - schedule {
          - pipeline_execution_start_condition = "EXPRESSION_MATCH_ONLY" -> null
          - schedule_expression                = "cron(0 0 1 * ? *)" -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this will be destroyed
  # (because aws_imagebuilder_image_recipe.this is not in configuration)
  - resource "aws_imagebuilder_image_recipe" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2-sql-2014-enterprise/0.0.6" -> null
      - date_created = "2023-11-03T12:58:37.076Z" -> null
      - description  = "Windows Server 2012 R2 with SQL 2014 Enterprise" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2-sql-2014-enterprise/0.0.6" -> null
      - name         = "base_windows_server_2012_r2_SQL_2014_enterprise" -> null
      - owner        = "374269020027" -> null
      - parent_image = "ami-05b7b1ee752ddc19a" -> null
      - platform     = "Windows" -> null
      - tags         = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - tags_all     = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - version      = "0.0.6" -> null

      - 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
            }
        }

      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:aws:component/amazon-cloudwatch-agent-windows/x.x.x" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core/0.3.0" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/aws-cli/0.0.3" -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this will be destroyed
  # (because aws_imagebuilder_infrastructure_configuration.this is not in configuration)
  - resource "aws_imagebuilder_infrastructure_configuration" "this" {
      - arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-sql-2014-enterprise-0-0-6" -> null
      - date_created                  = "2023-11-03T12:58:37.462Z" -> null
      - description                   = "Windows Server 2012 R2 with SQL 2014 Enterprise" -> null
      - id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-sql-2014-enterprise-0-0-6" -> null
      - instance_profile_name         = "ImageBuilder" -> null
      - instance_types                = [
          - "m4.xlarge",
        ] -> null
      - name                          = "base_windows_server_2012_r2_SQL_2014_enterprise_0_0_6" -> null
      - resource_tags                 = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - security_group_ids            = [
          - "sg-0ee607811d7668f33",
        ] -> null
      - subnet_id                     = "subnet-014d083e052388b2a" -> null
      - tags                          = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - tags_all                      = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2_SQL_2014_enterprise"
          - "image-recipe"                            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2_SQL_2014_enterprise/0.0.6"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2 with SQL 2014 Enterprise"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2_SQL_2014_enterprise"
        } -> null
      - terminate_instance_on_failure = true -> null

      - logging {
          - s3_logs {
              - s3_bucket_name = "ec2-image-builder-logs-20211019134837153100000001" -> null
              - s3_key_prefix  = "base" -> null
            }
        }
    }

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

Copy link
Contributor

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

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_ami.parent[0]: Reading...
module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.data.aws_caller_identity.current: Reading...
module.imagebuilder.data.aws_imagebuilder_component.this["amazon-cloudwatch-agent-windows"]: Reading...
module.imagebuilder.aws_imagebuilder_image_recipe.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_image_pipeline.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_distribution_configuration.this: Refreshing state... [id=<REDACTED>]
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_ami.parent[0]: Read complete after 1s [id=<REDACTED>]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be destroyed
  # (because aws_imagebuilder_distribution_configuration.this is not in configuration)
  - resource "aws_imagebuilder_distribution_configuration" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2" -> null
      - date_created = "2023-09-01T14:11:22.035Z" -> null
      - date_updated = "2024-02-12T11:22:55.406Z" -> null
      - description  = "Windows Server 2012 R2" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2" -> null
      - name         = "base_windows_server_2012_r2" -> null
      - tags         = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - tags_all     = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null

      - 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 will be destroyed
  # (because aws_imagebuilder_image_pipeline.this is not in configuration)
  - resource "aws_imagebuilder_image_pipeline" "this" {
      - arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2" -> null
      - date_created                     = "2024-02-12T11:26:29.491Z" -> null
      - date_last_run                    = "2024-02-12T11:26:50.285Z" -> null
      - date_next_run                    = "2024-03-01T00:00:00.000Z" -> null
      - date_updated                     = "2024-02-12T11:26:29.491Z" -> null
      - description                      = "Windows Server 2012 R2" -> null
      - distribution_configuration_arn   = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-windows-server-2012-r2" -> null
      - enhanced_image_metadata_enabled  = true -> null
      - id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-windows-server-2012-r2" -> null
      - image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.2" -> null
      - infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-2" -> null
      - name                             = "base_windows_server_2012_r2" -> null
      - platform                         = "Windows" -> null
      - status                           = "ENABLED" -> null
      - tags                             = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - tags_all                         = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null

      - image_tests_configuration {
          - image_tests_enabled = false -> null
          - timeout_minutes     = 720 -> null
        }

      - schedule {
          - pipeline_execution_start_condition = "EXPRESSION_MATCH_ONLY" -> null
          - schedule_expression                = "cron(0 0 1 * ? *)" -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this will be destroyed
  # (because aws_imagebuilder_image_recipe.this is not in configuration)
  - resource "aws_imagebuilder_image_recipe" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.2" -> null
      - date_created = "2024-02-12T11:26:28.510Z" -> null
      - description  = "Windows Server 2012 R2" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-windows-server-2012-r2/0.2.2" -> null
      - name         = "base_windows_server_2012_r2" -> null
      - owner        = "374269020027" -> null
      - parent_image = "ami-089fad2fece5002f1" -> null
      - platform     = "Windows" -> null
      - tags         = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - tags_all     = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - version      = "0.2.2" -> null

      - 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
            }
        }

      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:aws:component/amazon-cloudwatch-agent-windows/x.x.x" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/chocolatey/0.0.4" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/powershell-core-server-2012/0.5.0" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/aws-cli/0.0.4" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/git-windows/0.0.2" -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this will be destroyed
  # (because aws_imagebuilder_infrastructure_configuration.this is not in configuration)
  - resource "aws_imagebuilder_infrastructure_configuration" "this" {
      - arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-2" -> null
      - date_created                  = "2024-02-12T11:22:55.832Z" -> null
      - description                   = "Windows Server 2012 R2" -> null
      - id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-windows-server-2012-r2-0-2-2" -> null
      - instance_profile_name         = "ImageBuilder" -> null
      - instance_types                = [
          - "t3.medium",
        ] -> null
      - name                          = "base_windows_server_2012_r2_0_2_2" -> null
      - resource_tags                 = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - security_group_ids            = [
          - "sg-0ee607811d7668f33",
        ] -> null
      - subnet_id                     = "subnet-014d083e052388b2a" -> null
      - tags                          = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - tags_all                      = {
          - "amazon-cloudwatch-agent-windows-version" = "1.0.0"
          - "application"                             = "n/a"
          - "branch"                                  = "main"
          - "business-unit"                           = "HMPPS"
          - "image-pipeline"                          = "base_windows_server_2012_r2"
          - "image-recipe"                            = "base_windows_server_2012_r2/0.2.2"
          - "infrastructure-configuration"            = "base_windows_server_2012_r2/0.2.2"
          - "is-production"                           = "true"
          - "os-version"                              = "windows server 2012 r2"
          - "release-or-patch"                        = "release"
          - "source-code"                             = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/windows_server_2012_r2"
        } -> null
      - terminate_instance_on_failure = true -> null

      - logging {
          - s3_logs {
              - s3_bucket_name = "ec2-image-builder-logs-20211019134837153100000001" -> null
              - s3_key_prefix  = "base" -> null
            }
        }
    }

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

Copy link
Contributor

commonimages/base/rhel_6_10 terragrunt plan on pull_request event #528

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 2s
module.imagebuilder.data.aws_secretsmanager_secret.environment_management: Reading...
module.imagebuilder.data.terraform_remote_state.core_shared_services_production: Read complete after 3s
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.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["update-linux"]: Reading...
module.imagebuilder.aws_imagebuilder_component.this["stig_rhel6_ansible.yml.tftpl"]: Refreshing state... [id=<REDACTED>]
module.imagebuilder.data.aws_ami.parent[0]: Reading...
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_image_pipeline.this: Refreshing state... [id=<REDACTED>]
module.imagebuilder.aws_imagebuilder_distribution_configuration.this: Refreshing state... [id=<REDACTED>]
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["update-linux"]: Read complete after 1s [id=<REDACTED>]
module.imagebuilder.data.aws_ami.parent[0]: Read complete after 1s [id=<REDACTED>]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # module.imagebuilder.aws_imagebuilder_component.this["stig_rhel6_ansible.yml.tftpl"] will be destroyed
  # (because aws_imagebuilder_component.this is not in configuration)
  - resource "aws_imagebuilder_component" "this" {
      - arn                   = "arn:aws:imagebuilder:eu-west-2:374269020027:component/base-rhel-6-10-stig-rhel6-ansible/0.2.7/1" -> null
      - data                  = <<-EOT
            ---
            name: base_rhel_6_10_stig_rhel6_ansible
            description: Install ansible roles for running stig_rhel6
            schemaVersion: 1.0
            parameters:
              - Version:
                  type: string
                  default: 0.2.7
                  description: Uses the recipe version to avoid any issues with the branch template arg.
              - Platform:
                  type: string
                  default: "Linux"
                  description: Platform.
            phases:
              - name: build
                steps:
                  # Install ansible roles
                  - name: InstallAndRunAnsible
                    action: ExecuteBash
                    inputs:
                      commands:
                        - |
                          set -eo pipefail
                          PATH=$PATH:/usr/local/bin
                          run_ansible() {
                            repo="modernisation-platform-ami-builds"
                            ami_tag="base_rhel_6_10"
            
                            # clone ansible roles and playbook
                            yum install -y git
                            ansible_dir=$(mktemp -d)
                            echo "Cloning $repo into $ansible_dir using branch=main"
                            cd $ansible_dir
                            git clone -b main "https://github.com/ministryofjustice/$repo.git"
            
                            # set python version
                            if [[ $(which python3.9) ]]; then
                              python=$(which python3.9)
                            elif [[ $(which python3.6) ]]; then
                              python=$(which python3.6)
                            else
                              echo "Python3.9/3.6 not found"
                              exit 1
                            fi
                            echo "python: $python"
            
                            # install python dependencies outside of virtual env so ansible
                            # can be executed remotely
                            cd $ansible_dir/$repo/ansible
                            $python -m pip install -r requirements.txt
            
                            # activate virtual environment
                            mkdir $ansible_dir/python-venv && cd "$_"
                            $python -m venv ansible
                            source ansible/bin/activate
                            $python -m pip install --upgrade pip
                            if [[ "$python" =~ 3.6 ]]; then
                              $python -m pip install wheel
                              $python -m pip install cryptography==2.3
                              export LC_ALL=en_US.UTF-8
                              $python -m pip install ansible-core==2.11.12
                            else
                              $python -m pip install ansible==6.0.0
                            fi
            
                            # install requirements in virtual env
                            cd $ansible_dir/$repo/ansible
                            $python -m pip install -r requirements.txt
                            ansible-galaxy role install -r requirements.rhel6.yml
                            ansible-galaxy collection install -r requirements.rhel6.yml --force
            
                            # run ansible (note comma after localhost is deliberate)
                            ansible-playbook -v playbooks/stig_rhel6.yml \
                            --connection=local \
                            --inventory localhost, \
                            --extra-vars "ansible_python_interpreter=$python" \
                            --extra-vars "target=localhost" \
                            --tags "amibuild,prelim,cat1,cat2" \
                            --skip-tags "low,aide,sshd,selinux,V-38484,V-38497,V-38518,V-38519,V-38585,V-38623,V-51337" \
                            --become
            
                            # Cleanup
                            deactivate
                            echo "Cleaning up $ansible_dir"
                            rm -rf $ansible_dir/$repo
                            rm -rf $ansible_dir/python-venv
                            rmdir $ansible_dir
                          }
                          echo "stig_rhel6_ansible $ami_tag start" | logger -p local3.info -t ami-component
                          run_ansible 2>&1 | logger -p local3.info -t ami-component -s 2>&1
                          echo "stig_rhel6_ansible $ami_tag end" | logger -p local3.info -t ami-component
        EOT -> null
      - date_created          = "2024-01-23T09:50:19.068Z" -> null
      - description           = "Install ansible roles for running stig_rhel6" -> null
      - encrypted             = true -> null
      - id                    = "arn:aws:imagebuilder:eu-west-2:374269020027:component/base-rhel-6-10-stig-rhel6-ansible/0.2.7/1" -> null
      - kms_key_id            = "arn:aws:kms:eu-west-2:374269020027:key/12984197-3371-4c21-8e43-a88a1581e691" -> null
      - name                  = "base_rhel_6_10_stig_rhel6_ansible" -> null
      - owner                 = "374269020027" -> null
      - platform              = "Linux" -> null
      - skip_destroy          = false -> null
      - supported_os_versions = [] -> null
      - tags                  = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - tags_all              = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - type                  = "BUILD" -> null
      - version               = "0.2.7" -> null
    }

  # module.imagebuilder.aws_imagebuilder_distribution_configuration.this will be destroyed
  # (because aws_imagebuilder_distribution_configuration.this is not in configuration)
  - resource "aws_imagebuilder_distribution_configuration" "this" {
      - arn          = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-rhel-6-10" -> null
      - date_created = "2022-12-08T10:08:53.318Z" -> null
      - date_updated = "2024-01-23T09:50:18.809Z" -> null
      - description  = "shared rhel 6.10 base image" -> null
      - id           = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-rhel-6-10" -> null
      - name         = "base_rhel_6_10" -> null
      - tags         = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - tags_all     = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null

      - 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 will be destroyed
  # (because aws_imagebuilder_image_pipeline.this is not in configuration)
  - resource "aws_imagebuilder_image_pipeline" "this" {
      - arn                              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-rhel-6-10" -> null
      - date_created                     = "2024-01-23T09:50:22.207Z" -> null
      - date_last_run                    = "2024-02-01T00:00:03.449Z" -> null
      - date_next_run                    = "2024-03-01T00:00:00.000Z" -> null
      - date_updated                     = "2024-01-23T09:50:22.207Z" -> null
      - description                      = "shared rhel 6.10 base image" -> null
      - distribution_configuration_arn   = "arn:aws:imagebuilder:eu-west-2:374269020027:distribution-configuration/base-rhel-6-10" -> null
      - enhanced_image_metadata_enabled  = true -> null
      - id                               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-pipeline/base-rhel-6-10" -> null
      - image_recipe_arn                 = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-rhel-6-10/0.2.7" -> null
      - infrastructure_configuration_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-rhel-6-10-0-2-7" -> null
      - name                             = "base_rhel_6_10" -> null
      - platform                         = "Linux" -> null
      - status                           = "ENABLED" -> null
      - tags                             = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - tags_all                         = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null

      - image_tests_configuration {
          - image_tests_enabled = false -> null
          - timeout_minutes     = 720 -> null
        }

      - schedule {
          - pipeline_execution_start_condition = "EXPRESSION_MATCH_ONLY" -> null
          - schedule_expression                = "cron(0 0 1 * ? *)" -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_image_recipe.this will be destroyed
  # (because aws_imagebuilder_image_recipe.this is not in configuration)
  - resource "aws_imagebuilder_image_recipe" "this" {
      - arn              = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-rhel-6-10/0.2.7" -> null
      - date_created     = "2024-01-23T09:50:21.147Z" -> null
      - description      = "shared rhel 6.10 base image" -> null
      - id               = "arn:aws:imagebuilder:eu-west-2:374269020027:image-recipe/base-rhel-6-10/0.2.7" -> null
      - name             = "base_rhel_6_10" -> null
      - owner            = "374269020027" -> null
      - parent_image     = "ami-023a539e6d65fa54b" -> null
      - platform         = "Linux" -> null
      - tags             = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - tags_all         = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - user_data_base64 = "IyEvYmluL2Jhc2gKaW5zdGFsbF9zc21fYWdlbnQoKSB7CiAgc3VkbyB5dW0gaW5zdGFsbCAteSBodHRwczovL3MzLmV1LXdlc3QtMi5hbWF6b25hd3MuY29tL2FtYXpvbi1zc20tZXUtd2VzdC0yLzMuMC4xMzkwLjAvbGludXhfYW1kNjQvYW1hem9uLXNzbS1hZ2VudC5ycG0KICBzdWRvIHN0YXJ0IGFtYXpvbi1zc20tYWdlbnQKfQplY2hvICJpbnN0YWxsX3NzbV9hZ2VudCBzdGFydCIgfCBsb2dnZXIgLXAgbG9jYWwzLmluZm8gLXQgdXNlci1kYXRhCmluc3RhbGxfc3NtX2FnZW50IDI+JjEgfCBsb2dnZXIgLXAgbG9jYWwzLmluZm8gLXQgdXNlci1kYXRhCmVjaG8gImluc3RhbGxfc3NtX2FnZW50IGVuZCIgfCBsb2dnZXIgLXAgbG9jYWwzLmluZm8gLXQgdXNlci1kYXRhCg==" -> null
      - version          = "0.2.7" -> null

      - 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
            }
        }

      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:aws:component/update-linux/x.x.x" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/python-3-6/0.0.4" -> null
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/ansible/0.0.11" -> null

          - parameter {
              - name  = "Ami" -> null
              - value = "base_rhel_6_10" -> null
            }
          - parameter {
              - name  = "Branch" -> null
              - value = "main" -> null
            }
        }
      - component {
          - component_arn = "arn:aws:imagebuilder:eu-west-2:374269020027:component/base-rhel-6-10-stig-rhel6-ansible/0.2.7/1" -> null
        }

      - systems_manager_agent {
          - uninstall_after_build = false -> null
        }
    }

  # module.imagebuilder.aws_imagebuilder_infrastructure_configuration.this will be destroyed
  # (because aws_imagebuilder_infrastructure_configuration.this is not in configuration)
  - resource "aws_imagebuilder_infrastructure_configuration" "this" {
      - arn                           = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-rhel-6-10-0-2-7" -> null
      - date_created                  = "2024-01-23T09:50:19.115Z" -> null
      - description                   = "shared rhel 6.10 base image" -> null
      - id                            = "arn:aws:imagebuilder:eu-west-2:374269020027:infrastructure-configuration/base-rhel-6-10-0-2-7" -> null
      - instance_profile_name         = "ImageBuilder" -> null
      - instance_types                = [
          - "t2.large",
        ] -> null
      - name                          = "base_rhel_6_10_0_2_7" -> null
      - resource_tags                 = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - security_group_ids            = [
          - "sg-0ee607811d7668f33",
        ] -> null
      - subnet_id                     = "subnet-014d083e052388b2a" -> null
      - tags                          = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - tags_all                      = {
          - "application"                               = "n/a"
          - "base_rhel_6_10_stig_rhel6_ansible-version" = "0.2.7"
          - "branch"                                    = "main"
          - "business-unit"                             = "HMPPS"
          - "image-pipeline"                            = "base_rhel_6_10"
          - "image-recipe"                              = "base_rhel_6_10/0.2.7"
          - "infrastructure-configuration"              = "base_rhel_6_10/0.2.7"
          - "is-production"                             = "true"
          - "os-version"                                = "rhel 6.10"
          - "owner"                                     = "[email protected]"
          - "release-or-patch"                          = "n/a"
          - "source-code"                               = "https://github.com/ministryofjustice/modernisation-platform-ami-builds/tree/main/commonimages/base/rhel_6_10"
          - "update-linux-version"                      = "1.0.2"
        } -> null
      - terminate_instance_on_failure = true -> null

      - logging {
          - s3_logs {
              - s3_bucket_name = "ec2-image-builder-logs-20211019134837153100000001" -> null
              - s3_key_prefix  = "base" -> null
            }
        }
    }

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

@robertsweetman
Copy link
Contributor Author

No longer needed, worked around it some other way

@dms1981 dms1981 deleted the DSO/DSOS-2557/put-terragrunt-file-back branch May 14, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant