clients

package
v0.0.0-...-ae1b243 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DnsContributorRole = Role{
		Name: "DNS Zone Contributor",
		Id:   "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/befefa01-2a29-4197-83a8-272ff33ce314",
	}
	PrivateDnsContributorRole = Role{
		Name: "Private DNS Zone Contributor",
		Id:   "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/b12aa53e-6015-4669-85d0-8515ebb3ae7f",
	}
	AcrPullRole = Role{
		Name: "AcrPull",
		Id:   "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/7f951dda-4ed3-4680-a7ca-43fe172d538d",
	}
)
View Source
var OsmClusterOpt = McOpt{
	Name: "osm cluster",
	// contains filtered or unexported fields
}
View Source
var PrivateClusterOpt = McOpt{
	Name: "private cluster",
	// contains filtered or unexported fields
}

PrivateClusterOpt specifies that the cluster should be private

Functions

func LoadAcr

func LoadAcr(id azure.Resource) *acr

func LoadAks

func LoadAks(id azure.Resource, dnsServiceIp, location, principalId, clientId string, options map[string]struct{}) *aks

func LoadAkv

func LoadAkv(id azure.Resource) *akv

func LoadPrivateZone

func LoadPrivateZone(id azure.Resource) *privateZone

func LoadRg

func LoadRg(id arm.ResourceID) *rg

func LoadZone

func LoadZone(id azure.Resource, nameservers []string) *zone

func NewAcr

func NewAcr(ctx context.Context, subscriptionId, resourceGroup, name, location string) (*acr, error)

func NewAks

func NewAks(ctx context.Context, subscriptionId, resourceGroup, name, location string, spOpts *ServicePrincipal, mcOpts ...McOpt) (*aks, error)

NewAks creates a new AKS cluster spOpts is optional, if nil then the cluster will use MSI

func NewAkv

func NewAkv(ctx context.Context, tenantId, subscriptionId, resourceGroup, name, location string) (*akv, error)

func NewPrivateZone

func NewPrivateZone(ctx context.Context, subscriptionId, resourceGroup, name string, opts ...PrivateZoneOpt) (*privateZone, error)

func NewResourceGroup

func NewResourceGroup(ctx context.Context, subscriptionId, name, location string, rgOpts ...RgOpt) (*rg, error)

func NewRoleAssignment

func NewRoleAssignment(ctx context.Context, subscriptionId, scope, principalId string, role Role) (*roleAssignment, error)

func NewZone

func NewZone(ctx context.Context, subscriptionId, resourceGroup, name string, zoneOpts ...ZoneOpt) (*zone, error)

Types

type Cert

type Cert struct {
	// contains filtered or unexported fields
}

func LoadCert

func LoadCert(name, id string) *Cert

func (*Cert) GetId

func (c *Cert) GetId() string

func (*Cert) GetName

func (c *Cert) GetName() string

type CertOpt

CertOpt specifies what kind of certificate to create

type McOpt

type McOpt struct {
	Name string
	// contains filtered or unexported fields
}

McOpt specifies what kind of managed cluster to create

type PrivateZoneOpt

type PrivateZoneOpt func(z *armprivatedns.PrivateZone) error

PrivateZoneOpt specifies what kind of private zone to create

type RgOpt

type RgOpt func(rg *armresources.ResourceGroup) error

func DeleteAfterOpt

func DeleteAfterOpt(d time.Duration) RgOpt

type Role

type Role struct {
	Name string
	// format string with a single %s for the subscription id
	Id string
}

type ServicePrincipal

type ServicePrincipal struct {
	// ApplicationObjectID is Object ID of the application associated with the service principal
	ApplicationObjectID string
	// ApplicationClientID is the Client ID of the application and service principal (also called AppID of the service principal)
	ApplicationClientID string
	// ServicePrincipalObjectID is Object ID of the service principal
	ServicePrincipalObjectID string
	// ServicePrincipalCredPassword is a generated password credential for the application associated with the service principal
	ServicePrincipalCredPassword string
}

ServicePrincipal represents all the information needed to use a service principal including a fresh set of credentials and the associated application and service principal object ids. This representation is intended as read-only as in most cases only one ID is needed to retrieve the rest of the information for testing purposes.

func GetServicePrincipalOptions

func GetServicePrincipalOptions(ctx context.Context, applicationObjectID string, credName string) (*ServicePrincipal, error)

GetServicePrincipalOptions populates a new ServicePrincipalOptions struct with fresh credentials and application/client/servicePrincipal object ids

type ZoneOpt

type ZoneOpt func(z *armdns.Zone) error

ZoneOpt specifies what kind of zone to create

Jump to

Keyboard shortcuts

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