Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

fix(tests): Update Lightsail terraform for Integration testing of Instances #1137

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

hermanschaaf
Copy link
Member

  • attach a disk to an instance, a requirement for integration testing Lightsail Instances with disks attached. The disk and instance must also be in the same region and AZ
  • certain resource names must be lowercase; we should therefore convert the prefix to lowercase for those cases
  • fix some typos

@hermanschaaf hermanschaaf requested a review from a team as a code owner July 1, 2022 14:53
@hermanschaaf hermanschaaf requested review from zagronitay and removed request for a team July 1, 2022 14:53
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

Terraform Format and Style success

Terraform Initialization success

Terraform Validation success

Validation Output

Success! The configuration is valid.


Terraform Plan success

Show Plan

module.demo.awslightsail_container_service.awslightsail_container_service: Refreshing state... [id=cq-container-service]
module.demo.awslightsail_bucket.awslightsail_bucket: Refreshing state... [id=cq-lightsail-bucket]
module.demo.awslightsail_lb.awslightsail_lb: Refreshing state... [id=cq_load_ballancer]
module.demo.awslightsail_disk.awslightsail_disk: Refreshing state... [id=cq_awslightsail_disk]
module.demo.awslightsail_certificate.awslightsail_certificate: Refreshing state... [id=cq_awslightsail_certificate]
module.demo.awslightsail_database.awslightsail_database: Refreshing state... [id=cq-lightsail-database]
module.demo.awslightsail_container_deployment.awslightsail_container_deployment: Refreshing state... [id=cq-container-service]
module.demo.aws_lightsail_static_ip.aws_lightsail_static_ip: Refreshing state... [id=cq_static_ip]
module.demo.aws_lightsail_key_pair.aws_lightsail_key_pair: Refreshing state... [id=cq_key_pair]
module.demo.aws_lightsail_instance.aws_lightsail_instance: Refreshing state... [id=cq-lightsaleinstance]
module.demo.aws_lightsail_static_ip_attachment.test: Refreshing state... [id=cq_static_ip]
module.demo.awslightsail_lb_attachment.test: Refreshing state... [id=cq_load_ballancer_cq-lightsaleinstance]

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

Terraform will perform the following actions:

  # module.demo.aws_lightsail_instance.aws_lightsail_instance must be replaced
-/+ resource "aws_lightsail_instance" "aws_lightsail_instance" {
      ~ arn                = "arn:aws:lightsail:us-east-1:707066037989:Instance/1a9bb861-8b67-4945-a35c-ef2af24a2fc8" -> (known after apply)
      ~ cpu_count          = 1 -> (known after apply)
      ~ created_at         = "2022-06-23T11:28:38Z" -> (known after apply)
      ~ id                 = "cq-lightsaleinstance" -> (known after apply)
      ~ ipv6_address       = "2600:1f18:980:4301:5eeb:feeb:b1b7:11a2" -> (known after apply)
      ~ ipv6_addresses     = [
          - "2600:1f18:980:4301:5eeb:feeb:b1b7:11a2",
        ] -> (known after apply)
      ~ is_static_ip       = true -> (known after apply)
      ~ name               = "cq-lightsaleinstance" -> "cq-lightsailinstance" # forces replacement
      ~ private_ip_address = "172.26.20.190" -> (known after apply)
      ~ public_ip_address  = "34.197.132.4" -> (known after apply)
      ~ ram_size           = 0.5 -> (known after apply)
      ~ tags               = {
          + "foo1" = "bar1"
          + "foo2" = ""
        }
      ~ tags_all           = {
          + "foo1" = "bar1"
          + "foo2" = (known after apply)
        }
      ~ username           = "ec2-user" -> (known after apply)
        # (4 unchanged attributes hidden)
    }

  # module.demo.aws_lightsail_static_ip_attachment.test must be replaced
-/+ resource "aws_lightsail_static_ip_attachment" "test" {
      ~ id             = "cq_static_ip" -> (known after apply)
      ~ instance_name  = "cq-lightsaleinstance" -> (known after apply) # forces replacement
      ~ ip_address     = "34.197.132.4" -> (known after apply)
        # (1 unchanged attribute hidden)
    }

  # module.demo.awslightsail_disk.awslightsail_disk must be replaced
-/+ resource "awslightsail_disk" "awslightsail_disk" {
      ~ arn               = "arn:aws:lightsail:us-east-1:707066037989:Disk/5510b71c-820b-4beb-be08-031a0baa0cd1" -> (known after apply)
      ~ availability_zone = "us-east-1a" -> "us-east-1b" # forces replacement
      ~ created_at        = "2022-06-23T11:28:31Z" -> (known after apply)
      ~ id                = "cq_awslightsail_disk" -> (known after apply)
        name              = "cq_awslightsail_disk"
      ~ tags              = {
          + "foo1" = "bar1"
          + "foo2" = ""
        }
      ~ tags_all          = {
          + "foo1" = "bar1"
          + "foo2" = (known after apply)
        }
        # (1 unchanged attribute hidden)
    }

  # module.demo.awslightsail_disk_attachment.test will be created
  + resource "awslightsail_disk_attachment" "test" {
      + disk_name     = "cq_awslightsail_disk"
      + disk_path     = "/dev/xvdf"
      + id            = (known after apply)
      + instance_name = "cq-lightsailinstance"
    }

  # module.demo.awslightsail_domain.awslightsail_domain will be created
  + resource "awslightsail_domain" "awslightsail_domain" {
      + arn         = (known after apply)
      + domain_name = "mydomain.com"
      + id          = (known after apply)
      + tags_all    = (known after apply)
    }

  # module.demo.awslightsail_lb.awslightsail_lb must be replaced
