Documentation
¶
Index ¶
- Constants
- Variables
- func BuildChainedTokenCredential(model MSGraphProviderModel, options azidentity.DefaultAzureCredentialOptions) (*azidentity.ChainedTokenCredential, error)
- func New() func() provider.Provider
- func ResolveCloudEnvironment(environment string) (cloud.Configuration, error)
- type MSGraphProvider
- func (p *MSGraphProvider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *MSGraphProvider) DataSources(ctx context.Context) []func() datasource.DataSource
- func (p *MSGraphProvider) Metadata(ctx context.Context, req provider.MetadataRequest, ...)
- func (p *MSGraphProvider) Resources(ctx context.Context) []func() resource.Resource
- func (p *MSGraphProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
- type MSGraphProviderModel
- type MsiCredential
- type OidcCredential
- type OidcCredentialOptions
Constants ¶
View Source
const ( // Canonical environment names (kept consistent with the AzureAD provider). EnvironmentPublic = "public" EnvironmentUSGovernmentL4 = "usgovernmentl4" EnvironmentUSGovernmentL5 = "usgovernmentl5" EnvironmentChina = "china" // Aliases accepted for the canonical names above. EnvironmentGlobal = "global" EnvironmentUSGovernment = "usgovernment" EnvironmentDoD = "dod" GraphHostPublic = "https://graph.microsoft.com" GraphHostUSGovernmentL4 = "https://graph.microsoft.us" GraphHostUSGovernmentL5 = "https://dod-graph.microsoft.us" GraphHostChina = "https://microsoftgraph.chinacloudapi.cn" )
Variables ¶
View Source
var Environments = map[string]cloud.Configuration{ EnvironmentPublic: withGraphService(cloud.AzurePublic, GraphHostPublic), EnvironmentGlobal: withGraphService(cloud.AzurePublic, GraphHostPublic), EnvironmentUSGovernment: withGraphService(cloud.AzureGovernment, GraphHostUSGovernmentL4), EnvironmentUSGovernmentL4: withGraphService(cloud.AzureGovernment, GraphHostUSGovernmentL4), EnvironmentDoD: withGraphService(cloud.AzureGovernment, GraphHostUSGovernmentL5), EnvironmentUSGovernmentL5: withGraphService(cloud.AzureGovernment, GraphHostUSGovernmentL5), EnvironmentChina: withGraphService(cloud.AzureChina, GraphHostChina), }
Environments is the single source of truth mapping every accepted environment name (canonical values and their AzureAD-compatible aliases) to a fully resolved cloud.Configuration that embeds the Microsoft Graph service endpoint and audience.
View Source
var SupportedEnvironments = []string{ EnvironmentPublic, EnvironmentGlobal, EnvironmentUSGovernment, EnvironmentUSGovernmentL4, EnvironmentDoD, EnvironmentUSGovernmentL5, EnvironmentChina, }
SupportedEnvironments contains every value accepted for the `environment` argument, including the aliases that mirror the AzureAD provider. The order is stable so it can back both the schema validator and the documentation.
Functions ¶
func BuildChainedTokenCredential ¶
func BuildChainedTokenCredential(model MSGraphProviderModel, options azidentity.DefaultAzureCredentialOptions) (*azidentity.ChainedTokenCredential, error)
func ResolveCloudEnvironment ¶ added in v0.5.0
func ResolveCloudEnvironment(environment string) (cloud.Configuration, error)
ResolveCloudEnvironment returns the cloud.Configuration for the given environment name. An empty value defaults to the public cloud.
Types ¶
type MSGraphProvider ¶
type MSGraphProvider struct{}
func (*MSGraphProvider) Configure ¶
func (p *MSGraphProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
func (*MSGraphProvider) DataSources ¶
func (p *MSGraphProvider) DataSources(ctx context.Context) []func() datasource.DataSource
func (*MSGraphProvider) Metadata ¶
func (p *MSGraphProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse)
func (*MSGraphProvider) Resources ¶
func (p *MSGraphProvider) Resources(ctx context.Context) []func() resource.Resource
func (*MSGraphProvider) Schema ¶
func (p *MSGraphProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
type MSGraphProviderModel ¶
type MSGraphProviderModel struct {
Environment types.String `tfsdk:"environment"`
ClientID types.String `tfsdk:"client_id"`
ClientIDFilePath types.String `tfsdk:"client_id_file_path"`
TenantID types.String `tfsdk:"tenant_id"`
ClientCertificatePath types.String `tfsdk:"client_certificate_path"`
ClientCertificate types.String `tfsdk:"client_certificate"`
ClientCertificatePassword types.String `tfsdk:"client_certificate_password"`
ClientSecret types.String `tfsdk:"client_secret"`
ClientSecretFilePath types.String `tfsdk:"client_secret_file_path"`
OIDCRequestToken types.String `tfsdk:"oidc_request_token"`
OIDCRequestURL types.String `tfsdk:"oidc_request_url"`
OIDCToken types.String `tfsdk:"oidc_token"`
OIDCTokenFilePath types.String `tfsdk:"oidc_token_file_path"`
OIDCAzureServiceConnectionID types.String `tfsdk:"oidc_azure_service_connection_id"`
UseOIDC types.Bool `tfsdk:"use_oidc"`
UseCLI types.Bool `tfsdk:"use_cli"`
UsePowerShell types.Bool `tfsdk:"use_powershell"`
UseMSI types.Bool `tfsdk:"use_msi"`
UseAKSWorkloadIdentity types.Bool `tfsdk:"use_aks_workload_identity"`
PartnerID types.String `tfsdk:"partner_id"`
CustomCorrelationRequestID types.String `tfsdk:"custom_correlation_request_id"`
DisableCorrelationRequestID types.Bool `tfsdk:"disable_correlation_request_id"`
DisableTerraformPartnerID types.Bool `tfsdk:"disable_terraform_partner_id"`
}
func (MSGraphProviderModel) GetClientId ¶
func (model MSGraphProviderModel) GetClientId() (*string, error)
func (MSGraphProviderModel) GetClientSecret ¶
func (model MSGraphProviderModel) GetClientSecret() (*string, error)
func (MSGraphProviderModel) GetOIDCTokenFilePath ¶
func (model MSGraphProviderModel) GetOIDCTokenFilePath() string
type MsiCredential ¶
type MsiCredential struct {
// contains filtered or unexported fields
}
func NewManagedIdentityCredential ¶
func NewManagedIdentityCredential(options *azidentity.ManagedIdentityCredentialOptions) (*MsiCredential, error)
func (*MsiCredential) GetToken ¶
func (w *MsiCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error)
type OidcCredential ¶
type OidcCredential struct {
// contains filtered or unexported fields
}
func NewOidcCredential ¶
func NewOidcCredential(options *OidcCredentialOptions) (*OidcCredential, error)
func (*OidcCredential) GetToken ¶
func (w *OidcCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error)
Click to show internal directories.
Click to hide internal directories.