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

Db/azure integration #420

Merged
merged 4 commits into from
Aug 1, 2024
Merged

Db/azure integration #420

merged 4 commits into from
Aug 1, 2024

Conversation

davidbloss
Copy link
Contributor

@davidbloss davidbloss commented Aug 1, 2024

Issues

Picks up where the previous PR left off

Changelog

Add Azure Resources integration

  • List your changes here
  • Make a changie entry

Tophatting

Given this Terraform config file

# main.tf
resource "opslevel_integration_azure_resources" "test" {
  client_id       = "XXX_CLIENT_ID_XXX"
  client_secret   = "XXX_CLIENT_SECRET_XXX"
  name            = "DEV"
  subscription_id = "01234567-3523-0123-0123-012345678901"
  tenant_id       = "98765432-8976-9876-9876-987654321098"

  ownership_tag_keys      = ["owner", "team", "group"]
  ownership_tag_overrides = true
}

Create the opslevel_integration_azure_resources resource, terraform apply

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

Terraform will perform the following actions:

  # opslevel_integration_azure_resources.test will be created
  + resource "opslevel_integration_azure_resources" "test" {
      + aliases                 = (known after apply)
      + client_id               = "XXX_CLIENT_ID_XXX"
      + client_secret           = (sensitive value)
      + created_at              = (known after apply)
      + id                      = (known after apply)
      + installed_at            = (known after apply)
      + name                    = "DEV"
      + ownership_tag_keys      = [
          + "group",
          + "owner",
          + "team",
        ]
      + ownership_tag_overrides = true
      + subscription_id         = "01234567-3523-0123-0123-012345678901"
      + tenant_id               = "98765432-8976-9876-9876-987654321098"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
opslevel_integration_azure_resources.test: Creating...
opslevel_integration_azure_resources.test: Creation complete after 0s [id=Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Update the Terraform config file, unset optional fields

# main.tf - with changes
resource "opslevel_integration_azure_resources" "test" {
  client_id       = "XXX_CLIENT_ID_XXX"
  client_secret   = "XXX_CLIENT_SECRET_XXX"
  name            = "DEV"
  subscription_id = "01234567-3523-0123-0123-012345678901"
  tenant_id       = "98765432-8976-9876-9876-987654321098"

  # ownership_tag_keys      = ["owner", "team", "group"]
  # ownership_tag_overrides = true
}

Update the opslevel_<resource> resource, terraform apply

opslevel_integration_azure_resources.test: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # opslevel_integration_azure_resources.test will be updated in-place
  ~ resource "opslevel_integration_azure_resources" "test" {
      + aliases                 = (known after apply)
      ~ created_at              = "Thursday, 01-Aug-24 11:04:27 CDT" -> (known after apply)
        id                      = "Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc"
      ~ installed_at            = "Thursday, 01-Aug-24 11:04:27 CDT" -> (known after apply)
        name                    = "DEV"
      - ownership_tag_keys      = [
          - "group",
          - "owner",
          - "team",
        ] -> null
      - ownership_tag_overrides = true -> null
        # (4 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
opslevel_integration_azure_resources.test: Modifying... [id=Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc]
opslevel_integration_azure_resources.test: Modifications complete after 0s [id=Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Destroy the opslevel_<resource> resource, terraform destroy

opslevel_integration_azure_resources.test: Refreshing state... [id=Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc]

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:

  # opslevel_integration_azure_resources.test will be destroyed
  - resource "opslevel_integration_azure_resources" "test" {
      - client_id       = "XXX_CLIENT_ID_XXX" -> null
      - client_secret   = (sensitive value) -> null
      - created_at      = "Thursday, 01-Aug-24 11:04:27 CDT" -> null
      - id              = "Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc" -> null
      - installed_at    = "Thursday, 01-Aug-24 11:04:27 CDT" -> null
      - name            = "DEV" -> null
      - subscription_id = "01234567-3523-0123-0123-012345678901" -> null
      - tenant_id       = "98765432-8976-9876-9876-987654321098" -> null
    }

Plan: 0 to add, 0 to change, 1 to destroy.
opslevel_integration_azure_resources.test: Destroying... [id=Z2lkOi8vb3BzbGV2ZWwvSW50ZWdyYXRpb25zOjpBenVyZVJlc291cmNlc0ludGVncmF0aW9uLzU4NTc]
opslevel_integration_azure_resources.test: Destruction complete after 0s

Destroy complete! Resources: 1 destroyed.

davidbloss and others added 2 commits July 31, 2024 15:33
---------

Co-authored-by: Taimoor Ahmad <taimoor@opslevel.com>
@davidbloss davidbloss self-assigned this Aug 1, 2024
@davidbloss davidbloss merged commit caa5f51 into main Aug 1, 2024
6 checks passed
@davidbloss davidbloss deleted the db/azure-integration branch August 1, 2024 19:00
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.

2 participants