-/+ resource "awslightsail_lb" "awslightsail_lb" {
      ~ arn               = "arn:aws:lightsail:us-east-1:707066037989:LoadBalancer/3a2cf663-8308-411f-97e2-3497b7c6fd8a" -> (known after apply)
      ~ created_at        = "2022-06-23T11:28:30Z" -> (known after apply)
      ~ dns_name          = "7c8377eb56c07f4fff36c8dc8e83b561-1719117880.us-east-1.elb.amazonaws.com" -> (known after apply)
      ~ id                = "cq_load_ballancer" -> (known after apply)
      ~ name              = "cq_load_ballancer" -> "cq_load_balancer" # forces replacement
      ~ protocol          = "HTTP" -> (known after apply)
      ~ public_ports      = [
          - 80,
        ] -> (known after apply)
      - tags              = {} -> null
      ~ tags_all          = {} -> (known after apply)
        # (3 unchanged attributes hidden)
    }

  # module.demo.awslightsail_lb_attachment.test must be replaced
-/+ resource "awslightsail_lb_attachment" "test" {
      ~ id                 = "cq_load_ballancer_cq-lightsaleinstance" -> (known after apply)
      ~ instance_name      = "cq-lightsaleinstance" -> "cq-lightsailinstance" # forces replacement
      ~ load_balancer_name = "cq_load_ballancer" -> "cq_load_balancer" # forces replacement
    }

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

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan.binary

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan.binary"

Pusher: @hermanschaaf, Action: pull_request_target, Working Directory: ``, Workflow: terraform_plan

@github-actions
Copy link

github-actions bot commented Jul 1, 2022

💰 Infracost estimate: monthly cost will not change

Project Previous New Diff
cloudquery/cq-provider-aws/terraform/lightsail/prod/plan.json $3.43 $3.43 $0
Infracost output
──────────────────────────────────

The following projects have no cost estimate changes: cloudquery/cq-provider-aws/terraform/lightsail/prod/plan.json
Run infracost breakdown to see their breakdown.

──────────────────────────────────
4 cloud resources were detected:
∙ 1 was estimated
∙ 3 were free:
  ∙ 1 x aws_lightsail_key_pair
  ∙ 1 x aws_lightsail_static_ip
  ∙ 1 x aws_lightsail_static_ip_attachment

This comment will be updated when the cost estimate changes.

Is this comment useful? Yes, No

@hermanschaaf hermanschaaf merged commit 488a003 into cloudquery:main Jul 4, 2022
kodiakhq bot pushed a commit that referenced this pull request Jul 4, 2022
🤖 I have created a release *beep* *boop*
---


## [0.12.25](v0.12.24...v0.12.25) (2022-07-04)


### Bug Fixes

* **deps:** Update github.com/gocarina/gocsv digest to 72f2e84 ([#1151](#1151)) ([1c870e8](1c870e8))
* **deps:** Update module github.com/aws/aws-sdk-go-v2 to v1.16.6 ([#1152](#1152)) ([4ac2583](4ac2583))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/accessanalyzer to v1.15.7 ([#1153](#1153)) ([9ed2343](9ed2343))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/codepipeline to v1.13.7 ([#1154](#1154)) ([0a34f8e](0a34f8e))
* **deps:** Update module github.com/cloudquery/cq-provider-sdk to v0.13.3 ([#1156](#1156)) ([d4b0701](d4b0701))
* **docs:** Update documentation about adding new resources ([#1136](#1136)) ([fe5a5ad](fe5a5ad))
* **tests:** Update Lightsail terraform for Integration testing of Instances ([#1137](#1137)) ([488a003](488a003))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
erezrokah pushed a commit to cloudquery/cloudquery that referenced this pull request Aug 14, 2022
🤖 I have created a release *beep* *boop*
---


## [0.12.25](cloudquery/cq-provider-aws@v0.12.24...v0.12.25) (2022-07-04)


### Bug Fixes

* **deps:** Update github.com/gocarina/gocsv digest to 72f2e84 ([#1151](cloudquery/cq-provider-aws#1151)) ([1c870e8](cloudquery/cq-provider-aws@1c870e8))
* **deps:** Update module github.com/aws/aws-sdk-go-v2 to v1.16.6 ([#1152](cloudquery/cq-provider-aws#1152)) ([4ac2583](cloudquery/cq-provider-aws@4ac2583))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/accessanalyzer to v1.15.7 ([#1153](cloudquery/cq-provider-aws#1153)) ([9ed2343](cloudquery/cq-provider-aws@9ed2343))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/codepipeline to v1.13.7 ([#1154](cloudquery/cq-provider-aws#1154)) ([0a34f8e](cloudquery/cq-provider-aws@0a34f8e))
* **deps:** Update module github.com/cloudquery/cq-provider-sdk to v0.13.3 ([#1156](cloudquery/cq-provider-aws#1156)) ([d4b0701](cloudquery/cq-provider-aws@d4b0701))
* **docs:** Update documentation about adding new resources ([#1136](cloudquery/cq-provider-aws#1136)) ([fe5a5ad](cloudquery/cq-provider-aws@fe5a5ad))
* **tests:** Update Lightsail terraform for Integration testing of Instances ([#1137](cloudquery/cq-provider-aws#1137)) ([488a003](cloudquery/cq-provider-aws@488a003))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants