puppetlabs / puppetlabs-pecdm

Puppet Bolt driven fusion of puppetlabs/peadm and Terraform.
Apache License 2.0
14 stars 18 forks source link

aws only working with us-west-2 (take two) #102

Closed jessereynolds closed 1 year ago

jessereynolds commented 1 year ago

Describe the Bug

A re-iteration of the main issue that #99 sought to highlight.

pecdm only works correctly with AWS if you use us-west-2 when the region is specified via parameter to the pecdm::provision plan (and no environment variable such as AWS_REGION is used).

I've tried the following regions:

ap-southeast-2 us-east-1

Expected Behavior

Setting the region in the parameters to pecdm::provision should allow regions other than us-west-2 to be specified and the plan then able to complete successfully.

Steps to Reproduce

First reproduction case:

Use the version of pecdm with the extra verbose output showing the output of pecdm::subplans::provision so the inventory resolution can be evaluated with stage set to true (skip the PE install, just build the infra):

git clone git@github.com:jessereynolds/puppetlabs-pecdm.git puppetlabs-pecdm-99 && cd puppetlabs-pecdm-99
git checkout provision_verbose_output
git log -1
% git log -1
commit dcfb80e1c72f1311f97cf85a431375c80f12dacc (HEAD -> provision_verbose_output, origin/provision_verbose_output)
Author: Jesse Reynolds <jesse@va.com.au>
Date:   Mon Dec 19 00:06:28 2022 +1100

    include output of pecdm::subplans::provision to verbose output
# authenticate to aws using sso
aws sso login

ensure params.json contains (minus obvious redactions):

{
  "project"             : "jr-pe",
  "version"             : "2021.7.1",
  "architecture"        : "standard",
  "cluster_profile"     : "development",
  "provider"            : "aws",
  "cloud_region"        : "ap-southeast-2",
  "firewall_allow"      : [ "127.0.0.1/32" ],
  "ssh_pub_key_file"    : "/Users/jesse/.ssh/id_rsa.pub",
  "stage"               : true,
  "console_password"    : "puppetlabs",
  "extra_terraform_vars": {
    "tags" : {
      "lifetime"  : "2d",
      "department": "PS",
      "created_by": "foo.bar@example"
    }
  }
}
# clean ups if this dir has been used previously:
rm -rf .terraform .modules

# install modules
bolt module install --no-resolve

# do a provision
bolt plan run pecdm::provision --params @params.json  --verbose

Results:

pecdm::provision provisioned:

{
  "pe_inventory": {
  },
  "agent_inventory": [

  ],
  "windows_agent_inventory": [

  ],
  "compiler_pool_address": "ec2-54-252-209-17.ap-southeast-2.compute.amazonaws.com"
}
    on modules/networking/main.tf line 7, in locals:
     7:   vpc_id        = try(aws_vpc.pe[0].id, data.aws_vpc.existing[0].id)
      ├────────────────
      │ while calling try(expressions...)
      │ aws_vpc.pe is empty tuple
      │ data.aws_vpc.existing is empty tuple

Environment

% bolt --version 3.26.1

% terraform --version Terraform v1.3.4 on darwin_amd64

Additional Context

Note that this is fixed by bumping the version of puppetlabs-terraform used to df32b49

It is also fixed by calling the apply task twice, instead of apply and refresh, per #100 but @timidri's fix to puppetlabs-terraform is cleaner.

Full output of pecdm::provision:

% bolt plan run pecdm::provision --params @params.json  --verbose
Starting: plan pecdm::provision
Starting: plan pecdm::subplans::provision
Starting: task terraform::initialize on localhost
Started on localhost...
Finished on localhost:
  {
    "stdout": "Initializing modules...\n- instances in modules/instances\n- loadbalancer in modules/loadbalancer\n- networking in modules/networking\n\nInitializing the backend...\n\nInitializing provider plugins...\n- Finding hashicorp/aws versions matching \"3.32.0\"...\n- Finding hashicorp/random versions matching \"3.1.0\"...\n- Finding chriskuchin/hiera5 versions matching \"0.3.0\"...\n- Installing hashicorp/aws v3.32.0...\n- Installed hashicorp/aws v3.32.0 (signed by HashiCorp)\n- Installing hashicorp/random v3.1.0...\n- Installed hashicorp/random v3.1.0 (signed by HashiCorp)\n- Installing chriskuchin/hiera5 v0.3.0...\n- Installed chriskuchin/hiera5 v0.3.0 (self-signed, key ID 5CFE2C2CD45FB4ED)\n\nPartner and community providers are signed by their developers.\nIf you'd like to know more about provider signing, you can read about it here:\nhttps://www.terraform.io/docs/cli/plugins/signing.html\n\nTerraform has created a lock file .terraform.lock.hcl to record the provider\nselections it made above. Include this file in your version control repository\nso that Terraform can guarantee to make the same selections by default when\nyou run \"terraform init\" in the future.\n\nTerraform has been successfully initialized!\n\nYou may now begin working with Terraform. Try running \"terraform plan\" to see\nany changes that are required for your infrastructure. All Terraform commands\nshould now work.\n\nIf you ever set or change modules or backend configuration for Terraform,\nrerun this command to reinitialize your working directory. If you forget, other\ncommands will detect it and remind you to do so if necessary.\n"
  }
Finished: task terraform::initialize with 0 failures in 16.23 sec
Starting infrastructure provisioning for a standard deployment of Puppet Enterprise
.tfvars file content:

# Mapping all the plan parameters to their corresponding Terraform vars
#
# Quoting is important in a Terraform vars file so we take care in preserving
# them and converting single quotes to double.
project         = "jr-pe"
user            = "ec2-user"
lb_ip_mode      = "private"
ssh_key         = "/Users/jesse/.ssh/id_rsa.pub"
region          = "ap-southeast-2"
compiler_count  = 1
firewall_allow  = ["127.0.0.1/32"]
architecture    = "standard"
cluster_profile = "development"
replica         = false
tags = {
  "lifetime" = "2d"
  "department" = "PS"
  "created_by" = "foo.bar@example"
}

Starting: plan terraform::apply
Starting: task terraform::apply on localhost
Started on localhost...
Finished on localhost:
  {
    "stdout": "data.hiera5.server_count: Reading...\ndata.hiera5.primary_disk: Reading...\ndata.hiera5.database_count: Reading...\ndata.hiera5.database_type: Reading...\ndata.hiera5.database_disk: Reading...\ndata.hiera5.compiler_disk: Reading...\ndata.hiera5.database_count: Read complete after 0s [id=database_count]\ndata.hiera5.server_count: Read complete after 0s [id=server_count]\ndata.hiera5.primary_disk: Read complete after 0s [id=primary_disk_size]\ndata.hiera5.database_type: Read complete after 0s [id=database_instance_type]\ndata.hiera5.database_disk: Read complete after 0s [id=database_disk_size]\ndata.hiera5.compiler_disk: Read complete after 0s [id=compiler_disk_size]\ndata.hiera5.compiler_type: Reading...\ndata.hiera5.primary_type: Reading...\ndata.hiera5.compiler_type: Read complete after 0s [id=compiler_instance_type]\ndata.hiera5.primary_type: Read complete after 0s [id=primary_instance_type]\ndata.hiera5_bool.has_compilers: Reading...\ndata.hiera5_bool.has_compilers: Read complete after 0s [id=has_compilers]\nmodule.networking.data.aws_availability_zones.available: Reading...\nmodule.instances.data.aws_ami.ami: Reading...\nmodule.networking.data.aws_availability_zones.available: Read complete after 0s [id=ap-southeast-2]\nmodule.instances.data.aws_ami.ami: Read complete after 0s [id=ami-0aa29f1c98936e9a9]\n\nTerraform used the selected providers to generate the following execution\nplan. Resource actions are indicated with the following symbols:\n  + create\n\nTerraform will perform the following actions:\n\n  # random_id.deployment will be created\n  + resource \"random_id\" \"deployment\" {\n      + b64_std     = (known after apply)\n      + b64_url     = (known after apply)\n      + byte_length = 3\n      + dec         = (known after apply)\n      + hex         = (known after apply)\n      + id          = (known after apply)\n    }\n\n  # module.instances.aws_ec2_tag.internalDNS[0] will be created\n  + resource \"aws_ec2_tag\" \"internalDNS\" {\n      + id          = (known after apply)\n      + key         = \"internalDNS\"\n      + resource_id = (known after apply)\n      + value       = (known after apply)\n    }\n\n  # module.instances.aws_instance.server[0] will be created\n  + resource \"aws_instance\" \"server\" {\n      + ami                          = \"ami-0aa29f1c98936e9a9\"\n      + arn                          = (known after apply)\n      + associate_public_ip_address  = (known after apply)\n      + availability_zone            = (known after apply)\n      + cpu_core_count               = (known after apply)\n      + cpu_threads_per_core         = (known after apply)\n      + get_password_data            = false\n      + host_id                      = (known after apply)\n      + id                           = (known after apply)\n      + instance_state               = (known after apply)\n      + instance_type                = \"t3.large\"\n      + ipv6_address_count           = (known after apply)\n      + ipv6_addresses               = (known after apply)\n      + key_name                     = (known after apply)\n      + outpost_arn                  = (known after apply)\n      + password_data                = (known after apply)\n      + placement_group              = (known after apply)\n      + primary_network_interface_id = (known after apply)\n      + private_dns                  = (known after apply)\n      + private_ip                   = (known after apply)\n      + public_dns                   = (known after apply)\n      + public_ip                    = (known after apply)\n      + secondary_private_ips        = (known after apply)\n      + security_groups              = (known after apply)\n      + source_dest_check            = true\n      + subnet_id                    = (known after apply)\n      + tags                         = (known after apply)\n      + tenancy                      = (known after apply)\n      + vpc_security_group_ids       = (known after apply)\n\n      + ebs_block_device {\n          + delete_on_termination = (known after apply)\n          + device_name           = (known after apply)\n          + encrypted             = (known after apply)\n          + iops                  = (known after apply)\n          + kms_key_id            = (known after apply)\n          + snapshot_id           = (known after apply)\n          + tags                  = (known after apply)\n          + throughput            = (known after apply)\n          + volume_id             = (known after apply)\n          + volume_size           = (known after apply)\n          + volume_type           = (known after apply)\n        }\n\n      + enclave_options {\n          + enabled = (known after apply)\n        }\n\n      + ephemeral_block_device {\n          + device_name  = (known after apply)\n          + no_device    = (known after apply)\n          + virtual_name = (known after apply)\n        }\n\n      + metadata_options {\n          + http_endpoint               = (known after apply)\n          + http_put_response_hop_limit = (known after apply)\n          + http_tokens                 = (known after apply)\n        }\n\n      + network_interface {\n          + delete_on_termination = (known after apply)\n          + device_index          = (known after apply)\n          + network_interface_id  = (known after apply)\n        }\n\n      + root_block_device {\n          + delete_on_termination = true\n          + device_name           = (known after apply)\n          + encrypted             = (known after apply)\n          + iops                  = (known after apply)\n          + kms_key_id            = (known after apply)\n          + throughput            = (known after apply)\n          + volume_id             = (known after apply)\n          + volume_size           = 50\n          + volume_type           = \"gp2\"\n        }\n    }\n\n  # module.instances.aws_key_pair.pe_adm will be created\n  + resource \"aws_key_pair\" \"pe_adm\" {\n      + arn         = (known after apply)\n      + fingerprint = (known after apply)\n      + id          = (known after apply)\n      + key_name    = (known after apply)\n      + key_pair_id = (known after apply)\n      + public_key  = \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCwe62hcwqGkE2X7BQSJZc4yrug6zavMgkmDX8F83ZHcm0EyqkZA2UnII+8ZhO2NVLhH2S1rieOiCW+rGOIAn9HyVrMs4e5GORnvmV9XWZjmDntqmKAe0e35vMiavPdNYUoGKFvHkIOXh3Bv5M9huB94lObgAvx1NCaXRiUy/mZenGjPb4SqKw/xXJKkSYGSHjKEHIRo/GbbR5QUzq+p5bilOVDUqpRrTLkCkS+7eFIgrqnSUywWd12lfNoM1bmgB1tc1ak2kzfvn6Ij3I44nxXqrWOkWB2DNrMm5vLzHj1dOTgZq/U2T7PX0MIXS8Kx064NkeGfywHlTwIJsL8kh1 jesse@So-Much-For-Subtlety.local\"\n      + tags        = {\n          + \"created_by\"  = \"foo.bar@example\"\n          + \"department\"  = \"PS\"\n          + \"description\" = \"PEADM Deployed Puppet Enterprise\"\n          + \"lifetime\"    = \"2d\"\n          + \"project\"     = \"jr-pe\"\n        }\n    }\n\n  # module.networking.aws_internet_gateway.pe_gw[0] will be created\n  + resource \"aws_internet_gateway\" \"pe_gw\" {\n      + arn      = (known after apply)\n      + id       = (known after apply)\n      + owner_id = (known after apply)\n      + tags     = (known after apply)\n      + vpc_id   = (known after apply)\n    }\n\n  # module.networking.aws_route_table.pe_public[0] will be created\n  + resource \"aws_route_table\" \"pe_public\" {\n      + id               = (known after apply)\n      + owner_id         = (known after apply)\n      + propagating_vgws = (known after apply)\n      + route            = [\n          + {\n              + cidr_block                = \"0.0.0.0/0\"\n              + egress_only_gateway_id    = \"\"\n              + gateway_id                = (known after apply)\n              + instance_id               = \"\"\n              + ipv6_cidr_block           = \"\"\n              + local_gateway_id          = \"\"\n              + nat_gateway_id            = \"\"\n              + network_interface_id      = \"\"\n              + transit_gateway_id        = \"\"\n              + vpc_endpoint_id           = \"\"\n              + vpc_peering_connection_id = \"\"\n            },\n        ]\n      + tags             = (known after apply)\n      + vpc_id           = (known after apply)\n    }\n\n  # module.networking.aws_route_table_association.pe_subnet_public[0] will be created\n  + resource \"aws_route_table_association\" \"pe_subnet_public\" {\n      + id             = (known after apply)\n      + route_table_id = (known after apply)\n      + subnet_id      = (known after apply)\n    }\n\n  # module.networking.aws_route_table_association.pe_subnet_public[1] will be created\n  + resource \"aws_route_table_association\" \"pe_subnet_public\" {\n      + id             = (known after apply)\n      + route_table_id = (known after apply)\n      + subnet_id      = (known after apply)\n    }\n\n  # module.networking.aws_route_table_association.pe_subnet_public[2] will be created\n  + resource \"aws_route_table_association\" \"pe_subnet_public\" {\n      + id             = (known after apply)\n      + route_table_id = (known after apply)\n      + subnet_id      = (known after apply)\n    }\n\n  # module.networking.aws_security_group.pe_sg will be created\n  + resource \"aws_security_group\" \"pe_sg\" {\n      + arn                    = (known after apply)\n      + description            = \"Allow TLS inbound traffic\"\n      + egress                 = [\n          + {\n              + cidr_blocks      = [\n                  + \"0.0.0.0/0\",\n                ]\n              + description      = \"\"\n              + from_port        = 0\n              + ipv6_cidr_blocks = []\n              + prefix_list_ids  = []\n              + protocol         = \"-1\"\n              + security_groups  = []\n              + self             = false\n              + to_port          = 0\n            },\n        ]\n      + id                     = (known after apply)\n      + ingress                = [\n          + {\n              + cidr_blocks      = [\n                  + \"10.128.0.0/9\",\n                  + \"121.200.6.152/32\",\n                ]\n              + description      = \"General ingress rule\"\n              + from_port        = 0\n              + ipv6_cidr_blocks = []\n              + prefix_list_ids  = []\n              + protocol         = \"-1\"\n              + security_groups  = []\n              + self             = false\n              + to_port          = 0\n            },\n          + {\n              + cidr_blocks      = [\n                  + \"10.138.0.0/16\",\n                ]\n              + description      = \"Anything from VPC\"\n              + from_port        = 0\n              + ipv6_cidr_blocks = []\n              + prefix_list_ids  = []\n              + protocol         = \"-1\"\n              + security_groups  = []\n              + self             = false\n              + to_port          = 0\n            },\n        ]\n      + name                   = (known after apply)\n      + name_prefix            = (known after apply)\n      + owner_id               = (known after apply)\n      + revoke_rules_on_delete = false\n      + tags                   = (known after apply)\n      + vpc_id                 = (known after apply)\n    }\n\n  # module.networking.aws_subnet.pe_subnet[0] will be created\n  + resource \"aws_subnet\" \"pe_subnet\" {\n      + arn                             = (known after apply)\n      + assign_ipv6_address_on_creation = false\n      + availability_zone               = \"ap-southeast-2a\"\n      + availability_zone_id            = (known after apply)\n      + cidr_block                      = \"10.138.1.0/24\"\n      + id                              = (known after apply)\n      + ipv6_cidr_block_association_id  = (known after apply)\n      + map_public_ip_on_launch         = true\n      + owner_id                        = (known after apply)\n      + tags                            = (known after apply)\n      + vpc_id                          = (known after apply)\n    }\n\n  # module.networking.aws_subnet.pe_subnet[1] will be created\n  + resource \"aws_subnet\" \"pe_subnet\" {\n      + arn                             = (known after apply)\n      + assign_ipv6_address_on_creation = false\n      + availability_zone               = \"ap-southeast-2b\"\n      + availability_zone_id            = (known after apply)\n      + cidr_block                      = \"10.138.2.0/24\"\n      + id                              = (known after apply)\n      + ipv6_cidr_block_association_id  = (known after apply)\n      + map_public_ip_on_launch         = true\n      + owner_id                        = (known after apply)\n      + tags                            = (known after apply)\n      + vpc_id                          = (known after apply)\n    }\n\n  # module.networking.aws_subnet.pe_subnet[2] will be created\n  + resource \"aws_subnet\" \"pe_subnet\" {\n      + arn                             = (known after apply)\n      + assign_ipv6_address_on_creation = false\n      + availability_zone               = \"ap-southeast-2c\"\n      + availability_zone_id            = (known after apply)\n      + cidr_block                      = \"10.138.3.0/24\"\n      + id                              = (known after apply)\n      + ipv6_cidr_block_association_id  = (known after apply)\n      + map_public_ip_on_launch         = true\n      + owner_id                        = (known after apply)\n      + tags                            = (known after apply)\n      + vpc_id                          = (known after apply)\n    }\n\n  # module.networking.aws_vpc.pe[0] will be created\n  + resource \"aws_vpc\" \"pe\" {\n      + arn                              = (known after apply)\n      + assign_generated_ipv6_cidr_block = false\n      + cidr_block                       = \"10.138.0.0/16\"\n      + default_network_acl_id           = (known after apply)\n      + default_route_table_id           = (known after apply)\n      + default_security_group_id        = (known after apply)\n      + dhcp_options_id                  = (known after apply)\n      + enable_classiclink               = (known after apply)\n      + enable_classiclink_dns_support   = (known after apply)\n      + enable_dns_hostnames             = true\n      + enable_dns_support               = true\n      + id                               = (known after apply)\n      + instance_tenancy                 = \"default\"\n      + ipv6_association_id              = (known after apply)\n      + ipv6_cidr_block                  = (known after apply)\n      + main_route_table_id              = (known after apply)\n      + owner_id                         = (known after apply)\n      + tags                             = (known after apply)\n    }\n\nPlan: 14 to add, 0 to change, 0 to destroy.\n\nChanges to Outputs:\n  + console = (known after apply)\n  + pool    = (known after apply)\nrandom_id.deployment: Creating...\nrandom_id.deployment: Creation complete after 0s [id=beKE]\nmodule.instances.aws_key_pair.pe_adm: Creating...\nmodule.networking.aws_vpc.pe[0]: Creating...\nmodule.instances.aws_key_pair.pe_adm: Creation complete after 1s [id=pe_adm_6de284]\nmodule.networking.aws_vpc.pe[0]: Still creating... [10s elapsed]\nmodule.networking.aws_vpc.pe[0]: Creation complete after 13s [id=vpc-0ab3d5b56895d4f57]\nmodule.networking.aws_internet_gateway.pe_gw[0]: Creating...\nmodule.networking.aws_subnet.pe_subnet[2]: Creating...\nmodule.networking.aws_subnet.pe_subnet[0]: Creating...\nmodule.networking.aws_subnet.pe_subnet[1]: Creating...\nmodule.networking.aws_security_group.pe_sg: Creating...\nmodule.networking.aws_internet_gateway.pe_gw[0]: Creation complete after 2s [id=igw-05fc001c62e93ce94]\nmodule.networking.aws_route_table.pe_public[0]: Creating...\nmodule.networking.aws_route_table.pe_public[0]: Creation complete after 0s [id=rtb-01fd9c1563422057a]\nmodule.networking.aws_security_group.pe_sg: Creation complete after 2s [id=sg-03324b1436cdf8ac3]\nmodule.networking.aws_subnet.pe_subnet[0]: Still creating... [10s elapsed]\nmodule.networking.aws_subnet.pe_subnet[2]: Still creating... [10s elapsed]\nmodule.networking.aws_subnet.pe_subnet[1]: Still creating... [10s elapsed]\nmodule.networking.aws_subnet.pe_subnet[1]: Creation complete after 11s [id=subnet-017ab31c3b04434e5]\nmodule.networking.aws_subnet.pe_subnet[2]: Creation complete after 11s [id=subnet-09edda0656ce7c650]\nmodule.networking.aws_subnet.pe_subnet[0]: Creation complete after 11s [id=subnet-03f2be4fbbf76f6dd]\nmodule.networking.aws_route_table_association.pe_subnet_public[2]: Creating...\nmodule.networking.aws_route_table_association.pe_subnet_public[0]: Creating...\nmodule.networking.aws_route_table_association.pe_subnet_public[1]: Creating...\nmodule.instances.aws_instance.server[0]: Creating...\nmodule.networking.aws_route_table_association.pe_subnet_public[2]: Creation complete after 0s [id=rtbassoc-0ee45a526097f34aa]\nmodule.networking.aws_route_table_association.pe_subnet_public[1]: Creation complete after 0s [id=rtbassoc-039c4595f37cded20]\nmodule.networking.aws_route_table_association.pe_subnet_public[0]: Creation complete after 0s [id=rtbassoc-0855ef6c3f22e92ff]\nmodule.instances.aws_instance.server[0]: Still creating... [10s elapsed]\nmodule.instances.aws_instance.server[0]: Creation complete after 13s [id=i-0b1e226f0d69c79a2]\nmodule.instances.aws_ec2_tag.internalDNS[0]: Creating...\nmodule.instances.aws_ec2_tag.internalDNS[0]: Creation complete after 0s [id=i-0b1e226f0d69c79a2,internalDNS]\n\nApply complete! Resources: 14 added, 0 changed, 0 destroyed.\n\nOutputs:\n\nconsole = \"54.252.209.17\"\npool = \"ec2-54-252-209-17.ap-southeast-2.compute.amazonaws.com\"\n"
  }
Finished: task terraform::apply with 0 failures in 57.34 sec
Starting: task terraform::refresh on localhost
Started on localhost...
Finished on localhost:
  {
    "stdout": "{\"@level\":\"info\",\"@message\":\"Terraform 1.3.4\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:43:59.599665+11:00\",\"terraform\":\"1.3.4\",\"type\":\"version\",\"ui\":\"1.0\"}\n{\"@level\":\"info\",\"@message\":\"random_id.deployment: Refreshing state... [id=beKE]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.656786+11:00\",\"hook\":{\"resource\":{\"addr\":\"random_id.deployment\",\"module\":\"\",\"resource\":\"random_id.deployment\",\"implied_provider\":\"random\",\"resource_type\":\"random_id\",\"resource_name\":\"deployment\",\"resource_key\":null},\"id_key\":\"id\",\"id_value\":\"beKE\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.primary_disk: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.657759+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.primary_disk\",\"module\":\"\",\"resource\":\"data.hiera5.primary_disk\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"primary_disk\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5_bool.has_compilers: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.657783+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5_bool.has_compilers\",\"module\":\"\",\"resource\":\"data.hiera5_bool.has_compilers\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5_bool\",\"resource_name\":\"has_compilers\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"random_id.deployment: Refresh complete [id=beKE]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.658215+11:00\",\"hook\":{\"resource\":{\"addr\":\"random_id.deployment\",\"module\":\"\",\"resource\":\"random_id.deployment\",\"implied_provider\":\"random\",\"resource_type\":\"random_id\",\"resource_name\":\"deployment\",\"resource_key\":null},\"id_key\":\"id\",\"id_value\":\"beKE\"},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.server_count: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.659116+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.server_count\",\"module\":\"\",\"resource\":\"data.hiera5.server_count\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"server_count\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.primary_type: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.661338+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.primary_type\",\"module\":\"\",\"resource\":\"data.hiera5.primary_type\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"primary_type\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5_bool.has_compilers: Refresh complete after 0s [id=has_compilers]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.662751+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5_bool.has_compilers\",\"module\":\"\",\"resource\":\"data.hiera5_bool.has_compilers\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5_bool\",\"resource_name\":\"has_compilers\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"has_compilers\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.database_disk: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.662853+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.database_disk\",\"module\":\"\",\"resource\":\"data.hiera5.database_disk\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"database_disk\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.primary_disk: Refresh complete after 0s [id=primary_disk_size]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.663496+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.primary_disk\",\"module\":\"\",\"resource\":\"data.hiera5.primary_disk\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"primary_disk\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"primary_disk_size\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.server_count: Refresh complete after 0s [id=server_count]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.663551+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.server_count\",\"module\":\"\",\"resource\":\"data.hiera5.server_count\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"server_count\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"server_count\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.database_type: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.663613+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.database_type\",\"module\":\"\",\"resource\":\"data.hiera5.database_type\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"database_type\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.primary_type: Refresh complete after 0s [id=primary_instance_type]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.666644+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.primary_type\",\"module\":\"\",\"resource\":\"data.hiera5.primary_type\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"primary_type\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"primary_instance_type\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.database_disk: Refresh complete after 0s [id=database_disk_size]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.667892+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.database_disk\",\"module\":\"\",\"resource\":\"data.hiera5.database_disk\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"database_disk\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"database_disk_size\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.compiler_type: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.668574+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.compiler_type\",\"module\":\"\",\"resource\":\"data.hiera5.compiler_type\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"compiler_type\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.database_type: Refresh complete after 0s [id=database_instance_type]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.669665+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.database_type\",\"module\":\"\",\"resource\":\"data.hiera5.database_type\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"database_type\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"database_instance_type\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.compiler_disk: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.669860+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.compiler_disk\",\"module\":\"\",\"resource\":\"data.hiera5.compiler_disk\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"compiler_disk\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.database_count: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.670348+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.database_count\",\"module\":\"\",\"resource\":\"data.hiera5.database_count\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"database_count\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.compiler_type: Refresh complete after 0s [id=compiler_instance_type]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.671962+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.compiler_type\",\"module\":\"\",\"resource\":\"data.hiera5.compiler_type\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"compiler_type\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"compiler_instance_type\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.compiler_disk: Refresh complete after 0s [id=compiler_disk_size]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.672684+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.compiler_disk\",\"module\":\"\",\"resource\":\"data.hiera5.compiler_disk\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"compiler_disk\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"compiler_disk_size\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"data.hiera5.database_count: Refresh complete after 0s [id=database_count]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:01.672965+11:00\",\"hook\":{\"resource\":{\"addr\":\"data.hiera5.database_count\",\"module\":\"\",\"resource\":\"data.hiera5.database_count\",\"implied_provider\":\"hiera5\",\"resource_type\":\"hiera5\",\"resource_name\":\"database_count\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"database_count\",\"elapsed_seconds\":0},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.data.aws_ami.ami: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.116859+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.data.aws_ami.ami\",\"module\":\"module.instances\",\"resource\":\"data.aws_ami.ami\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_ami\",\"resource_name\":\"ami\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.data.aws_availability_zones.available: Refreshing...\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.117426+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.data.aws_availability_zones.available\",\"module\":\"module.networking\",\"resource\":\"data.aws_availability_zones.available\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_availability_zones\",\"resource_name\":\"available\",\"resource_key\":null},\"action\":\"read\"},\"type\":\"apply_start\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.aws_key_pair.pe_adm: Refreshing state... [id=pe_adm_6de284]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.117675+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.aws_key_pair.pe_adm\",\"module\":\"module.instances\",\"resource\":\"aws_key_pair.pe_adm\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_key_pair\",\"resource_name\":\"pe_adm\",\"resource_key\":null},\"id_key\":\"id\",\"id_value\":\"pe_adm_6de284\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_vpc.pe[0]: Refreshing state... [id=vpc-0ab3d5b56895d4f57]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.119377+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_vpc.pe[0]\",\"module\":\"module.networking\",\"resource\":\"aws_vpc.pe[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_vpc\",\"resource_name\":\"pe\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"vpc-0ab3d5b56895d4f57\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.aws_key_pair.pe_adm: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.934477+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.aws_key_pair.pe_adm\",\"module\":\"module.instances\",\"resource\":\"aws_key_pair.pe_adm\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_key_pair\",\"resource_name\":\"pe_adm\",\"resource_key\":null}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.data.aws_availability_zones.available: Refresh complete after 1s [id=us-west-2]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.961870+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.data.aws_availability_zones.available\",\"module\":\"module.networking\",\"resource\":\"data.aws_availability_zones.available\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_availability_zones\",\"resource_name\":\"available\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"us-west-2\",\"elapsed_seconds\":1},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_vpc.pe[0]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.973480+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_vpc.pe[0]\",\"module\":\"module.networking\",\"resource\":\"aws_vpc.pe[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_vpc\",\"resource_name\":\"pe\",\"resource_key\":0}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_subnet.pe_subnet[1]: Refreshing state... [id=subnet-017ab31c3b04434e5]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.980990+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_subnet.pe_subnet[1]\",\"module\":\"module.networking\",\"resource\":\"aws_subnet.pe_subnet[1]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_subnet\",\"resource_name\":\"pe_subnet\",\"resource_key\":1},\"id_key\":\"id\",\"id_value\":\"subnet-017ab31c3b04434e5\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_internet_gateway.pe_gw[0]: Refreshing state... [id=igw-05fc001c62e93ce94]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.981080+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_internet_gateway.pe_gw[0]\",\"module\":\"module.networking\",\"resource\":\"aws_internet_gateway.pe_gw[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_internet_gateway\",\"resource_name\":\"pe_gw\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"igw-05fc001c62e93ce94\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_subnet.pe_subnet[0]: Refreshing state... [id=subnet-03f2be4fbbf76f6dd]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.981213+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_subnet.pe_subnet[0]\",\"module\":\"module.networking\",\"resource\":\"aws_subnet.pe_subnet[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_subnet\",\"resource_name\":\"pe_subnet\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"subnet-03f2be4fbbf76f6dd\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_subnet.pe_subnet[2]: Refreshing state... [id=subnet-09edda0656ce7c650]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.981505+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_subnet.pe_subnet[2]\",\"module\":\"module.networking\",\"resource\":\"aws_subnet.pe_subnet[2]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_subnet\",\"resource_name\":\"pe_subnet\",\"resource_key\":2},\"id_key\":\"id\",\"id_value\":\"subnet-09edda0656ce7c650\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_security_group.pe_sg: Refreshing state... [id=sg-03324b1436cdf8ac3]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:06.982012+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_security_group.pe_sg\",\"module\":\"module.networking\",\"resource\":\"aws_security_group.pe_sg\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_security_group\",\"resource_name\":\"pe_sg\",\"resource_key\":null},\"id_key\":\"id\",\"id_value\":\"sg-03324b1436cdf8ac3\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.data.aws_ami.ami: Refresh complete after 1s [id=ami-0f12219b4df721aa6]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.115050+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.data.aws_ami.ami\",\"module\":\"module.instances\",\"resource\":\"data.aws_ami.ami\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_ami\",\"resource_name\":\"ami\",\"resource_key\":null},\"action\":\"read\",\"id_key\":\"id\",\"id_value\":\"ami-0f12219b4df721aa6\",\"elapsed_seconds\":1},\"type\":\"apply_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_internet_gateway.pe_gw[0]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.790875+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_internet_gateway.pe_gw[0]\",\"module\":\"module.networking\",\"resource\":\"aws_internet_gateway.pe_gw[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_internet_gateway\",\"resource_name\":\"pe_gw\",\"resource_key\":0}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table.pe_public[0]: Refreshing state... [id=rtb-01fd9c1563422057a]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.793726+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table.pe_public[0]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table.pe_public[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table\",\"resource_name\":\"pe_public\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"rtb-01fd9c1563422057a\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_subnet.pe_subnet[2]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.831190+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_subnet.pe_subnet[2]\",\"module\":\"module.networking\",\"resource\":\"aws_subnet.pe_subnet[2]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_subnet\",\"resource_name\":\"pe_subnet\",\"resource_key\":2}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_security_group.pe_sg: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.831262+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_security_group.pe_sg\",\"module\":\"module.networking\",\"resource\":\"aws_security_group.pe_sg\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_security_group\",\"resource_name\":\"pe_sg\",\"resource_key\":null}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_subnet.pe_subnet[0]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.831316+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_subnet.pe_subnet[0]\",\"module\":\"module.networking\",\"resource\":\"aws_subnet.pe_subnet[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_subnet\",\"resource_name\":\"pe_subnet\",\"resource_key\":0}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_subnet.pe_subnet[1]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.836142+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_subnet.pe_subnet[1]\",\"module\":\"module.networking\",\"resource\":\"aws_subnet.pe_subnet[1]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_subnet\",\"resource_name\":\"pe_subnet\",\"resource_key\":1}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.aws_instance.server[0]: Refreshing state... [id=i-0b1e226f0d69c79a2]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:07.844770+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.aws_instance.server[0]\",\"module\":\"module.instances\",\"resource\":\"aws_instance.server[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_instance\",\"resource_name\":\"server\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"i-0b1e226f0d69c79a2\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table.pe_public[0]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:08.625968+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table.pe_public[0]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table.pe_public[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table\",\"resource_name\":\"pe_public\",\"resource_key\":0}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table_association.pe_subnet_public[1]: Refreshing state... [id=rtbassoc-039c4595f37cded20]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:08.631022+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table_association.pe_subnet_public[1]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table_association.pe_subnet_public[1]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table_association\",\"resource_name\":\"pe_subnet_public\",\"resource_key\":1},\"id_key\":\"id\",\"id_value\":\"rtbassoc-039c4595f37cded20\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table_association.pe_subnet_public[2]: Refreshing state... [id=rtbassoc-0ee45a526097f34aa]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:08.631178+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table_association.pe_subnet_public[2]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table_association.pe_subnet_public[2]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table_association\",\"resource_name\":\"pe_subnet_public\",\"resource_key\":2},\"id_key\":\"id\",\"id_value\":\"rtbassoc-0ee45a526097f34aa\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table_association.pe_subnet_public[0]: Refreshing state... [id=rtbassoc-0855ef6c3f22e92ff]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:08.631183+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table_association.pe_subnet_public[0]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table_association.pe_subnet_public[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table_association\",\"resource_name\":\"pe_subnet_public\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"rtbassoc-0855ef6c3f22e92ff\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.aws_instance.server[0]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:08.656770+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.aws_instance.server[0]\",\"module\":\"module.instances\",\"resource\":\"aws_instance.server[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_instance\",\"resource_name\":\"server\",\"resource_key\":0}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.aws_ec2_tag.internalDNS[0]: Refreshing state... [id=i-0b1e226f0d69c79a2,internalDNS]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:08.664406+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.aws_ec2_tag.internalDNS[0]\",\"module\":\"module.instances\",\"resource\":\"aws_ec2_tag.internalDNS[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_ec2_tag\",\"resource_name\":\"internalDNS\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"i-0b1e226f0d69c79a2,internalDNS\"},\"type\":\"refresh_start\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table_association.pe_subnet_public[0]: Refresh complete [id=rtbassoc-0855ef6c3f22e92ff]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:09.450888+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table_association.pe_subnet_public[0]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table_association.pe_subnet_public[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table_association\",\"resource_name\":\"pe_subnet_public\",\"resource_key\":0},\"id_key\":\"id\",\"id_value\":\"rtbassoc-0855ef6c3f22e92ff\"},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table_association.pe_subnet_public[1]: Refresh complete [id=rtbassoc-039c4595f37cded20]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:09.455918+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table_association.pe_subnet_public[1]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table_association.pe_subnet_public[1]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table_association\",\"resource_name\":\"pe_subnet_public\",\"resource_key\":1},\"id_key\":\"id\",\"id_value\":\"rtbassoc-039c4595f37cded20\"},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.networking.aws_route_table_association.pe_subnet_public[2]: Refresh complete [id=rtbassoc-0ee45a526097f34aa]\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:09.469550+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.networking.aws_route_table_association.pe_subnet_public[2]\",\"module\":\"module.networking\",\"resource\":\"aws_route_table_association.pe_subnet_public[2]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_route_table_association\",\"resource_name\":\"pe_subnet_public\",\"resource_key\":2},\"id_key\":\"id\",\"id_value\":\"rtbassoc-0ee45a526097f34aa\"},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"module.instances.aws_ec2_tag.internalDNS[0]: Refresh complete\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:09.473004+11:00\",\"hook\":{\"resource\":{\"addr\":\"module.instances.aws_ec2_tag.internalDNS[0]\",\"module\":\"module.instances\",\"resource\":\"aws_ec2_tag.internalDNS[0]\",\"implied_provider\":\"aws\",\"resource_type\":\"aws_ec2_tag\",\"resource_name\":\"internalDNS\",\"resource_key\":0}},\"type\":\"refresh_complete\"}\n{\"@level\":\"info\",\"@message\":\"Outputs: 2\",\"@module\":\"terraform.ui\",\"@timestamp\":\"2022-12-28T13:44:09.546512+11:00\",\"outputs\":{\"console\":{\"sensitive\":false,\"type\":\"string\",\"value\":\"54.252.209.17\"},\"pool\":{\"sensitive\":false,\"type\":\"string\",\"value\":\"ec2-54-252-209-17.ap-southeast-2.compute.amazonaws.com\"}},\"type\":\"outputs\"}\n"
  }
Finished: task terraform::refresh with 0 failures in 10.22 sec
Starting: task terraform::output on localhost
Started on localhost...
Finished on localhost:
  {
    "console": {
      "sensitive": false,
      "type": "string",
      "value": "54.252.209.17"
    },
    "pool": {
      "sensitive": false,
      "type": "string",
      "value": "ec2-54-252-209-17.ap-southeast-2.compute.amazonaws.com"
    }
  }
Finished: task terraform::output with 0 failures in 0.9 sec
Finished: plan terraform::apply in 1 min, 8 sec
Finished provisioning infrastructure for a standard deployment of Puppet Enterprise
Finished: plan pecdm::subplans::provision in 1 min, 27 sec
pecdm::provision provisioned:

{
  "pe_inventory": {
  },
  "agent_inventory": [

  ],
  "windows_agent_inventory": [

  ],
  "compiler_pool_address": "ec2-54-252-209-17.ap-southeast-2.compute.amazonaws.com"
}

The parameter stage was set to true, infrastructure has been staged but Puppet Enterprise deployment skipped
Starting: plan pecdm::utils::inventory_yaml
Writing inventory.yaml for aws
Finished: plan pecdm::utils::inventory_yaml in 0.01 sec
Finished: plan pecdm::provision in 1 min, 27 sec
Plan completed successfully with no result

Full output of pecdm::destroy:

% bolt plan run pecdm::destroy provider=aws cloud_region=ap-southeast-2 --verbose
Starting: plan pecdm::destroy
Starting: plan pecdm::subplans::destroy
Destroying Puppet Enterprise deployment on aws
Starting: task terraform::initialize on localhost
Started on localhost...
Finished on localhost:
  {
    "stdout": "Terraform directory already initialized"
  }
Finished: task terraform::initialize with 0 failures in 0.18 sec
Starting: plan terraform::destroy
Starting: task terraform::destroy on localhost
Started on localhost...
Failed on localhost:

  Error: Error in function call

    on modules/networking/main.tf line 7, in locals:
     7:   vpc_id        = try(aws_vpc.pe[0].id, data.aws_vpc.existing[0].id)
      ├────────────────
      │ while calling try(expressions...)
      │ aws_vpc.pe is empty tuple
      │ data.aws_vpc.existing is empty tuple

  Call to function "try" failed: no expression succeeded:
  - Invalid index (at modules/networking/main.tf:7,33-36)
    The given key does not identify an element in this collection value: the collection has no elements.
  - Invalid index (at modules/networking/main.tf:7,62-65)
    The given key does not identify an element in this collection value: the collection has no elements.

  At least one expression must produce a successful result.
Finished: task terraform::destroy with 1 failure in 6.35 sec
Finished: plan terraform::destroy in 6.35 sec
Finished: plan pecdm::subplans::destroy in 7.49 sec
Finished: plan pecdm::destroy in 7.5 sec
Failed on localhost:

  Error: Error in function call

    on modules/networking/main.tf line 7, in locals:
     7:   vpc_id        = try(aws_vpc.pe[0].id, data.aws_vpc.existing[0].id)
      ├────────────────
      │ while calling try(expressions...)
      │ aws_vpc.pe is empty tuple
      │ data.aws_vpc.existing is empty tuple

  Call to function "try" failed: no expression succeeded:
  - Invalid index (at modules/networking/main.tf:7,33-36)
    The given key does not identify an element in this collection value: the collection has no elements.
  - Invalid index (at modules/networking/main.tf:7,62-65)
    The given key does not identify an element in this collection value: the collection has no elements.

  At least one expression must produce a successful result.
Failed on 1 target: localhost
Ran on 1 target
timidri commented 1 year ago

@jessereynolds I have re-tested this with the newest pecdm (https://github.com/puppetlabs/puppetlabs-pecdm/commit/4149814346d47a48282df81465713366e3482214) and it works for me, both apply and destroy. Can you please try this version?

jessereynolds commented 1 year ago

@timidri looking good with commit 4149814346d47a48282df81465713366e3482214 on the fix-terraform-vars branch, thank you.

timidri commented 1 year ago

@jessereynolds Awesome! Closing the issue. /cc @ody