azure

package
v0.0.0-...-3ad3058 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TenantScope        registry.Scope = "tenant"
	SubscriptionScope  registry.Scope = "subscription"
	ResourceGroupScope registry.Scope = "resource-group"
)

Variables

View Source
var (
	ResourceGroupRegex = regexp.MustCompile(`/resourceGroups/([^/]+)`)
)

Functions

func GetResourceGroupFromID

func GetResourceGroupFromID(id string) *string

Types

type Authorizers

type Authorizers struct {
	Graph      *autorest.Authorizer
	Management *autorest.Authorizer

	MicrosoftGraph  auth.Authorizer
	ResourceManager auth.Authorizer

	IdentityCreds azcore.TokenCredential
}

func ConfigureAuth

func ConfigureAuth(
	ctx context.Context,
	environment, tenantID, clientID, clientSecret, clientCertFile, clientFedTokenFile string) (*Authorizers, error)

type ListerOpts

type ListerOpts struct {
	Authorizers    *Authorizers
	TenantID       string
	SubscriptionID string
	ResourceGroup  string
	ResourceGroups []string
	Region         string
	Regions        []string
}

type Prompt

type Prompt struct {
	Parameters *libnuke.Parameters
	Tenant     *Tenant
}

Prompt is a struct that contains the parameters and tenant details use to craft a unique prompt for the user to confirm the nuke operation.

func (*Prompt) Prompt

func (p *Prompt) Prompt() error

type Tenant

type Tenant struct {
	Authorizers *Authorizers

	ID              string
	SubscriptionIds []string
	TenantIds       []string

	Regions        map[string][]string
	ResourceGroups map[string][]string
}

func NewTenant

func NewTenant(
	pctx context.Context, authorizers *Authorizers,
	tenantID string, subscriptionIDs, regions []string,
) (*Tenant, error)

Jump to

Keyboard shortcuts

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