azurerm-dalek

command module
v0.0.0-...-4c64dde Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: MIT Imports: 10 Imported by: 0

README

Azure Dalek

Azure Dalek will work through your Azure Subscription and delete everything it comes across (matching a filter).

~> NOTE / BE AWARE: This will delete resources in your Azure Subscription which do not include the tag DoNotDelete - please read the source to understand before running.

The Dalek supports using both a Service Principal and your Azure CLI credentials. The following Environment Variables can be configure:

  • ARM_CLIENT_ID - (Optional) The Client ID associated with the Service Principal used for authentication
  • ARM_CLIENT_SECRET - (Optional) The Client Secret associated with the Service Principal used for authentication
  • ARM_ENVIRONMENT - (Optional) The Azure Environment which the tests should be run against, e.g. public, german, azurestackcloud. Defaults to public.
  • ARM_SUBSCRIPTION_ID - The ID of the Azure Subscription within the Tenant
  • ARM_TENANT_ID - The ID of the Azure Tenant
  • ARM_ENDPOINT - (Optional) The URI of a Custom Resource Manager Endpoint, intended for use with Azure Stack.
  • YES_I_REALLY_WANT_TO_DELETE_THINGS - (Optional) Set this to true to actually delete resources

It's also possible to use the following command line flags:

  • prefix - (Optional) An optional prefix for Resource Group names.

Dependencies

  • Go 1.19

Example Usage

To delete using your Azure CLI Credentials against Azure Public:

$ go build .
$ YES_I_REALLY_WANT_TO_DELETE_THINGS="true" ./azurerm-dalek

To delete with a Service Principal against Azure Public:

$ export ARM_CLIENT_ID="00000000-0000-0000-0000-000000000000"
$ export ARM_CLIENT_SECRET="00000000-0000-0000-0000-000000000000"
$ export ARM_ENVIRONMENT="public"
$ export ARM_SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000"
$ export ARM_TENANT_ID="00000000-0000-0000-0000-000000000000"
$ go build .
$ YES_I_REALLY_WANT_TO_DELETE_THINGS="true" ./azurerm-dalek

To delete using your Azure CLI Credentials against Azure Stack:

$ go build .
$ YES_I_REALLY_WANT_TO_DELETE_THINGS="true" ./azurerm-dalek

To delete with a Service Principal against Azure Stack:

$ export ARM_CLIENT_ID="00000000-0000-0000-0000-000000000000"
$ export ARM_CLIENT_SECRET="00000000-0000-0000-0000-000000000000"
$ export ARM_ENVIRONMENT="public"
$ export ARM_ENDPOINT="https://management.westus.mydomain.com
$ export ARM_SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000"
$ export ARM_TENANT_ID="00000000-0000-0000-0000-000000000000"
$ go build .
$ YES_I_REALLY_WANT_TO_DELETE_THINGS="true" ./azurerm-dalek

Licence

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL