repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1 value | license stringclasses 7 values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2 classes |
|---|---|---|---|---|---|---|---|---|
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/apiRelease.go | sdk/go/azure/apimanagement/apiRelease.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a API Management API Release.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("My Company"),
// PublisherEmail: pulumi.String("company@terraform.io"),
// SkuName: pulumi.String("Developer_1"),
// })
// if err != nil {
// return err
// }
// exampleApi, err := apimanagement.NewApi(ctx, "example", &apimanagement.ApiArgs{
// Name: pulumi.String("example-api"),
// ResourceGroupName: example.Name,
// ApiManagementName: exampleService.Name,
// Revision: pulumi.String("1"),
// DisplayName: pulumi.String("Example API"),
// Path: pulumi.String("example"),
// Protocols: pulumi.StringArray{
// pulumi.String("https"),
// },
// Import: &apimanagement.ApiImportArgs{
// ContentFormat: pulumi.String("swagger-link-json"),
// ContentValue: pulumi.String("https://raw.githubusercontent.com/hashicorp/terraform-provider-azurerm/refs/heads/main/internal/services/apimanagement/testdata/api_management_api_swagger.json"),
// },
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewApiRelease(ctx, "example", &apimanagement.ApiReleaseArgs{
// Name: pulumi.String("example-Api-Release"),
// ApiId: exampleApi.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management API Releases can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/apiRelease:ApiRelease example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/apis/api1/releases/release1
// ```
type ApiRelease struct {
pulumi.CustomResourceState
// The ID of the API Management API. Changing this forces a new API Management API Release to be created.
ApiId pulumi.StringOutput `pulumi:"apiId"`
// The name which should be used for this API Management API Release. Changing this forces a new API Management API Release to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The Release Notes.
Notes pulumi.StringPtrOutput `pulumi:"notes"`
}
// NewApiRelease registers a new resource with the given unique name, arguments, and options.
func NewApiRelease(ctx *pulumi.Context,
name string, args *ApiReleaseArgs, opts ...pulumi.ResourceOption) (*ApiRelease, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiId == nil {
return nil, errors.New("invalid value for required argument 'ApiId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ApiRelease
err := ctx.RegisterResource("azure:apimanagement/apiRelease:ApiRelease", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApiRelease gets an existing ApiRelease resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetApiRelease(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiReleaseState, opts ...pulumi.ResourceOption) (*ApiRelease, error) {
var resource ApiRelease
err := ctx.ReadResource("azure:apimanagement/apiRelease:ApiRelease", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApiRelease resources.
type apiReleaseState struct {
// The ID of the API Management API. Changing this forces a new API Management API Release to be created.
ApiId *string `pulumi:"apiId"`
// The name which should be used for this API Management API Release. Changing this forces a new API Management API Release to be created.
Name *string `pulumi:"name"`
// The Release Notes.
Notes *string `pulumi:"notes"`
}
type ApiReleaseState struct {
// The ID of the API Management API. Changing this forces a new API Management API Release to be created.
ApiId pulumi.StringPtrInput
// The name which should be used for this API Management API Release. Changing this forces a new API Management API Release to be created.
Name pulumi.StringPtrInput
// The Release Notes.
Notes pulumi.StringPtrInput
}
func (ApiReleaseState) ElementType() reflect.Type {
return reflect.TypeOf((*apiReleaseState)(nil)).Elem()
}
type apiReleaseArgs struct {
// The ID of the API Management API. Changing this forces a new API Management API Release to be created.
ApiId string `pulumi:"apiId"`
// The name which should be used for this API Management API Release. Changing this forces a new API Management API Release to be created.
Name *string `pulumi:"name"`
// The Release Notes.
Notes *string `pulumi:"notes"`
}
// The set of arguments for constructing a ApiRelease resource.
type ApiReleaseArgs struct {
// The ID of the API Management API. Changing this forces a new API Management API Release to be created.
ApiId pulumi.StringInput
// The name which should be used for this API Management API Release. Changing this forces a new API Management API Release to be created.
Name pulumi.StringPtrInput
// The Release Notes.
Notes pulumi.StringPtrInput
}
func (ApiReleaseArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiReleaseArgs)(nil)).Elem()
}
type ApiReleaseInput interface {
pulumi.Input
ToApiReleaseOutput() ApiReleaseOutput
ToApiReleaseOutputWithContext(ctx context.Context) ApiReleaseOutput
}
func (*ApiRelease) ElementType() reflect.Type {
return reflect.TypeOf((**ApiRelease)(nil)).Elem()
}
func (i *ApiRelease) ToApiReleaseOutput() ApiReleaseOutput {
return i.ToApiReleaseOutputWithContext(context.Background())
}
func (i *ApiRelease) ToApiReleaseOutputWithContext(ctx context.Context) ApiReleaseOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiReleaseOutput)
}
// ApiReleaseArrayInput is an input type that accepts ApiReleaseArray and ApiReleaseArrayOutput values.
// You can construct a concrete instance of `ApiReleaseArrayInput` via:
//
// ApiReleaseArray{ ApiReleaseArgs{...} }
type ApiReleaseArrayInput interface {
pulumi.Input
ToApiReleaseArrayOutput() ApiReleaseArrayOutput
ToApiReleaseArrayOutputWithContext(context.Context) ApiReleaseArrayOutput
}
type ApiReleaseArray []ApiReleaseInput
func (ApiReleaseArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiRelease)(nil)).Elem()
}
func (i ApiReleaseArray) ToApiReleaseArrayOutput() ApiReleaseArrayOutput {
return i.ToApiReleaseArrayOutputWithContext(context.Background())
}
func (i ApiReleaseArray) ToApiReleaseArrayOutputWithContext(ctx context.Context) ApiReleaseArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiReleaseArrayOutput)
}
// ApiReleaseMapInput is an input type that accepts ApiReleaseMap and ApiReleaseMapOutput values.
// You can construct a concrete instance of `ApiReleaseMapInput` via:
//
// ApiReleaseMap{ "key": ApiReleaseArgs{...} }
type ApiReleaseMapInput interface {
pulumi.Input
ToApiReleaseMapOutput() ApiReleaseMapOutput
ToApiReleaseMapOutputWithContext(context.Context) ApiReleaseMapOutput
}
type ApiReleaseMap map[string]ApiReleaseInput
func (ApiReleaseMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiRelease)(nil)).Elem()
}
func (i ApiReleaseMap) ToApiReleaseMapOutput() ApiReleaseMapOutput {
return i.ToApiReleaseMapOutputWithContext(context.Background())
}
func (i ApiReleaseMap) ToApiReleaseMapOutputWithContext(ctx context.Context) ApiReleaseMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiReleaseMapOutput)
}
type ApiReleaseOutput struct{ *pulumi.OutputState }
func (ApiReleaseOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ApiRelease)(nil)).Elem()
}
func (o ApiReleaseOutput) ToApiReleaseOutput() ApiReleaseOutput {
return o
}
func (o ApiReleaseOutput) ToApiReleaseOutputWithContext(ctx context.Context) ApiReleaseOutput {
return o
}
// The ID of the API Management API. Changing this forces a new API Management API Release to be created.
func (o ApiReleaseOutput) ApiId() pulumi.StringOutput {
return o.ApplyT(func(v *ApiRelease) pulumi.StringOutput { return v.ApiId }).(pulumi.StringOutput)
}
// The name which should be used for this API Management API Release. Changing this forces a new API Management API Release to be created.
func (o ApiReleaseOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ApiRelease) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The Release Notes.
func (o ApiReleaseOutput) Notes() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiRelease) pulumi.StringPtrOutput { return v.Notes }).(pulumi.StringPtrOutput)
}
type ApiReleaseArrayOutput struct{ *pulumi.OutputState }
func (ApiReleaseArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiRelease)(nil)).Elem()
}
func (o ApiReleaseArrayOutput) ToApiReleaseArrayOutput() ApiReleaseArrayOutput {
return o
}
func (o ApiReleaseArrayOutput) ToApiReleaseArrayOutputWithContext(ctx context.Context) ApiReleaseArrayOutput {
return o
}
func (o ApiReleaseArrayOutput) Index(i pulumi.IntInput) ApiReleaseOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApiRelease {
return vs[0].([]*ApiRelease)[vs[1].(int)]
}).(ApiReleaseOutput)
}
type ApiReleaseMapOutput struct{ *pulumi.OutputState }
func (ApiReleaseMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiRelease)(nil)).Elem()
}
func (o ApiReleaseMapOutput) ToApiReleaseMapOutput() ApiReleaseMapOutput {
return o
}
func (o ApiReleaseMapOutput) ToApiReleaseMapOutputWithContext(ctx context.Context) ApiReleaseMapOutput {
return o
}
func (o ApiReleaseMapOutput) MapIndex(k pulumi.StringInput) ApiReleaseOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApiRelease {
return vs[0].(map[string]*ApiRelease)[vs[1].(string)]
}).(ApiReleaseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApiReleaseInput)(nil)).Elem(), &ApiRelease{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiReleaseArrayInput)(nil)).Elem(), ApiReleaseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiReleaseMapInput)(nil)).Elem(), ApiReleaseMap{})
pulumi.RegisterOutputType(ApiReleaseOutput{})
pulumi.RegisterOutputType(ApiReleaseArrayOutput{})
pulumi.RegisterOutputType(ApiReleaseMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/backend.go | sdk/go/azure/apimanagement/backend.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a backend within an API Management Service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("My Company"),
// PublisherEmail: pulumi.String("company@exmaple.com"),
// SkuName: pulumi.String("Developer_1"),
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewBackend(ctx, "example", &apimanagement.BackendArgs{
// Name: pulumi.String("example-backend"),
// ResourceGroupName: example.Name,
// ApiManagementName: exampleService.Name,
// Protocol: pulumi.String("http"),
// Url: pulumi.String("https://backend.com/api"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2024-05-01
//
// ## Import
//
// API Management backends can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/backend:Backend example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/backends/backend1
// ```
type Backend struct {
pulumi.CustomResourceState
// The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringOutput `pulumi:"apiManagementName"`
// A `circuitBreakerRule` block as documented below.
CircuitBreakerRule BackendCircuitBreakerRulePtrOutput `pulumi:"circuitBreakerRule"`
// A `credentials` block as documented below.
Credentials BackendCredentialsPtrOutput `pulumi:"credentials"`
// The description of the backend.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The name of the API Management backend. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The protocol used by the backend host. Possible values are `http` or `soap`.
Protocol pulumi.StringOutput `pulumi:"protocol"`
// A `proxy` block as documented below.
Proxy BackendProxyPtrOutput `pulumi:"proxy"`
// The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.
ResourceId pulumi.StringPtrOutput `pulumi:"resourceId"`
// A `serviceFabricCluster` block as documented below.
ServiceFabricCluster BackendServiceFabricClusterPtrOutput `pulumi:"serviceFabricCluster"`
// The title of the backend.
Title pulumi.StringPtrOutput `pulumi:"title"`
// A `tls` block as documented below.
Tls BackendTlsPtrOutput `pulumi:"tls"`
// The backend host URL should be specified in the format `"https://backend.com/api"`, avoiding trailing slashes (/) to minimize misconfiguration risks. Azure API Management instance will append the backend resource name to this URL. This URL typically serves as the `base-url` in the [`set-backend-service`](https://learn.microsoft.com/azure/api-management/set-backend-service-policy) policy, enabling seamless transitions from frontend to backend.
Url pulumi.StringOutput `pulumi:"url"`
}
// NewBackend registers a new resource with the given unique name, arguments, and options.
func NewBackend(ctx *pulumi.Context,
name string, args *BackendArgs, opts ...pulumi.ResourceOption) (*Backend, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementName == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementName'")
}
if args.Protocol == nil {
return nil, errors.New("invalid value for required argument 'Protocol'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Url == nil {
return nil, errors.New("invalid value for required argument 'Url'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Backend
err := ctx.RegisterResource("azure:apimanagement/backend:Backend", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBackend gets an existing Backend resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetBackend(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BackendState, opts ...pulumi.ResourceOption) (*Backend, error) {
var resource Backend
err := ctx.ReadResource("azure:apimanagement/backend:Backend", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Backend resources.
type backendState struct {
// The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.
ApiManagementName *string `pulumi:"apiManagementName"`
// A `circuitBreakerRule` block as documented below.
CircuitBreakerRule *BackendCircuitBreakerRule `pulumi:"circuitBreakerRule"`
// A `credentials` block as documented below.
Credentials *BackendCredentials `pulumi:"credentials"`
// The description of the backend.
Description *string `pulumi:"description"`
// The name of the API Management backend. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The protocol used by the backend host. Possible values are `http` or `soap`.
Protocol *string `pulumi:"protocol"`
// A `proxy` block as documented below.
Proxy *BackendProxy `pulumi:"proxy"`
// The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.
ResourceId *string `pulumi:"resourceId"`
// A `serviceFabricCluster` block as documented below.
ServiceFabricCluster *BackendServiceFabricCluster `pulumi:"serviceFabricCluster"`
// The title of the backend.
Title *string `pulumi:"title"`
// A `tls` block as documented below.
Tls *BackendTls `pulumi:"tls"`
// The backend host URL should be specified in the format `"https://backend.com/api"`, avoiding trailing slashes (/) to minimize misconfiguration risks. Azure API Management instance will append the backend resource name to this URL. This URL typically serves as the `base-url` in the [`set-backend-service`](https://learn.microsoft.com/azure/api-management/set-backend-service-policy) policy, enabling seamless transitions from frontend to backend.
Url *string `pulumi:"url"`
}
type BackendState struct {
// The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringPtrInput
// A `circuitBreakerRule` block as documented below.
CircuitBreakerRule BackendCircuitBreakerRulePtrInput
// A `credentials` block as documented below.
Credentials BackendCredentialsPtrInput
// The description of the backend.
Description pulumi.StringPtrInput
// The name of the API Management backend. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The protocol used by the backend host. Possible values are `http` or `soap`.
Protocol pulumi.StringPtrInput
// A `proxy` block as documented below.
Proxy BackendProxyPtrInput
// The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.
ResourceId pulumi.StringPtrInput
// A `serviceFabricCluster` block as documented below.
ServiceFabricCluster BackendServiceFabricClusterPtrInput
// The title of the backend.
Title pulumi.StringPtrInput
// A `tls` block as documented below.
Tls BackendTlsPtrInput
// The backend host URL should be specified in the format `"https://backend.com/api"`, avoiding trailing slashes (/) to minimize misconfiguration risks. Azure API Management instance will append the backend resource name to this URL. This URL typically serves as the `base-url` in the [`set-backend-service`](https://learn.microsoft.com/azure/api-management/set-backend-service-policy) policy, enabling seamless transitions from frontend to backend.
Url pulumi.StringPtrInput
}
func (BackendState) ElementType() reflect.Type {
return reflect.TypeOf((*backendState)(nil)).Elem()
}
type backendArgs struct {
// The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.
ApiManagementName string `pulumi:"apiManagementName"`
// A `circuitBreakerRule` block as documented below.
CircuitBreakerRule *BackendCircuitBreakerRule `pulumi:"circuitBreakerRule"`
// A `credentials` block as documented below.
Credentials *BackendCredentials `pulumi:"credentials"`
// The description of the backend.
Description *string `pulumi:"description"`
// The name of the API Management backend. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The protocol used by the backend host. Possible values are `http` or `soap`.
Protocol string `pulumi:"protocol"`
// A `proxy` block as documented below.
Proxy *BackendProxy `pulumi:"proxy"`
// The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.
ResourceId *string `pulumi:"resourceId"`
// A `serviceFabricCluster` block as documented below.
ServiceFabricCluster *BackendServiceFabricCluster `pulumi:"serviceFabricCluster"`
// The title of the backend.
Title *string `pulumi:"title"`
// A `tls` block as documented below.
Tls *BackendTls `pulumi:"tls"`
// The backend host URL should be specified in the format `"https://backend.com/api"`, avoiding trailing slashes (/) to minimize misconfiguration risks. Azure API Management instance will append the backend resource name to this URL. This URL typically serves as the `base-url` in the [`set-backend-service`](https://learn.microsoft.com/azure/api-management/set-backend-service-policy) policy, enabling seamless transitions from frontend to backend.
Url string `pulumi:"url"`
}
// The set of arguments for constructing a Backend resource.
type BackendArgs struct {
// The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringInput
// A `circuitBreakerRule` block as documented below.
CircuitBreakerRule BackendCircuitBreakerRulePtrInput
// A `credentials` block as documented below.
Credentials BackendCredentialsPtrInput
// The description of the backend.
Description pulumi.StringPtrInput
// The name of the API Management backend. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The protocol used by the backend host. Possible values are `http` or `soap`.
Protocol pulumi.StringInput
// A `proxy` block as documented below.
Proxy BackendProxyPtrInput
// The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.
ResourceId pulumi.StringPtrInput
// A `serviceFabricCluster` block as documented below.
ServiceFabricCluster BackendServiceFabricClusterPtrInput
// The title of the backend.
Title pulumi.StringPtrInput
// A `tls` block as documented below.
Tls BackendTlsPtrInput
// The backend host URL should be specified in the format `"https://backend.com/api"`, avoiding trailing slashes (/) to minimize misconfiguration risks. Azure API Management instance will append the backend resource name to this URL. This URL typically serves as the `base-url` in the [`set-backend-service`](https://learn.microsoft.com/azure/api-management/set-backend-service-policy) policy, enabling seamless transitions from frontend to backend.
Url pulumi.StringInput
}
func (BackendArgs) ElementType() reflect.Type {
return reflect.TypeOf((*backendArgs)(nil)).Elem()
}
type BackendInput interface {
pulumi.Input
ToBackendOutput() BackendOutput
ToBackendOutputWithContext(ctx context.Context) BackendOutput
}
func (*Backend) ElementType() reflect.Type {
return reflect.TypeOf((**Backend)(nil)).Elem()
}
func (i *Backend) ToBackendOutput() BackendOutput {
return i.ToBackendOutputWithContext(context.Background())
}
func (i *Backend) ToBackendOutputWithContext(ctx context.Context) BackendOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackendOutput)
}
// BackendArrayInput is an input type that accepts BackendArray and BackendArrayOutput values.
// You can construct a concrete instance of `BackendArrayInput` via:
//
// BackendArray{ BackendArgs{...} }
type BackendArrayInput interface {
pulumi.Input
ToBackendArrayOutput() BackendArrayOutput
ToBackendArrayOutputWithContext(context.Context) BackendArrayOutput
}
type BackendArray []BackendInput
func (BackendArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Backend)(nil)).Elem()
}
func (i BackendArray) ToBackendArrayOutput() BackendArrayOutput {
return i.ToBackendArrayOutputWithContext(context.Background())
}
func (i BackendArray) ToBackendArrayOutputWithContext(ctx context.Context) BackendArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackendArrayOutput)
}
// BackendMapInput is an input type that accepts BackendMap and BackendMapOutput values.
// You can construct a concrete instance of `BackendMapInput` via:
//
// BackendMap{ "key": BackendArgs{...} }
type BackendMapInput interface {
pulumi.Input
ToBackendMapOutput() BackendMapOutput
ToBackendMapOutputWithContext(context.Context) BackendMapOutput
}
type BackendMap map[string]BackendInput
func (BackendMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Backend)(nil)).Elem()
}
func (i BackendMap) ToBackendMapOutput() BackendMapOutput {
return i.ToBackendMapOutputWithContext(context.Background())
}
func (i BackendMap) ToBackendMapOutputWithContext(ctx context.Context) BackendMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackendMapOutput)
}
type BackendOutput struct{ *pulumi.OutputState }
func (BackendOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Backend)(nil)).Elem()
}
func (o BackendOutput) ToBackendOutput() BackendOutput {
return o
}
func (o BackendOutput) ToBackendOutputWithContext(ctx context.Context) BackendOutput {
return o
}
// The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.
func (o BackendOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v *Backend) pulumi.StringOutput { return v.ApiManagementName }).(pulumi.StringOutput)
}
// A `circuitBreakerRule` block as documented below.
func (o BackendOutput) CircuitBreakerRule() BackendCircuitBreakerRulePtrOutput {
return o.ApplyT(func(v *Backend) BackendCircuitBreakerRulePtrOutput { return v.CircuitBreakerRule }).(BackendCircuitBreakerRulePtrOutput)
}
// A `credentials` block as documented below.
func (o BackendOutput) Credentials() BackendCredentialsPtrOutput {
return o.ApplyT(func(v *Backend) BackendCredentialsPtrOutput { return v.Credentials }).(BackendCredentialsPtrOutput)
}
// The description of the backend.
func (o BackendOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Backend) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The name of the API Management backend. Changing this forces a new resource to be created.
func (o BackendOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Backend) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The protocol used by the backend host. Possible values are `http` or `soap`.
func (o BackendOutput) Protocol() pulumi.StringOutput {
return o.ApplyT(func(v *Backend) pulumi.StringOutput { return v.Protocol }).(pulumi.StringOutput)
}
// A `proxy` block as documented below.
func (o BackendOutput) Proxy() BackendProxyPtrOutput {
return o.ApplyT(func(v *Backend) BackendProxyPtrOutput { return v.Proxy }).(BackendProxyPtrOutput)
}
// The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
func (o BackendOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Backend) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.
func (o BackendOutput) ResourceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Backend) pulumi.StringPtrOutput { return v.ResourceId }).(pulumi.StringPtrOutput)
}
// A `serviceFabricCluster` block as documented below.
func (o BackendOutput) ServiceFabricCluster() BackendServiceFabricClusterPtrOutput {
return o.ApplyT(func(v *Backend) BackendServiceFabricClusterPtrOutput { return v.ServiceFabricCluster }).(BackendServiceFabricClusterPtrOutput)
}
// The title of the backend.
func (o BackendOutput) Title() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Backend) pulumi.StringPtrOutput { return v.Title }).(pulumi.StringPtrOutput)
}
// A `tls` block as documented below.
func (o BackendOutput) Tls() BackendTlsPtrOutput {
return o.ApplyT(func(v *Backend) BackendTlsPtrOutput { return v.Tls }).(BackendTlsPtrOutput)
}
// The backend host URL should be specified in the format `"https://backend.com/api"`, avoiding trailing slashes (/) to minimize misconfiguration risks. Azure API Management instance will append the backend resource name to this URL. This URL typically serves as the `base-url` in the [`set-backend-service`](https://learn.microsoft.com/azure/api-management/set-backend-service-policy) policy, enabling seamless transitions from frontend to backend.
func (o BackendOutput) Url() pulumi.StringOutput {
return o.ApplyT(func(v *Backend) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
}
type BackendArrayOutput struct{ *pulumi.OutputState }
func (BackendArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Backend)(nil)).Elem()
}
func (o BackendArrayOutput) ToBackendArrayOutput() BackendArrayOutput {
return o
}
func (o BackendArrayOutput) ToBackendArrayOutputWithContext(ctx context.Context) BackendArrayOutput {
return o
}
func (o BackendArrayOutput) Index(i pulumi.IntInput) BackendOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Backend {
return vs[0].([]*Backend)[vs[1].(int)]
}).(BackendOutput)
}
type BackendMapOutput struct{ *pulumi.OutputState }
func (BackendMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Backend)(nil)).Elem()
}
func (o BackendMapOutput) ToBackendMapOutput() BackendMapOutput {
return o
}
func (o BackendMapOutput) ToBackendMapOutputWithContext(ctx context.Context) BackendMapOutput {
return o
}
func (o BackendMapOutput) MapIndex(k pulumi.StringInput) BackendOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Backend {
return vs[0].(map[string]*Backend)[vs[1].(string)]
}).(BackendOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BackendInput)(nil)).Elem(), &Backend{})
pulumi.RegisterInputType(reflect.TypeOf((*BackendArrayInput)(nil)).Elem(), BackendArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BackendMapInput)(nil)).Elem(), BackendMap{})
pulumi.RegisterOutputType(BackendOutput{})
pulumi.RegisterOutputType(BackendArrayOutput{})
pulumi.RegisterOutputType(BackendMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/getService.go | sdk/go/azure/apimanagement/getService.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing API Management Service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
// Name: "search-api",
// ResourceGroupName: "search-service",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("apiManagementId", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2024-05-01, 2022-08-01
func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupServiceResult
err := ctx.Invoke("azure:apimanagement/getService:getService", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getService.
type LookupServiceArgs struct {
// The name of the API Management service.
Name string `pulumi:"name"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getService.
type LookupServiceResult struct {
// Zero or more `additionalLocation` blocks as defined below
AdditionalLocations []GetServiceAdditionalLocation `pulumi:"additionalLocations"`
// The URL for the Developer Portal associated with this API Management service.
DeveloperPortalUrl string `pulumi:"developerPortalUrl"`
// Gateway URL of the API Management service in the Region.
GatewayRegionalUrl string `pulumi:"gatewayRegionalUrl"`
// The URL for the API Management Service's Gateway.
GatewayUrl string `pulumi:"gatewayUrl"`
// A `hostnameConfiguration` block as defined below.
HostnameConfigurations []GetServiceHostnameConfiguration `pulumi:"hostnameConfigurations"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// An `identity` block as defined below.
Identities []GetServiceIdentity `pulumi:"identities"`
// The location name of the additional region among Azure Data center regions.
Location string `pulumi:"location"`
// The URL for the Management API.
ManagementApiUrl string `pulumi:"managementApiUrl"`
Name string `pulumi:"name"`
// The email address from which the notification will be sent.
NotificationSenderEmail string `pulumi:"notificationSenderEmail"`
// The URL of the Publisher Portal.
PortalUrl string `pulumi:"portalUrl"`
// Private IP addresses of the API Management service in the additional location, for instances using virtual network mode.
PrivateIpAddresses []string `pulumi:"privateIpAddresses"`
// ID of the standard SKU IPv4 Public IP. Available only for Premium SKU deployed in a virtual network.
PublicIpAddressId string `pulumi:"publicIpAddressId"`
// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU.
PublicIpAddresses []string `pulumi:"publicIpAddresses"`
// The email of Publisher/Company of the API Management Service.
PublisherEmail string `pulumi:"publisherEmail"`
// The name of the Publisher/Company of the API Management Service.
PublisherName string `pulumi:"publisherName"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The SCM (Source Code Management) endpoint.
ScmUrl string `pulumi:"scmUrl"`
// The SKU of the API Management Service consisting of the name and capacity, separated by an underscore.
SkuName string `pulumi:"skuName"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// A `tenantAccess` block as defined below.
TenantAccesses []GetServiceTenantAccess `pulumi:"tenantAccesses"`
}
func LookupServiceOutput(ctx *pulumi.Context, args LookupServiceOutputArgs, opts ...pulumi.InvokeOption) LookupServiceResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupServiceResultOutput, error) {
args := v.(LookupServiceArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:apimanagement/getService:getService", args, LookupServiceResultOutput{}, options).(LookupServiceResultOutput), nil
}).(LookupServiceResultOutput)
}
// A collection of arguments for invoking getService.
type LookupServiceOutputArgs struct {
// The name of the API Management service.
Name pulumi.StringInput `pulumi:"name"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the resource.
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupServiceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupServiceArgs)(nil)).Elem()
}
// A collection of values returned by getService.
type LookupServiceResultOutput struct{ *pulumi.OutputState }
func (LookupServiceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupServiceResult)(nil)).Elem()
}
func (o LookupServiceResultOutput) ToLookupServiceResultOutput() LookupServiceResultOutput {
return o
}
func (o LookupServiceResultOutput) ToLookupServiceResultOutputWithContext(ctx context.Context) LookupServiceResultOutput {
return o
}
// Zero or more `additionalLocation` blocks as defined below
func (o LookupServiceResultOutput) AdditionalLocations() GetServiceAdditionalLocationArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceAdditionalLocation { return v.AdditionalLocations }).(GetServiceAdditionalLocationArrayOutput)
}
// The URL for the Developer Portal associated with this API Management service.
func (o LookupServiceResultOutput) DeveloperPortalUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.DeveloperPortalUrl }).(pulumi.StringOutput)
}
// Gateway URL of the API Management service in the Region.
func (o LookupServiceResultOutput) GatewayRegionalUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.GatewayRegionalUrl }).(pulumi.StringOutput)
}
// The URL for the API Management Service's Gateway.
func (o LookupServiceResultOutput) GatewayUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.GatewayUrl }).(pulumi.StringOutput)
}
// A `hostnameConfiguration` block as defined below.
func (o LookupServiceResultOutput) HostnameConfigurations() GetServiceHostnameConfigurationArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceHostnameConfiguration { return v.HostnameConfigurations }).(GetServiceHostnameConfigurationArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupServiceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.Id }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o LookupServiceResultOutput) Identities() GetServiceIdentityArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceIdentity { return v.Identities }).(GetServiceIdentityArrayOutput)
}
// The location name of the additional region among Azure Data center regions.
func (o LookupServiceResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.Location }).(pulumi.StringOutput)
}
// The URL for the Management API.
func (o LookupServiceResultOutput) ManagementApiUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.ManagementApiUrl }).(pulumi.StringOutput)
}
func (o LookupServiceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.Name }).(pulumi.StringOutput)
}
// The email address from which the notification will be sent.
func (o LookupServiceResultOutput) NotificationSenderEmail() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.NotificationSenderEmail }).(pulumi.StringOutput)
}
// The URL of the Publisher Portal.
func (o LookupServiceResultOutput) PortalUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PortalUrl }).(pulumi.StringOutput)
}
// Private IP addresses of the API Management service in the additional location, for instances using virtual network mode.
func (o LookupServiceResultOutput) PrivateIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []string { return v.PrivateIpAddresses }).(pulumi.StringArrayOutput)
}
// ID of the standard SKU IPv4 Public IP. Available only for Premium SKU deployed in a virtual network.
func (o LookupServiceResultOutput) PublicIpAddressId() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PublicIpAddressId }).(pulumi.StringOutput)
}
// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU.
func (o LookupServiceResultOutput) PublicIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []string { return v.PublicIpAddresses }).(pulumi.StringArrayOutput)
}
// The email of Publisher/Company of the API Management Service.
func (o LookupServiceResultOutput) PublisherEmail() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PublisherEmail }).(pulumi.StringOutput)
}
// The name of the Publisher/Company of the API Management Service.
func (o LookupServiceResultOutput) PublisherName() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PublisherName }).(pulumi.StringOutput)
}
func (o LookupServiceResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The SCM (Source Code Management) endpoint.
func (o LookupServiceResultOutput) ScmUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.ScmUrl }).(pulumi.StringOutput)
}
// The SKU of the API Management Service consisting of the name and capacity, separated by an underscore.
func (o LookupServiceResultOutput) SkuName() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.SkuName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the resource.
func (o LookupServiceResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupServiceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// A `tenantAccess` block as defined below.
func (o LookupServiceResultOutput) TenantAccesses() GetServiceTenantAccessArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceTenantAccess { return v.TenantAccesses }).(GetServiceTenantAccessArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupServiceResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/gateway.go | sdk/go/azure/apimanagement/gateway.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an API Management Gateway.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("pub1"),
// PublisherEmail: pulumi.String("pub1@email.com"),
// SkuName: pulumi.String("Consumption_0"),
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewGateway(ctx, "example", &apimanagement.GatewayArgs{
// Name: pulumi.String("example-gateway"),
// ApiManagementId: exampleService.ID(),
// Description: pulumi.String("Example API Management gateway"),
// LocationData: &apimanagement.GatewayLocationDataArgs{
// Name: pulumi.String("example name"),
// City: pulumi.String("example city"),
// District: pulumi.String("example district"),
// Region: pulumi.String("example region"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management Gateways can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/gateway:Gateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/gateways/gateway1
// ```
type Gateway struct {
pulumi.CustomResourceState
// The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
ApiManagementId pulumi.StringOutput `pulumi:"apiManagementId"`
// The description of the API Management Gateway.
Description pulumi.StringPtrOutput `pulumi:"description"`
// A `locationData` block as documented below.
LocationData GatewayLocationDataOutput `pulumi:"locationData"`
// The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewGateway registers a new resource with the given unique name, arguments, and options.
func NewGateway(ctx *pulumi.Context,
name string, args *GatewayArgs, opts ...pulumi.ResourceOption) (*Gateway, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementId == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementId'")
}
if args.LocationData == nil {
return nil, errors.New("invalid value for required argument 'LocationData'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Gateway
err := ctx.RegisterResource("azure:apimanagement/gateway:Gateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGateway gets an existing Gateway resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GatewayState, opts ...pulumi.ResourceOption) (*Gateway, error) {
var resource Gateway
err := ctx.ReadResource("azure:apimanagement/gateway:Gateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Gateway resources.
type gatewayState struct {
// The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
ApiManagementId *string `pulumi:"apiManagementId"`
// The description of the API Management Gateway.
Description *string `pulumi:"description"`
// A `locationData` block as documented below.
LocationData *GatewayLocationData `pulumi:"locationData"`
// The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
Name *string `pulumi:"name"`
}
type GatewayState struct {
// The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
ApiManagementId pulumi.StringPtrInput
// The description of the API Management Gateway.
Description pulumi.StringPtrInput
// A `locationData` block as documented below.
LocationData GatewayLocationDataPtrInput
// The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
Name pulumi.StringPtrInput
}
func (GatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*gatewayState)(nil)).Elem()
}
type gatewayArgs struct {
// The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
ApiManagementId string `pulumi:"apiManagementId"`
// The description of the API Management Gateway.
Description *string `pulumi:"description"`
// A `locationData` block as documented below.
LocationData GatewayLocationData `pulumi:"locationData"`
// The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a Gateway resource.
type GatewayArgs struct {
// The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
ApiManagementId pulumi.StringInput
// The description of the API Management Gateway.
Description pulumi.StringPtrInput
// A `locationData` block as documented below.
LocationData GatewayLocationDataInput
// The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
Name pulumi.StringPtrInput
}
func (GatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gatewayArgs)(nil)).Elem()
}
type GatewayInput interface {
pulumi.Input
ToGatewayOutput() GatewayOutput
ToGatewayOutputWithContext(ctx context.Context) GatewayOutput
}
func (*Gateway) ElementType() reflect.Type {
return reflect.TypeOf((**Gateway)(nil)).Elem()
}
func (i *Gateway) ToGatewayOutput() GatewayOutput {
return i.ToGatewayOutputWithContext(context.Background())
}
func (i *Gateway) ToGatewayOutputWithContext(ctx context.Context) GatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewayOutput)
}
// GatewayArrayInput is an input type that accepts GatewayArray and GatewayArrayOutput values.
// You can construct a concrete instance of `GatewayArrayInput` via:
//
// GatewayArray{ GatewayArgs{...} }
type GatewayArrayInput interface {
pulumi.Input
ToGatewayArrayOutput() GatewayArrayOutput
ToGatewayArrayOutputWithContext(context.Context) GatewayArrayOutput
}
type GatewayArray []GatewayInput
func (GatewayArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Gateway)(nil)).Elem()
}
func (i GatewayArray) ToGatewayArrayOutput() GatewayArrayOutput {
return i.ToGatewayArrayOutputWithContext(context.Background())
}
func (i GatewayArray) ToGatewayArrayOutputWithContext(ctx context.Context) GatewayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewayArrayOutput)
}
// GatewayMapInput is an input type that accepts GatewayMap and GatewayMapOutput values.
// You can construct a concrete instance of `GatewayMapInput` via:
//
// GatewayMap{ "key": GatewayArgs{...} }
type GatewayMapInput interface {
pulumi.Input
ToGatewayMapOutput() GatewayMapOutput
ToGatewayMapOutputWithContext(context.Context) GatewayMapOutput
}
type GatewayMap map[string]GatewayInput
func (GatewayMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Gateway)(nil)).Elem()
}
func (i GatewayMap) ToGatewayMapOutput() GatewayMapOutput {
return i.ToGatewayMapOutputWithContext(context.Background())
}
func (i GatewayMap) ToGatewayMapOutputWithContext(ctx context.Context) GatewayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewayMapOutput)
}
type GatewayOutput struct{ *pulumi.OutputState }
func (GatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Gateway)(nil)).Elem()
}
func (o GatewayOutput) ToGatewayOutput() GatewayOutput {
return o
}
func (o GatewayOutput) ToGatewayOutputWithContext(ctx context.Context) GatewayOutput {
return o
}
// The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
func (o GatewayOutput) ApiManagementId() pulumi.StringOutput {
return o.ApplyT(func(v *Gateway) pulumi.StringOutput { return v.ApiManagementId }).(pulumi.StringOutput)
}
// The description of the API Management Gateway.
func (o GatewayOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Gateway) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// A `locationData` block as documented below.
func (o GatewayOutput) LocationData() GatewayLocationDataOutput {
return o.ApplyT(func(v *Gateway) GatewayLocationDataOutput { return v.LocationData }).(GatewayLocationDataOutput)
}
// The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
func (o GatewayOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Gateway) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type GatewayArrayOutput struct{ *pulumi.OutputState }
func (GatewayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Gateway)(nil)).Elem()
}
func (o GatewayArrayOutput) ToGatewayArrayOutput() GatewayArrayOutput {
return o
}
func (o GatewayArrayOutput) ToGatewayArrayOutputWithContext(ctx context.Context) GatewayArrayOutput {
return o
}
func (o GatewayArrayOutput) Index(i pulumi.IntInput) GatewayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Gateway {
return vs[0].([]*Gateway)[vs[1].(int)]
}).(GatewayOutput)
}
type GatewayMapOutput struct{ *pulumi.OutputState }
func (GatewayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Gateway)(nil)).Elem()
}
func (o GatewayMapOutput) ToGatewayMapOutput() GatewayMapOutput {
return o
}
func (o GatewayMapOutput) ToGatewayMapOutputWithContext(ctx context.Context) GatewayMapOutput {
return o
}
func (o GatewayMapOutput) MapIndex(k pulumi.StringInput) GatewayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Gateway {
return vs[0].(map[string]*Gateway)[vs[1].(string)]
}).(GatewayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GatewayInput)(nil)).Elem(), &Gateway{})
pulumi.RegisterInputType(reflect.TypeOf((*GatewayArrayInput)(nil)).Elem(), GatewayArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GatewayMapInput)(nil)).Elem(), GatewayMap{})
pulumi.RegisterOutputType(GatewayOutput{})
pulumi.RegisterOutputType(GatewayArrayOutput{})
pulumi.RegisterOutputType(GatewayMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/getApi.go | sdk/go/azure/apimanagement/getApi.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing API Management API.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
// Name: "search-api",
// ApiManagementName: "search-api-management",
// ResourceGroupName: "search-service",
// Revision: "2",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("apiManagementApiId", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
func LookupApi(ctx *pulumi.Context, args *LookupApiArgs, opts ...pulumi.InvokeOption) (*LookupApiResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupApiResult
err := ctx.Invoke("azure:apimanagement/getApi:getApi", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getApi.
type LookupApiArgs struct {
// The name of the API Management Service in which the API Management API exists.
ApiManagementName string `pulumi:"apiManagementName"`
// The name of the API Management API.
Name string `pulumi:"name"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The Revision of the API Management API.
Revision string `pulumi:"revision"`
}
// A collection of values returned by getApi.
type LookupApiResult struct {
ApiManagementName string `pulumi:"apiManagementName"`
// A description of the API Management API, which may include HTML formatting tags.
Description string `pulumi:"description"`
// The display name of the API.
DisplayName string `pulumi:"displayName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Is this the current API Revision?
IsCurrent bool `pulumi:"isCurrent"`
// Is this API Revision online/accessible via the Gateway?
IsOnline bool `pulumi:"isOnline"`
Name string `pulumi:"name"`
// The Path for this API Management API.
Path string `pulumi:"path"`
// A list of protocols the operations in this API can be invoked.
Protocols []string `pulumi:"protocols"`
ResourceGroupName string `pulumi:"resourceGroupName"`
Revision string `pulumi:"revision"`
// Absolute URL of the backend service implementing this API.
ServiceUrl string `pulumi:"serviceUrl"`
// Should this API expose a SOAP frontend, rather than a HTTP frontend?
SoapPassThrough bool `pulumi:"soapPassThrough"`
// A `subscriptionKeyParameterNames` block as documented below.
SubscriptionKeyParameterNames []GetApiSubscriptionKeyParameterName `pulumi:"subscriptionKeyParameterNames"`
// Should this API require a subscription key?
SubscriptionRequired bool `pulumi:"subscriptionRequired"`
// The Version number of this API, if this API is versioned.
Version string `pulumi:"version"`
// The ID of the Version Set which this API is associated with.
VersionSetId string `pulumi:"versionSetId"`
}
func LookupApiOutput(ctx *pulumi.Context, args LookupApiOutputArgs, opts ...pulumi.InvokeOption) LookupApiResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupApiResultOutput, error) {
args := v.(LookupApiArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:apimanagement/getApi:getApi", args, LookupApiResultOutput{}, options).(LookupApiResultOutput), nil
}).(LookupApiResultOutput)
}
// A collection of arguments for invoking getApi.
type LookupApiOutputArgs struct {
// The name of the API Management Service in which the API Management API exists.
ApiManagementName pulumi.StringInput `pulumi:"apiManagementName"`
// The name of the API Management API.
Name pulumi.StringInput `pulumi:"name"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// The Revision of the API Management API.
Revision pulumi.StringInput `pulumi:"revision"`
}
func (LookupApiOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupApiArgs)(nil)).Elem()
}
// A collection of values returned by getApi.
type LookupApiResultOutput struct{ *pulumi.OutputState }
func (LookupApiResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupApiResult)(nil)).Elem()
}
func (o LookupApiResultOutput) ToLookupApiResultOutput() LookupApiResultOutput {
return o
}
func (o LookupApiResultOutput) ToLookupApiResultOutputWithContext(ctx context.Context) LookupApiResultOutput {
return o
}
func (o LookupApiResultOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.ApiManagementName }).(pulumi.StringOutput)
}
// A description of the API Management API, which may include HTML formatting tags.
func (o LookupApiResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Description }).(pulumi.StringOutput)
}
// The display name of the API.
func (o LookupApiResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupApiResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Id }).(pulumi.StringOutput)
}
// Is this the current API Revision?
func (o LookupApiResultOutput) IsCurrent() pulumi.BoolOutput {
return o.ApplyT(func(v LookupApiResult) bool { return v.IsCurrent }).(pulumi.BoolOutput)
}
// Is this API Revision online/accessible via the Gateway?
func (o LookupApiResultOutput) IsOnline() pulumi.BoolOutput {
return o.ApplyT(func(v LookupApiResult) bool { return v.IsOnline }).(pulumi.BoolOutput)
}
func (o LookupApiResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Name }).(pulumi.StringOutput)
}
// The Path for this API Management API.
func (o LookupApiResultOutput) Path() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Path }).(pulumi.StringOutput)
}
// A list of protocols the operations in this API can be invoked.
func (o LookupApiResultOutput) Protocols() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupApiResult) []string { return v.Protocols }).(pulumi.StringArrayOutput)
}
func (o LookupApiResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o LookupApiResultOutput) Revision() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Revision }).(pulumi.StringOutput)
}
// Absolute URL of the backend service implementing this API.
func (o LookupApiResultOutput) ServiceUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.ServiceUrl }).(pulumi.StringOutput)
}
// Should this API expose a SOAP frontend, rather than a HTTP frontend?
func (o LookupApiResultOutput) SoapPassThrough() pulumi.BoolOutput {
return o.ApplyT(func(v LookupApiResult) bool { return v.SoapPassThrough }).(pulumi.BoolOutput)
}
// A `subscriptionKeyParameterNames` block as documented below.
func (o LookupApiResultOutput) SubscriptionKeyParameterNames() GetApiSubscriptionKeyParameterNameArrayOutput {
return o.ApplyT(func(v LookupApiResult) []GetApiSubscriptionKeyParameterName { return v.SubscriptionKeyParameterNames }).(GetApiSubscriptionKeyParameterNameArrayOutput)
}
// Should this API require a subscription key?
func (o LookupApiResultOutput) SubscriptionRequired() pulumi.BoolOutput {
return o.ApplyT(func(v LookupApiResult) bool { return v.SubscriptionRequired }).(pulumi.BoolOutput)
}
// The Version number of this API, if this API is versioned.
func (o LookupApiResultOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Version }).(pulumi.StringOutput)
}
// The ID of the Version Set which this API is associated with.
func (o LookupApiResultOutput) VersionSetId() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.VersionSetId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupApiResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/logger.go | sdk/go/azure/apimanagement/logger.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Logger within an API Management Service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appinsights"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
// Name: pulumi.String("example-appinsights"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// ApplicationType: pulumi.String("other"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("My Company"),
// PublisherEmail: pulumi.String("company@exmaple.com"),
// SkuName: pulumi.String("Developer_1"),
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewLogger(ctx, "example", &apimanagement.LoggerArgs{
// Name: pulumi.String("example-logger"),
// ApiManagementName: exampleService.Name,
// ResourceGroupName: example.Name,
// ResourceId: exampleInsights.ID(),
// ApplicationInsights: &apimanagement.LoggerApplicationInsightsArgs{
// InstrumentationKey: exampleInsights.InstrumentationKey,
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management Loggers can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/logger:Logger example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.ApiManagement/service/example-apim/loggers/example-logger
// ```
type Logger struct {
pulumi.CustomResourceState
// The name of the API Management Service. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringOutput `pulumi:"apiManagementName"`
// An `applicationInsights` block as documented below. Changing this forces a new resource to be created.
ApplicationInsights LoggerApplicationInsightsPtrOutput `pulumi:"applicationInsights"`
// Specifies whether records should be buffered in the Logger prior to publishing. Defaults to `true`.
Buffered pulumi.BoolPtrOutput `pulumi:"buffered"`
// A description of this Logger.
Description pulumi.StringPtrOutput `pulumi:"description"`
// An `eventhub` block as documented below. Changing this forces a new resource to be created.
Eventhub LoggerEventhubPtrOutput `pulumi:"eventhub"`
// The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
ResourceId pulumi.StringPtrOutput `pulumi:"resourceId"`
}
// NewLogger registers a new resource with the given unique name, arguments, and options.
func NewLogger(ctx *pulumi.Context,
name string, args *LoggerArgs, opts ...pulumi.ResourceOption) (*Logger, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementName == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Logger
err := ctx.RegisterResource("azure:apimanagement/logger:Logger", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLogger gets an existing Logger resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetLogger(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LoggerState, opts ...pulumi.ResourceOption) (*Logger, error) {
var resource Logger
err := ctx.ReadResource("azure:apimanagement/logger:Logger", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Logger resources.
type loggerState struct {
// The name of the API Management Service. Changing this forces a new resource to be created.
ApiManagementName *string `pulumi:"apiManagementName"`
// An `applicationInsights` block as documented below. Changing this forces a new resource to be created.
ApplicationInsights *LoggerApplicationInsights `pulumi:"applicationInsights"`
// Specifies whether records should be buffered in the Logger prior to publishing. Defaults to `true`.
Buffered *bool `pulumi:"buffered"`
// A description of this Logger.
Description *string `pulumi:"description"`
// An `eventhub` block as documented below. Changing this forces a new resource to be created.
Eventhub *LoggerEventhub `pulumi:"eventhub"`
// The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
ResourceId *string `pulumi:"resourceId"`
}
type LoggerState struct {
// The name of the API Management Service. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringPtrInput
// An `applicationInsights` block as documented below. Changing this forces a new resource to be created.
ApplicationInsights LoggerApplicationInsightsPtrInput
// Specifies whether records should be buffered in the Logger prior to publishing. Defaults to `true`.
Buffered pulumi.BoolPtrInput
// A description of this Logger.
Description pulumi.StringPtrInput
// An `eventhub` block as documented below. Changing this forces a new resource to be created.
Eventhub LoggerEventhubPtrInput
// The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
ResourceId pulumi.StringPtrInput
}
func (LoggerState) ElementType() reflect.Type {
return reflect.TypeOf((*loggerState)(nil)).Elem()
}
type loggerArgs struct {
// The name of the API Management Service. Changing this forces a new resource to be created.
ApiManagementName string `pulumi:"apiManagementName"`
// An `applicationInsights` block as documented below. Changing this forces a new resource to be created.
ApplicationInsights *LoggerApplicationInsights `pulumi:"applicationInsights"`
// Specifies whether records should be buffered in the Logger prior to publishing. Defaults to `true`.
Buffered *bool `pulumi:"buffered"`
// A description of this Logger.
Description *string `pulumi:"description"`
// An `eventhub` block as documented below. Changing this forces a new resource to be created.
Eventhub *LoggerEventhub `pulumi:"eventhub"`
// The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
ResourceId *string `pulumi:"resourceId"`
}
// The set of arguments for constructing a Logger resource.
type LoggerArgs struct {
// The name of the API Management Service. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringInput
// An `applicationInsights` block as documented below. Changing this forces a new resource to be created.
ApplicationInsights LoggerApplicationInsightsPtrInput
// Specifies whether records should be buffered in the Logger prior to publishing. Defaults to `true`.
Buffered pulumi.BoolPtrInput
// A description of this Logger.
Description pulumi.StringPtrInput
// An `eventhub` block as documented below. Changing this forces a new resource to be created.
Eventhub LoggerEventhubPtrInput
// The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
ResourceId pulumi.StringPtrInput
}
func (LoggerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*loggerArgs)(nil)).Elem()
}
type LoggerInput interface {
pulumi.Input
ToLoggerOutput() LoggerOutput
ToLoggerOutputWithContext(ctx context.Context) LoggerOutput
}
func (*Logger) ElementType() reflect.Type {
return reflect.TypeOf((**Logger)(nil)).Elem()
}
func (i *Logger) ToLoggerOutput() LoggerOutput {
return i.ToLoggerOutputWithContext(context.Background())
}
func (i *Logger) ToLoggerOutputWithContext(ctx context.Context) LoggerOutput {
return pulumi.ToOutputWithContext(ctx, i).(LoggerOutput)
}
// LoggerArrayInput is an input type that accepts LoggerArray and LoggerArrayOutput values.
// You can construct a concrete instance of `LoggerArrayInput` via:
//
// LoggerArray{ LoggerArgs{...} }
type LoggerArrayInput interface {
pulumi.Input
ToLoggerArrayOutput() LoggerArrayOutput
ToLoggerArrayOutputWithContext(context.Context) LoggerArrayOutput
}
type LoggerArray []LoggerInput
func (LoggerArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Logger)(nil)).Elem()
}
func (i LoggerArray) ToLoggerArrayOutput() LoggerArrayOutput {
return i.ToLoggerArrayOutputWithContext(context.Background())
}
func (i LoggerArray) ToLoggerArrayOutputWithContext(ctx context.Context) LoggerArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LoggerArrayOutput)
}
// LoggerMapInput is an input type that accepts LoggerMap and LoggerMapOutput values.
// You can construct a concrete instance of `LoggerMapInput` via:
//
// LoggerMap{ "key": LoggerArgs{...} }
type LoggerMapInput interface {
pulumi.Input
ToLoggerMapOutput() LoggerMapOutput
ToLoggerMapOutputWithContext(context.Context) LoggerMapOutput
}
type LoggerMap map[string]LoggerInput
func (LoggerMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Logger)(nil)).Elem()
}
func (i LoggerMap) ToLoggerMapOutput() LoggerMapOutput {
return i.ToLoggerMapOutputWithContext(context.Background())
}
func (i LoggerMap) ToLoggerMapOutputWithContext(ctx context.Context) LoggerMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LoggerMapOutput)
}
type LoggerOutput struct{ *pulumi.OutputState }
func (LoggerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Logger)(nil)).Elem()
}
func (o LoggerOutput) ToLoggerOutput() LoggerOutput {
return o
}
func (o LoggerOutput) ToLoggerOutputWithContext(ctx context.Context) LoggerOutput {
return o
}
// The name of the API Management Service. Changing this forces a new resource to be created.
func (o LoggerOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v *Logger) pulumi.StringOutput { return v.ApiManagementName }).(pulumi.StringOutput)
}
// An `applicationInsights` block as documented below. Changing this forces a new resource to be created.
func (o LoggerOutput) ApplicationInsights() LoggerApplicationInsightsPtrOutput {
return o.ApplyT(func(v *Logger) LoggerApplicationInsightsPtrOutput { return v.ApplicationInsights }).(LoggerApplicationInsightsPtrOutput)
}
// Specifies whether records should be buffered in the Logger prior to publishing. Defaults to `true`.
func (o LoggerOutput) Buffered() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Logger) pulumi.BoolPtrOutput { return v.Buffered }).(pulumi.BoolPtrOutput)
}
// A description of this Logger.
func (o LoggerOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Logger) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// An `eventhub` block as documented below. Changing this forces a new resource to be created.
func (o LoggerOutput) Eventhub() LoggerEventhubPtrOutput {
return o.ApplyT(func(v *Logger) LoggerEventhubPtrOutput { return v.Eventhub }).(LoggerEventhubPtrOutput)
}
// The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
func (o LoggerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Logger) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
func (o LoggerOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Logger) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
func (o LoggerOutput) ResourceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Logger) pulumi.StringPtrOutput { return v.ResourceId }).(pulumi.StringPtrOutput)
}
type LoggerArrayOutput struct{ *pulumi.OutputState }
func (LoggerArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Logger)(nil)).Elem()
}
func (o LoggerArrayOutput) ToLoggerArrayOutput() LoggerArrayOutput {
return o
}
func (o LoggerArrayOutput) ToLoggerArrayOutputWithContext(ctx context.Context) LoggerArrayOutput {
return o
}
func (o LoggerArrayOutput) Index(i pulumi.IntInput) LoggerOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Logger {
return vs[0].([]*Logger)[vs[1].(int)]
}).(LoggerOutput)
}
type LoggerMapOutput struct{ *pulumi.OutputState }
func (LoggerMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Logger)(nil)).Elem()
}
func (o LoggerMapOutput) ToLoggerMapOutput() LoggerMapOutput {
return o
}
func (o LoggerMapOutput) ToLoggerMapOutputWithContext(ctx context.Context) LoggerMapOutput {
return o
}
func (o LoggerMapOutput) MapIndex(k pulumi.StringInput) LoggerOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Logger {
return vs[0].(map[string]*Logger)[vs[1].(string)]
}).(LoggerOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LoggerInput)(nil)).Elem(), &Logger{})
pulumi.RegisterInputType(reflect.TypeOf((*LoggerArrayInput)(nil)).Elem(), LoggerArray{})
pulumi.RegisterInputType(reflect.TypeOf((*LoggerMapInput)(nil)).Elem(), LoggerMap{})
pulumi.RegisterOutputType(LoggerOutput{})
pulumi.RegisterOutputType(LoggerArrayOutput{})
pulumi.RegisterOutputType(LoggerMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/workspace.go | sdk/go/azure/apimanagement/workspace.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an API Management Workspace.
//
// > **Note:** This resource is currently available only when using the Classic Premium SKU of `apimanagement.Service`. For more details, refer to [Federated API Management with Workspaces](https://learn.microsoft.com/en-us/azure/api-management/workspaces-overview).
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apimanagement"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("pub1"),
// PublisherEmail: pulumi.String("pub1@email.com"),
// SkuName: pulumi.String("Premium_1"),
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewWorkspace(ctx, "example", &apimanagement.WorkspaceArgs{
// Name: pulumi.String("example-workspace"),
// ApiManagementId: exampleService.ID(),
// DisplayName: pulumi.String("my workspace"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2024-05-01
//
// ## Import
//
// API Management Workspace can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/workspace:Workspace example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/workspaces/workspace1
// ```
type Workspace struct {
pulumi.CustomResourceState
// Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
ApiManagementId pulumi.StringOutput `pulumi:"apiManagementId"`
// The description of the API Management Workspace.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The display name of the API Management Workspace.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewWorkspace registers a new resource with the given unique name, arguments, and options.
func NewWorkspace(ctx *pulumi.Context,
name string, args *WorkspaceArgs, opts ...pulumi.ResourceOption) (*Workspace, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementId == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementId'")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Workspace
err := ctx.RegisterResource("azure:apimanagement/workspace:Workspace", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetWorkspace gets an existing Workspace resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetWorkspace(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *WorkspaceState, opts ...pulumi.ResourceOption) (*Workspace, error) {
var resource Workspace
err := ctx.ReadResource("azure:apimanagement/workspace:Workspace", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Workspace resources.
type workspaceState struct {
// Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
ApiManagementId *string `pulumi:"apiManagementId"`
// The description of the API Management Workspace.
Description *string `pulumi:"description"`
// The display name of the API Management Workspace.
DisplayName *string `pulumi:"displayName"`
// Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
}
type WorkspaceState struct {
// Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
ApiManagementId pulumi.StringPtrInput
// The description of the API Management Workspace.
Description pulumi.StringPtrInput
// The display name of the API Management Workspace.
DisplayName pulumi.StringPtrInput
// Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
}
func (WorkspaceState) ElementType() reflect.Type {
return reflect.TypeOf((*workspaceState)(nil)).Elem()
}
type workspaceArgs struct {
// Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
ApiManagementId string `pulumi:"apiManagementId"`
// The description of the API Management Workspace.
Description *string `pulumi:"description"`
// The display name of the API Management Workspace.
DisplayName string `pulumi:"displayName"`
// Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a Workspace resource.
type WorkspaceArgs struct {
// Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
ApiManagementId pulumi.StringInput
// The description of the API Management Workspace.
Description pulumi.StringPtrInput
// The display name of the API Management Workspace.
DisplayName pulumi.StringInput
// Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
}
func (WorkspaceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*workspaceArgs)(nil)).Elem()
}
type WorkspaceInput interface {
pulumi.Input
ToWorkspaceOutput() WorkspaceOutput
ToWorkspaceOutputWithContext(ctx context.Context) WorkspaceOutput
}
func (*Workspace) ElementType() reflect.Type {
return reflect.TypeOf((**Workspace)(nil)).Elem()
}
func (i *Workspace) ToWorkspaceOutput() WorkspaceOutput {
return i.ToWorkspaceOutputWithContext(context.Background())
}
func (i *Workspace) ToWorkspaceOutputWithContext(ctx context.Context) WorkspaceOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkspaceOutput)
}
// WorkspaceArrayInput is an input type that accepts WorkspaceArray and WorkspaceArrayOutput values.
// You can construct a concrete instance of `WorkspaceArrayInput` via:
//
// WorkspaceArray{ WorkspaceArgs{...} }
type WorkspaceArrayInput interface {
pulumi.Input
ToWorkspaceArrayOutput() WorkspaceArrayOutput
ToWorkspaceArrayOutputWithContext(context.Context) WorkspaceArrayOutput
}
type WorkspaceArray []WorkspaceInput
func (WorkspaceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Workspace)(nil)).Elem()
}
func (i WorkspaceArray) ToWorkspaceArrayOutput() WorkspaceArrayOutput {
return i.ToWorkspaceArrayOutputWithContext(context.Background())
}
func (i WorkspaceArray) ToWorkspaceArrayOutputWithContext(ctx context.Context) WorkspaceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkspaceArrayOutput)
}
// WorkspaceMapInput is an input type that accepts WorkspaceMap and WorkspaceMapOutput values.
// You can construct a concrete instance of `WorkspaceMapInput` via:
//
// WorkspaceMap{ "key": WorkspaceArgs{...} }
type WorkspaceMapInput interface {
pulumi.Input
ToWorkspaceMapOutput() WorkspaceMapOutput
ToWorkspaceMapOutputWithContext(context.Context) WorkspaceMapOutput
}
type WorkspaceMap map[string]WorkspaceInput
func (WorkspaceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Workspace)(nil)).Elem()
}
func (i WorkspaceMap) ToWorkspaceMapOutput() WorkspaceMapOutput {
return i.ToWorkspaceMapOutputWithContext(context.Background())
}
func (i WorkspaceMap) ToWorkspaceMapOutputWithContext(ctx context.Context) WorkspaceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkspaceMapOutput)
}
type WorkspaceOutput struct{ *pulumi.OutputState }
func (WorkspaceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Workspace)(nil)).Elem()
}
func (o WorkspaceOutput) ToWorkspaceOutput() WorkspaceOutput {
return o
}
func (o WorkspaceOutput) ToWorkspaceOutputWithContext(ctx context.Context) WorkspaceOutput {
return o
}
// Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
func (o WorkspaceOutput) ApiManagementId() pulumi.StringOutput {
return o.ApplyT(func(v *Workspace) pulumi.StringOutput { return v.ApiManagementId }).(pulumi.StringOutput)
}
// The description of the API Management Workspace.
func (o WorkspaceOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Workspace) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The display name of the API Management Workspace.
func (o WorkspaceOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *Workspace) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
func (o WorkspaceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Workspace) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type WorkspaceArrayOutput struct{ *pulumi.OutputState }
func (WorkspaceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Workspace)(nil)).Elem()
}
func (o WorkspaceArrayOutput) ToWorkspaceArrayOutput() WorkspaceArrayOutput {
return o
}
func (o WorkspaceArrayOutput) ToWorkspaceArrayOutputWithContext(ctx context.Context) WorkspaceArrayOutput {
return o
}
func (o WorkspaceArrayOutput) Index(i pulumi.IntInput) WorkspaceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Workspace {
return vs[0].([]*Workspace)[vs[1].(int)]
}).(WorkspaceOutput)
}
type WorkspaceMapOutput struct{ *pulumi.OutputState }
func (WorkspaceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Workspace)(nil)).Elem()
}
func (o WorkspaceMapOutput) ToWorkspaceMapOutput() WorkspaceMapOutput {
return o
}
func (o WorkspaceMapOutput) ToWorkspaceMapOutputWithContext(ctx context.Context) WorkspaceMapOutput {
return o
}
func (o WorkspaceMapOutput) MapIndex(k pulumi.StringInput) WorkspaceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Workspace {
return vs[0].(map[string]*Workspace)[vs[1].(string)]
}).(WorkspaceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*WorkspaceInput)(nil)).Elem(), &Workspace{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkspaceArrayInput)(nil)).Elem(), WorkspaceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkspaceMapInput)(nil)).Elem(), WorkspaceMap{})
pulumi.RegisterOutputType(WorkspaceOutput{})
pulumi.RegisterOutputType(WorkspaceArrayOutput{})
pulumi.RegisterOutputType(WorkspaceMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/user.go | sdk/go/azure/apimanagement/user.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an API Management User.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("My Company"),
// PublisherEmail: pulumi.String("company@exmaple.com"),
// SkuName: pulumi.String("Developer_1"),
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewUser(ctx, "example", &apimanagement.UserArgs{
// UserId: pulumi.String("5931a75ae4bbd512288c680b"),
// ApiManagementName: exampleService.Name,
// ResourceGroupName: example.Name,
// FirstName: pulumi.String("Example"),
// LastName: pulumi.String("User"),
// Email: pulumi.String("user@example.com"),
// State: pulumi.String("active"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management Users can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/user:User example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/users/abc123
// ```
type User struct {
pulumi.CustomResourceState
// The name of the API Management Service in which the User should be created. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringOutput `pulumi:"apiManagementName"`
// The kind of confirmation email which will be sent to this user. Possible values are `invite` and `signup`. Changing this forces a new resource to be created.
Confirmation pulumi.StringPtrOutput `pulumi:"confirmation"`
// The email address associated with this user.
Email pulumi.StringOutput `pulumi:"email"`
// The first name for this user.
FirstName pulumi.StringOutput `pulumi:"firstName"`
// The last name for this user.
LastName pulumi.StringOutput `pulumi:"lastName"`
// A note about this user.
Note pulumi.StringPtrOutput `pulumi:"note"`
// The password associated with this user.
Password pulumi.StringPtrOutput `pulumi:"password"`
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The state of this user. Possible values are `active`, `blocked` and `pending`.
//
// > **Note:** the State can be changed from Pending > Active/Blocked but not from Active/Blocked > Pending.
State pulumi.StringOutput `pulumi:"state"`
// The Identifier for this User, which must be unique within the API Management Service. Changing this forces a new resource to be created.
UserId pulumi.StringOutput `pulumi:"userId"`
}
// NewUser registers a new resource with the given unique name, arguments, and options.
func NewUser(ctx *pulumi.Context,
name string, args *UserArgs, opts ...pulumi.ResourceOption) (*User, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementName == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementName'")
}
if args.Email == nil {
return nil, errors.New("invalid value for required argument 'Email'")
}
if args.FirstName == nil {
return nil, errors.New("invalid value for required argument 'FirstName'")
}
if args.LastName == nil {
return nil, errors.New("invalid value for required argument 'LastName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.UserId == nil {
return nil, errors.New("invalid value for required argument 'UserId'")
}
if args.Password != nil {
args.Password = pulumi.ToSecret(args.Password).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"password",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource User
err := ctx.RegisterResource("azure:apimanagement/user:User", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUser gets an existing User resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetUser(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserState, opts ...pulumi.ResourceOption) (*User, error) {
var resource User
err := ctx.ReadResource("azure:apimanagement/user:User", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering User resources.
type userState struct {
// The name of the API Management Service in which the User should be created. Changing this forces a new resource to be created.
ApiManagementName *string `pulumi:"apiManagementName"`
// The kind of confirmation email which will be sent to this user. Possible values are `invite` and `signup`. Changing this forces a new resource to be created.
Confirmation *string `pulumi:"confirmation"`
// The email address associated with this user.
Email *string `pulumi:"email"`
// The first name for this user.
FirstName *string `pulumi:"firstName"`
// The last name for this user.
LastName *string `pulumi:"lastName"`
// A note about this user.
Note *string `pulumi:"note"`
// The password associated with this user.
Password *string `pulumi:"password"`
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The state of this user. Possible values are `active`, `blocked` and `pending`.
//
// > **Note:** the State can be changed from Pending > Active/Blocked but not from Active/Blocked > Pending.
State *string `pulumi:"state"`
// The Identifier for this User, which must be unique within the API Management Service. Changing this forces a new resource to be created.
UserId *string `pulumi:"userId"`
}
type UserState struct {
// The name of the API Management Service in which the User should be created. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringPtrInput
// The kind of confirmation email which will be sent to this user. Possible values are `invite` and `signup`. Changing this forces a new resource to be created.
Confirmation pulumi.StringPtrInput
// The email address associated with this user.
Email pulumi.StringPtrInput
// The first name for this user.
FirstName pulumi.StringPtrInput
// The last name for this user.
LastName pulumi.StringPtrInput
// A note about this user.
Note pulumi.StringPtrInput
// The password associated with this user.
Password pulumi.StringPtrInput
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The state of this user. Possible values are `active`, `blocked` and `pending`.
//
// > **Note:** the State can be changed from Pending > Active/Blocked but not from Active/Blocked > Pending.
State pulumi.StringPtrInput
// The Identifier for this User, which must be unique within the API Management Service. Changing this forces a new resource to be created.
UserId pulumi.StringPtrInput
}
func (UserState) ElementType() reflect.Type {
return reflect.TypeOf((*userState)(nil)).Elem()
}
type userArgs struct {
// The name of the API Management Service in which the User should be created. Changing this forces a new resource to be created.
ApiManagementName string `pulumi:"apiManagementName"`
// The kind of confirmation email which will be sent to this user. Possible values are `invite` and `signup`. Changing this forces a new resource to be created.
Confirmation *string `pulumi:"confirmation"`
// The email address associated with this user.
Email string `pulumi:"email"`
// The first name for this user.
FirstName string `pulumi:"firstName"`
// The last name for this user.
LastName string `pulumi:"lastName"`
// A note about this user.
Note *string `pulumi:"note"`
// The password associated with this user.
Password *string `pulumi:"password"`
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The state of this user. Possible values are `active`, `blocked` and `pending`.
//
// > **Note:** the State can be changed from Pending > Active/Blocked but not from Active/Blocked > Pending.
State *string `pulumi:"state"`
// The Identifier for this User, which must be unique within the API Management Service. Changing this forces a new resource to be created.
UserId string `pulumi:"userId"`
}
// The set of arguments for constructing a User resource.
type UserArgs struct {
// The name of the API Management Service in which the User should be created. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringInput
// The kind of confirmation email which will be sent to this user. Possible values are `invite` and `signup`. Changing this forces a new resource to be created.
Confirmation pulumi.StringPtrInput
// The email address associated with this user.
Email pulumi.StringInput
// The first name for this user.
FirstName pulumi.StringInput
// The last name for this user.
LastName pulumi.StringInput
// A note about this user.
Note pulumi.StringPtrInput
// The password associated with this user.
Password pulumi.StringPtrInput
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The state of this user. Possible values are `active`, `blocked` and `pending`.
//
// > **Note:** the State can be changed from Pending > Active/Blocked but not from Active/Blocked > Pending.
State pulumi.StringPtrInput
// The Identifier for this User, which must be unique within the API Management Service. Changing this forces a new resource to be created.
UserId pulumi.StringInput
}
func (UserArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userArgs)(nil)).Elem()
}
type UserInput interface {
pulumi.Input
ToUserOutput() UserOutput
ToUserOutputWithContext(ctx context.Context) UserOutput
}
func (*User) ElementType() reflect.Type {
return reflect.TypeOf((**User)(nil)).Elem()
}
func (i *User) ToUserOutput() UserOutput {
return i.ToUserOutputWithContext(context.Background())
}
func (i *User) ToUserOutputWithContext(ctx context.Context) UserOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserOutput)
}
// UserArrayInput is an input type that accepts UserArray and UserArrayOutput values.
// You can construct a concrete instance of `UserArrayInput` via:
//
// UserArray{ UserArgs{...} }
type UserArrayInput interface {
pulumi.Input
ToUserArrayOutput() UserArrayOutput
ToUserArrayOutputWithContext(context.Context) UserArrayOutput
}
type UserArray []UserInput
func (UserArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*User)(nil)).Elem()
}
func (i UserArray) ToUserArrayOutput() UserArrayOutput {
return i.ToUserArrayOutputWithContext(context.Background())
}
func (i UserArray) ToUserArrayOutputWithContext(ctx context.Context) UserArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserArrayOutput)
}
// UserMapInput is an input type that accepts UserMap and UserMapOutput values.
// You can construct a concrete instance of `UserMapInput` via:
//
// UserMap{ "key": UserArgs{...} }
type UserMapInput interface {
pulumi.Input
ToUserMapOutput() UserMapOutput
ToUserMapOutputWithContext(context.Context) UserMapOutput
}
type UserMap map[string]UserInput
func (UserMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*User)(nil)).Elem()
}
func (i UserMap) ToUserMapOutput() UserMapOutput {
return i.ToUserMapOutputWithContext(context.Background())
}
func (i UserMap) ToUserMapOutputWithContext(ctx context.Context) UserMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserMapOutput)
}
type UserOutput struct{ *pulumi.OutputState }
func (UserOutput) ElementType() reflect.Type {
return reflect.TypeOf((**User)(nil)).Elem()
}
func (o UserOutput) ToUserOutput() UserOutput {
return o
}
func (o UserOutput) ToUserOutputWithContext(ctx context.Context) UserOutput {
return o
}
// The name of the API Management Service in which the User should be created. Changing this forces a new resource to be created.
func (o UserOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.ApiManagementName }).(pulumi.StringOutput)
}
// The kind of confirmation email which will be sent to this user. Possible values are `invite` and `signup`. Changing this forces a new resource to be created.
func (o UserOutput) Confirmation() pulumi.StringPtrOutput {
return o.ApplyT(func(v *User) pulumi.StringPtrOutput { return v.Confirmation }).(pulumi.StringPtrOutput)
}
// The email address associated with this user.
func (o UserOutput) Email() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.Email }).(pulumi.StringOutput)
}
// The first name for this user.
func (o UserOutput) FirstName() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.FirstName }).(pulumi.StringOutput)
}
// The last name for this user.
func (o UserOutput) LastName() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.LastName }).(pulumi.StringOutput)
}
// A note about this user.
func (o UserOutput) Note() pulumi.StringPtrOutput {
return o.ApplyT(func(v *User) pulumi.StringPtrOutput { return v.Note }).(pulumi.StringPtrOutput)
}
// The password associated with this user.
func (o UserOutput) Password() pulumi.StringPtrOutput {
return o.ApplyT(func(v *User) pulumi.StringPtrOutput { return v.Password }).(pulumi.StringPtrOutput)
}
// The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
func (o UserOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The state of this user. Possible values are `active`, `blocked` and `pending`.
//
// > **Note:** the State can be changed from Pending > Active/Blocked but not from Active/Blocked > Pending.
func (o UserOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// The Identifier for this User, which must be unique within the API Management Service. Changing this forces a new resource to be created.
func (o UserOutput) UserId() pulumi.StringOutput {
return o.ApplyT(func(v *User) pulumi.StringOutput { return v.UserId }).(pulumi.StringOutput)
}
type UserArrayOutput struct{ *pulumi.OutputState }
func (UserArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*User)(nil)).Elem()
}
func (o UserArrayOutput) ToUserArrayOutput() UserArrayOutput {
return o
}
func (o UserArrayOutput) ToUserArrayOutputWithContext(ctx context.Context) UserArrayOutput {
return o
}
func (o UserArrayOutput) Index(i pulumi.IntInput) UserOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *User {
return vs[0].([]*User)[vs[1].(int)]
}).(UserOutput)
}
type UserMapOutput struct{ *pulumi.OutputState }
func (UserMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*User)(nil)).Elem()
}
func (o UserMapOutput) ToUserMapOutput() UserMapOutput {
return o
}
func (o UserMapOutput) ToUserMapOutputWithContext(ctx context.Context) UserMapOutput {
return o
}
func (o UserMapOutput) MapIndex(k pulumi.StringInput) UserOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *User {
return vs[0].(map[string]*User)[vs[1].(string)]
}).(UserOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UserInput)(nil)).Elem(), &User{})
pulumi.RegisterInputType(reflect.TypeOf((*UserArrayInput)(nil)).Elem(), UserArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UserMapInput)(nil)).Elem(), UserMap{})
pulumi.RegisterOutputType(UserOutput{})
pulumi.RegisterOutputType(UserArrayOutput{})
pulumi.RegisterOutputType(UserMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/getUser.go | sdk/go/azure/apimanagement/getUser.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing API Management User.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupUser(ctx, &apimanagement.LookupUserArgs{
// UserId: "my-user",
// ApiManagementName: "example-apim",
// ResourceGroupName: "search-service",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("notes", example.Notes)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
func LookupUser(ctx *pulumi.Context, args *LookupUserArgs, opts ...pulumi.InvokeOption) (*LookupUserResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupUserResult
err := ctx.Invoke("azure:apimanagement/getUser:getUser", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getUser.
type LookupUserArgs struct {
// The Name of the API Management Service in which this User exists.
ApiManagementName string `pulumi:"apiManagementName"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The Identifier for the User.
UserId string `pulumi:"userId"`
}
// A collection of values returned by getUser.
type LookupUserResult struct {
ApiManagementName string `pulumi:"apiManagementName"`
// The Email Address used for this User.
Email string `pulumi:"email"`
// The First Name for the User.
FirstName string `pulumi:"firstName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The Last Name for the User.
LastName string `pulumi:"lastName"`
// Any notes about this User.
Note string `pulumi:"note"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The current state of this User, for example `active`, `blocked` or `pending`.
State string `pulumi:"state"`
UserId string `pulumi:"userId"`
}
func LookupUserOutput(ctx *pulumi.Context, args LookupUserOutputArgs, opts ...pulumi.InvokeOption) LookupUserResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupUserResultOutput, error) {
args := v.(LookupUserArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:apimanagement/getUser:getUser", args, LookupUserResultOutput{}, options).(LookupUserResultOutput), nil
}).(LookupUserResultOutput)
}
// A collection of arguments for invoking getUser.
type LookupUserOutputArgs struct {
// The Name of the API Management Service in which this User exists.
ApiManagementName pulumi.StringInput `pulumi:"apiManagementName"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// The Identifier for the User.
UserId pulumi.StringInput `pulumi:"userId"`
}
func (LookupUserOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupUserArgs)(nil)).Elem()
}
// A collection of values returned by getUser.
type LookupUserResultOutput struct{ *pulumi.OutputState }
func (LookupUserResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupUserResult)(nil)).Elem()
}
func (o LookupUserResultOutput) ToLookupUserResultOutput() LookupUserResultOutput {
return o
}
func (o LookupUserResultOutput) ToLookupUserResultOutputWithContext(ctx context.Context) LookupUserResultOutput {
return o
}
func (o LookupUserResultOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.ApiManagementName }).(pulumi.StringOutput)
}
// The Email Address used for this User.
func (o LookupUserResultOutput) Email() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.Email }).(pulumi.StringOutput)
}
// The First Name for the User.
func (o LookupUserResultOutput) FirstName() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.FirstName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupUserResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.Id }).(pulumi.StringOutput)
}
// The Last Name for the User.
func (o LookupUserResultOutput) LastName() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.LastName }).(pulumi.StringOutput)
}
// Any notes about this User.
func (o LookupUserResultOutput) Note() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.Note }).(pulumi.StringOutput)
}
func (o LookupUserResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The current state of this User, for example `active`, `blocked` or `pending`.
func (o LookupUserResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.State }).(pulumi.StringOutput)
}
func (o LookupUserResultOutput) UserId() pulumi.StringOutput {
return o.ApplyT(func(v LookupUserResult) string { return v.UserId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupUserResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/gatewayApi.go | sdk/go/azure/apimanagement/gatewayApi.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a API Management Gateway API.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
// Name: "example-api",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// exampleGetApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
// Name: "search-api",
// ApiManagementName: example.Name,
// ResourceGroupName: example.ResourceGroupName,
// Revision: "2",
// }, nil)
// if err != nil {
// return err
// }
// exampleGetGateway, err := apimanagement.LookupGateway(ctx, &apimanagement.LookupGatewayArgs{
// Name: "example-gateway",
// ApiManagementId: example.Id,
// }, nil)
// if err != nil {
// return err
// }
// _, err = apimanagement.NewGatewayApi(ctx, "example", &apimanagement.GatewayApiArgs{
// GatewayId: pulumi.String(exampleGetGateway.Id),
// ApiId: pulumi.String(exampleGetApi.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management Gateway APIs can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/gatewayApi:GatewayApi example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.ApiManagement/service/service1/gateways/gateway1/apis/api1
// ```
type GatewayApi struct {
pulumi.CustomResourceState
// The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
ApiId pulumi.StringOutput `pulumi:"apiId"`
// The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
GatewayId pulumi.StringOutput `pulumi:"gatewayId"`
}
// NewGatewayApi registers a new resource with the given unique name, arguments, and options.
func NewGatewayApi(ctx *pulumi.Context,
name string, args *GatewayApiArgs, opts ...pulumi.ResourceOption) (*GatewayApi, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiId == nil {
return nil, errors.New("invalid value for required argument 'ApiId'")
}
if args.GatewayId == nil {
return nil, errors.New("invalid value for required argument 'GatewayId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GatewayApi
err := ctx.RegisterResource("azure:apimanagement/gatewayApi:GatewayApi", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGatewayApi gets an existing GatewayApi resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGatewayApi(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GatewayApiState, opts ...pulumi.ResourceOption) (*GatewayApi, error) {
var resource GatewayApi
err := ctx.ReadResource("azure:apimanagement/gatewayApi:GatewayApi", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GatewayApi resources.
type gatewayApiState struct {
// The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
ApiId *string `pulumi:"apiId"`
// The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
GatewayId *string `pulumi:"gatewayId"`
}
type GatewayApiState struct {
// The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
ApiId pulumi.StringPtrInput
// The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
GatewayId pulumi.StringPtrInput
}
func (GatewayApiState) ElementType() reflect.Type {
return reflect.TypeOf((*gatewayApiState)(nil)).Elem()
}
type gatewayApiArgs struct {
// The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
ApiId string `pulumi:"apiId"`
// The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
GatewayId string `pulumi:"gatewayId"`
}
// The set of arguments for constructing a GatewayApi resource.
type GatewayApiArgs struct {
// The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
ApiId pulumi.StringInput
// The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
GatewayId pulumi.StringInput
}
func (GatewayApiArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gatewayApiArgs)(nil)).Elem()
}
type GatewayApiInput interface {
pulumi.Input
ToGatewayApiOutput() GatewayApiOutput
ToGatewayApiOutputWithContext(ctx context.Context) GatewayApiOutput
}
func (*GatewayApi) ElementType() reflect.Type {
return reflect.TypeOf((**GatewayApi)(nil)).Elem()
}
func (i *GatewayApi) ToGatewayApiOutput() GatewayApiOutput {
return i.ToGatewayApiOutputWithContext(context.Background())
}
func (i *GatewayApi) ToGatewayApiOutputWithContext(ctx context.Context) GatewayApiOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewayApiOutput)
}
// GatewayApiArrayInput is an input type that accepts GatewayApiArray and GatewayApiArrayOutput values.
// You can construct a concrete instance of `GatewayApiArrayInput` via:
//
// GatewayApiArray{ GatewayApiArgs{...} }
type GatewayApiArrayInput interface {
pulumi.Input
ToGatewayApiArrayOutput() GatewayApiArrayOutput
ToGatewayApiArrayOutputWithContext(context.Context) GatewayApiArrayOutput
}
type GatewayApiArray []GatewayApiInput
func (GatewayApiArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GatewayApi)(nil)).Elem()
}
func (i GatewayApiArray) ToGatewayApiArrayOutput() GatewayApiArrayOutput {
return i.ToGatewayApiArrayOutputWithContext(context.Background())
}
func (i GatewayApiArray) ToGatewayApiArrayOutputWithContext(ctx context.Context) GatewayApiArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewayApiArrayOutput)
}
// GatewayApiMapInput is an input type that accepts GatewayApiMap and GatewayApiMapOutput values.
// You can construct a concrete instance of `GatewayApiMapInput` via:
//
// GatewayApiMap{ "key": GatewayApiArgs{...} }
type GatewayApiMapInput interface {
pulumi.Input
ToGatewayApiMapOutput() GatewayApiMapOutput
ToGatewayApiMapOutputWithContext(context.Context) GatewayApiMapOutput
}
type GatewayApiMap map[string]GatewayApiInput
func (GatewayApiMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GatewayApi)(nil)).Elem()
}
func (i GatewayApiMap) ToGatewayApiMapOutput() GatewayApiMapOutput {
return i.ToGatewayApiMapOutputWithContext(context.Background())
}
func (i GatewayApiMap) ToGatewayApiMapOutputWithContext(ctx context.Context) GatewayApiMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewayApiMapOutput)
}
type GatewayApiOutput struct{ *pulumi.OutputState }
func (GatewayApiOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GatewayApi)(nil)).Elem()
}
func (o GatewayApiOutput) ToGatewayApiOutput() GatewayApiOutput {
return o
}
func (o GatewayApiOutput) ToGatewayApiOutputWithContext(ctx context.Context) GatewayApiOutput {
return o
}
// The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
func (o GatewayApiOutput) ApiId() pulumi.StringOutput {
return o.ApplyT(func(v *GatewayApi) pulumi.StringOutput { return v.ApiId }).(pulumi.StringOutput)
}
// The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
func (o GatewayApiOutput) GatewayId() pulumi.StringOutput {
return o.ApplyT(func(v *GatewayApi) pulumi.StringOutput { return v.GatewayId }).(pulumi.StringOutput)
}
type GatewayApiArrayOutput struct{ *pulumi.OutputState }
func (GatewayApiArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GatewayApi)(nil)).Elem()
}
func (o GatewayApiArrayOutput) ToGatewayApiArrayOutput() GatewayApiArrayOutput {
return o
}
func (o GatewayApiArrayOutput) ToGatewayApiArrayOutputWithContext(ctx context.Context) GatewayApiArrayOutput {
return o
}
func (o GatewayApiArrayOutput) Index(i pulumi.IntInput) GatewayApiOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GatewayApi {
return vs[0].([]*GatewayApi)[vs[1].(int)]
}).(GatewayApiOutput)
}
type GatewayApiMapOutput struct{ *pulumi.OutputState }
func (GatewayApiMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GatewayApi)(nil)).Elem()
}
func (o GatewayApiMapOutput) ToGatewayApiMapOutput() GatewayApiMapOutput {
return o
}
func (o GatewayApiMapOutput) ToGatewayApiMapOutputWithContext(ctx context.Context) GatewayApiMapOutput {
return o
}
func (o GatewayApiMapOutput) MapIndex(k pulumi.StringInput) GatewayApiOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GatewayApi {
return vs[0].(map[string]*GatewayApi)[vs[1].(string)]
}).(GatewayApiOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GatewayApiInput)(nil)).Elem(), &GatewayApi{})
pulumi.RegisterInputType(reflect.TypeOf((*GatewayApiArrayInput)(nil)).Elem(), GatewayApiArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GatewayApiMapInput)(nil)).Elem(), GatewayApiMap{})
pulumi.RegisterOutputType(GatewayApiOutput{})
pulumi.RegisterOutputType(GatewayApiArrayOutput{})
pulumi.RegisterOutputType(GatewayApiMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/apiOperationTag.go | sdk/go/azure/apimanagement/apiOperationTag.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a API Management API Operation Tag.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
// Name: "search-api",
// ApiManagementName: "search-api-management",
// ResourceGroupName: "search-service",
// Revision: "2",
// }, nil)
// if err != nil {
// return err
// }
// exampleApiOperation, err := apimanagement.NewApiOperation(ctx, "example", &apimanagement.ApiOperationArgs{
// OperationId: pulumi.String("user-delete"),
// ApiName: pulumi.String(example.Name),
// ApiManagementName: pulumi.String(example.ApiManagementName),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// DisplayName: pulumi.String("Delete User Operation"),
// Method: pulumi.String("DELETE"),
// UrlTemplate: pulumi.String("/users/{id}/delete"),
// Description: pulumi.String("This can only be done by the logged in user."),
// TemplateParameters: apimanagement.ApiOperationTemplateParameterArray{
// &apimanagement.ApiOperationTemplateParameterArgs{
// Name: pulumi.String("id"),
// Type: pulumi.String("number"),
// Required: pulumi.Bool(true),
// },
// },
// Responses: apimanagement.ApiOperationResponseArray{
// &apimanagement.ApiOperationResponseArgs{
// StatusCode: pulumi.Int(200),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewApiOperationTag(ctx, "example", &apimanagement.ApiOperationTagArgs{
// Name: pulumi.String("example-Tag"),
// ApiOperationId: exampleApiOperation.ID(),
// DisplayName: pulumi.String("example-Tag"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management API Operation Tags can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/apiOperationTag:ApiOperationTag example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/apis/api1/operations/operation1/tags/tag1
// ```
type ApiOperationTag struct {
pulumi.CustomResourceState
// The ID of the API Management API Operation. Changing this forces a new API Management API Operation Tag to be created.
ApiOperationId pulumi.StringOutput `pulumi:"apiOperationId"`
// The display name of the API Management API Operation Tag.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// The name which should be used for this API Management API Operation Tag. Changing this forces a new API Management API Operation Tag to be created. The name must be unique in the API Management Service.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewApiOperationTag registers a new resource with the given unique name, arguments, and options.
func NewApiOperationTag(ctx *pulumi.Context,
name string, args *ApiOperationTagArgs, opts ...pulumi.ResourceOption) (*ApiOperationTag, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiOperationId == nil {
return nil, errors.New("invalid value for required argument 'ApiOperationId'")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ApiOperationTag
err := ctx.RegisterResource("azure:apimanagement/apiOperationTag:ApiOperationTag", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApiOperationTag gets an existing ApiOperationTag resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetApiOperationTag(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiOperationTagState, opts ...pulumi.ResourceOption) (*ApiOperationTag, error) {
var resource ApiOperationTag
err := ctx.ReadResource("azure:apimanagement/apiOperationTag:ApiOperationTag", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApiOperationTag resources.
type apiOperationTagState struct {
// The ID of the API Management API Operation. Changing this forces a new API Management API Operation Tag to be created.
ApiOperationId *string `pulumi:"apiOperationId"`
// The display name of the API Management API Operation Tag.
DisplayName *string `pulumi:"displayName"`
// The name which should be used for this API Management API Operation Tag. Changing this forces a new API Management API Operation Tag to be created. The name must be unique in the API Management Service.
Name *string `pulumi:"name"`
}
type ApiOperationTagState struct {
// The ID of the API Management API Operation. Changing this forces a new API Management API Operation Tag to be created.
ApiOperationId pulumi.StringPtrInput
// The display name of the API Management API Operation Tag.
DisplayName pulumi.StringPtrInput
// The name which should be used for this API Management API Operation Tag. Changing this forces a new API Management API Operation Tag to be created. The name must be unique in the API Management Service.
Name pulumi.StringPtrInput
}
func (ApiOperationTagState) ElementType() reflect.Type {
return reflect.TypeOf((*apiOperationTagState)(nil)).Elem()
}
type apiOperationTagArgs struct {
// The ID of the API Management API Operation. Changing this forces a new API Management API Operation Tag to be created.
ApiOperationId string `pulumi:"apiOperationId"`
// The display name of the API Management API Operation Tag.
DisplayName string `pulumi:"displayName"`
// The name which should be used for this API Management API Operation Tag. Changing this forces a new API Management API Operation Tag to be created. The name must be unique in the API Management Service.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a ApiOperationTag resource.
type ApiOperationTagArgs struct {
// The ID of the API Management API Operation. Changing this forces a new API Management API Operation Tag to be created.
ApiOperationId pulumi.StringInput
// The display name of the API Management API Operation Tag.
DisplayName pulumi.StringInput
// The name which should be used for this API Management API Operation Tag. Changing this forces a new API Management API Operation Tag to be created. The name must be unique in the API Management Service.
Name pulumi.StringPtrInput
}
func (ApiOperationTagArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiOperationTagArgs)(nil)).Elem()
}
type ApiOperationTagInput interface {
pulumi.Input
ToApiOperationTagOutput() ApiOperationTagOutput
ToApiOperationTagOutputWithContext(ctx context.Context) ApiOperationTagOutput
}
func (*ApiOperationTag) ElementType() reflect.Type {
return reflect.TypeOf((**ApiOperationTag)(nil)).Elem()
}
func (i *ApiOperationTag) ToApiOperationTagOutput() ApiOperationTagOutput {
return i.ToApiOperationTagOutputWithContext(context.Background())
}
func (i *ApiOperationTag) ToApiOperationTagOutputWithContext(ctx context.Context) ApiOperationTagOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiOperationTagOutput)
}
// ApiOperationTagArrayInput is an input type that accepts ApiOperationTagArray and ApiOperationTagArrayOutput values.
// You can construct a concrete instance of `ApiOperationTagArrayInput` via:
//
// ApiOperationTagArray{ ApiOperationTagArgs{...} }
type ApiOperationTagArrayInput interface {
pulumi.Input
ToApiOperationTagArrayOutput() ApiOperationTagArrayOutput
ToApiOperationTagArrayOutputWithContext(context.Context) ApiOperationTagArrayOutput
}
type ApiOperationTagArray []ApiOperationTagInput
func (ApiOperationTagArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiOperationTag)(nil)).Elem()
}
func (i ApiOperationTagArray) ToApiOperationTagArrayOutput() ApiOperationTagArrayOutput {
return i.ToApiOperationTagArrayOutputWithContext(context.Background())
}
func (i ApiOperationTagArray) ToApiOperationTagArrayOutputWithContext(ctx context.Context) ApiOperationTagArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiOperationTagArrayOutput)
}
// ApiOperationTagMapInput is an input type that accepts ApiOperationTagMap and ApiOperationTagMapOutput values.
// You can construct a concrete instance of `ApiOperationTagMapInput` via:
//
// ApiOperationTagMap{ "key": ApiOperationTagArgs{...} }
type ApiOperationTagMapInput interface {
pulumi.Input
ToApiOperationTagMapOutput() ApiOperationTagMapOutput
ToApiOperationTagMapOutputWithContext(context.Context) ApiOperationTagMapOutput
}
type ApiOperationTagMap map[string]ApiOperationTagInput
func (ApiOperationTagMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiOperationTag)(nil)).Elem()
}
func (i ApiOperationTagMap) ToApiOperationTagMapOutput() ApiOperationTagMapOutput {
return i.ToApiOperationTagMapOutputWithContext(context.Background())
}
func (i ApiOperationTagMap) ToApiOperationTagMapOutputWithContext(ctx context.Context) ApiOperationTagMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiOperationTagMapOutput)
}
type ApiOperationTagOutput struct{ *pulumi.OutputState }
func (ApiOperationTagOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ApiOperationTag)(nil)).Elem()
}
func (o ApiOperationTagOutput) ToApiOperationTagOutput() ApiOperationTagOutput {
return o
}
func (o ApiOperationTagOutput) ToApiOperationTagOutputWithContext(ctx context.Context) ApiOperationTagOutput {
return o
}
// The ID of the API Management API Operation. Changing this forces a new API Management API Operation Tag to be created.
func (o ApiOperationTagOutput) ApiOperationId() pulumi.StringOutput {
return o.ApplyT(func(v *ApiOperationTag) pulumi.StringOutput { return v.ApiOperationId }).(pulumi.StringOutput)
}
// The display name of the API Management API Operation Tag.
func (o ApiOperationTagOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *ApiOperationTag) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// The name which should be used for this API Management API Operation Tag. Changing this forces a new API Management API Operation Tag to be created. The name must be unique in the API Management Service.
func (o ApiOperationTagOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ApiOperationTag) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type ApiOperationTagArrayOutput struct{ *pulumi.OutputState }
func (ApiOperationTagArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiOperationTag)(nil)).Elem()
}
func (o ApiOperationTagArrayOutput) ToApiOperationTagArrayOutput() ApiOperationTagArrayOutput {
return o
}
func (o ApiOperationTagArrayOutput) ToApiOperationTagArrayOutputWithContext(ctx context.Context) ApiOperationTagArrayOutput {
return o
}
func (o ApiOperationTagArrayOutput) Index(i pulumi.IntInput) ApiOperationTagOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApiOperationTag {
return vs[0].([]*ApiOperationTag)[vs[1].(int)]
}).(ApiOperationTagOutput)
}
type ApiOperationTagMapOutput struct{ *pulumi.OutputState }
func (ApiOperationTagMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiOperationTag)(nil)).Elem()
}
func (o ApiOperationTagMapOutput) ToApiOperationTagMapOutput() ApiOperationTagMapOutput {
return o
}
func (o ApiOperationTagMapOutput) ToApiOperationTagMapOutputWithContext(ctx context.Context) ApiOperationTagMapOutput {
return o
}
func (o ApiOperationTagMapOutput) MapIndex(k pulumi.StringInput) ApiOperationTagOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApiOperationTag {
return vs[0].(map[string]*ApiOperationTag)[vs[1].(string)]
}).(ApiOperationTagOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApiOperationTagInput)(nil)).Elem(), &ApiOperationTag{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiOperationTagArrayInput)(nil)).Elem(), ApiOperationTagArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiOperationTagMapInput)(nil)).Elem(), ApiOperationTagMap{})
pulumi.RegisterOutputType(ApiOperationTagOutput{})
pulumi.RegisterOutputType(ApiOperationTagArrayOutput{})
pulumi.RegisterOutputType(ApiOperationTagMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/globalSchema.go | sdk/go/azure/apimanagement/globalSchema.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Global Schema within an API Management Service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-rg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("pub1"),
// PublisherEmail: pulumi.String("pub1@email.com"),
// SkuName: pulumi.String("Consumption_0"),
// })
// if err != nil {
// return err
// }
// invokeFile, err := std.File(ctx, &std.FileArgs{
// Input: "api_management_api_schema.xml",
// }, nil)
// if err != nil {
// return err
// }
// _, err = apimanagement.NewGlobalSchema(ctx, "example", &apimanagement.GlobalSchemaArgs{
// SchemaId: pulumi.String("example-schema1"),
// ApiManagementName: exampleService.Name,
// ResourceGroupName: example.Name,
// Type: pulumi.String("xml"),
// Value: pulumi.String(invokeFile.Result),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management API Schema's can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/globalSchema:GlobalSchema example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/schemas/schema1
// ```
type GlobalSchema struct {
pulumi.CustomResourceState
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringOutput `pulumi:"apiManagementName"`
// The description of the schema.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A unique identifier for this Schema. Changing this forces a new resource to be created.
SchemaId pulumi.StringOutput `pulumi:"schemaId"`
// The content type of the Schema. Possible values are `xml` and `json`.
Type pulumi.StringOutput `pulumi:"type"`
// The string defining the document representing the Schema.
Value pulumi.StringOutput `pulumi:"value"`
}
// NewGlobalSchema registers a new resource with the given unique name, arguments, and options.
func NewGlobalSchema(ctx *pulumi.Context,
name string, args *GlobalSchemaArgs, opts ...pulumi.ResourceOption) (*GlobalSchema, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementName == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.SchemaId == nil {
return nil, errors.New("invalid value for required argument 'SchemaId'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GlobalSchema
err := ctx.RegisterResource("azure:apimanagement/globalSchema:GlobalSchema", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGlobalSchema gets an existing GlobalSchema resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGlobalSchema(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GlobalSchemaState, opts ...pulumi.ResourceOption) (*GlobalSchema, error) {
var resource GlobalSchema
err := ctx.ReadResource("azure:apimanagement/globalSchema:GlobalSchema", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GlobalSchema resources.
type globalSchemaState struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName *string `pulumi:"apiManagementName"`
// The description of the schema.
Description *string `pulumi:"description"`
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A unique identifier for this Schema. Changing this forces a new resource to be created.
SchemaId *string `pulumi:"schemaId"`
// The content type of the Schema. Possible values are `xml` and `json`.
Type *string `pulumi:"type"`
// The string defining the document representing the Schema.
Value *string `pulumi:"value"`
}
type GlobalSchemaState struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringPtrInput
// The description of the schema.
Description pulumi.StringPtrInput
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A unique identifier for this Schema. Changing this forces a new resource to be created.
SchemaId pulumi.StringPtrInput
// The content type of the Schema. Possible values are `xml` and `json`.
Type pulumi.StringPtrInput
// The string defining the document representing the Schema.
Value pulumi.StringPtrInput
}
func (GlobalSchemaState) ElementType() reflect.Type {
return reflect.TypeOf((*globalSchemaState)(nil)).Elem()
}
type globalSchemaArgs struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName string `pulumi:"apiManagementName"`
// The description of the schema.
Description *string `pulumi:"description"`
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A unique identifier for this Schema. Changing this forces a new resource to be created.
SchemaId string `pulumi:"schemaId"`
// The content type of the Schema. Possible values are `xml` and `json`.
Type string `pulumi:"type"`
// The string defining the document representing the Schema.
Value string `pulumi:"value"`
}
// The set of arguments for constructing a GlobalSchema resource.
type GlobalSchemaArgs struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringInput
// The description of the schema.
Description pulumi.StringPtrInput
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A unique identifier for this Schema. Changing this forces a new resource to be created.
SchemaId pulumi.StringInput
// The content type of the Schema. Possible values are `xml` and `json`.
Type pulumi.StringInput
// The string defining the document representing the Schema.
Value pulumi.StringInput
}
func (GlobalSchemaArgs) ElementType() reflect.Type {
return reflect.TypeOf((*globalSchemaArgs)(nil)).Elem()
}
type GlobalSchemaInput interface {
pulumi.Input
ToGlobalSchemaOutput() GlobalSchemaOutput
ToGlobalSchemaOutputWithContext(ctx context.Context) GlobalSchemaOutput
}
func (*GlobalSchema) ElementType() reflect.Type {
return reflect.TypeOf((**GlobalSchema)(nil)).Elem()
}
func (i *GlobalSchema) ToGlobalSchemaOutput() GlobalSchemaOutput {
return i.ToGlobalSchemaOutputWithContext(context.Background())
}
func (i *GlobalSchema) ToGlobalSchemaOutputWithContext(ctx context.Context) GlobalSchemaOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalSchemaOutput)
}
// GlobalSchemaArrayInput is an input type that accepts GlobalSchemaArray and GlobalSchemaArrayOutput values.
// You can construct a concrete instance of `GlobalSchemaArrayInput` via:
//
// GlobalSchemaArray{ GlobalSchemaArgs{...} }
type GlobalSchemaArrayInput interface {
pulumi.Input
ToGlobalSchemaArrayOutput() GlobalSchemaArrayOutput
ToGlobalSchemaArrayOutputWithContext(context.Context) GlobalSchemaArrayOutput
}
type GlobalSchemaArray []GlobalSchemaInput
func (GlobalSchemaArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GlobalSchema)(nil)).Elem()
}
func (i GlobalSchemaArray) ToGlobalSchemaArrayOutput() GlobalSchemaArrayOutput {
return i.ToGlobalSchemaArrayOutputWithContext(context.Background())
}
func (i GlobalSchemaArray) ToGlobalSchemaArrayOutputWithContext(ctx context.Context) GlobalSchemaArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalSchemaArrayOutput)
}
// GlobalSchemaMapInput is an input type that accepts GlobalSchemaMap and GlobalSchemaMapOutput values.
// You can construct a concrete instance of `GlobalSchemaMapInput` via:
//
// GlobalSchemaMap{ "key": GlobalSchemaArgs{...} }
type GlobalSchemaMapInput interface {
pulumi.Input
ToGlobalSchemaMapOutput() GlobalSchemaMapOutput
ToGlobalSchemaMapOutputWithContext(context.Context) GlobalSchemaMapOutput
}
type GlobalSchemaMap map[string]GlobalSchemaInput
func (GlobalSchemaMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GlobalSchema)(nil)).Elem()
}
func (i GlobalSchemaMap) ToGlobalSchemaMapOutput() GlobalSchemaMapOutput {
return i.ToGlobalSchemaMapOutputWithContext(context.Background())
}
func (i GlobalSchemaMap) ToGlobalSchemaMapOutputWithContext(ctx context.Context) GlobalSchemaMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalSchemaMapOutput)
}
type GlobalSchemaOutput struct{ *pulumi.OutputState }
func (GlobalSchemaOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GlobalSchema)(nil)).Elem()
}
func (o GlobalSchemaOutput) ToGlobalSchemaOutput() GlobalSchemaOutput {
return o
}
func (o GlobalSchemaOutput) ToGlobalSchemaOutputWithContext(ctx context.Context) GlobalSchemaOutput {
return o
}
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
func (o GlobalSchemaOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchema) pulumi.StringOutput { return v.ApiManagementName }).(pulumi.StringOutput)
}
// The description of the schema.
func (o GlobalSchemaOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GlobalSchema) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
func (o GlobalSchemaOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchema) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A unique identifier for this Schema. Changing this forces a new resource to be created.
func (o GlobalSchemaOutput) SchemaId() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchema) pulumi.StringOutput { return v.SchemaId }).(pulumi.StringOutput)
}
// The content type of the Schema. Possible values are `xml` and `json`.
func (o GlobalSchemaOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchema) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// The string defining the document representing the Schema.
func (o GlobalSchemaOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchema) pulumi.StringOutput { return v.Value }).(pulumi.StringOutput)
}
type GlobalSchemaArrayOutput struct{ *pulumi.OutputState }
func (GlobalSchemaArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GlobalSchema)(nil)).Elem()
}
func (o GlobalSchemaArrayOutput) ToGlobalSchemaArrayOutput() GlobalSchemaArrayOutput {
return o
}
func (o GlobalSchemaArrayOutput) ToGlobalSchemaArrayOutputWithContext(ctx context.Context) GlobalSchemaArrayOutput {
return o
}
func (o GlobalSchemaArrayOutput) Index(i pulumi.IntInput) GlobalSchemaOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GlobalSchema {
return vs[0].([]*GlobalSchema)[vs[1].(int)]
}).(GlobalSchemaOutput)
}
type GlobalSchemaMapOutput struct{ *pulumi.OutputState }
func (GlobalSchemaMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GlobalSchema)(nil)).Elem()
}
func (o GlobalSchemaMapOutput) ToGlobalSchemaMapOutput() GlobalSchemaMapOutput {
return o
}
func (o GlobalSchemaMapOutput) ToGlobalSchemaMapOutputWithContext(ctx context.Context) GlobalSchemaMapOutput {
return o
}
func (o GlobalSchemaMapOutput) MapIndex(k pulumi.StringInput) GlobalSchemaOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GlobalSchema {
return vs[0].(map[string]*GlobalSchema)[vs[1].(string)]
}).(GlobalSchemaOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GlobalSchemaInput)(nil)).Elem(), &GlobalSchema{})
pulumi.RegisterInputType(reflect.TypeOf((*GlobalSchemaArrayInput)(nil)).Elem(), GlobalSchemaArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GlobalSchemaMapInput)(nil)).Elem(), GlobalSchemaMap{})
pulumi.RegisterOutputType(GlobalSchemaOutput{})
pulumi.RegisterOutputType(GlobalSchemaArrayOutput{})
pulumi.RegisterOutputType(GlobalSchemaMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/getGatewayHostNameConfiguration.go | sdk/go/azure/apimanagement/getGatewayHostNameConfiguration.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing API Management Gateway Host Configuration.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
// Name: "example-apim",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// exampleGetGateway, err := apimanagement.LookupGateway(ctx, &apimanagement.LookupGatewayArgs{
// Name: "example-gateway",
// ApiManagementId: main.Id,
// }, nil)
// if err != nil {
// return err
// }
// exampleGetGatewayHostNameConfiguration, err := apimanagement.LookupGatewayHostNameConfiguration(ctx, &apimanagement.LookupGatewayHostNameConfigurationArgs{
// Name: "example-host-configuration",
// ApiManagementId: example.Id,
// GatewayName: exampleGetGateway.Name,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("hostName", exampleGetGatewayHostNameConfiguration.HostName)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
func LookupGatewayHostNameConfiguration(ctx *pulumi.Context, args *LookupGatewayHostNameConfigurationArgs, opts ...pulumi.InvokeOption) (*LookupGatewayHostNameConfigurationResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupGatewayHostNameConfigurationResult
err := ctx.Invoke("azure:apimanagement/getGatewayHostNameConfiguration:getGatewayHostNameConfiguration", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getGatewayHostNameConfiguration.
type LookupGatewayHostNameConfigurationArgs struct {
// The ID of the API Management Service.
ApiManagementId string `pulumi:"apiManagementId"`
// The name of the API Management Gateway.
// *
GatewayName string `pulumi:"gatewayName"`
// The name of the API Management Gateway Host Name Configuration.
Name string `pulumi:"name"`
}
// A collection of values returned by getGatewayHostNameConfiguration.
type LookupGatewayHostNameConfigurationResult struct {
ApiManagementId string `pulumi:"apiManagementId"`
// The ID of the certificate used for TLS connection establishment.
CertificateId string `pulumi:"certificateId"`
GatewayName string `pulumi:"gatewayName"`
// The host name used for the API Management Gateway Host Name Configuration.
HostName string `pulumi:"hostName"`
// Whether HTTP/2.0 is supported.
Http2Enabled bool `pulumi:"http2Enabled"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// Whether the API Management Gateway requests a client certificate.
RequestClientCertificateEnabled bool `pulumi:"requestClientCertificateEnabled"`
// Whether TLS 1.0 is supported.
Tls10Enabled bool `pulumi:"tls10Enabled"`
// Whether TLS 1.1 is supported.
Tls11Enabled bool `pulumi:"tls11Enabled"`
}
func LookupGatewayHostNameConfigurationOutput(ctx *pulumi.Context, args LookupGatewayHostNameConfigurationOutputArgs, opts ...pulumi.InvokeOption) LookupGatewayHostNameConfigurationResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupGatewayHostNameConfigurationResultOutput, error) {
args := v.(LookupGatewayHostNameConfigurationArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:apimanagement/getGatewayHostNameConfiguration:getGatewayHostNameConfiguration", args, LookupGatewayHostNameConfigurationResultOutput{}, options).(LookupGatewayHostNameConfigurationResultOutput), nil
}).(LookupGatewayHostNameConfigurationResultOutput)
}
// A collection of arguments for invoking getGatewayHostNameConfiguration.
type LookupGatewayHostNameConfigurationOutputArgs struct {
// The ID of the API Management Service.
ApiManagementId pulumi.StringInput `pulumi:"apiManagementId"`
// The name of the API Management Gateway.
// *
GatewayName pulumi.StringInput `pulumi:"gatewayName"`
// The name of the API Management Gateway Host Name Configuration.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupGatewayHostNameConfigurationOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGatewayHostNameConfigurationArgs)(nil)).Elem()
}
// A collection of values returned by getGatewayHostNameConfiguration.
type LookupGatewayHostNameConfigurationResultOutput struct{ *pulumi.OutputState }
func (LookupGatewayHostNameConfigurationResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGatewayHostNameConfigurationResult)(nil)).Elem()
}
func (o LookupGatewayHostNameConfigurationResultOutput) ToLookupGatewayHostNameConfigurationResultOutput() LookupGatewayHostNameConfigurationResultOutput {
return o
}
func (o LookupGatewayHostNameConfigurationResultOutput) ToLookupGatewayHostNameConfigurationResultOutputWithContext(ctx context.Context) LookupGatewayHostNameConfigurationResultOutput {
return o
}
func (o LookupGatewayHostNameConfigurationResultOutput) ApiManagementId() pulumi.StringOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) string { return v.ApiManagementId }).(pulumi.StringOutput)
}
// The ID of the certificate used for TLS connection establishment.
func (o LookupGatewayHostNameConfigurationResultOutput) CertificateId() pulumi.StringOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) string { return v.CertificateId }).(pulumi.StringOutput)
}
func (o LookupGatewayHostNameConfigurationResultOutput) GatewayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) string { return v.GatewayName }).(pulumi.StringOutput)
}
// The host name used for the API Management Gateway Host Name Configuration.
func (o LookupGatewayHostNameConfigurationResultOutput) HostName() pulumi.StringOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) string { return v.HostName }).(pulumi.StringOutput)
}
// Whether HTTP/2.0 is supported.
func (o LookupGatewayHostNameConfigurationResultOutput) Http2Enabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) bool { return v.Http2Enabled }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupGatewayHostNameConfigurationResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupGatewayHostNameConfigurationResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) string { return v.Name }).(pulumi.StringOutput)
}
// Whether the API Management Gateway requests a client certificate.
func (o LookupGatewayHostNameConfigurationResultOutput) RequestClientCertificateEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) bool { return v.RequestClientCertificateEnabled }).(pulumi.BoolOutput)
}
// Whether TLS 1.0 is supported.
func (o LookupGatewayHostNameConfigurationResultOutput) Tls10Enabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) bool { return v.Tls10Enabled }).(pulumi.BoolOutput)
}
// Whether TLS 1.1 is supported.
func (o LookupGatewayHostNameConfigurationResultOutput) Tls11Enabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupGatewayHostNameConfigurationResult) bool { return v.Tls11Enabled }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupGatewayHostNameConfigurationResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/apimanagement/apiSchema.go | sdk/go/azure/apimanagement/apiSchema.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an API Schema within an API Management Service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
// Name: "search-api",
// ApiManagementName: "search-api-management",
// ResourceGroupName: "search-service",
// Revision: "2",
// }, nil)
// if err != nil {
// return err
// }
// invokeFile, err := std.File(ctx, &std.FileArgs{
// Input: "api_management_api_schema.xml",
// }, nil)
// if err != nil {
// return err
// }
// _, err = apimanagement.NewApiSchema(ctx, "example", &apimanagement.ApiSchemaArgs{
// ApiName: pulumi.String(example.Name),
// ApiManagementName: pulumi.String(example.ApiManagementName),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// SchemaId: pulumi.String("example-schema"),
// ContentType: pulumi.String("application/vnd.ms-azure-apim.xsd+xml"),
// Value: pulumi.String(invokeFile.Result),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.ApiManagement` - 2022-08-01
//
// ## Import
//
// API Management API Schema's can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/apiSchema:ApiSchema example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/apis/api1/schemas/schema1
// ```
type ApiSchema struct {
pulumi.CustomResourceState
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringOutput `pulumi:"apiManagementName"`
// The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
ApiName pulumi.StringOutput `pulumi:"apiName"`
// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
Components pulumi.StringPtrOutput `pulumi:"components"`
// The content type of the API Schema.
ContentType pulumi.StringOutput `pulumi:"contentType"`
// Types definitions. Used for Swagger/OpenAPI v1 schemas only.
Definitions pulumi.StringPtrOutput `pulumi:"definitions"`
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A unique identifier for this API Schema. Changing this forces a new resource to be created.
SchemaId pulumi.StringOutput `pulumi:"schemaId"`
// The JSON escaped string defining the document representing the Schema.
Value pulumi.StringPtrOutput `pulumi:"value"`
}
// NewApiSchema registers a new resource with the given unique name, arguments, and options.
func NewApiSchema(ctx *pulumi.Context,
name string, args *ApiSchemaArgs, opts ...pulumi.ResourceOption) (*ApiSchema, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementName == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementName'")
}
if args.ApiName == nil {
return nil, errors.New("invalid value for required argument 'ApiName'")
}
if args.ContentType == nil {
return nil, errors.New("invalid value for required argument 'ContentType'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.SchemaId == nil {
return nil, errors.New("invalid value for required argument 'SchemaId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ApiSchema
err := ctx.RegisterResource("azure:apimanagement/apiSchema:ApiSchema", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApiSchema gets an existing ApiSchema resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetApiSchema(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiSchemaState, opts ...pulumi.ResourceOption) (*ApiSchema, error) {
var resource ApiSchema
err := ctx.ReadResource("azure:apimanagement/apiSchema:ApiSchema", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApiSchema resources.
type apiSchemaState struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName *string `pulumi:"apiManagementName"`
// The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
ApiName *string `pulumi:"apiName"`
// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
Components *string `pulumi:"components"`
// The content type of the API Schema.
ContentType *string `pulumi:"contentType"`
// Types definitions. Used for Swagger/OpenAPI v1 schemas only.
Definitions *string `pulumi:"definitions"`
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A unique identifier for this API Schema. Changing this forces a new resource to be created.
SchemaId *string `pulumi:"schemaId"`
// The JSON escaped string defining the document representing the Schema.
Value *string `pulumi:"value"`
}
type ApiSchemaState struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringPtrInput
// The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
ApiName pulumi.StringPtrInput
// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
Components pulumi.StringPtrInput
// The content type of the API Schema.
ContentType pulumi.StringPtrInput
// Types definitions. Used for Swagger/OpenAPI v1 schemas only.
Definitions pulumi.StringPtrInput
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A unique identifier for this API Schema. Changing this forces a new resource to be created.
SchemaId pulumi.StringPtrInput
// The JSON escaped string defining the document representing the Schema.
Value pulumi.StringPtrInput
}
func (ApiSchemaState) ElementType() reflect.Type {
return reflect.TypeOf((*apiSchemaState)(nil)).Elem()
}
type apiSchemaArgs struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName string `pulumi:"apiManagementName"`
// The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
ApiName string `pulumi:"apiName"`
// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
Components *string `pulumi:"components"`
// The content type of the API Schema.
ContentType string `pulumi:"contentType"`
// Types definitions. Used for Swagger/OpenAPI v1 schemas only.
Definitions *string `pulumi:"definitions"`
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A unique identifier for this API Schema. Changing this forces a new resource to be created.
SchemaId string `pulumi:"schemaId"`
// The JSON escaped string defining the document representing the Schema.
Value *string `pulumi:"value"`
}
// The set of arguments for constructing a ApiSchema resource.
type ApiSchemaArgs struct {
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
ApiManagementName pulumi.StringInput
// The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
ApiName pulumi.StringInput
// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
Components pulumi.StringPtrInput
// The content type of the API Schema.
ContentType pulumi.StringInput
// Types definitions. Used for Swagger/OpenAPI v1 schemas only.
Definitions pulumi.StringPtrInput
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A unique identifier for this API Schema. Changing this forces a new resource to be created.
SchemaId pulumi.StringInput
// The JSON escaped string defining the document representing the Schema.
Value pulumi.StringPtrInput
}
func (ApiSchemaArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiSchemaArgs)(nil)).Elem()
}
type ApiSchemaInput interface {
pulumi.Input
ToApiSchemaOutput() ApiSchemaOutput
ToApiSchemaOutputWithContext(ctx context.Context) ApiSchemaOutput
}
func (*ApiSchema) ElementType() reflect.Type {
return reflect.TypeOf((**ApiSchema)(nil)).Elem()
}
func (i *ApiSchema) ToApiSchemaOutput() ApiSchemaOutput {
return i.ToApiSchemaOutputWithContext(context.Background())
}
func (i *ApiSchema) ToApiSchemaOutputWithContext(ctx context.Context) ApiSchemaOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiSchemaOutput)
}
// ApiSchemaArrayInput is an input type that accepts ApiSchemaArray and ApiSchemaArrayOutput values.
// You can construct a concrete instance of `ApiSchemaArrayInput` via:
//
// ApiSchemaArray{ ApiSchemaArgs{...} }
type ApiSchemaArrayInput interface {
pulumi.Input
ToApiSchemaArrayOutput() ApiSchemaArrayOutput
ToApiSchemaArrayOutputWithContext(context.Context) ApiSchemaArrayOutput
}
type ApiSchemaArray []ApiSchemaInput
func (ApiSchemaArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiSchema)(nil)).Elem()
}
func (i ApiSchemaArray) ToApiSchemaArrayOutput() ApiSchemaArrayOutput {
return i.ToApiSchemaArrayOutputWithContext(context.Background())
}
func (i ApiSchemaArray) ToApiSchemaArrayOutputWithContext(ctx context.Context) ApiSchemaArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiSchemaArrayOutput)
}
// ApiSchemaMapInput is an input type that accepts ApiSchemaMap and ApiSchemaMapOutput values.
// You can construct a concrete instance of `ApiSchemaMapInput` via:
//
// ApiSchemaMap{ "key": ApiSchemaArgs{...} }
type ApiSchemaMapInput interface {
pulumi.Input
ToApiSchemaMapOutput() ApiSchemaMapOutput
ToApiSchemaMapOutputWithContext(context.Context) ApiSchemaMapOutput
}
type ApiSchemaMap map[string]ApiSchemaInput
func (ApiSchemaMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiSchema)(nil)).Elem()
}
func (i ApiSchemaMap) ToApiSchemaMapOutput() ApiSchemaMapOutput {
return i.ToApiSchemaMapOutputWithContext(context.Background())
}
func (i ApiSchemaMap) ToApiSchemaMapOutputWithContext(ctx context.Context) ApiSchemaMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiSchemaMapOutput)
}
type ApiSchemaOutput struct{ *pulumi.OutputState }
func (ApiSchemaOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ApiSchema)(nil)).Elem()
}
func (o ApiSchemaOutput) ToApiSchemaOutput() ApiSchemaOutput {
return o
}
func (o ApiSchemaOutput) ToApiSchemaOutputWithContext(ctx context.Context) ApiSchemaOutput {
return o
}
// The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
func (o ApiSchemaOutput) ApiManagementName() pulumi.StringOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringOutput { return v.ApiManagementName }).(pulumi.StringOutput)
}
// The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
func (o ApiSchemaOutput) ApiName() pulumi.StringOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringOutput { return v.ApiName }).(pulumi.StringOutput)
}
// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
func (o ApiSchemaOutput) Components() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringPtrOutput { return v.Components }).(pulumi.StringPtrOutput)
}
// The content type of the API Schema.
func (o ApiSchemaOutput) ContentType() pulumi.StringOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringOutput { return v.ContentType }).(pulumi.StringOutput)
}
// Types definitions. Used for Swagger/OpenAPI v1 schemas only.
func (o ApiSchemaOutput) Definitions() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringPtrOutput { return v.Definitions }).(pulumi.StringPtrOutput)
}
// The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
func (o ApiSchemaOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A unique identifier for this API Schema. Changing this forces a new resource to be created.
func (o ApiSchemaOutput) SchemaId() pulumi.StringOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringOutput { return v.SchemaId }).(pulumi.StringOutput)
}
// The JSON escaped string defining the document representing the Schema.
func (o ApiSchemaOutput) Value() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiSchema) pulumi.StringPtrOutput { return v.Value }).(pulumi.StringPtrOutput)
}
type ApiSchemaArrayOutput struct{ *pulumi.OutputState }
func (ApiSchemaArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiSchema)(nil)).Elem()
}
func (o ApiSchemaArrayOutput) ToApiSchemaArrayOutput() ApiSchemaArrayOutput {
return o
}
func (o ApiSchemaArrayOutput) ToApiSchemaArrayOutputWithContext(ctx context.Context) ApiSchemaArrayOutput {
return o
}
func (o ApiSchemaArrayOutput) Index(i pulumi.IntInput) ApiSchemaOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApiSchema {
return vs[0].([]*ApiSchema)[vs[1].(int)]
}).(ApiSchemaOutput)
}
type ApiSchemaMapOutput struct{ *pulumi.OutputState }
func (ApiSchemaMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiSchema)(nil)).Elem()
}
func (o ApiSchemaMapOutput) ToApiSchemaMapOutput() ApiSchemaMapOutput {
return o
}
func (o ApiSchemaMapOutput) ToApiSchemaMapOutputWithContext(ctx context.Context) ApiSchemaMapOutput {
return o
}
func (o ApiSchemaMapOutput) MapIndex(k pulumi.StringInput) ApiSchemaOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApiSchema {
return vs[0].(map[string]*ApiSchema)[vs[1].(string)]
}).(ApiSchemaOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApiSchemaInput)(nil)).Elem(), &ApiSchema{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiSchemaArrayInput)(nil)).Elem(), ApiSchemaArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiSchemaMapInput)(nil)).Elem(), ApiSchemaMap{})
pulumi.RegisterOutputType(ApiSchemaOutput{})
pulumi.RegisterOutputType(ApiSchemaArrayOutput{})
pulumi.RegisterOutputType(ApiSchemaMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getProject.go | sdk/go/azure/devcenter/getProject.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Project.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupProject(ctx, &devcenter.LookupProjectArgs{
// Name: "example",
// ResourceGroupName: "example-resource-group",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupProject(ctx *pulumi.Context, args *LookupProjectArgs, opts ...pulumi.InvokeOption) (*LookupProjectResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupProjectResult
err := ctx.Invoke("azure:devcenter/getProject:getProject", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getProject.
type LookupProjectArgs struct {
// The name of this Dev Center Project.
Name string `pulumi:"name"`
// The name of the Resource Group where the Dev Center Project exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getProject.
type LookupProjectResult struct {
// The description of the Dev Center Project.
Description string `pulumi:"description"`
// The ID of the associated Dev Center.
DevCenterId string `pulumi:"devCenterId"`
// The URI of the Dev Center.
DevCenterUri string `pulumi:"devCenterUri"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// An `identity` block as defined below.
Identities []GetProjectIdentity `pulumi:"identities"`
// The Azure Region where the Dev Center Project exists.
Location string `pulumi:"location"`
// The maximum number of Dev Boxes a single user can create across all pools in the project.
MaximumDevBoxesPerUser int `pulumi:"maximumDevBoxesPerUser"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the Dev Center Project.
Tags map[string]string `pulumi:"tags"`
}
func LookupProjectOutput(ctx *pulumi.Context, args LookupProjectOutputArgs, opts ...pulumi.InvokeOption) LookupProjectResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupProjectResultOutput, error) {
args := v.(LookupProjectArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getProject:getProject", args, LookupProjectResultOutput{}, options).(LookupProjectResultOutput), nil
}).(LookupProjectResultOutput)
}
// A collection of arguments for invoking getProject.
type LookupProjectOutputArgs struct {
// The name of this Dev Center Project.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Dev Center Project exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupProjectOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupProjectArgs)(nil)).Elem()
}
// A collection of values returned by getProject.
type LookupProjectResultOutput struct{ *pulumi.OutputState }
func (LookupProjectResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupProjectResult)(nil)).Elem()
}
func (o LookupProjectResultOutput) ToLookupProjectResultOutput() LookupProjectResultOutput {
return o
}
func (o LookupProjectResultOutput) ToLookupProjectResultOutputWithContext(ctx context.Context) LookupProjectResultOutput {
return o
}
// The description of the Dev Center Project.
func (o LookupProjectResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.Description }).(pulumi.StringOutput)
}
// The ID of the associated Dev Center.
func (o LookupProjectResultOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.DevCenterId }).(pulumi.StringOutput)
}
// The URI of the Dev Center.
func (o LookupProjectResultOutput) DevCenterUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.DevCenterUri }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupProjectResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.Id }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o LookupProjectResultOutput) Identities() GetProjectIdentityArrayOutput {
return o.ApplyT(func(v LookupProjectResult) []GetProjectIdentity { return v.Identities }).(GetProjectIdentityArrayOutput)
}
// The Azure Region where the Dev Center Project exists.
func (o LookupProjectResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.Location }).(pulumi.StringOutput)
}
// The maximum number of Dev Boxes a single user can create across all pools in the project.
func (o LookupProjectResultOutput) MaximumDevBoxesPerUser() pulumi.IntOutput {
return o.ApplyT(func(v LookupProjectResult) int { return v.MaximumDevBoxesPerUser }).(pulumi.IntOutput)
}
func (o LookupProjectResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupProjectResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Dev Center Project.
func (o LookupProjectResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupProjectResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupProjectResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/init.go | sdk/go/azure/devcenter/init.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"fmt"
"github.com/blang/semver"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type module struct {
version semver.Version
}
func (m *module) Version() semver.Version {
return m.version
}
func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) {
switch typ {
case "azure:devcenter/attachedNetwork:AttachedNetwork":
r = &AttachedNetwork{}
case "azure:devcenter/catalog:Catalog":
r = &Catalog{}
case "azure:devcenter/devBoxDefinition:DevBoxDefinition":
r = &DevBoxDefinition{}
case "azure:devcenter/devCenter:DevCenter":
r = &DevCenter{}
case "azure:devcenter/environmentType:EnvironmentType":
r = &EnvironmentType{}
case "azure:devcenter/gallery:Gallery":
r = &Gallery{}
case "azure:devcenter/networkConnection:NetworkConnection":
r = &NetworkConnection{}
case "azure:devcenter/project:Project":
r = &Project{}
case "azure:devcenter/projectEnvironmentType:ProjectEnvironmentType":
r = &ProjectEnvironmentType{}
case "azure:devcenter/projectPool:ProjectPool":
r = &ProjectPool{}
default:
return nil, fmt.Errorf("unknown resource type: %s", typ)
}
err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn))
return
}
func init() {
version, err := internal.PkgVersion()
if err != nil {
version = semver.Version{Major: 1}
}
pulumi.RegisterResourceModule(
"azure",
"devcenter/attachedNetwork",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/catalog",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/devBoxDefinition",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/devCenter",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/environmentType",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/gallery",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/networkConnection",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/project",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/projectEnvironmentType",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"devcenter/projectPool",
&module{version},
)
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getNetworkConnection.go | sdk/go/azure/devcenter/getNetworkConnection.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Network Connection.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupNetworkConnection(ctx, &devcenter.LookupNetworkConnectionArgs{
// Name: "example",
// ResourceGroupName: "example-resource-group",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupNetworkConnection(ctx *pulumi.Context, args *LookupNetworkConnectionArgs, opts ...pulumi.InvokeOption) (*LookupNetworkConnectionResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupNetworkConnectionResult
err := ctx.Invoke("azure:devcenter/getNetworkConnection:getNetworkConnection", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getNetworkConnection.
type LookupNetworkConnectionArgs struct {
// The name of this Dev Center Network Connection.
Name string `pulumi:"name"`
// The name of the Resource Group where the Dev Center Network Connection exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getNetworkConnection.
type LookupNetworkConnectionResult struct {
// The Azure Active Directory Join type.
DomainJoinType string `pulumi:"domainJoinType"`
// The name of the Azure Active Directory domain.
DomainName string `pulumi:"domainName"`
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
DomainUsername string `pulumi:"domainUsername"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The Azure Region where the Dev Center Network Connection exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
// The Azure Active Directory domain Organization Unit (OU).
OrganizationUnit string `pulumi:"organizationUnit"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The ID of the Subnet that is used to attach Virtual Machines.
SubnetId string `pulumi:"subnetId"`
// A mapping of tags assigned to the Dev Center Network Connection.
Tags map[string]string `pulumi:"tags"`
}
func LookupNetworkConnectionOutput(ctx *pulumi.Context, args LookupNetworkConnectionOutputArgs, opts ...pulumi.InvokeOption) LookupNetworkConnectionResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupNetworkConnectionResultOutput, error) {
args := v.(LookupNetworkConnectionArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getNetworkConnection:getNetworkConnection", args, LookupNetworkConnectionResultOutput{}, options).(LookupNetworkConnectionResultOutput), nil
}).(LookupNetworkConnectionResultOutput)
}
// A collection of arguments for invoking getNetworkConnection.
type LookupNetworkConnectionOutputArgs struct {
// The name of this Dev Center Network Connection.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Dev Center Network Connection exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupNetworkConnectionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNetworkConnectionArgs)(nil)).Elem()
}
// A collection of values returned by getNetworkConnection.
type LookupNetworkConnectionResultOutput struct{ *pulumi.OutputState }
func (LookupNetworkConnectionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNetworkConnectionResult)(nil)).Elem()
}
func (o LookupNetworkConnectionResultOutput) ToLookupNetworkConnectionResultOutput() LookupNetworkConnectionResultOutput {
return o
}
func (o LookupNetworkConnectionResultOutput) ToLookupNetworkConnectionResultOutputWithContext(ctx context.Context) LookupNetworkConnectionResultOutput {
return o
}
// The Azure Active Directory Join type.
func (o LookupNetworkConnectionResultOutput) DomainJoinType() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.DomainJoinType }).(pulumi.StringOutput)
}
// The name of the Azure Active Directory domain.
func (o LookupNetworkConnectionResultOutput) DomainName() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.DomainName }).(pulumi.StringOutput)
}
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
func (o LookupNetworkConnectionResultOutput) DomainUsername() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.DomainUsername }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupNetworkConnectionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.Id }).(pulumi.StringOutput)
}
// The Azure Region where the Dev Center Network Connection exists.
func (o LookupNetworkConnectionResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupNetworkConnectionResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.Name }).(pulumi.StringOutput)
}
// The Azure Active Directory domain Organization Unit (OU).
func (o LookupNetworkConnectionResultOutput) OrganizationUnit() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.OrganizationUnit }).(pulumi.StringOutput)
}
func (o LookupNetworkConnectionResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The ID of the Subnet that is used to attach Virtual Machines.
func (o LookupNetworkConnectionResultOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) string { return v.SubnetId }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Dev Center Network Connection.
func (o LookupNetworkConnectionResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNetworkConnectionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupNetworkConnectionResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/pulumiTypes.go | sdk/go/azure/devcenter/pulumiTypes.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
var _ = internal.GetEnvOrDefault
type CatalogCatalogAdogit struct {
// The Git branch of the Dev Center Catalog.
Branch string `pulumi:"branch"`
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
KeyVaultKeyUrl string `pulumi:"keyVaultKeyUrl"`
// The folder where the catalog items can be found inside the repository.
Path string `pulumi:"path"`
// The Git URI of the Dev Center Catalog.
Uri string `pulumi:"uri"`
}
// CatalogCatalogAdogitInput is an input type that accepts CatalogCatalogAdogitArgs and CatalogCatalogAdogitOutput values.
// You can construct a concrete instance of `CatalogCatalogAdogitInput` via:
//
// CatalogCatalogAdogitArgs{...}
type CatalogCatalogAdogitInput interface {
pulumi.Input
ToCatalogCatalogAdogitOutput() CatalogCatalogAdogitOutput
ToCatalogCatalogAdogitOutputWithContext(context.Context) CatalogCatalogAdogitOutput
}
type CatalogCatalogAdogitArgs struct {
// The Git branch of the Dev Center Catalog.
Branch pulumi.StringInput `pulumi:"branch"`
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
KeyVaultKeyUrl pulumi.StringInput `pulumi:"keyVaultKeyUrl"`
// The folder where the catalog items can be found inside the repository.
Path pulumi.StringInput `pulumi:"path"`
// The Git URI of the Dev Center Catalog.
Uri pulumi.StringInput `pulumi:"uri"`
}
func (CatalogCatalogAdogitArgs) ElementType() reflect.Type {
return reflect.TypeOf((*CatalogCatalogAdogit)(nil)).Elem()
}
func (i CatalogCatalogAdogitArgs) ToCatalogCatalogAdogitOutput() CatalogCatalogAdogitOutput {
return i.ToCatalogCatalogAdogitOutputWithContext(context.Background())
}
func (i CatalogCatalogAdogitArgs) ToCatalogCatalogAdogitOutputWithContext(ctx context.Context) CatalogCatalogAdogitOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogCatalogAdogitOutput)
}
func (i CatalogCatalogAdogitArgs) ToCatalogCatalogAdogitPtrOutput() CatalogCatalogAdogitPtrOutput {
return i.ToCatalogCatalogAdogitPtrOutputWithContext(context.Background())
}
func (i CatalogCatalogAdogitArgs) ToCatalogCatalogAdogitPtrOutputWithContext(ctx context.Context) CatalogCatalogAdogitPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogCatalogAdogitOutput).ToCatalogCatalogAdogitPtrOutputWithContext(ctx)
}
// CatalogCatalogAdogitPtrInput is an input type that accepts CatalogCatalogAdogitArgs, CatalogCatalogAdogitPtr and CatalogCatalogAdogitPtrOutput values.
// You can construct a concrete instance of `CatalogCatalogAdogitPtrInput` via:
//
// CatalogCatalogAdogitArgs{...}
//
// or:
//
// nil
type CatalogCatalogAdogitPtrInput interface {
pulumi.Input
ToCatalogCatalogAdogitPtrOutput() CatalogCatalogAdogitPtrOutput
ToCatalogCatalogAdogitPtrOutputWithContext(context.Context) CatalogCatalogAdogitPtrOutput
}
type catalogCatalogAdogitPtrType CatalogCatalogAdogitArgs
func CatalogCatalogAdogitPtr(v *CatalogCatalogAdogitArgs) CatalogCatalogAdogitPtrInput {
return (*catalogCatalogAdogitPtrType)(v)
}
func (*catalogCatalogAdogitPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**CatalogCatalogAdogit)(nil)).Elem()
}
func (i *catalogCatalogAdogitPtrType) ToCatalogCatalogAdogitPtrOutput() CatalogCatalogAdogitPtrOutput {
return i.ToCatalogCatalogAdogitPtrOutputWithContext(context.Background())
}
func (i *catalogCatalogAdogitPtrType) ToCatalogCatalogAdogitPtrOutputWithContext(ctx context.Context) CatalogCatalogAdogitPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogCatalogAdogitPtrOutput)
}
type CatalogCatalogAdogitOutput struct{ *pulumi.OutputState }
func (CatalogCatalogAdogitOutput) ElementType() reflect.Type {
return reflect.TypeOf((*CatalogCatalogAdogit)(nil)).Elem()
}
func (o CatalogCatalogAdogitOutput) ToCatalogCatalogAdogitOutput() CatalogCatalogAdogitOutput {
return o
}
func (o CatalogCatalogAdogitOutput) ToCatalogCatalogAdogitOutputWithContext(ctx context.Context) CatalogCatalogAdogitOutput {
return o
}
func (o CatalogCatalogAdogitOutput) ToCatalogCatalogAdogitPtrOutput() CatalogCatalogAdogitPtrOutput {
return o.ToCatalogCatalogAdogitPtrOutputWithContext(context.Background())
}
func (o CatalogCatalogAdogitOutput) ToCatalogCatalogAdogitPtrOutputWithContext(ctx context.Context) CatalogCatalogAdogitPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v CatalogCatalogAdogit) *CatalogCatalogAdogit {
return &v
}).(CatalogCatalogAdogitPtrOutput)
}
// The Git branch of the Dev Center Catalog.
func (o CatalogCatalogAdogitOutput) Branch() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogAdogit) string { return v.Branch }).(pulumi.StringOutput)
}
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
func (o CatalogCatalogAdogitOutput) KeyVaultKeyUrl() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogAdogit) string { return v.KeyVaultKeyUrl }).(pulumi.StringOutput)
}
// The folder where the catalog items can be found inside the repository.
func (o CatalogCatalogAdogitOutput) Path() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogAdogit) string { return v.Path }).(pulumi.StringOutput)
}
// The Git URI of the Dev Center Catalog.
func (o CatalogCatalogAdogitOutput) Uri() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogAdogit) string { return v.Uri }).(pulumi.StringOutput)
}
type CatalogCatalogAdogitPtrOutput struct{ *pulumi.OutputState }
func (CatalogCatalogAdogitPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CatalogCatalogAdogit)(nil)).Elem()
}
func (o CatalogCatalogAdogitPtrOutput) ToCatalogCatalogAdogitPtrOutput() CatalogCatalogAdogitPtrOutput {
return o
}
func (o CatalogCatalogAdogitPtrOutput) ToCatalogCatalogAdogitPtrOutputWithContext(ctx context.Context) CatalogCatalogAdogitPtrOutput {
return o
}
func (o CatalogCatalogAdogitPtrOutput) Elem() CatalogCatalogAdogitOutput {
return o.ApplyT(func(v *CatalogCatalogAdogit) CatalogCatalogAdogit {
if v != nil {
return *v
}
var ret CatalogCatalogAdogit
return ret
}).(CatalogCatalogAdogitOutput)
}
// The Git branch of the Dev Center Catalog.
func (o CatalogCatalogAdogitPtrOutput) Branch() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogAdogit) *string {
if v == nil {
return nil
}
return &v.Branch
}).(pulumi.StringPtrOutput)
}
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
func (o CatalogCatalogAdogitPtrOutput) KeyVaultKeyUrl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogAdogit) *string {
if v == nil {
return nil
}
return &v.KeyVaultKeyUrl
}).(pulumi.StringPtrOutput)
}
// The folder where the catalog items can be found inside the repository.
func (o CatalogCatalogAdogitPtrOutput) Path() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogAdogit) *string {
if v == nil {
return nil
}
return &v.Path
}).(pulumi.StringPtrOutput)
}
// The Git URI of the Dev Center Catalog.
func (o CatalogCatalogAdogitPtrOutput) Uri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogAdogit) *string {
if v == nil {
return nil
}
return &v.Uri
}).(pulumi.StringPtrOutput)
}
type CatalogCatalogGithub struct {
// The Git branch of the Dev Center Catalog.
Branch string `pulumi:"branch"`
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
KeyVaultKeyUrl string `pulumi:"keyVaultKeyUrl"`
// The folder where the catalog items can be found inside the repository.
Path string `pulumi:"path"`
// The Git URI of the Dev Center Catalog.
Uri string `pulumi:"uri"`
}
// CatalogCatalogGithubInput is an input type that accepts CatalogCatalogGithubArgs and CatalogCatalogGithubOutput values.
// You can construct a concrete instance of `CatalogCatalogGithubInput` via:
//
// CatalogCatalogGithubArgs{...}
type CatalogCatalogGithubInput interface {
pulumi.Input
ToCatalogCatalogGithubOutput() CatalogCatalogGithubOutput
ToCatalogCatalogGithubOutputWithContext(context.Context) CatalogCatalogGithubOutput
}
type CatalogCatalogGithubArgs struct {
// The Git branch of the Dev Center Catalog.
Branch pulumi.StringInput `pulumi:"branch"`
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
KeyVaultKeyUrl pulumi.StringInput `pulumi:"keyVaultKeyUrl"`
// The folder where the catalog items can be found inside the repository.
Path pulumi.StringInput `pulumi:"path"`
// The Git URI of the Dev Center Catalog.
Uri pulumi.StringInput `pulumi:"uri"`
}
func (CatalogCatalogGithubArgs) ElementType() reflect.Type {
return reflect.TypeOf((*CatalogCatalogGithub)(nil)).Elem()
}
func (i CatalogCatalogGithubArgs) ToCatalogCatalogGithubOutput() CatalogCatalogGithubOutput {
return i.ToCatalogCatalogGithubOutputWithContext(context.Background())
}
func (i CatalogCatalogGithubArgs) ToCatalogCatalogGithubOutputWithContext(ctx context.Context) CatalogCatalogGithubOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogCatalogGithubOutput)
}
func (i CatalogCatalogGithubArgs) ToCatalogCatalogGithubPtrOutput() CatalogCatalogGithubPtrOutput {
return i.ToCatalogCatalogGithubPtrOutputWithContext(context.Background())
}
func (i CatalogCatalogGithubArgs) ToCatalogCatalogGithubPtrOutputWithContext(ctx context.Context) CatalogCatalogGithubPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogCatalogGithubOutput).ToCatalogCatalogGithubPtrOutputWithContext(ctx)
}
// CatalogCatalogGithubPtrInput is an input type that accepts CatalogCatalogGithubArgs, CatalogCatalogGithubPtr and CatalogCatalogGithubPtrOutput values.
// You can construct a concrete instance of `CatalogCatalogGithubPtrInput` via:
//
// CatalogCatalogGithubArgs{...}
//
// or:
//
// nil
type CatalogCatalogGithubPtrInput interface {
pulumi.Input
ToCatalogCatalogGithubPtrOutput() CatalogCatalogGithubPtrOutput
ToCatalogCatalogGithubPtrOutputWithContext(context.Context) CatalogCatalogGithubPtrOutput
}
type catalogCatalogGithubPtrType CatalogCatalogGithubArgs
func CatalogCatalogGithubPtr(v *CatalogCatalogGithubArgs) CatalogCatalogGithubPtrInput {
return (*catalogCatalogGithubPtrType)(v)
}
func (*catalogCatalogGithubPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**CatalogCatalogGithub)(nil)).Elem()
}
func (i *catalogCatalogGithubPtrType) ToCatalogCatalogGithubPtrOutput() CatalogCatalogGithubPtrOutput {
return i.ToCatalogCatalogGithubPtrOutputWithContext(context.Background())
}
func (i *catalogCatalogGithubPtrType) ToCatalogCatalogGithubPtrOutputWithContext(ctx context.Context) CatalogCatalogGithubPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogCatalogGithubPtrOutput)
}
type CatalogCatalogGithubOutput struct{ *pulumi.OutputState }
func (CatalogCatalogGithubOutput) ElementType() reflect.Type {
return reflect.TypeOf((*CatalogCatalogGithub)(nil)).Elem()
}
func (o CatalogCatalogGithubOutput) ToCatalogCatalogGithubOutput() CatalogCatalogGithubOutput {
return o
}
func (o CatalogCatalogGithubOutput) ToCatalogCatalogGithubOutputWithContext(ctx context.Context) CatalogCatalogGithubOutput {
return o
}
func (o CatalogCatalogGithubOutput) ToCatalogCatalogGithubPtrOutput() CatalogCatalogGithubPtrOutput {
return o.ToCatalogCatalogGithubPtrOutputWithContext(context.Background())
}
func (o CatalogCatalogGithubOutput) ToCatalogCatalogGithubPtrOutputWithContext(ctx context.Context) CatalogCatalogGithubPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v CatalogCatalogGithub) *CatalogCatalogGithub {
return &v
}).(CatalogCatalogGithubPtrOutput)
}
// The Git branch of the Dev Center Catalog.
func (o CatalogCatalogGithubOutput) Branch() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogGithub) string { return v.Branch }).(pulumi.StringOutput)
}
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
func (o CatalogCatalogGithubOutput) KeyVaultKeyUrl() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogGithub) string { return v.KeyVaultKeyUrl }).(pulumi.StringOutput)
}
// The folder where the catalog items can be found inside the repository.
func (o CatalogCatalogGithubOutput) Path() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogGithub) string { return v.Path }).(pulumi.StringOutput)
}
// The Git URI of the Dev Center Catalog.
func (o CatalogCatalogGithubOutput) Uri() pulumi.StringOutput {
return o.ApplyT(func(v CatalogCatalogGithub) string { return v.Uri }).(pulumi.StringOutput)
}
type CatalogCatalogGithubPtrOutput struct{ *pulumi.OutputState }
func (CatalogCatalogGithubPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CatalogCatalogGithub)(nil)).Elem()
}
func (o CatalogCatalogGithubPtrOutput) ToCatalogCatalogGithubPtrOutput() CatalogCatalogGithubPtrOutput {
return o
}
func (o CatalogCatalogGithubPtrOutput) ToCatalogCatalogGithubPtrOutputWithContext(ctx context.Context) CatalogCatalogGithubPtrOutput {
return o
}
func (o CatalogCatalogGithubPtrOutput) Elem() CatalogCatalogGithubOutput {
return o.ApplyT(func(v *CatalogCatalogGithub) CatalogCatalogGithub {
if v != nil {
return *v
}
var ret CatalogCatalogGithub
return ret
}).(CatalogCatalogGithubOutput)
}
// The Git branch of the Dev Center Catalog.
func (o CatalogCatalogGithubPtrOutput) Branch() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogGithub) *string {
if v == nil {
return nil
}
return &v.Branch
}).(pulumi.StringPtrOutput)
}
// A reference to the Key Vault secret containing a security token to authenticate to a Git repository.
func (o CatalogCatalogGithubPtrOutput) KeyVaultKeyUrl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogGithub) *string {
if v == nil {
return nil
}
return &v.KeyVaultKeyUrl
}).(pulumi.StringPtrOutput)
}
// The folder where the catalog items can be found inside the repository.
func (o CatalogCatalogGithubPtrOutput) Path() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogGithub) *string {
if v == nil {
return nil
}
return &v.Path
}).(pulumi.StringPtrOutput)
}
// The Git URI of the Dev Center Catalog.
func (o CatalogCatalogGithubPtrOutput) Uri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CatalogCatalogGithub) *string {
if v == nil {
return nil
}
return &v.Uri
}).(pulumi.StringPtrOutput)
}
type DevCenterIdentity struct {
IdentityIds []string `pulumi:"identityIds"`
PrincipalId *string `pulumi:"principalId"`
TenantId *string `pulumi:"tenantId"`
Type string `pulumi:"type"`
}
// DevCenterIdentityInput is an input type that accepts DevCenterIdentityArgs and DevCenterIdentityOutput values.
// You can construct a concrete instance of `DevCenterIdentityInput` via:
//
// DevCenterIdentityArgs{...}
type DevCenterIdentityInput interface {
pulumi.Input
ToDevCenterIdentityOutput() DevCenterIdentityOutput
ToDevCenterIdentityOutputWithContext(context.Context) DevCenterIdentityOutput
}
type DevCenterIdentityArgs struct {
IdentityIds pulumi.StringArrayInput `pulumi:"identityIds"`
PrincipalId pulumi.StringPtrInput `pulumi:"principalId"`
TenantId pulumi.StringPtrInput `pulumi:"tenantId"`
Type pulumi.StringInput `pulumi:"type"`
}
func (DevCenterIdentityArgs) ElementType() reflect.Type {
return reflect.TypeOf((*DevCenterIdentity)(nil)).Elem()
}
func (i DevCenterIdentityArgs) ToDevCenterIdentityOutput() DevCenterIdentityOutput {
return i.ToDevCenterIdentityOutputWithContext(context.Background())
}
func (i DevCenterIdentityArgs) ToDevCenterIdentityOutputWithContext(ctx context.Context) DevCenterIdentityOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevCenterIdentityOutput)
}
func (i DevCenterIdentityArgs) ToDevCenterIdentityPtrOutput() DevCenterIdentityPtrOutput {
return i.ToDevCenterIdentityPtrOutputWithContext(context.Background())
}
func (i DevCenterIdentityArgs) ToDevCenterIdentityPtrOutputWithContext(ctx context.Context) DevCenterIdentityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevCenterIdentityOutput).ToDevCenterIdentityPtrOutputWithContext(ctx)
}
// DevCenterIdentityPtrInput is an input type that accepts DevCenterIdentityArgs, DevCenterIdentityPtr and DevCenterIdentityPtrOutput values.
// You can construct a concrete instance of `DevCenterIdentityPtrInput` via:
//
// DevCenterIdentityArgs{...}
//
// or:
//
// nil
type DevCenterIdentityPtrInput interface {
pulumi.Input
ToDevCenterIdentityPtrOutput() DevCenterIdentityPtrOutput
ToDevCenterIdentityPtrOutputWithContext(context.Context) DevCenterIdentityPtrOutput
}
type devCenterIdentityPtrType DevCenterIdentityArgs
func DevCenterIdentityPtr(v *DevCenterIdentityArgs) DevCenterIdentityPtrInput {
return (*devCenterIdentityPtrType)(v)
}
func (*devCenterIdentityPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**DevCenterIdentity)(nil)).Elem()
}
func (i *devCenterIdentityPtrType) ToDevCenterIdentityPtrOutput() DevCenterIdentityPtrOutput {
return i.ToDevCenterIdentityPtrOutputWithContext(context.Background())
}
func (i *devCenterIdentityPtrType) ToDevCenterIdentityPtrOutputWithContext(ctx context.Context) DevCenterIdentityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevCenterIdentityPtrOutput)
}
type DevCenterIdentityOutput struct{ *pulumi.OutputState }
func (DevCenterIdentityOutput) ElementType() reflect.Type {
return reflect.TypeOf((*DevCenterIdentity)(nil)).Elem()
}
func (o DevCenterIdentityOutput) ToDevCenterIdentityOutput() DevCenterIdentityOutput {
return o
}
func (o DevCenterIdentityOutput) ToDevCenterIdentityOutputWithContext(ctx context.Context) DevCenterIdentityOutput {
return o
}
func (o DevCenterIdentityOutput) ToDevCenterIdentityPtrOutput() DevCenterIdentityPtrOutput {
return o.ToDevCenterIdentityPtrOutputWithContext(context.Background())
}
func (o DevCenterIdentityOutput) ToDevCenterIdentityPtrOutputWithContext(ctx context.Context) DevCenterIdentityPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v DevCenterIdentity) *DevCenterIdentity {
return &v
}).(DevCenterIdentityPtrOutput)
}
func (o DevCenterIdentityOutput) IdentityIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v DevCenterIdentity) []string { return v.IdentityIds }).(pulumi.StringArrayOutput)
}
func (o DevCenterIdentityOutput) PrincipalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v DevCenterIdentity) *string { return v.PrincipalId }).(pulumi.StringPtrOutput)
}
func (o DevCenterIdentityOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v DevCenterIdentity) *string { return v.TenantId }).(pulumi.StringPtrOutput)
}
func (o DevCenterIdentityOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v DevCenterIdentity) string { return v.Type }).(pulumi.StringOutput)
}
type DevCenterIdentityPtrOutput struct{ *pulumi.OutputState }
func (DevCenterIdentityPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DevCenterIdentity)(nil)).Elem()
}
func (o DevCenterIdentityPtrOutput) ToDevCenterIdentityPtrOutput() DevCenterIdentityPtrOutput {
return o
}
func (o DevCenterIdentityPtrOutput) ToDevCenterIdentityPtrOutputWithContext(ctx context.Context) DevCenterIdentityPtrOutput {
return o
}
func (o DevCenterIdentityPtrOutput) Elem() DevCenterIdentityOutput {
return o.ApplyT(func(v *DevCenterIdentity) DevCenterIdentity {
if v != nil {
return *v
}
var ret DevCenterIdentity
return ret
}).(DevCenterIdentityOutput)
}
func (o DevCenterIdentityPtrOutput) IdentityIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *DevCenterIdentity) []string {
if v == nil {
return nil
}
return v.IdentityIds
}).(pulumi.StringArrayOutput)
}
func (o DevCenterIdentityPtrOutput) PrincipalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DevCenterIdentity) *string {
if v == nil {
return nil
}
return v.PrincipalId
}).(pulumi.StringPtrOutput)
}
func (o DevCenterIdentityPtrOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DevCenterIdentity) *string {
if v == nil {
return nil
}
return v.TenantId
}).(pulumi.StringPtrOutput)
}
func (o DevCenterIdentityPtrOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DevCenterIdentity) *string {
if v == nil {
return nil
}
return &v.Type
}).(pulumi.StringPtrOutput)
}
type ProjectEnvironmentTypeIdentity struct {
// The ID of the User Assigned Identity which should be assigned to this Dev Center Project Environment Type.
//
// > **Note:** `identityIds` is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
IdentityIds []string `pulumi:"identityIds"`
PrincipalId *string `pulumi:"principalId"`
TenantId *string `pulumi:"tenantId"`
// The type of identity used for this Dev Center Project Environment Type. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
Type string `pulumi:"type"`
}
// ProjectEnvironmentTypeIdentityInput is an input type that accepts ProjectEnvironmentTypeIdentityArgs and ProjectEnvironmentTypeIdentityOutput values.
// You can construct a concrete instance of `ProjectEnvironmentTypeIdentityInput` via:
//
// ProjectEnvironmentTypeIdentityArgs{...}
type ProjectEnvironmentTypeIdentityInput interface {
pulumi.Input
ToProjectEnvironmentTypeIdentityOutput() ProjectEnvironmentTypeIdentityOutput
ToProjectEnvironmentTypeIdentityOutputWithContext(context.Context) ProjectEnvironmentTypeIdentityOutput
}
type ProjectEnvironmentTypeIdentityArgs struct {
// The ID of the User Assigned Identity which should be assigned to this Dev Center Project Environment Type.
//
// > **Note:** `identityIds` is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
IdentityIds pulumi.StringArrayInput `pulumi:"identityIds"`
PrincipalId pulumi.StringPtrInput `pulumi:"principalId"`
TenantId pulumi.StringPtrInput `pulumi:"tenantId"`
// The type of identity used for this Dev Center Project Environment Type. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
Type pulumi.StringInput `pulumi:"type"`
}
func (ProjectEnvironmentTypeIdentityArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ProjectEnvironmentTypeIdentity)(nil)).Elem()
}
func (i ProjectEnvironmentTypeIdentityArgs) ToProjectEnvironmentTypeIdentityOutput() ProjectEnvironmentTypeIdentityOutput {
return i.ToProjectEnvironmentTypeIdentityOutputWithContext(context.Background())
}
func (i ProjectEnvironmentTypeIdentityArgs) ToProjectEnvironmentTypeIdentityOutputWithContext(ctx context.Context) ProjectEnvironmentTypeIdentityOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeIdentityOutput)
}
func (i ProjectEnvironmentTypeIdentityArgs) ToProjectEnvironmentTypeIdentityPtrOutput() ProjectEnvironmentTypeIdentityPtrOutput {
return i.ToProjectEnvironmentTypeIdentityPtrOutputWithContext(context.Background())
}
func (i ProjectEnvironmentTypeIdentityArgs) ToProjectEnvironmentTypeIdentityPtrOutputWithContext(ctx context.Context) ProjectEnvironmentTypeIdentityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeIdentityOutput).ToProjectEnvironmentTypeIdentityPtrOutputWithContext(ctx)
}
// ProjectEnvironmentTypeIdentityPtrInput is an input type that accepts ProjectEnvironmentTypeIdentityArgs, ProjectEnvironmentTypeIdentityPtr and ProjectEnvironmentTypeIdentityPtrOutput values.
// You can construct a concrete instance of `ProjectEnvironmentTypeIdentityPtrInput` via:
//
// ProjectEnvironmentTypeIdentityArgs{...}
//
// or:
//
// nil
type ProjectEnvironmentTypeIdentityPtrInput interface {
pulumi.Input
ToProjectEnvironmentTypeIdentityPtrOutput() ProjectEnvironmentTypeIdentityPtrOutput
ToProjectEnvironmentTypeIdentityPtrOutputWithContext(context.Context) ProjectEnvironmentTypeIdentityPtrOutput
}
type projectEnvironmentTypeIdentityPtrType ProjectEnvironmentTypeIdentityArgs
func ProjectEnvironmentTypeIdentityPtr(v *ProjectEnvironmentTypeIdentityArgs) ProjectEnvironmentTypeIdentityPtrInput {
return (*projectEnvironmentTypeIdentityPtrType)(v)
}
func (*projectEnvironmentTypeIdentityPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectEnvironmentTypeIdentity)(nil)).Elem()
}
func (i *projectEnvironmentTypeIdentityPtrType) ToProjectEnvironmentTypeIdentityPtrOutput() ProjectEnvironmentTypeIdentityPtrOutput {
return i.ToProjectEnvironmentTypeIdentityPtrOutputWithContext(context.Background())
}
func (i *projectEnvironmentTypeIdentityPtrType) ToProjectEnvironmentTypeIdentityPtrOutputWithContext(ctx context.Context) ProjectEnvironmentTypeIdentityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeIdentityPtrOutput)
}
type ProjectEnvironmentTypeIdentityOutput struct{ *pulumi.OutputState }
func (ProjectEnvironmentTypeIdentityOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ProjectEnvironmentTypeIdentity)(nil)).Elem()
}
func (o ProjectEnvironmentTypeIdentityOutput) ToProjectEnvironmentTypeIdentityOutput() ProjectEnvironmentTypeIdentityOutput {
return o
}
func (o ProjectEnvironmentTypeIdentityOutput) ToProjectEnvironmentTypeIdentityOutputWithContext(ctx context.Context) ProjectEnvironmentTypeIdentityOutput {
return o
}
func (o ProjectEnvironmentTypeIdentityOutput) ToProjectEnvironmentTypeIdentityPtrOutput() ProjectEnvironmentTypeIdentityPtrOutput {
return o.ToProjectEnvironmentTypeIdentityPtrOutputWithContext(context.Background())
}
func (o ProjectEnvironmentTypeIdentityOutput) ToProjectEnvironmentTypeIdentityPtrOutputWithContext(ctx context.Context) ProjectEnvironmentTypeIdentityPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v ProjectEnvironmentTypeIdentity) *ProjectEnvironmentTypeIdentity {
return &v
}).(ProjectEnvironmentTypeIdentityPtrOutput)
}
// The ID of the User Assigned Identity which should be assigned to this Dev Center Project Environment Type.
//
// > **Note:** `identityIds` is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
func (o ProjectEnvironmentTypeIdentityOutput) IdentityIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v ProjectEnvironmentTypeIdentity) []string { return v.IdentityIds }).(pulumi.StringArrayOutput)
}
func (o ProjectEnvironmentTypeIdentityOutput) PrincipalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v ProjectEnvironmentTypeIdentity) *string { return v.PrincipalId }).(pulumi.StringPtrOutput)
}
func (o ProjectEnvironmentTypeIdentityOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v ProjectEnvironmentTypeIdentity) *string { return v.TenantId }).(pulumi.StringPtrOutput)
}
// The type of identity used for this Dev Center Project Environment Type. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
func (o ProjectEnvironmentTypeIdentityOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v ProjectEnvironmentTypeIdentity) string { return v.Type }).(pulumi.StringOutput)
}
type ProjectEnvironmentTypeIdentityPtrOutput struct{ *pulumi.OutputState }
func (ProjectEnvironmentTypeIdentityPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectEnvironmentTypeIdentity)(nil)).Elem()
}
func (o ProjectEnvironmentTypeIdentityPtrOutput) ToProjectEnvironmentTypeIdentityPtrOutput() ProjectEnvironmentTypeIdentityPtrOutput {
return o
}
func (o ProjectEnvironmentTypeIdentityPtrOutput) ToProjectEnvironmentTypeIdentityPtrOutputWithContext(ctx context.Context) ProjectEnvironmentTypeIdentityPtrOutput {
return o
}
func (o ProjectEnvironmentTypeIdentityPtrOutput) Elem() ProjectEnvironmentTypeIdentityOutput {
return o.ApplyT(func(v *ProjectEnvironmentTypeIdentity) ProjectEnvironmentTypeIdentity {
if v != nil {
return *v
}
var ret ProjectEnvironmentTypeIdentity
return ret
}).(ProjectEnvironmentTypeIdentityOutput)
}
// The ID of the User Assigned Identity which should be assigned to this Dev Center Project Environment Type.
//
// > **Note:** `identityIds` is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
func (o ProjectEnvironmentTypeIdentityPtrOutput) IdentityIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *ProjectEnvironmentTypeIdentity) []string {
if v == nil {
return nil
}
return v.IdentityIds
}).(pulumi.StringArrayOutput)
}
func (o ProjectEnvironmentTypeIdentityPtrOutput) PrincipalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ProjectEnvironmentTypeIdentity) *string {
if v == nil {
return nil
}
return v.PrincipalId
}).(pulumi.StringPtrOutput)
}
func (o ProjectEnvironmentTypeIdentityPtrOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ProjectEnvironmentTypeIdentity) *string {
if v == nil {
return nil
}
return v.TenantId
}).(pulumi.StringPtrOutput)
}
// The type of identity used for this Dev Center Project Environment Type. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
func (o ProjectEnvironmentTypeIdentityPtrOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ProjectEnvironmentTypeIdentity) *string {
if v == nil {
return nil
}
return &v.Type
}).(pulumi.StringPtrOutput)
}
type ProjectEnvironmentTypeUserRoleAssignment struct {
// A list of roles to assign to the `userId`.
Roles []string `pulumi:"roles"`
// The user object ID that is assigned roles.
UserId string `pulumi:"userId"`
}
// ProjectEnvironmentTypeUserRoleAssignmentInput is an input type that accepts ProjectEnvironmentTypeUserRoleAssignmentArgs and ProjectEnvironmentTypeUserRoleAssignmentOutput values.
// You can construct a concrete instance of `ProjectEnvironmentTypeUserRoleAssignmentInput` via:
//
// ProjectEnvironmentTypeUserRoleAssignmentArgs{...}
type ProjectEnvironmentTypeUserRoleAssignmentInput interface {
pulumi.Input
ToProjectEnvironmentTypeUserRoleAssignmentOutput() ProjectEnvironmentTypeUserRoleAssignmentOutput
ToProjectEnvironmentTypeUserRoleAssignmentOutputWithContext(context.Context) ProjectEnvironmentTypeUserRoleAssignmentOutput
}
type ProjectEnvironmentTypeUserRoleAssignmentArgs struct {
// A list of roles to assign to the `userId`.
Roles pulumi.StringArrayInput `pulumi:"roles"`
// The user object ID that is assigned roles.
UserId pulumi.StringInput `pulumi:"userId"`
}
func (ProjectEnvironmentTypeUserRoleAssignmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ProjectEnvironmentTypeUserRoleAssignment)(nil)).Elem()
}
func (i ProjectEnvironmentTypeUserRoleAssignmentArgs) ToProjectEnvironmentTypeUserRoleAssignmentOutput() ProjectEnvironmentTypeUserRoleAssignmentOutput {
return i.ToProjectEnvironmentTypeUserRoleAssignmentOutputWithContext(context.Background())
}
func (i ProjectEnvironmentTypeUserRoleAssignmentArgs) ToProjectEnvironmentTypeUserRoleAssignmentOutputWithContext(ctx context.Context) ProjectEnvironmentTypeUserRoleAssignmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeUserRoleAssignmentOutput)
}
// ProjectEnvironmentTypeUserRoleAssignmentArrayInput is an input type that accepts ProjectEnvironmentTypeUserRoleAssignmentArray and ProjectEnvironmentTypeUserRoleAssignmentArrayOutput values.
// You can construct a concrete instance of `ProjectEnvironmentTypeUserRoleAssignmentArrayInput` via:
//
// ProjectEnvironmentTypeUserRoleAssignmentArray{ ProjectEnvironmentTypeUserRoleAssignmentArgs{...} }
type ProjectEnvironmentTypeUserRoleAssignmentArrayInput interface {
pulumi.Input
ToProjectEnvironmentTypeUserRoleAssignmentArrayOutput() ProjectEnvironmentTypeUserRoleAssignmentArrayOutput
ToProjectEnvironmentTypeUserRoleAssignmentArrayOutputWithContext(context.Context) ProjectEnvironmentTypeUserRoleAssignmentArrayOutput
}
type ProjectEnvironmentTypeUserRoleAssignmentArray []ProjectEnvironmentTypeUserRoleAssignmentInput
func (ProjectEnvironmentTypeUserRoleAssignmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]ProjectEnvironmentTypeUserRoleAssignment)(nil)).Elem()
}
func (i ProjectEnvironmentTypeUserRoleAssignmentArray) ToProjectEnvironmentTypeUserRoleAssignmentArrayOutput() ProjectEnvironmentTypeUserRoleAssignmentArrayOutput {
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/devCenter.go | sdk/go/azure/devcenter/devCenter.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
// Name: pulumi.String("example"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Location: example.Location,
// Name: pulumi.String("example"),
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Blocks Reference
//
// ### `identity` Block
//
// The `identity` block supports the following arguments:
//
// * `type` - (Required) Specifies the type of Managed Identity that should be assigned to this Dev Center. Possible values are `SystemAssigned`, `SystemAssigned, UserAssigned` and `UserAssigned`.
// * `identityIds` - (Optional) A list of the User Assigned Identity IDs that should be assigned to this Dev Center.
//
// In addition to the arguments defined above, the `identity` block exports the following attributes:
//
// * `principalId` - The Principal ID for the System-Assigned Managed Identity assigned to this Dev Center.
// * `tenantId` - The Tenant ID for the System-Assigned Managed Identity assigned to this Dev Center.
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/devCenter:DevCenter example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devCenters/{devCenterName}
// ```
//
// * Where `{subscriptionId}` is the ID of the Azure Subscription where the Dev Center exists. For example `12345678-1234-9876-4563-123456789012`.
//
// * Where `{resourceGroupName}` is the name of Resource Group where this Dev Center exists. For example `example-resource-group`.
//
// * Where `{devCenterName}` is the name of the Dev Center. For example `devCenterValue`.
type DevCenter struct {
pulumi.CustomResourceState
// The URI of the Dev Center.
DevCenterUri pulumi.StringOutput `pulumi:"devCenterUri"`
// An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
Identity DevCenterIdentityPtrOutput `pulumi:"identity"`
// The Azure Region where the Dev Center should exist. Changing this forces a new Dev Center to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of this Dev Center. Changing this forces a new Dev Center to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Whether the project catalogs associated with projects in this Dev Center are allowed to sync catalog items. Defaults to `false`.
ProjectCatalogItemSyncEnabled pulumi.BoolPtrOutput `pulumi:"projectCatalogItemSyncEnabled"`
// Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Dev Center.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewDevCenter registers a new resource with the given unique name, arguments, and options.
func NewDevCenter(ctx *pulumi.Context,
name string, args *DevCenterArgs, opts ...pulumi.ResourceOption) (*DevCenter, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DevCenter
err := ctx.RegisterResource("azure:devcenter/devCenter:DevCenter", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDevCenter gets an existing DevCenter resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDevCenter(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DevCenterState, opts ...pulumi.ResourceOption) (*DevCenter, error) {
var resource DevCenter
err := ctx.ReadResource("azure:devcenter/devCenter:DevCenter", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DevCenter resources.
type devCenterState struct {
// The URI of the Dev Center.
DevCenterUri *string `pulumi:"devCenterUri"`
// An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
Identity *DevCenterIdentity `pulumi:"identity"`
// The Azure Region where the Dev Center should exist. Changing this forces a new Dev Center to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center. Changing this forces a new Dev Center to be created.
Name *string `pulumi:"name"`
// Whether the project catalogs associated with projects in this Dev Center are allowed to sync catalog items. Defaults to `false`.
ProjectCatalogItemSyncEnabled *bool `pulumi:"projectCatalogItemSyncEnabled"`
// Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Dev Center.
Tags map[string]string `pulumi:"tags"`
}
type DevCenterState struct {
// The URI of the Dev Center.
DevCenterUri pulumi.StringPtrInput
// An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
Identity DevCenterIdentityPtrInput
// The Azure Region where the Dev Center should exist. Changing this forces a new Dev Center to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center. Changing this forces a new Dev Center to be created.
Name pulumi.StringPtrInput
// Whether the project catalogs associated with projects in this Dev Center are allowed to sync catalog items. Defaults to `false`.
ProjectCatalogItemSyncEnabled pulumi.BoolPtrInput
// Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center.
Tags pulumi.StringMapInput
}
func (DevCenterState) ElementType() reflect.Type {
return reflect.TypeOf((*devCenterState)(nil)).Elem()
}
type devCenterArgs struct {
// An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
Identity *DevCenterIdentity `pulumi:"identity"`
// The Azure Region where the Dev Center should exist. Changing this forces a new Dev Center to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center. Changing this forces a new Dev Center to be created.
Name *string `pulumi:"name"`
// Whether the project catalogs associated with projects in this Dev Center are allowed to sync catalog items. Defaults to `false`.
ProjectCatalogItemSyncEnabled *bool `pulumi:"projectCatalogItemSyncEnabled"`
// Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Dev Center.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a DevCenter resource.
type DevCenterArgs struct {
// An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
Identity DevCenterIdentityPtrInput
// The Azure Region where the Dev Center should exist. Changing this forces a new Dev Center to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center. Changing this forces a new Dev Center to be created.
Name pulumi.StringPtrInput
// Whether the project catalogs associated with projects in this Dev Center are allowed to sync catalog items. Defaults to `false`.
ProjectCatalogItemSyncEnabled pulumi.BoolPtrInput
// Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags which should be assigned to the Dev Center.
Tags pulumi.StringMapInput
}
func (DevCenterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*devCenterArgs)(nil)).Elem()
}
type DevCenterInput interface {
pulumi.Input
ToDevCenterOutput() DevCenterOutput
ToDevCenterOutputWithContext(ctx context.Context) DevCenterOutput
}
func (*DevCenter) ElementType() reflect.Type {
return reflect.TypeOf((**DevCenter)(nil)).Elem()
}
func (i *DevCenter) ToDevCenterOutput() DevCenterOutput {
return i.ToDevCenterOutputWithContext(context.Background())
}
func (i *DevCenter) ToDevCenterOutputWithContext(ctx context.Context) DevCenterOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevCenterOutput)
}
// DevCenterArrayInput is an input type that accepts DevCenterArray and DevCenterArrayOutput values.
// You can construct a concrete instance of `DevCenterArrayInput` via:
//
// DevCenterArray{ DevCenterArgs{...} }
type DevCenterArrayInput interface {
pulumi.Input
ToDevCenterArrayOutput() DevCenterArrayOutput
ToDevCenterArrayOutputWithContext(context.Context) DevCenterArrayOutput
}
type DevCenterArray []DevCenterInput
func (DevCenterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DevCenter)(nil)).Elem()
}
func (i DevCenterArray) ToDevCenterArrayOutput() DevCenterArrayOutput {
return i.ToDevCenterArrayOutputWithContext(context.Background())
}
func (i DevCenterArray) ToDevCenterArrayOutputWithContext(ctx context.Context) DevCenterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevCenterArrayOutput)
}
// DevCenterMapInput is an input type that accepts DevCenterMap and DevCenterMapOutput values.
// You can construct a concrete instance of `DevCenterMapInput` via:
//
// DevCenterMap{ "key": DevCenterArgs{...} }
type DevCenterMapInput interface {
pulumi.Input
ToDevCenterMapOutput() DevCenterMapOutput
ToDevCenterMapOutputWithContext(context.Context) DevCenterMapOutput
}
type DevCenterMap map[string]DevCenterInput
func (DevCenterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DevCenter)(nil)).Elem()
}
func (i DevCenterMap) ToDevCenterMapOutput() DevCenterMapOutput {
return i.ToDevCenterMapOutputWithContext(context.Background())
}
func (i DevCenterMap) ToDevCenterMapOutputWithContext(ctx context.Context) DevCenterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevCenterMapOutput)
}
type DevCenterOutput struct{ *pulumi.OutputState }
func (DevCenterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DevCenter)(nil)).Elem()
}
func (o DevCenterOutput) ToDevCenterOutput() DevCenterOutput {
return o
}
func (o DevCenterOutput) ToDevCenterOutputWithContext(ctx context.Context) DevCenterOutput {
return o
}
// The URI of the Dev Center.
func (o DevCenterOutput) DevCenterUri() pulumi.StringOutput {
return o.ApplyT(func(v *DevCenter) pulumi.StringOutput { return v.DevCenterUri }).(pulumi.StringOutput)
}
// An `identity` block as defined below. Specifies the Managed Identity which should be assigned to this Dev Center.
func (o DevCenterOutput) Identity() DevCenterIdentityPtrOutput {
return o.ApplyT(func(v *DevCenter) DevCenterIdentityPtrOutput { return v.Identity }).(DevCenterIdentityPtrOutput)
}
// The Azure Region where the Dev Center should exist. Changing this forces a new Dev Center to be created.
func (o DevCenterOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *DevCenter) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center. Changing this forces a new Dev Center to be created.
func (o DevCenterOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DevCenter) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Whether the project catalogs associated with projects in this Dev Center are allowed to sync catalog items. Defaults to `false`.
func (o DevCenterOutput) ProjectCatalogItemSyncEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *DevCenter) pulumi.BoolPtrOutput { return v.ProjectCatalogItemSyncEnabled }).(pulumi.BoolPtrOutput)
}
// Specifies the name of the Resource Group within which this Dev Center should exist. Changing this forces a new Dev Center to be created.
func (o DevCenterOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *DevCenter) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Dev Center.
func (o DevCenterOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *DevCenter) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type DevCenterArrayOutput struct{ *pulumi.OutputState }
func (DevCenterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DevCenter)(nil)).Elem()
}
func (o DevCenterArrayOutput) ToDevCenterArrayOutput() DevCenterArrayOutput {
return o
}
func (o DevCenterArrayOutput) ToDevCenterArrayOutputWithContext(ctx context.Context) DevCenterArrayOutput {
return o
}
func (o DevCenterArrayOutput) Index(i pulumi.IntInput) DevCenterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DevCenter {
return vs[0].([]*DevCenter)[vs[1].(int)]
}).(DevCenterOutput)
}
type DevCenterMapOutput struct{ *pulumi.OutputState }
func (DevCenterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DevCenter)(nil)).Elem()
}
func (o DevCenterMapOutput) ToDevCenterMapOutput() DevCenterMapOutput {
return o
}
func (o DevCenterMapOutput) ToDevCenterMapOutputWithContext(ctx context.Context) DevCenterMapOutput {
return o
}
func (o DevCenterMapOutput) MapIndex(k pulumi.StringInput) DevCenterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DevCenter {
return vs[0].(map[string]*DevCenter)[vs[1].(string)]
}).(DevCenterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DevCenterInput)(nil)).Elem(), &DevCenter{})
pulumi.RegisterInputType(reflect.TypeOf((*DevCenterArrayInput)(nil)).Elem(), DevCenterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DevCenterMapInput)(nil)).Elem(), DevCenterMap{})
pulumi.RegisterOutputType(DevCenterOutput{})
pulumi.RegisterOutputType(DevCenterArrayOutput{})
pulumi.RegisterOutputType(DevCenterMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/catalog.go | sdk/go/azure/devcenter/catalog.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Catalog.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Location: example.Location,
// Name: pulumi.String("example"),
// ResourceGroupName: example.Name,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewCatalog(ctx, "example", &devcenter.CatalogArgs{
// Name: pulumi.String("example"),
// ResourceGroupName: pulumi.Any(testAzurermResourceGroup.Name),
// DevCenterId: pulumi.Any(test.Id),
// CatalogGithub: &devcenter.CatalogCatalogGithubArgs{
// Branch: pulumi.String("foo"),
// Path: pulumi.String(""),
// Uri: pulumi.String("example URI"),
// KeyVaultKeyUrl: pulumi.String("secret"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Catalog can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/catalog:Catalog example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devCenters/{devCenterName}/catalogs/{catalogName}
// ```
//
// * Where `{subscriptionId}` is the ID of the Azure Subscription where the Dev Center exists. For example `12345678-1234-9876-4563-123456789012`.
//
// * Where `{resourceGroupName}` is the name of Resource Group where this Dev Center exists. For example `example-resource-group`.
//
// * Where `{devCenterName}` is the name of the Dev Center. For example `devCenterValue`.
//
// * Where `{catalogName}` is the name of the Dev Center Catalog. For example `catalogValue`.
type Catalog struct {
pulumi.CustomResourceState
// A `catalogAdogit` block as defined below.
CatalogAdogit CatalogCatalogAdogitPtrOutput `pulumi:"catalogAdogit"`
// A `catalogGithub` block as defined below.
CatalogGithub CatalogCatalogGithubPtrOutput `pulumi:"catalogGithub"`
// Specifies the Dev Center Id within which this Dev Center Catalog should exist. Changing this forces a new Dev Center Catalog to be created.
DevCenterId pulumi.StringOutput `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Catalog. Changing this forces a new Dev Center to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the name of the Resource Group within which this Dev Center Catalog should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewCatalog registers a new resource with the given unique name, arguments, and options.
func NewCatalog(ctx *pulumi.Context,
name string, args *CatalogArgs, opts ...pulumi.ResourceOption) (*Catalog, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevCenterId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Catalog
err := ctx.RegisterResource("azure:devcenter/catalog:Catalog", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCatalog gets an existing Catalog resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCatalog(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CatalogState, opts ...pulumi.ResourceOption) (*Catalog, error) {
var resource Catalog
err := ctx.ReadResource("azure:devcenter/catalog:Catalog", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Catalog resources.
type catalogState struct {
// A `catalogAdogit` block as defined below.
CatalogAdogit *CatalogCatalogAdogit `pulumi:"catalogAdogit"`
// A `catalogGithub` block as defined below.
CatalogGithub *CatalogCatalogGithub `pulumi:"catalogGithub"`
// Specifies the Dev Center Id within which this Dev Center Catalog should exist. Changing this forces a new Dev Center Catalog to be created.
DevCenterId *string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Catalog. Changing this forces a new Dev Center to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group within which this Dev Center Catalog should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type CatalogState struct {
// A `catalogAdogit` block as defined below.
CatalogAdogit CatalogCatalogAdogitPtrInput
// A `catalogGithub` block as defined below.
CatalogGithub CatalogCatalogGithubPtrInput
// Specifies the Dev Center Id within which this Dev Center Catalog should exist. Changing this forces a new Dev Center Catalog to be created.
DevCenterId pulumi.StringPtrInput
// Specifies the name of this Dev Center Catalog. Changing this forces a new Dev Center to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group within which this Dev Center Catalog should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName pulumi.StringPtrInput
}
func (CatalogState) ElementType() reflect.Type {
return reflect.TypeOf((*catalogState)(nil)).Elem()
}
type catalogArgs struct {
// A `catalogAdogit` block as defined below.
CatalogAdogit *CatalogCatalogAdogit `pulumi:"catalogAdogit"`
// A `catalogGithub` block as defined below.
CatalogGithub *CatalogCatalogGithub `pulumi:"catalogGithub"`
// Specifies the Dev Center Id within which this Dev Center Catalog should exist. Changing this forces a new Dev Center Catalog to be created.
DevCenterId string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Catalog. Changing this forces a new Dev Center to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group within which this Dev Center Catalog should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a Catalog resource.
type CatalogArgs struct {
// A `catalogAdogit` block as defined below.
CatalogAdogit CatalogCatalogAdogitPtrInput
// A `catalogGithub` block as defined below.
CatalogGithub CatalogCatalogGithubPtrInput
// Specifies the Dev Center Id within which this Dev Center Catalog should exist. Changing this forces a new Dev Center Catalog to be created.
DevCenterId pulumi.StringInput
// Specifies the name of this Dev Center Catalog. Changing this forces a new Dev Center to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group within which this Dev Center Catalog should exist. Changing this forces a new Dev Center to be created.
ResourceGroupName pulumi.StringInput
}
func (CatalogArgs) ElementType() reflect.Type {
return reflect.TypeOf((*catalogArgs)(nil)).Elem()
}
type CatalogInput interface {
pulumi.Input
ToCatalogOutput() CatalogOutput
ToCatalogOutputWithContext(ctx context.Context) CatalogOutput
}
func (*Catalog) ElementType() reflect.Type {
return reflect.TypeOf((**Catalog)(nil)).Elem()
}
func (i *Catalog) ToCatalogOutput() CatalogOutput {
return i.ToCatalogOutputWithContext(context.Background())
}
func (i *Catalog) ToCatalogOutputWithContext(ctx context.Context) CatalogOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogOutput)
}
// CatalogArrayInput is an input type that accepts CatalogArray and CatalogArrayOutput values.
// You can construct a concrete instance of `CatalogArrayInput` via:
//
// CatalogArray{ CatalogArgs{...} }
type CatalogArrayInput interface {
pulumi.Input
ToCatalogArrayOutput() CatalogArrayOutput
ToCatalogArrayOutputWithContext(context.Context) CatalogArrayOutput
}
type CatalogArray []CatalogInput
func (CatalogArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Catalog)(nil)).Elem()
}
func (i CatalogArray) ToCatalogArrayOutput() CatalogArrayOutput {
return i.ToCatalogArrayOutputWithContext(context.Background())
}
func (i CatalogArray) ToCatalogArrayOutputWithContext(ctx context.Context) CatalogArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogArrayOutput)
}
// CatalogMapInput is an input type that accepts CatalogMap and CatalogMapOutput values.
// You can construct a concrete instance of `CatalogMapInput` via:
//
// CatalogMap{ "key": CatalogArgs{...} }
type CatalogMapInput interface {
pulumi.Input
ToCatalogMapOutput() CatalogMapOutput
ToCatalogMapOutputWithContext(context.Context) CatalogMapOutput
}
type CatalogMap map[string]CatalogInput
func (CatalogMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Catalog)(nil)).Elem()
}
func (i CatalogMap) ToCatalogMapOutput() CatalogMapOutput {
return i.ToCatalogMapOutputWithContext(context.Background())
}
func (i CatalogMap) ToCatalogMapOutputWithContext(ctx context.Context) CatalogMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogMapOutput)
}
type CatalogOutput struct{ *pulumi.OutputState }
func (CatalogOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Catalog)(nil)).Elem()
}
func (o CatalogOutput) ToCatalogOutput() CatalogOutput {
return o
}
func (o CatalogOutput) ToCatalogOutputWithContext(ctx context.Context) CatalogOutput {
return o
}
// A `catalogAdogit` block as defined below.
func (o CatalogOutput) CatalogAdogit() CatalogCatalogAdogitPtrOutput {
return o.ApplyT(func(v *Catalog) CatalogCatalogAdogitPtrOutput { return v.CatalogAdogit }).(CatalogCatalogAdogitPtrOutput)
}
// A `catalogGithub` block as defined below.
func (o CatalogOutput) CatalogGithub() CatalogCatalogGithubPtrOutput {
return o.ApplyT(func(v *Catalog) CatalogCatalogGithubPtrOutput { return v.CatalogGithub }).(CatalogCatalogGithubPtrOutput)
}
// Specifies the Dev Center Id within which this Dev Center Catalog should exist. Changing this forces a new Dev Center Catalog to be created.
func (o CatalogOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v *Catalog) pulumi.StringOutput { return v.DevCenterId }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Catalog. Changing this forces a new Dev Center to be created.
func (o CatalogOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Catalog) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the name of the Resource Group within which this Dev Center Catalog should exist. Changing this forces a new Dev Center to be created.
func (o CatalogOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Catalog) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
type CatalogArrayOutput struct{ *pulumi.OutputState }
func (CatalogArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Catalog)(nil)).Elem()
}
func (o CatalogArrayOutput) ToCatalogArrayOutput() CatalogArrayOutput {
return o
}
func (o CatalogArrayOutput) ToCatalogArrayOutputWithContext(ctx context.Context) CatalogArrayOutput {
return o
}
func (o CatalogArrayOutput) Index(i pulumi.IntInput) CatalogOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Catalog {
return vs[0].([]*Catalog)[vs[1].(int)]
}).(CatalogOutput)
}
type CatalogMapOutput struct{ *pulumi.OutputState }
func (CatalogMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Catalog)(nil)).Elem()
}
func (o CatalogMapOutput) ToCatalogMapOutput() CatalogMapOutput {
return o
}
func (o CatalogMapOutput) ToCatalogMapOutputWithContext(ctx context.Context) CatalogMapOutput {
return o
}
func (o CatalogMapOutput) MapIndex(k pulumi.StringInput) CatalogOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Catalog {
return vs[0].(map[string]*Catalog)[vs[1].(string)]
}).(CatalogOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CatalogInput)(nil)).Elem(), &Catalog{})
pulumi.RegisterInputType(reflect.TypeOf((*CatalogArrayInput)(nil)).Elem(), CatalogArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CatalogMapInput)(nil)).Elem(), CatalogMap{})
pulumi.RegisterOutputType(CatalogOutput{})
pulumi.RegisterOutputType(CatalogArrayOutput{})
pulumi.RegisterOutputType(CatalogMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getEnvironmentType.go | sdk/go/azure/devcenter/getEnvironmentType.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Environment Type.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupEnvironmentType(ctx, &devcenter.LookupEnvironmentTypeArgs{
// Name: exampleAzurermDevCenterEnvironmentType.Name,
// DevCenterId: exampleAzurermDevCenterEnvironmentType.DevCenterId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupEnvironmentType(ctx *pulumi.Context, args *LookupEnvironmentTypeArgs, opts ...pulumi.InvokeOption) (*LookupEnvironmentTypeResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupEnvironmentTypeResult
err := ctx.Invoke("azure:devcenter/getEnvironmentType:getEnvironmentType", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getEnvironmentType.
type LookupEnvironmentTypeArgs struct {
// The ID of the associated Dev Center.
DevCenterId string `pulumi:"devCenterId"`
// The name of this Dev Center Environment Type.
Name string `pulumi:"name"`
}
// A collection of values returned by getEnvironmentType.
type LookupEnvironmentTypeResult struct {
DevCenterId string `pulumi:"devCenterId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// A mapping of tags assigned to the Dev Center Environment Type.
Tags map[string]string `pulumi:"tags"`
}
func LookupEnvironmentTypeOutput(ctx *pulumi.Context, args LookupEnvironmentTypeOutputArgs, opts ...pulumi.InvokeOption) LookupEnvironmentTypeResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupEnvironmentTypeResultOutput, error) {
args := v.(LookupEnvironmentTypeArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getEnvironmentType:getEnvironmentType", args, LookupEnvironmentTypeResultOutput{}, options).(LookupEnvironmentTypeResultOutput), nil
}).(LookupEnvironmentTypeResultOutput)
}
// A collection of arguments for invoking getEnvironmentType.
type LookupEnvironmentTypeOutputArgs struct {
// The ID of the associated Dev Center.
DevCenterId pulumi.StringInput `pulumi:"devCenterId"`
// The name of this Dev Center Environment Type.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupEnvironmentTypeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupEnvironmentTypeArgs)(nil)).Elem()
}
// A collection of values returned by getEnvironmentType.
type LookupEnvironmentTypeResultOutput struct{ *pulumi.OutputState }
func (LookupEnvironmentTypeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupEnvironmentTypeResult)(nil)).Elem()
}
func (o LookupEnvironmentTypeResultOutput) ToLookupEnvironmentTypeResultOutput() LookupEnvironmentTypeResultOutput {
return o
}
func (o LookupEnvironmentTypeResultOutput) ToLookupEnvironmentTypeResultOutputWithContext(ctx context.Context) LookupEnvironmentTypeResultOutput {
return o
}
func (o LookupEnvironmentTypeResultOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupEnvironmentTypeResult) string { return v.DevCenterId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupEnvironmentTypeResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupEnvironmentTypeResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupEnvironmentTypeResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupEnvironmentTypeResult) string { return v.Name }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Dev Center Environment Type.
func (o LookupEnvironmentTypeResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupEnvironmentTypeResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupEnvironmentTypeResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/environmentType.go | sdk/go/azure/devcenter/environmentType.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Environment Type.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleDevCenter, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Name: pulumi.String("example-dc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewEnvironmentType(ctx, "example", &devcenter.EnvironmentTypeArgs{
// Name: pulumi.String("example-dcet"),
// DevCenterId: exampleDevCenter.ID(),
// Tags: pulumi.StringMap{
// "Env": pulumi.String("Test"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Environment Type can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/environmentType:EnvironmentType example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/devCenters/dc1/environmentTypes/et1
// ```
type EnvironmentType struct {
pulumi.CustomResourceState
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringOutput `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Environment Type. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A mapping of tags which should be assigned to the Dev Center Environment Type.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewEnvironmentType registers a new resource with the given unique name, arguments, and options.
func NewEnvironmentType(ctx *pulumi.Context,
name string, args *EnvironmentTypeArgs, opts ...pulumi.ResourceOption) (*EnvironmentType, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevCenterId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource EnvironmentType
err := ctx.RegisterResource("azure:devcenter/environmentType:EnvironmentType", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEnvironmentType gets an existing EnvironmentType resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEnvironmentType(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EnvironmentTypeState, opts ...pulumi.ResourceOption) (*EnvironmentType, error) {
var resource EnvironmentType
err := ctx.ReadResource("azure:devcenter/environmentType:EnvironmentType", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EnvironmentType resources.
type environmentTypeState struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId *string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Environment Type. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A mapping of tags which should be assigned to the Dev Center Environment Type.
Tags map[string]string `pulumi:"tags"`
}
type EnvironmentTypeState struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringPtrInput
// Specifies the name of this Dev Center Environment Type. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Environment Type.
Tags pulumi.StringMapInput
}
func (EnvironmentTypeState) ElementType() reflect.Type {
return reflect.TypeOf((*environmentTypeState)(nil)).Elem()
}
type environmentTypeArgs struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Environment Type. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A mapping of tags which should be assigned to the Dev Center Environment Type.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a EnvironmentType resource.
type EnvironmentTypeArgs struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringInput
// Specifies the name of this Dev Center Environment Type. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Environment Type.
Tags pulumi.StringMapInput
}
func (EnvironmentTypeArgs) ElementType() reflect.Type {
return reflect.TypeOf((*environmentTypeArgs)(nil)).Elem()
}
type EnvironmentTypeInput interface {
pulumi.Input
ToEnvironmentTypeOutput() EnvironmentTypeOutput
ToEnvironmentTypeOutputWithContext(ctx context.Context) EnvironmentTypeOutput
}
func (*EnvironmentType) ElementType() reflect.Type {
return reflect.TypeOf((**EnvironmentType)(nil)).Elem()
}
func (i *EnvironmentType) ToEnvironmentTypeOutput() EnvironmentTypeOutput {
return i.ToEnvironmentTypeOutputWithContext(context.Background())
}
func (i *EnvironmentType) ToEnvironmentTypeOutputWithContext(ctx context.Context) EnvironmentTypeOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnvironmentTypeOutput)
}
// EnvironmentTypeArrayInput is an input type that accepts EnvironmentTypeArray and EnvironmentTypeArrayOutput values.
// You can construct a concrete instance of `EnvironmentTypeArrayInput` via:
//
// EnvironmentTypeArray{ EnvironmentTypeArgs{...} }
type EnvironmentTypeArrayInput interface {
pulumi.Input
ToEnvironmentTypeArrayOutput() EnvironmentTypeArrayOutput
ToEnvironmentTypeArrayOutputWithContext(context.Context) EnvironmentTypeArrayOutput
}
type EnvironmentTypeArray []EnvironmentTypeInput
func (EnvironmentTypeArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EnvironmentType)(nil)).Elem()
}
func (i EnvironmentTypeArray) ToEnvironmentTypeArrayOutput() EnvironmentTypeArrayOutput {
return i.ToEnvironmentTypeArrayOutputWithContext(context.Background())
}
func (i EnvironmentTypeArray) ToEnvironmentTypeArrayOutputWithContext(ctx context.Context) EnvironmentTypeArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnvironmentTypeArrayOutput)
}
// EnvironmentTypeMapInput is an input type that accepts EnvironmentTypeMap and EnvironmentTypeMapOutput values.
// You can construct a concrete instance of `EnvironmentTypeMapInput` via:
//
// EnvironmentTypeMap{ "key": EnvironmentTypeArgs{...} }
type EnvironmentTypeMapInput interface {
pulumi.Input
ToEnvironmentTypeMapOutput() EnvironmentTypeMapOutput
ToEnvironmentTypeMapOutputWithContext(context.Context) EnvironmentTypeMapOutput
}
type EnvironmentTypeMap map[string]EnvironmentTypeInput
func (EnvironmentTypeMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EnvironmentType)(nil)).Elem()
}
func (i EnvironmentTypeMap) ToEnvironmentTypeMapOutput() EnvironmentTypeMapOutput {
return i.ToEnvironmentTypeMapOutputWithContext(context.Background())
}
func (i EnvironmentTypeMap) ToEnvironmentTypeMapOutputWithContext(ctx context.Context) EnvironmentTypeMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnvironmentTypeMapOutput)
}
type EnvironmentTypeOutput struct{ *pulumi.OutputState }
func (EnvironmentTypeOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EnvironmentType)(nil)).Elem()
}
func (o EnvironmentTypeOutput) ToEnvironmentTypeOutput() EnvironmentTypeOutput {
return o
}
func (o EnvironmentTypeOutput) ToEnvironmentTypeOutputWithContext(ctx context.Context) EnvironmentTypeOutput {
return o
}
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
func (o EnvironmentTypeOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v *EnvironmentType) pulumi.StringOutput { return v.DevCenterId }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Environment Type. Changing this forces a new resource to be created.
func (o EnvironmentTypeOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *EnvironmentType) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Dev Center Environment Type.
func (o EnvironmentTypeOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *EnvironmentType) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type EnvironmentTypeArrayOutput struct{ *pulumi.OutputState }
func (EnvironmentTypeArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EnvironmentType)(nil)).Elem()
}
func (o EnvironmentTypeArrayOutput) ToEnvironmentTypeArrayOutput() EnvironmentTypeArrayOutput {
return o
}
func (o EnvironmentTypeArrayOutput) ToEnvironmentTypeArrayOutputWithContext(ctx context.Context) EnvironmentTypeArrayOutput {
return o
}
func (o EnvironmentTypeArrayOutput) Index(i pulumi.IntInput) EnvironmentTypeOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EnvironmentType {
return vs[0].([]*EnvironmentType)[vs[1].(int)]
}).(EnvironmentTypeOutput)
}
type EnvironmentTypeMapOutput struct{ *pulumi.OutputState }
func (EnvironmentTypeMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EnvironmentType)(nil)).Elem()
}
func (o EnvironmentTypeMapOutput) ToEnvironmentTypeMapOutput() EnvironmentTypeMapOutput {
return o
}
func (o EnvironmentTypeMapOutput) ToEnvironmentTypeMapOutputWithContext(ctx context.Context) EnvironmentTypeMapOutput {
return o
}
func (o EnvironmentTypeMapOutput) MapIndex(k pulumi.StringInput) EnvironmentTypeOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EnvironmentType {
return vs[0].(map[string]*EnvironmentType)[vs[1].(string)]
}).(EnvironmentTypeOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EnvironmentTypeInput)(nil)).Elem(), &EnvironmentType{})
pulumi.RegisterInputType(reflect.TypeOf((*EnvironmentTypeArrayInput)(nil)).Elem(), EnvironmentTypeArray{})
pulumi.RegisterInputType(reflect.TypeOf((*EnvironmentTypeMapInput)(nil)).Elem(), EnvironmentTypeMap{})
pulumi.RegisterOutputType(EnvironmentTypeOutput{})
pulumi.RegisterOutputType(EnvironmentTypeArrayOutput{})
pulumi.RegisterOutputType(EnvironmentTypeMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getProjectPool.go | sdk/go/azure/devcenter/getProjectPool.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Project Pool.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupProjectPool(ctx, &devcenter.LookupProjectPoolArgs{
// Name: exampleAzurermDevCenterProjectPool.Name,
// DevCenterProjectId: exampleAzurermDevCenterProjectPool.DevCenterProjectId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupProjectPool(ctx *pulumi.Context, args *LookupProjectPoolArgs, opts ...pulumi.InvokeOption) (*LookupProjectPoolResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupProjectPoolResult
err := ctx.Invoke("azure:devcenter/getProjectPool:getProjectPool", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getProjectPool.
type LookupProjectPoolArgs struct {
// The ID of the associated Dev Center Project.
DevCenterProjectId string `pulumi:"devCenterProjectId"`
// The name of this Dev Center Project Pool.
Name string `pulumi:"name"`
}
// A collection of values returned by getProjectPool.
type LookupProjectPoolResult struct {
// The name of the Dev Center Dev Box Definition.
DevBoxDefinitionName string `pulumi:"devBoxDefinitionName"`
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
DevCenterAttachedNetworkName string `pulumi:"devCenterAttachedNetworkName"`
DevCenterProjectId string `pulumi:"devCenterProjectId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
LocalAdministratorEnabled bool `pulumi:"localAdministratorEnabled"`
// The Azure Region where the Dev Center Project Pool exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled.
SingleSignOnEnabled bool `pulumi:"singleSignOnEnabled"`
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected.
StopOnDisconnectGracePeriodMinutes int `pulumi:"stopOnDisconnectGracePeriodMinutes"`
// A mapping of tags assigned to the Dev Center Project Pool.
Tags map[string]string `pulumi:"tags"`
}
func LookupProjectPoolOutput(ctx *pulumi.Context, args LookupProjectPoolOutputArgs, opts ...pulumi.InvokeOption) LookupProjectPoolResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupProjectPoolResultOutput, error) {
args := v.(LookupProjectPoolArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getProjectPool:getProjectPool", args, LookupProjectPoolResultOutput{}, options).(LookupProjectPoolResultOutput), nil
}).(LookupProjectPoolResultOutput)
}
// A collection of arguments for invoking getProjectPool.
type LookupProjectPoolOutputArgs struct {
// The ID of the associated Dev Center Project.
DevCenterProjectId pulumi.StringInput `pulumi:"devCenterProjectId"`
// The name of this Dev Center Project Pool.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupProjectPoolOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupProjectPoolArgs)(nil)).Elem()
}
// A collection of values returned by getProjectPool.
type LookupProjectPoolResultOutput struct{ *pulumi.OutputState }
func (LookupProjectPoolResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupProjectPoolResult)(nil)).Elem()
}
func (o LookupProjectPoolResultOutput) ToLookupProjectPoolResultOutput() LookupProjectPoolResultOutput {
return o
}
func (o LookupProjectPoolResultOutput) ToLookupProjectPoolResultOutputWithContext(ctx context.Context) LookupProjectPoolResultOutput {
return o
}
// The name of the Dev Center Dev Box Definition.
func (o LookupProjectPoolResultOutput) DevBoxDefinitionName() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectPoolResult) string { return v.DevBoxDefinitionName }).(pulumi.StringOutput)
}
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
func (o LookupProjectPoolResultOutput) DevCenterAttachedNetworkName() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectPoolResult) string { return v.DevCenterAttachedNetworkName }).(pulumi.StringOutput)
}
func (o LookupProjectPoolResultOutput) DevCenterProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectPoolResult) string { return v.DevCenterProjectId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupProjectPoolResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectPoolResult) string { return v.Id }).(pulumi.StringOutput)
}
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
func (o LookupProjectPoolResultOutput) LocalAdministratorEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupProjectPoolResult) bool { return v.LocalAdministratorEnabled }).(pulumi.BoolOutput)
}
// The Azure Region where the Dev Center Project Pool exists.
func (o LookupProjectPoolResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectPoolResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupProjectPoolResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectPoolResult) string { return v.Name }).(pulumi.StringOutput)
}
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled.
func (o LookupProjectPoolResultOutput) SingleSignOnEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupProjectPoolResult) bool { return v.SingleSignOnEnabled }).(pulumi.BoolOutput)
}
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected.
func (o LookupProjectPoolResultOutput) StopOnDisconnectGracePeriodMinutes() pulumi.IntOutput {
return o.ApplyT(func(v LookupProjectPoolResult) int { return v.StopOnDisconnectGracePeriodMinutes }).(pulumi.IntOutput)
}
// A mapping of tags assigned to the Dev Center Project Pool.
func (o LookupProjectPoolResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupProjectPoolResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupProjectPoolResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/projectPool.go | sdk/go/azure/devcenter/projectPool.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Project Pool.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleDevCenter, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Name: pulumi.String("example-dc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-vnet"),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// exampleNetworkConnection, err := devcenter.NewNetworkConnection(ctx, "example", &devcenter.NetworkConnectionArgs{
// Name: pulumi.String("example-dcnc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// SubnetId: exampleSubnet.ID(),
// DomainJoinType: pulumi.String("AzureADJoin"),
// })
// if err != nil {
// return err
// }
// exampleAttachedNetwork, err := devcenter.NewAttachedNetwork(ctx, "example", &devcenter.AttachedNetworkArgs{
// Name: pulumi.String("example-dcet"),
// DevCenterId: exampleDevCenter.ID(),
// NetworkConnectionId: exampleNetworkConnection.ID(),
// })
// if err != nil {
// return err
// }
// exampleProject, err := devcenter.NewProject(ctx, "example", &devcenter.ProjectArgs{
// Name: pulumi.String("example-dcp"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// DevCenterId: exampleDevCenter.ID(),
// })
// if err != nil {
// return err
// }
// exampleDevBoxDefinition, err := devcenter.NewDevBoxDefinition(ctx, "example", &devcenter.DevBoxDefinitionArgs{
// Name: pulumi.String("example-dcet"),
// Location: example.Location,
// DevCenterId: exampleDevCenter.ID(),
// ImageReferenceId: exampleDevCenter.ID().ApplyT(func(id string) (string, error) {
// return fmt.Sprintf("%v/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2", id), nil
// }).(pulumi.StringOutput),
// SkuName: pulumi.String("general_i_8c32gb256ssd_v2"),
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewProjectPool(ctx, "example", &devcenter.ProjectPoolArgs{
// Name: pulumi.String("example-dcpl"),
// Location: example.Location,
// DevCenterProjectId: exampleProject.ID(),
// DevBoxDefinitionName: exampleDevBoxDefinition.Name,
// LocalAdministratorEnabled: pulumi.Bool(true),
// DevCenterAttachedNetworkName: exampleAttachedNetwork.Name,
// StopOnDisconnectGracePeriodMinutes: pulumi.Int(60),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Project Pool can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/projectPool:ProjectPool example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/projects/project1/pools/pool1
// ```
type ProjectPool struct {
pulumi.CustomResourceState
// The name of the Dev Center Dev Box Definition.
DevBoxDefinitionName pulumi.StringOutput `pulumi:"devBoxDefinitionName"`
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
DevCenterAttachedNetworkName pulumi.StringOutput `pulumi:"devCenterAttachedNetworkName"`
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId pulumi.StringOutput `pulumi:"devCenterProjectId"`
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
LocalAdministratorEnabled pulumi.BoolOutput `pulumi:"localAdministratorEnabled"`
// The Azure Region where the Dev Center Project Pool should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// A list of the regions of the managed Virtual Network. When specified, the Dev Center Project Pool will use a Microsoft managed network.
//
// > **Note:** Currently only one region can be specified for `managedVirtualNetworkRegions`.
ManagedVirtualNetworkRegions pulumi.StringPtrOutput `pulumi:"managedVirtualNetworkRegions"`
// Specifies the name of this Dev Center Project Pool. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled. Defaults to `false`.
SingleSignOnEnabled pulumi.BoolPtrOutput `pulumi:"singleSignOnEnabled"`
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected. Possible values are between `60` and `480`.
StopOnDisconnectGracePeriodMinutes pulumi.IntPtrOutput `pulumi:"stopOnDisconnectGracePeriodMinutes"`
// A mapping of tags which should be assigned to the Dev Center Project Pool.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewProjectPool registers a new resource with the given unique name, arguments, and options.
func NewProjectPool(ctx *pulumi.Context,
name string, args *ProjectPoolArgs, opts ...pulumi.ResourceOption) (*ProjectPool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevBoxDefinitionName == nil {
return nil, errors.New("invalid value for required argument 'DevBoxDefinitionName'")
}
if args.DevCenterAttachedNetworkName == nil {
return nil, errors.New("invalid value for required argument 'DevCenterAttachedNetworkName'")
}
if args.DevCenterProjectId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterProjectId'")
}
if args.LocalAdministratorEnabled == nil {
return nil, errors.New("invalid value for required argument 'LocalAdministratorEnabled'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ProjectPool
err := ctx.RegisterResource("azure:devcenter/projectPool:ProjectPool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProjectPool gets an existing ProjectPool resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetProjectPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProjectPoolState, opts ...pulumi.ResourceOption) (*ProjectPool, error) {
var resource ProjectPool
err := ctx.ReadResource("azure:devcenter/projectPool:ProjectPool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ProjectPool resources.
type projectPoolState struct {
// The name of the Dev Center Dev Box Definition.
DevBoxDefinitionName *string `pulumi:"devBoxDefinitionName"`
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
DevCenterAttachedNetworkName *string `pulumi:"devCenterAttachedNetworkName"`
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId *string `pulumi:"devCenterProjectId"`
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
LocalAdministratorEnabled *bool `pulumi:"localAdministratorEnabled"`
// The Azure Region where the Dev Center Project Pool should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A list of the regions of the managed Virtual Network. When specified, the Dev Center Project Pool will use a Microsoft managed network.
//
// > **Note:** Currently only one region can be specified for `managedVirtualNetworkRegions`.
ManagedVirtualNetworkRegions *string `pulumi:"managedVirtualNetworkRegions"`
// Specifies the name of this Dev Center Project Pool. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled. Defaults to `false`.
SingleSignOnEnabled *bool `pulumi:"singleSignOnEnabled"`
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected. Possible values are between `60` and `480`.
StopOnDisconnectGracePeriodMinutes *int `pulumi:"stopOnDisconnectGracePeriodMinutes"`
// A mapping of tags which should be assigned to the Dev Center Project Pool.
Tags map[string]string `pulumi:"tags"`
}
type ProjectPoolState struct {
// The name of the Dev Center Dev Box Definition.
DevBoxDefinitionName pulumi.StringPtrInput
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
DevCenterAttachedNetworkName pulumi.StringPtrInput
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId pulumi.StringPtrInput
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
LocalAdministratorEnabled pulumi.BoolPtrInput
// The Azure Region where the Dev Center Project Pool should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A list of the regions of the managed Virtual Network. When specified, the Dev Center Project Pool will use a Microsoft managed network.
//
// > **Note:** Currently only one region can be specified for `managedVirtualNetworkRegions`.
ManagedVirtualNetworkRegions pulumi.StringPtrInput
// Specifies the name of this Dev Center Project Pool. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled. Defaults to `false`.
SingleSignOnEnabled pulumi.BoolPtrInput
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected. Possible values are between `60` and `480`.
StopOnDisconnectGracePeriodMinutes pulumi.IntPtrInput
// A mapping of tags which should be assigned to the Dev Center Project Pool.
Tags pulumi.StringMapInput
}
func (ProjectPoolState) ElementType() reflect.Type {
return reflect.TypeOf((*projectPoolState)(nil)).Elem()
}
type projectPoolArgs struct {
// The name of the Dev Center Dev Box Definition.
DevBoxDefinitionName string `pulumi:"devBoxDefinitionName"`
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
DevCenterAttachedNetworkName string `pulumi:"devCenterAttachedNetworkName"`
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId string `pulumi:"devCenterProjectId"`
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
LocalAdministratorEnabled bool `pulumi:"localAdministratorEnabled"`
// The Azure Region where the Dev Center Project Pool should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A list of the regions of the managed Virtual Network. When specified, the Dev Center Project Pool will use a Microsoft managed network.
//
// > **Note:** Currently only one region can be specified for `managedVirtualNetworkRegions`.
ManagedVirtualNetworkRegions *string `pulumi:"managedVirtualNetworkRegions"`
// Specifies the name of this Dev Center Project Pool. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled. Defaults to `false`.
SingleSignOnEnabled *bool `pulumi:"singleSignOnEnabled"`
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected. Possible values are between `60` and `480`.
StopOnDisconnectGracePeriodMinutes *int `pulumi:"stopOnDisconnectGracePeriodMinutes"`
// A mapping of tags which should be assigned to the Dev Center Project Pool.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a ProjectPool resource.
type ProjectPoolArgs struct {
// The name of the Dev Center Dev Box Definition.
DevBoxDefinitionName pulumi.StringInput
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
DevCenterAttachedNetworkName pulumi.StringInput
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId pulumi.StringInput
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
LocalAdministratorEnabled pulumi.BoolInput
// The Azure Region where the Dev Center Project Pool should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A list of the regions of the managed Virtual Network. When specified, the Dev Center Project Pool will use a Microsoft managed network.
//
// > **Note:** Currently only one region can be specified for `managedVirtualNetworkRegions`.
ManagedVirtualNetworkRegions pulumi.StringPtrInput
// Specifies the name of this Dev Center Project Pool. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled. Defaults to `false`.
SingleSignOnEnabled pulumi.BoolPtrInput
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected. Possible values are between `60` and `480`.
StopOnDisconnectGracePeriodMinutes pulumi.IntPtrInput
// A mapping of tags which should be assigned to the Dev Center Project Pool.
Tags pulumi.StringMapInput
}
func (ProjectPoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*projectPoolArgs)(nil)).Elem()
}
type ProjectPoolInput interface {
pulumi.Input
ToProjectPoolOutput() ProjectPoolOutput
ToProjectPoolOutputWithContext(ctx context.Context) ProjectPoolOutput
}
func (*ProjectPool) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectPool)(nil)).Elem()
}
func (i *ProjectPool) ToProjectPoolOutput() ProjectPoolOutput {
return i.ToProjectPoolOutputWithContext(context.Background())
}
func (i *ProjectPool) ToProjectPoolOutputWithContext(ctx context.Context) ProjectPoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectPoolOutput)
}
// ProjectPoolArrayInput is an input type that accepts ProjectPoolArray and ProjectPoolArrayOutput values.
// You can construct a concrete instance of `ProjectPoolArrayInput` via:
//
// ProjectPoolArray{ ProjectPoolArgs{...} }
type ProjectPoolArrayInput interface {
pulumi.Input
ToProjectPoolArrayOutput() ProjectPoolArrayOutput
ToProjectPoolArrayOutputWithContext(context.Context) ProjectPoolArrayOutput
}
type ProjectPoolArray []ProjectPoolInput
func (ProjectPoolArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ProjectPool)(nil)).Elem()
}
func (i ProjectPoolArray) ToProjectPoolArrayOutput() ProjectPoolArrayOutput {
return i.ToProjectPoolArrayOutputWithContext(context.Background())
}
func (i ProjectPoolArray) ToProjectPoolArrayOutputWithContext(ctx context.Context) ProjectPoolArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectPoolArrayOutput)
}
// ProjectPoolMapInput is an input type that accepts ProjectPoolMap and ProjectPoolMapOutput values.
// You can construct a concrete instance of `ProjectPoolMapInput` via:
//
// ProjectPoolMap{ "key": ProjectPoolArgs{...} }
type ProjectPoolMapInput interface {
pulumi.Input
ToProjectPoolMapOutput() ProjectPoolMapOutput
ToProjectPoolMapOutputWithContext(context.Context) ProjectPoolMapOutput
}
type ProjectPoolMap map[string]ProjectPoolInput
func (ProjectPoolMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ProjectPool)(nil)).Elem()
}
func (i ProjectPoolMap) ToProjectPoolMapOutput() ProjectPoolMapOutput {
return i.ToProjectPoolMapOutputWithContext(context.Background())
}
func (i ProjectPoolMap) ToProjectPoolMapOutputWithContext(ctx context.Context) ProjectPoolMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectPoolMapOutput)
}
type ProjectPoolOutput struct{ *pulumi.OutputState }
func (ProjectPoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectPool)(nil)).Elem()
}
func (o ProjectPoolOutput) ToProjectPoolOutput() ProjectPoolOutput {
return o
}
func (o ProjectPoolOutput) ToProjectPoolOutputWithContext(ctx context.Context) ProjectPoolOutput {
return o
}
// The name of the Dev Center Dev Box Definition.
func (o ProjectPoolOutput) DevBoxDefinitionName() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringOutput { return v.DevBoxDefinitionName }).(pulumi.StringOutput)
}
// The name of the Dev Center Attached Network in parent Project of the Dev Center Project Pool.
func (o ProjectPoolOutput) DevCenterAttachedNetworkName() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringOutput { return v.DevCenterAttachedNetworkName }).(pulumi.StringOutput)
}
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
func (o ProjectPoolOutput) DevCenterProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringOutput { return v.DevCenterProjectId }).(pulumi.StringOutput)
}
// Specifies whether owners of Dev Boxes in the Dev Center Project Pool are added as local administrators on the Dev Box.
func (o ProjectPoolOutput) LocalAdministratorEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.BoolOutput { return v.LocalAdministratorEnabled }).(pulumi.BoolOutput)
}
// The Azure Region where the Dev Center Project Pool should exist. Changing this forces a new resource to be created.
func (o ProjectPoolOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// A list of the regions of the managed Virtual Network. When specified, the Dev Center Project Pool will use a Microsoft managed network.
//
// > **Note:** Currently only one region can be specified for `managedVirtualNetworkRegions`.
func (o ProjectPoolOutput) ManagedVirtualNetworkRegions() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringPtrOutput { return v.ManagedVirtualNetworkRegions }).(pulumi.StringPtrOutput)
}
// Specifies the name of this Dev Center Project Pool. Changing this forces a new resource to be created.
func (o ProjectPoolOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies whether Dev Boxes in the Pool will have SSO enabled or disabled. Defaults to `false`.
func (o ProjectPoolOutput) SingleSignOnEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.BoolPtrOutput { return v.SingleSignOnEnabled }).(pulumi.BoolPtrOutput)
}
// The specified time in minutes to wait before stopping a Dev Center Dev Box once disconnect is detected. Possible values are between `60` and `480`.
func (o ProjectPoolOutput) StopOnDisconnectGracePeriodMinutes() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.IntPtrOutput { return v.StopOnDisconnectGracePeriodMinutes }).(pulumi.IntPtrOutput)
}
// A mapping of tags which should be assigned to the Dev Center Project Pool.
func (o ProjectPoolOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *ProjectPool) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type ProjectPoolArrayOutput struct{ *pulumi.OutputState }
func (ProjectPoolArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ProjectPool)(nil)).Elem()
}
func (o ProjectPoolArrayOutput) ToProjectPoolArrayOutput() ProjectPoolArrayOutput {
return o
}
func (o ProjectPoolArrayOutput) ToProjectPoolArrayOutputWithContext(ctx context.Context) ProjectPoolArrayOutput {
return o
}
func (o ProjectPoolArrayOutput) Index(i pulumi.IntInput) ProjectPoolOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ProjectPool {
return vs[0].([]*ProjectPool)[vs[1].(int)]
}).(ProjectPoolOutput)
}
type ProjectPoolMapOutput struct{ *pulumi.OutputState }
func (ProjectPoolMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ProjectPool)(nil)).Elem()
}
func (o ProjectPoolMapOutput) ToProjectPoolMapOutput() ProjectPoolMapOutput {
return o
}
func (o ProjectPoolMapOutput) ToProjectPoolMapOutputWithContext(ctx context.Context) ProjectPoolMapOutput {
return o
}
func (o ProjectPoolMapOutput) MapIndex(k pulumi.StringInput) ProjectPoolOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ProjectPool {
return vs[0].(map[string]*ProjectPool)[vs[1].(string)]
}).(ProjectPoolOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProjectPoolInput)(nil)).Elem(), &ProjectPool{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectPoolArrayInput)(nil)).Elem(), ProjectPoolArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectPoolMapInput)(nil)).Elem(), ProjectPoolMap{})
pulumi.RegisterOutputType(ProjectPoolOutput{})
pulumi.RegisterOutputType(ProjectPoolArrayOutput{})
pulumi.RegisterOutputType(ProjectPoolMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getDevBoxDefinition.go | sdk/go/azure/devcenter/getDevBoxDefinition.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Dev Box Definition.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupDevBoxDefinition(ctx, &devcenter.LookupDevBoxDefinitionArgs{
// Name: exampleAzurermDevCenterDevBoxDefinition.Name,
// DevCenterId: exampleAzurermDevCenterDevBoxDefinition.DevCenterId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupDevBoxDefinition(ctx *pulumi.Context, args *LookupDevBoxDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupDevBoxDefinitionResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupDevBoxDefinitionResult
err := ctx.Invoke("azure:devcenter/getDevBoxDefinition:getDevBoxDefinition", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDevBoxDefinition.
type LookupDevBoxDefinitionArgs struct {
// The ID of the associated Dev Center.
DevCenterId string `pulumi:"devCenterId"`
// The name of this Dev Center Dev Box Definition.
Name string `pulumi:"name"`
}
// A collection of values returned by getDevBoxDefinition.
type LookupDevBoxDefinitionResult struct {
DevCenterId string `pulumi:"devCenterId"`
// Whether Dev Boxes created with this definition are capable of hibernation.
HibernateSupportEnabled bool `pulumi:"hibernateSupportEnabled"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The ID of the image for the Dev Center Dev Box Definition.
ImageReferenceId string `pulumi:"imageReferenceId"`
// The Azure Region where the Dev Center Dev Box Definition exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
// The name of the SKU for the Dev Center Dev Box Definition.
SkuName string `pulumi:"skuName"`
// A mapping of tags assigned to the Dev Center Dev Box Definition.
Tags map[string]string `pulumi:"tags"`
}
func LookupDevBoxDefinitionOutput(ctx *pulumi.Context, args LookupDevBoxDefinitionOutputArgs, opts ...pulumi.InvokeOption) LookupDevBoxDefinitionResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupDevBoxDefinitionResultOutput, error) {
args := v.(LookupDevBoxDefinitionArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getDevBoxDefinition:getDevBoxDefinition", args, LookupDevBoxDefinitionResultOutput{}, options).(LookupDevBoxDefinitionResultOutput), nil
}).(LookupDevBoxDefinitionResultOutput)
}
// A collection of arguments for invoking getDevBoxDefinition.
type LookupDevBoxDefinitionOutputArgs struct {
// The ID of the associated Dev Center.
DevCenterId pulumi.StringInput `pulumi:"devCenterId"`
// The name of this Dev Center Dev Box Definition.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupDevBoxDefinitionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDevBoxDefinitionArgs)(nil)).Elem()
}
// A collection of values returned by getDevBoxDefinition.
type LookupDevBoxDefinitionResultOutput struct{ *pulumi.OutputState }
func (LookupDevBoxDefinitionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDevBoxDefinitionResult)(nil)).Elem()
}
func (o LookupDevBoxDefinitionResultOutput) ToLookupDevBoxDefinitionResultOutput() LookupDevBoxDefinitionResultOutput {
return o
}
func (o LookupDevBoxDefinitionResultOutput) ToLookupDevBoxDefinitionResultOutputWithContext(ctx context.Context) LookupDevBoxDefinitionResultOutput {
return o
}
func (o LookupDevBoxDefinitionResultOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) string { return v.DevCenterId }).(pulumi.StringOutput)
}
// Whether Dev Boxes created with this definition are capable of hibernation.
func (o LookupDevBoxDefinitionResultOutput) HibernateSupportEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) bool { return v.HibernateSupportEnabled }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupDevBoxDefinitionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) string { return v.Id }).(pulumi.StringOutput)
}
// The ID of the image for the Dev Center Dev Box Definition.
func (o LookupDevBoxDefinitionResultOutput) ImageReferenceId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) string { return v.ImageReferenceId }).(pulumi.StringOutput)
}
// The Azure Region where the Dev Center Dev Box Definition exists.
func (o LookupDevBoxDefinitionResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupDevBoxDefinitionResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) string { return v.Name }).(pulumi.StringOutput)
}
// The name of the SKU for the Dev Center Dev Box Definition.
func (o LookupDevBoxDefinitionResultOutput) SkuName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) string { return v.SkuName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Dev Center Dev Box Definition.
func (o LookupDevBoxDefinitionResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDevBoxDefinitionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDevBoxDefinitionResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getProjectEnvironmentType.go | sdk/go/azure/devcenter/getProjectEnvironmentType.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Project Environment Type.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupProjectEnvironmentType(ctx, &devcenter.LookupProjectEnvironmentTypeArgs{
// Name: exampleAzurermDevCenterProjectEnvironmentType.Name,
// DevCenterProjectId: exampleAzurermDevCenterProjectEnvironmentType.DevCenterProjectId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupProjectEnvironmentType(ctx *pulumi.Context, args *LookupProjectEnvironmentTypeArgs, opts ...pulumi.InvokeOption) (*LookupProjectEnvironmentTypeResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupProjectEnvironmentTypeResult
err := ctx.Invoke("azure:devcenter/getProjectEnvironmentType:getProjectEnvironmentType", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getProjectEnvironmentType.
type LookupProjectEnvironmentTypeArgs struct {
// The ID of the associated Dev Center Project.
DevCenterProjectId string `pulumi:"devCenterProjectId"`
// The name of this Dev Center Project Environment Type.
Name string `pulumi:"name"`
}
// A collection of values returned by getProjectEnvironmentType.
type LookupProjectEnvironmentTypeResult struct {
// A list of roles assigned to the environment creator.
CreatorRoleAssignmentRoles []string `pulumi:"creatorRoleAssignmentRoles"`
// The ID of the subscription that the Environment Type is mapped to.
DeploymentTargetId string `pulumi:"deploymentTargetId"`
DevCenterProjectId string `pulumi:"devCenterProjectId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// An `identity` block as defined below.
Identities []GetProjectEnvironmentTypeIdentity `pulumi:"identities"`
// The Azure Region where the Dev Center Project Environment Type exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
// A mapping of tags assigned to the Dev Center Project Environment Type.
Tags map[string]string `pulumi:"tags"`
// A `userRoleAssignment` block as defined below.
UserRoleAssignments []GetProjectEnvironmentTypeUserRoleAssignment `pulumi:"userRoleAssignments"`
}
func LookupProjectEnvironmentTypeOutput(ctx *pulumi.Context, args LookupProjectEnvironmentTypeOutputArgs, opts ...pulumi.InvokeOption) LookupProjectEnvironmentTypeResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupProjectEnvironmentTypeResultOutput, error) {
args := v.(LookupProjectEnvironmentTypeArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getProjectEnvironmentType:getProjectEnvironmentType", args, LookupProjectEnvironmentTypeResultOutput{}, options).(LookupProjectEnvironmentTypeResultOutput), nil
}).(LookupProjectEnvironmentTypeResultOutput)
}
// A collection of arguments for invoking getProjectEnvironmentType.
type LookupProjectEnvironmentTypeOutputArgs struct {
// The ID of the associated Dev Center Project.
DevCenterProjectId pulumi.StringInput `pulumi:"devCenterProjectId"`
// The name of this Dev Center Project Environment Type.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupProjectEnvironmentTypeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupProjectEnvironmentTypeArgs)(nil)).Elem()
}
// A collection of values returned by getProjectEnvironmentType.
type LookupProjectEnvironmentTypeResultOutput struct{ *pulumi.OutputState }
func (LookupProjectEnvironmentTypeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupProjectEnvironmentTypeResult)(nil)).Elem()
}
func (o LookupProjectEnvironmentTypeResultOutput) ToLookupProjectEnvironmentTypeResultOutput() LookupProjectEnvironmentTypeResultOutput {
return o
}
func (o LookupProjectEnvironmentTypeResultOutput) ToLookupProjectEnvironmentTypeResultOutputWithContext(ctx context.Context) LookupProjectEnvironmentTypeResultOutput {
return o
}
// A list of roles assigned to the environment creator.
func (o LookupProjectEnvironmentTypeResultOutput) CreatorRoleAssignmentRoles() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) []string { return v.CreatorRoleAssignmentRoles }).(pulumi.StringArrayOutput)
}
// The ID of the subscription that the Environment Type is mapped to.
func (o LookupProjectEnvironmentTypeResultOutput) DeploymentTargetId() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) string { return v.DeploymentTargetId }).(pulumi.StringOutput)
}
func (o LookupProjectEnvironmentTypeResultOutput) DevCenterProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) string { return v.DevCenterProjectId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupProjectEnvironmentTypeResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) string { return v.Id }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o LookupProjectEnvironmentTypeResultOutput) Identities() GetProjectEnvironmentTypeIdentityArrayOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) []GetProjectEnvironmentTypeIdentity { return v.Identities }).(GetProjectEnvironmentTypeIdentityArrayOutput)
}
// The Azure Region where the Dev Center Project Environment Type exists.
func (o LookupProjectEnvironmentTypeResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupProjectEnvironmentTypeResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) string { return v.Name }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Dev Center Project Environment Type.
func (o LookupProjectEnvironmentTypeResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// A `userRoleAssignment` block as defined below.
func (o LookupProjectEnvironmentTypeResultOutput) UserRoleAssignments() GetProjectEnvironmentTypeUserRoleAssignmentArrayOutput {
return o.ApplyT(func(v LookupProjectEnvironmentTypeResult) []GetProjectEnvironmentTypeUserRoleAssignment {
return v.UserRoleAssignments
}).(GetProjectEnvironmentTypeUserRoleAssignmentArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupProjectEnvironmentTypeResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/gallery.go | sdk/go/azure/devcenter/gallery.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// testUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "test", &authorization.UserAssignedIdentityArgs{
// Name: pulumi.String("example-uai"),
// Location: pulumi.Any(testAzurermResourceGroup.Location),
// ResourceGroupName: pulumi.Any(testAzurermResourceGroup.Name),
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewDevCenter(ctx, "test", &devcenter.DevCenterArgs{
// Name: pulumi.String("example-devcenter"),
// ResourceGroupName: pulumi.Any(testAzurermResourceGroup.Name),
// Location: pulumi.Any(testAzurermResourceGroup.Location),
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("UserAssigned"),
// IdentityIds: pulumi.StringArray{
// testUserAssignedIdentity.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "example", &compute.SharedImageGalleryArgs{
// Name: pulumi.String("example-image-gallery"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewGallery(ctx, "example", &devcenter.GalleryArgs{
// DevCenterId: pulumi.Any(exampleAzurermDevCenter.Id),
// SharedGalleryId: exampleSharedImageGallery.ID(),
// Name: pulumi.String("example"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Gallery can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/gallery:Gallery example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devCenters/{devCenterName}/galleries/{galleryName}
// ```
//
// * Where `{subscriptionId}` is the ID of the Azure Subscription where the Dev Center Gallery exists. For example `12345678-1234-9876-4563-123456789012`.
//
// * Where `{resourceGroupName}` is the name of Resource Group where this Dev Center Gallery exists. For example `example-resource-group`.
//
// * Where `{devCenterName}` is the name of the Dev Center. For example `devCenterValue`.
//
// * Where `{galleryName}` is the name of the Gallery. For example `galleryValue`.
type Gallery struct {
pulumi.CustomResourceState
// Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
DevCenterId pulumi.StringOutput `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
SharedGalleryId pulumi.StringOutput `pulumi:"sharedGalleryId"`
}
// NewGallery registers a new resource with the given unique name, arguments, and options.
func NewGallery(ctx *pulumi.Context,
name string, args *GalleryArgs, opts ...pulumi.ResourceOption) (*Gallery, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevCenterId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterId'")
}
if args.SharedGalleryId == nil {
return nil, errors.New("invalid value for required argument 'SharedGalleryId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Gallery
err := ctx.RegisterResource("azure:devcenter/gallery:Gallery", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGallery gets an existing Gallery resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGallery(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GalleryState, opts ...pulumi.ResourceOption) (*Gallery, error) {
var resource Gallery
err := ctx.ReadResource("azure:devcenter/gallery:Gallery", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Gallery resources.
type galleryState struct {
// Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
DevCenterId *string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
Name *string `pulumi:"name"`
// The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
SharedGalleryId *string `pulumi:"sharedGalleryId"`
}
type GalleryState struct {
// Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
DevCenterId pulumi.StringPtrInput
// Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
Name pulumi.StringPtrInput
// The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
SharedGalleryId pulumi.StringPtrInput
}
func (GalleryState) ElementType() reflect.Type {
return reflect.TypeOf((*galleryState)(nil)).Elem()
}
type galleryArgs struct {
// Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
DevCenterId string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
Name *string `pulumi:"name"`
// The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
SharedGalleryId string `pulumi:"sharedGalleryId"`
}
// The set of arguments for constructing a Gallery resource.
type GalleryArgs struct {
// Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
DevCenterId pulumi.StringInput
// Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
Name pulumi.StringPtrInput
// The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
SharedGalleryId pulumi.StringInput
}
func (GalleryArgs) ElementType() reflect.Type {
return reflect.TypeOf((*galleryArgs)(nil)).Elem()
}
type GalleryInput interface {
pulumi.Input
ToGalleryOutput() GalleryOutput
ToGalleryOutputWithContext(ctx context.Context) GalleryOutput
}
func (*Gallery) ElementType() reflect.Type {
return reflect.TypeOf((**Gallery)(nil)).Elem()
}
func (i *Gallery) ToGalleryOutput() GalleryOutput {
return i.ToGalleryOutputWithContext(context.Background())
}
func (i *Gallery) ToGalleryOutputWithContext(ctx context.Context) GalleryOutput {
return pulumi.ToOutputWithContext(ctx, i).(GalleryOutput)
}
// GalleryArrayInput is an input type that accepts GalleryArray and GalleryArrayOutput values.
// You can construct a concrete instance of `GalleryArrayInput` via:
//
// GalleryArray{ GalleryArgs{...} }
type GalleryArrayInput interface {
pulumi.Input
ToGalleryArrayOutput() GalleryArrayOutput
ToGalleryArrayOutputWithContext(context.Context) GalleryArrayOutput
}
type GalleryArray []GalleryInput
func (GalleryArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Gallery)(nil)).Elem()
}
func (i GalleryArray) ToGalleryArrayOutput() GalleryArrayOutput {
return i.ToGalleryArrayOutputWithContext(context.Background())
}
func (i GalleryArray) ToGalleryArrayOutputWithContext(ctx context.Context) GalleryArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GalleryArrayOutput)
}
// GalleryMapInput is an input type that accepts GalleryMap and GalleryMapOutput values.
// You can construct a concrete instance of `GalleryMapInput` via:
//
// GalleryMap{ "key": GalleryArgs{...} }
type GalleryMapInput interface {
pulumi.Input
ToGalleryMapOutput() GalleryMapOutput
ToGalleryMapOutputWithContext(context.Context) GalleryMapOutput
}
type GalleryMap map[string]GalleryInput
func (GalleryMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Gallery)(nil)).Elem()
}
func (i GalleryMap) ToGalleryMapOutput() GalleryMapOutput {
return i.ToGalleryMapOutputWithContext(context.Background())
}
func (i GalleryMap) ToGalleryMapOutputWithContext(ctx context.Context) GalleryMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GalleryMapOutput)
}
type GalleryOutput struct{ *pulumi.OutputState }
func (GalleryOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Gallery)(nil)).Elem()
}
func (o GalleryOutput) ToGalleryOutput() GalleryOutput {
return o
}
func (o GalleryOutput) ToGalleryOutputWithContext(ctx context.Context) GalleryOutput {
return o
}
// Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
func (o GalleryOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v *Gallery) pulumi.StringOutput { return v.DevCenterId }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
func (o GalleryOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Gallery) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
func (o GalleryOutput) SharedGalleryId() pulumi.StringOutput {
return o.ApplyT(func(v *Gallery) pulumi.StringOutput { return v.SharedGalleryId }).(pulumi.StringOutput)
}
type GalleryArrayOutput struct{ *pulumi.OutputState }
func (GalleryArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Gallery)(nil)).Elem()
}
func (o GalleryArrayOutput) ToGalleryArrayOutput() GalleryArrayOutput {
return o
}
func (o GalleryArrayOutput) ToGalleryArrayOutputWithContext(ctx context.Context) GalleryArrayOutput {
return o
}
func (o GalleryArrayOutput) Index(i pulumi.IntInput) GalleryOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Gallery {
return vs[0].([]*Gallery)[vs[1].(int)]
}).(GalleryOutput)
}
type GalleryMapOutput struct{ *pulumi.OutputState }
func (GalleryMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Gallery)(nil)).Elem()
}
func (o GalleryMapOutput) ToGalleryMapOutput() GalleryMapOutput {
return o
}
func (o GalleryMapOutput) ToGalleryMapOutputWithContext(ctx context.Context) GalleryMapOutput {
return o
}
func (o GalleryMapOutput) MapIndex(k pulumi.StringInput) GalleryOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Gallery {
return vs[0].(map[string]*Gallery)[vs[1].(string)]
}).(GalleryOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GalleryInput)(nil)).Elem(), &Gallery{})
pulumi.RegisterInputType(reflect.TypeOf((*GalleryArrayInput)(nil)).Elem(), GalleryArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GalleryMapInput)(nil)).Elem(), GalleryMap{})
pulumi.RegisterOutputType(GalleryOutput{})
pulumi.RegisterOutputType(GalleryArrayOutput{})
pulumi.RegisterOutputType(GalleryMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getCatalog.go | sdk/go/azure/devcenter/getCatalog.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Catalog.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupCatalog(ctx, &devcenter.LookupCatalogArgs{
// Name: exampleAzurermDevCenterCatalog.Name,
// DevCenterId: exampleAzurermDevCenterCatalog.DevCenterId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupCatalog(ctx *pulumi.Context, args *LookupCatalogArgs, opts ...pulumi.InvokeOption) (*LookupCatalogResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupCatalogResult
err := ctx.Invoke("azure:devcenter/getCatalog:getCatalog", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCatalog.
type LookupCatalogArgs struct {
// Specifies the Dev Center Id within which this Dev Center Catalog should exist.
DevCenterId string `pulumi:"devCenterId"`
// The name of this Dev Center Catalog.
Name string `pulumi:"name"`
}
// A collection of values returned by getCatalog.
type LookupCatalogResult struct {
// A `catalogAdogit` block as defined below.
CatalogAdogits []GetCatalogCatalogAdogit `pulumi:"catalogAdogits"`
// A `catalogGithub` block as defined below.
CatalogGithubs []GetCatalogCatalogGithub `pulumi:"catalogGithubs"`
DevCenterId string `pulumi:"devCenterId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
}
func LookupCatalogOutput(ctx *pulumi.Context, args LookupCatalogOutputArgs, opts ...pulumi.InvokeOption) LookupCatalogResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupCatalogResultOutput, error) {
args := v.(LookupCatalogArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getCatalog:getCatalog", args, LookupCatalogResultOutput{}, options).(LookupCatalogResultOutput), nil
}).(LookupCatalogResultOutput)
}
// A collection of arguments for invoking getCatalog.
type LookupCatalogOutputArgs struct {
// Specifies the Dev Center Id within which this Dev Center Catalog should exist.
DevCenterId pulumi.StringInput `pulumi:"devCenterId"`
// The name of this Dev Center Catalog.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupCatalogOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCatalogArgs)(nil)).Elem()
}
// A collection of values returned by getCatalog.
type LookupCatalogResultOutput struct{ *pulumi.OutputState }
func (LookupCatalogResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCatalogResult)(nil)).Elem()
}
func (o LookupCatalogResultOutput) ToLookupCatalogResultOutput() LookupCatalogResultOutput {
return o
}
func (o LookupCatalogResultOutput) ToLookupCatalogResultOutputWithContext(ctx context.Context) LookupCatalogResultOutput {
return o
}
// A `catalogAdogit` block as defined below.
func (o LookupCatalogResultOutput) CatalogAdogits() GetCatalogCatalogAdogitArrayOutput {
return o.ApplyT(func(v LookupCatalogResult) []GetCatalogCatalogAdogit { return v.CatalogAdogits }).(GetCatalogCatalogAdogitArrayOutput)
}
// A `catalogGithub` block as defined below.
func (o LookupCatalogResultOutput) CatalogGithubs() GetCatalogCatalogGithubArrayOutput {
return o.ApplyT(func(v LookupCatalogResult) []GetCatalogCatalogGithub { return v.CatalogGithubs }).(GetCatalogCatalogGithubArrayOutput)
}
func (o LookupCatalogResultOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupCatalogResult) string { return v.DevCenterId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupCatalogResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupCatalogResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupCatalogResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupCatalogResult) string { return v.Name }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCatalogResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getAttachedNetwork.go | sdk/go/azure/devcenter/getAttachedNetwork.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Attached Network.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupAttachedNetwork(ctx, &devcenter.LookupAttachedNetworkArgs{
// Name: exampleAzurermDevCenterAttachedNetwork.Name,
// DevCenterId: exampleAzurermDevCenterAttachedNetwork.DevCenterId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupAttachedNetwork(ctx *pulumi.Context, args *LookupAttachedNetworkArgs, opts ...pulumi.InvokeOption) (*LookupAttachedNetworkResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupAttachedNetworkResult
err := ctx.Invoke("azure:devcenter/getAttachedNetwork:getAttachedNetwork", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAttachedNetwork.
type LookupAttachedNetworkArgs struct {
// The ID of the associated Dev Center.
DevCenterId string `pulumi:"devCenterId"`
// The name of this Dev Center Attached Network.
Name string `pulumi:"name"`
}
// A collection of values returned by getAttachedNetwork.
type LookupAttachedNetworkResult struct {
DevCenterId string `pulumi:"devCenterId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// The ID of the attached Dev Center Network Connection.
NetworkConnectionId string `pulumi:"networkConnectionId"`
}
func LookupAttachedNetworkOutput(ctx *pulumi.Context, args LookupAttachedNetworkOutputArgs, opts ...pulumi.InvokeOption) LookupAttachedNetworkResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupAttachedNetworkResultOutput, error) {
args := v.(LookupAttachedNetworkArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getAttachedNetwork:getAttachedNetwork", args, LookupAttachedNetworkResultOutput{}, options).(LookupAttachedNetworkResultOutput), nil
}).(LookupAttachedNetworkResultOutput)
}
// A collection of arguments for invoking getAttachedNetwork.
type LookupAttachedNetworkOutputArgs struct {
// The ID of the associated Dev Center.
DevCenterId pulumi.StringInput `pulumi:"devCenterId"`
// The name of this Dev Center Attached Network.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupAttachedNetworkOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAttachedNetworkArgs)(nil)).Elem()
}
// A collection of values returned by getAttachedNetwork.
type LookupAttachedNetworkResultOutput struct{ *pulumi.OutputState }
func (LookupAttachedNetworkResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAttachedNetworkResult)(nil)).Elem()
}
func (o LookupAttachedNetworkResultOutput) ToLookupAttachedNetworkResultOutput() LookupAttachedNetworkResultOutput {
return o
}
func (o LookupAttachedNetworkResultOutput) ToLookupAttachedNetworkResultOutputWithContext(ctx context.Context) LookupAttachedNetworkResultOutput {
return o
}
func (o LookupAttachedNetworkResultOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupAttachedNetworkResult) string { return v.DevCenterId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupAttachedNetworkResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupAttachedNetworkResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupAttachedNetworkResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupAttachedNetworkResult) string { return v.Name }).(pulumi.StringOutput)
}
// The ID of the attached Dev Center Network Connection.
func (o LookupAttachedNetworkResultOutput) NetworkConnectionId() pulumi.StringOutput {
return o.ApplyT(func(v LookupAttachedNetworkResult) string { return v.NetworkConnectionId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupAttachedNetworkResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/get.go | sdk/go/azure/devcenter/get.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.Get(ctx, &devcenter.GetArgs{
// Name: "example",
// ResourceGroupName: "example-resource-group",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func Get(ctx *pulumi.Context, args *GetArgs, opts ...pulumi.InvokeOption) (*GetResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetResult
err := ctx.Invoke("azure:devcenter/get:get", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking get.
type GetArgs struct {
// The name of this Dev Center.
Name string `pulumi:"name"`
// The name of the Resource Group where the Dev Center exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by get.
type GetResult struct {
// The URI of the Dev Center.
DevCenterUri string `pulumi:"devCenterUri"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// An `identity` block as defined below.
Identities []GetIdentity `pulumi:"identities"`
// The Azure Region where the Dev Center exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the Dev Center.
Tags map[string]string `pulumi:"tags"`
}
func GetOutput(ctx *pulumi.Context, args GetOutputArgs, opts ...pulumi.InvokeOption) GetResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (GetResultOutput, error) {
args := v.(GetArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/get:get", args, GetResultOutput{}, options).(GetResultOutput), nil
}).(GetResultOutput)
}
// A collection of arguments for invoking get.
type GetOutputArgs struct {
// The name of this Dev Center.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Dev Center exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (GetOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetArgs)(nil)).Elem()
}
// A collection of values returned by get.
type GetResultOutput struct{ *pulumi.OutputState }
func (GetResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetResult)(nil)).Elem()
}
func (o GetResultOutput) ToGetResultOutput() GetResultOutput {
return o
}
func (o GetResultOutput) ToGetResultOutputWithContext(ctx context.Context) GetResultOutput {
return o
}
// The URI of the Dev Center.
func (o GetResultOutput) DevCenterUri() pulumi.StringOutput {
return o.ApplyT(func(v GetResult) string { return v.DevCenterUri }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetResult) string { return v.Id }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o GetResultOutput) Identities() GetIdentityArrayOutput {
return o.ApplyT(func(v GetResult) []GetIdentity { return v.Identities }).(GetIdentityArrayOutput)
}
// The Azure Region where the Dev Center exists.
func (o GetResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v GetResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o GetResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o GetResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v GetResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Dev Center.
func (o GetResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v GetResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(GetResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/projectEnvironmentType.go | sdk/go/azure/devcenter/projectEnvironmentType.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Project Environment Type.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// current, err := core.GetClientConfig(ctx, map[string]interface{}{}, nil)
// if err != nil {
// return err
// }
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleDevCenter, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Name: pulumi.String("example-dc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// exampleEnvironmentType, err := devcenter.NewEnvironmentType(ctx, "example", &devcenter.EnvironmentTypeArgs{
// Name: pulumi.String("example-et"),
// DevCenterId: exampleDevCenter.ID(),
// })
// if err != nil {
// return err
// }
// exampleProject, err := devcenter.NewProject(ctx, "example", &devcenter.ProjectArgs{
// Name: pulumi.String("example-dcp"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// DevCenterId: exampleDevCenter.ID(),
// }, pulumi.DependsOn([]pulumi.Resource{
// exampleEnvironmentType,
// }))
// if err != nil {
// return err
// }
// _, err = devcenter.NewProjectEnvironmentType(ctx, "example", &devcenter.ProjectEnvironmentTypeArgs{
// Name: pulumi.String("example-et"),
// Location: example.Location,
// DevCenterProjectId: exampleProject.ID(),
// DeploymentTargetId: pulumi.Sprintf("/subscriptions/%v", current.SubscriptionId),
// Identity: &devcenter.ProjectEnvironmentTypeIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Project Environment Type can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/projectEnvironmentType:ProjectEnvironmentType example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/projects/project1/environmentTypes/et1
// ```
type ProjectEnvironmentType struct {
pulumi.CustomResourceState
// A list of roles to assign to the environment creator.
CreatorRoleAssignmentRoles pulumi.StringArrayOutput `pulumi:"creatorRoleAssignmentRoles"`
// The ID of the subscription that the Environment Type will be mapped to. The environment's resources will be deployed into this subscription.
DeploymentTargetId pulumi.StringOutput `pulumi:"deploymentTargetId"`
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId pulumi.StringOutput `pulumi:"devCenterProjectId"`
// An `identity` block as defined below.
Identity ProjectEnvironmentTypeIdentityOutput `pulumi:"identity"`
// The Azure Region where the Dev Center Project Environment Type should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of this Dev Center Project Environment Type. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A mapping of tags which should be assigned to the Dev Center Project Environment Type.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A `userRoleAssignment` block as defined below.
UserRoleAssignments ProjectEnvironmentTypeUserRoleAssignmentArrayOutput `pulumi:"userRoleAssignments"`
}
// NewProjectEnvironmentType registers a new resource with the given unique name, arguments, and options.
func NewProjectEnvironmentType(ctx *pulumi.Context,
name string, args *ProjectEnvironmentTypeArgs, opts ...pulumi.ResourceOption) (*ProjectEnvironmentType, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DeploymentTargetId == nil {
return nil, errors.New("invalid value for required argument 'DeploymentTargetId'")
}
if args.DevCenterProjectId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterProjectId'")
}
if args.Identity == nil {
return nil, errors.New("invalid value for required argument 'Identity'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ProjectEnvironmentType
err := ctx.RegisterResource("azure:devcenter/projectEnvironmentType:ProjectEnvironmentType", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProjectEnvironmentType gets an existing ProjectEnvironmentType resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetProjectEnvironmentType(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProjectEnvironmentTypeState, opts ...pulumi.ResourceOption) (*ProjectEnvironmentType, error) {
var resource ProjectEnvironmentType
err := ctx.ReadResource("azure:devcenter/projectEnvironmentType:ProjectEnvironmentType", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ProjectEnvironmentType resources.
type projectEnvironmentTypeState struct {
// A list of roles to assign to the environment creator.
CreatorRoleAssignmentRoles []string `pulumi:"creatorRoleAssignmentRoles"`
// The ID of the subscription that the Environment Type will be mapped to. The environment's resources will be deployed into this subscription.
DeploymentTargetId *string `pulumi:"deploymentTargetId"`
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId *string `pulumi:"devCenterProjectId"`
// An `identity` block as defined below.
Identity *ProjectEnvironmentTypeIdentity `pulumi:"identity"`
// The Azure Region where the Dev Center Project Environment Type should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center Project Environment Type. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A mapping of tags which should be assigned to the Dev Center Project Environment Type.
Tags map[string]string `pulumi:"tags"`
// A `userRoleAssignment` block as defined below.
UserRoleAssignments []ProjectEnvironmentTypeUserRoleAssignment `pulumi:"userRoleAssignments"`
}
type ProjectEnvironmentTypeState struct {
// A list of roles to assign to the environment creator.
CreatorRoleAssignmentRoles pulumi.StringArrayInput
// The ID of the subscription that the Environment Type will be mapped to. The environment's resources will be deployed into this subscription.
DeploymentTargetId pulumi.StringPtrInput
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId pulumi.StringPtrInput
// An `identity` block as defined below.
Identity ProjectEnvironmentTypeIdentityPtrInput
// The Azure Region where the Dev Center Project Environment Type should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center Project Environment Type. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Project Environment Type.
Tags pulumi.StringMapInput
// A `userRoleAssignment` block as defined below.
UserRoleAssignments ProjectEnvironmentTypeUserRoleAssignmentArrayInput
}
func (ProjectEnvironmentTypeState) ElementType() reflect.Type {
return reflect.TypeOf((*projectEnvironmentTypeState)(nil)).Elem()
}
type projectEnvironmentTypeArgs struct {
// A list of roles to assign to the environment creator.
CreatorRoleAssignmentRoles []string `pulumi:"creatorRoleAssignmentRoles"`
// The ID of the subscription that the Environment Type will be mapped to. The environment's resources will be deployed into this subscription.
DeploymentTargetId string `pulumi:"deploymentTargetId"`
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId string `pulumi:"devCenterProjectId"`
// An `identity` block as defined below.
Identity ProjectEnvironmentTypeIdentity `pulumi:"identity"`
// The Azure Region where the Dev Center Project Environment Type should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center Project Environment Type. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A mapping of tags which should be assigned to the Dev Center Project Environment Type.
Tags map[string]string `pulumi:"tags"`
// A `userRoleAssignment` block as defined below.
UserRoleAssignments []ProjectEnvironmentTypeUserRoleAssignment `pulumi:"userRoleAssignments"`
}
// The set of arguments for constructing a ProjectEnvironmentType resource.
type ProjectEnvironmentTypeArgs struct {
// A list of roles to assign to the environment creator.
CreatorRoleAssignmentRoles pulumi.StringArrayInput
// The ID of the subscription that the Environment Type will be mapped to. The environment's resources will be deployed into this subscription.
DeploymentTargetId pulumi.StringInput
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
DevCenterProjectId pulumi.StringInput
// An `identity` block as defined below.
Identity ProjectEnvironmentTypeIdentityInput
// The Azure Region where the Dev Center Project Environment Type should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center Project Environment Type. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Project Environment Type.
Tags pulumi.StringMapInput
// A `userRoleAssignment` block as defined below.
UserRoleAssignments ProjectEnvironmentTypeUserRoleAssignmentArrayInput
}
func (ProjectEnvironmentTypeArgs) ElementType() reflect.Type {
return reflect.TypeOf((*projectEnvironmentTypeArgs)(nil)).Elem()
}
type ProjectEnvironmentTypeInput interface {
pulumi.Input
ToProjectEnvironmentTypeOutput() ProjectEnvironmentTypeOutput
ToProjectEnvironmentTypeOutputWithContext(ctx context.Context) ProjectEnvironmentTypeOutput
}
func (*ProjectEnvironmentType) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectEnvironmentType)(nil)).Elem()
}
func (i *ProjectEnvironmentType) ToProjectEnvironmentTypeOutput() ProjectEnvironmentTypeOutput {
return i.ToProjectEnvironmentTypeOutputWithContext(context.Background())
}
func (i *ProjectEnvironmentType) ToProjectEnvironmentTypeOutputWithContext(ctx context.Context) ProjectEnvironmentTypeOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeOutput)
}
// ProjectEnvironmentTypeArrayInput is an input type that accepts ProjectEnvironmentTypeArray and ProjectEnvironmentTypeArrayOutput values.
// You can construct a concrete instance of `ProjectEnvironmentTypeArrayInput` via:
//
// ProjectEnvironmentTypeArray{ ProjectEnvironmentTypeArgs{...} }
type ProjectEnvironmentTypeArrayInput interface {
pulumi.Input
ToProjectEnvironmentTypeArrayOutput() ProjectEnvironmentTypeArrayOutput
ToProjectEnvironmentTypeArrayOutputWithContext(context.Context) ProjectEnvironmentTypeArrayOutput
}
type ProjectEnvironmentTypeArray []ProjectEnvironmentTypeInput
func (ProjectEnvironmentTypeArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ProjectEnvironmentType)(nil)).Elem()
}
func (i ProjectEnvironmentTypeArray) ToProjectEnvironmentTypeArrayOutput() ProjectEnvironmentTypeArrayOutput {
return i.ToProjectEnvironmentTypeArrayOutputWithContext(context.Background())
}
func (i ProjectEnvironmentTypeArray) ToProjectEnvironmentTypeArrayOutputWithContext(ctx context.Context) ProjectEnvironmentTypeArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeArrayOutput)
}
// ProjectEnvironmentTypeMapInput is an input type that accepts ProjectEnvironmentTypeMap and ProjectEnvironmentTypeMapOutput values.
// You can construct a concrete instance of `ProjectEnvironmentTypeMapInput` via:
//
// ProjectEnvironmentTypeMap{ "key": ProjectEnvironmentTypeArgs{...} }
type ProjectEnvironmentTypeMapInput interface {
pulumi.Input
ToProjectEnvironmentTypeMapOutput() ProjectEnvironmentTypeMapOutput
ToProjectEnvironmentTypeMapOutputWithContext(context.Context) ProjectEnvironmentTypeMapOutput
}
type ProjectEnvironmentTypeMap map[string]ProjectEnvironmentTypeInput
func (ProjectEnvironmentTypeMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ProjectEnvironmentType)(nil)).Elem()
}
func (i ProjectEnvironmentTypeMap) ToProjectEnvironmentTypeMapOutput() ProjectEnvironmentTypeMapOutput {
return i.ToProjectEnvironmentTypeMapOutputWithContext(context.Background())
}
func (i ProjectEnvironmentTypeMap) ToProjectEnvironmentTypeMapOutputWithContext(ctx context.Context) ProjectEnvironmentTypeMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectEnvironmentTypeMapOutput)
}
type ProjectEnvironmentTypeOutput struct{ *pulumi.OutputState }
func (ProjectEnvironmentTypeOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ProjectEnvironmentType)(nil)).Elem()
}
func (o ProjectEnvironmentTypeOutput) ToProjectEnvironmentTypeOutput() ProjectEnvironmentTypeOutput {
return o
}
func (o ProjectEnvironmentTypeOutput) ToProjectEnvironmentTypeOutputWithContext(ctx context.Context) ProjectEnvironmentTypeOutput {
return o
}
// A list of roles to assign to the environment creator.
func (o ProjectEnvironmentTypeOutput) CreatorRoleAssignmentRoles() pulumi.StringArrayOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) pulumi.StringArrayOutput { return v.CreatorRoleAssignmentRoles }).(pulumi.StringArrayOutput)
}
// The ID of the subscription that the Environment Type will be mapped to. The environment's resources will be deployed into this subscription.
func (o ProjectEnvironmentTypeOutput) DeploymentTargetId() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) pulumi.StringOutput { return v.DeploymentTargetId }).(pulumi.StringOutput)
}
// The ID of the associated Dev Center Project. Changing this forces a new resource to be created.
func (o ProjectEnvironmentTypeOutput) DevCenterProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) pulumi.StringOutput { return v.DevCenterProjectId }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o ProjectEnvironmentTypeOutput) Identity() ProjectEnvironmentTypeIdentityOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) ProjectEnvironmentTypeIdentityOutput { return v.Identity }).(ProjectEnvironmentTypeIdentityOutput)
}
// The Azure Region where the Dev Center Project Environment Type should exist. Changing this forces a new resource to be created.
func (o ProjectEnvironmentTypeOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Project Environment Type. Changing this forces a new resource to be created.
func (o ProjectEnvironmentTypeOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Dev Center Project Environment Type.
func (o ProjectEnvironmentTypeOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A `userRoleAssignment` block as defined below.
func (o ProjectEnvironmentTypeOutput) UserRoleAssignments() ProjectEnvironmentTypeUserRoleAssignmentArrayOutput {
return o.ApplyT(func(v *ProjectEnvironmentType) ProjectEnvironmentTypeUserRoleAssignmentArrayOutput {
return v.UserRoleAssignments
}).(ProjectEnvironmentTypeUserRoleAssignmentArrayOutput)
}
type ProjectEnvironmentTypeArrayOutput struct{ *pulumi.OutputState }
func (ProjectEnvironmentTypeArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ProjectEnvironmentType)(nil)).Elem()
}
func (o ProjectEnvironmentTypeArrayOutput) ToProjectEnvironmentTypeArrayOutput() ProjectEnvironmentTypeArrayOutput {
return o
}
func (o ProjectEnvironmentTypeArrayOutput) ToProjectEnvironmentTypeArrayOutputWithContext(ctx context.Context) ProjectEnvironmentTypeArrayOutput {
return o
}
func (o ProjectEnvironmentTypeArrayOutput) Index(i pulumi.IntInput) ProjectEnvironmentTypeOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ProjectEnvironmentType {
return vs[0].([]*ProjectEnvironmentType)[vs[1].(int)]
}).(ProjectEnvironmentTypeOutput)
}
type ProjectEnvironmentTypeMapOutput struct{ *pulumi.OutputState }
func (ProjectEnvironmentTypeMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ProjectEnvironmentType)(nil)).Elem()
}
func (o ProjectEnvironmentTypeMapOutput) ToProjectEnvironmentTypeMapOutput() ProjectEnvironmentTypeMapOutput {
return o
}
func (o ProjectEnvironmentTypeMapOutput) ToProjectEnvironmentTypeMapOutputWithContext(ctx context.Context) ProjectEnvironmentTypeMapOutput {
return o
}
func (o ProjectEnvironmentTypeMapOutput) MapIndex(k pulumi.StringInput) ProjectEnvironmentTypeOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ProjectEnvironmentType {
return vs[0].(map[string]*ProjectEnvironmentType)[vs[1].(string)]
}).(ProjectEnvironmentTypeOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProjectEnvironmentTypeInput)(nil)).Elem(), &ProjectEnvironmentType{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectEnvironmentTypeArrayInput)(nil)).Elem(), ProjectEnvironmentTypeArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectEnvironmentTypeMapInput)(nil)).Elem(), ProjectEnvironmentTypeMap{})
pulumi.RegisterOutputType(ProjectEnvironmentTypeOutput{})
pulumi.RegisterOutputType(ProjectEnvironmentTypeArrayOutput{})
pulumi.RegisterOutputType(ProjectEnvironmentTypeMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/networkConnection.go | sdk/go/azure/devcenter/networkConnection.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Network Connection.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-vnet"),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewNetworkConnection(ctx, "example", &devcenter.NetworkConnectionArgs{
// Name: pulumi.String("example-dcnc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// DomainJoinType: pulumi.String("AzureADJoin"),
// SubnetId: exampleSubnet.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Network Connection can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/networkConnection:NetworkConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/networkConnections/networkConnection1
// ```
type NetworkConnection struct {
pulumi.CustomResourceState
// The Azure Active Directory Join type. Possible values are `AzureADJoin`, `HybridAzureADJoin` and `None`. Changing this forces a new resource to be created.
DomainJoinType pulumi.StringOutput `pulumi:"domainJoinType"`
// The name of the Azure Active Directory domain.
DomainName pulumi.StringPtrOutput `pulumi:"domainName"`
// The password for the account used to join domain.
DomainPassword pulumi.StringPtrOutput `pulumi:"domainPassword"`
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
DomainUsername pulumi.StringPtrOutput `pulumi:"domainUsername"`
// The Azure Region where the Dev Center Network Connection should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of this Dev Center Network Connection. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The Azure Active Directory domain Organization Unit (OU).
OrganizationUnit pulumi.StringPtrOutput `pulumi:"organizationUnit"`
// Specifies the name of the Resource Group within which this Dev Center Network Connection should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The ID of the Subnet that is used to attach Virtual Machines.
SubnetId pulumi.StringOutput `pulumi:"subnetId"`
// A mapping of tags which should be assigned to the Dev Center Network Connection.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewNetworkConnection registers a new resource with the given unique name, arguments, and options.
func NewNetworkConnection(ctx *pulumi.Context,
name string, args *NetworkConnectionArgs, opts ...pulumi.ResourceOption) (*NetworkConnection, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DomainJoinType == nil {
return nil, errors.New("invalid value for required argument 'DomainJoinType'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.SubnetId == nil {
return nil, errors.New("invalid value for required argument 'SubnetId'")
}
if args.DomainPassword != nil {
args.DomainPassword = pulumi.ToSecret(args.DomainPassword).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"domainPassword",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource NetworkConnection
err := ctx.RegisterResource("azure:devcenter/networkConnection:NetworkConnection", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNetworkConnection gets an existing NetworkConnection resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetNetworkConnection(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NetworkConnectionState, opts ...pulumi.ResourceOption) (*NetworkConnection, error) {
var resource NetworkConnection
err := ctx.ReadResource("azure:devcenter/networkConnection:NetworkConnection", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering NetworkConnection resources.
type networkConnectionState struct {
// The Azure Active Directory Join type. Possible values are `AzureADJoin`, `HybridAzureADJoin` and `None`. Changing this forces a new resource to be created.
DomainJoinType *string `pulumi:"domainJoinType"`
// The name of the Azure Active Directory domain.
DomainName *string `pulumi:"domainName"`
// The password for the account used to join domain.
DomainPassword *string `pulumi:"domainPassword"`
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
DomainUsername *string `pulumi:"domainUsername"`
// The Azure Region where the Dev Center Network Connection should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center Network Connection. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The Azure Active Directory domain Organization Unit (OU).
OrganizationUnit *string `pulumi:"organizationUnit"`
// Specifies the name of the Resource Group within which this Dev Center Network Connection should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The ID of the Subnet that is used to attach Virtual Machines.
SubnetId *string `pulumi:"subnetId"`
// A mapping of tags which should be assigned to the Dev Center Network Connection.
Tags map[string]string `pulumi:"tags"`
}
type NetworkConnectionState struct {
// The Azure Active Directory Join type. Possible values are `AzureADJoin`, `HybridAzureADJoin` and `None`. Changing this forces a new resource to be created.
DomainJoinType pulumi.StringPtrInput
// The name of the Azure Active Directory domain.
DomainName pulumi.StringPtrInput
// The password for the account used to join domain.
DomainPassword pulumi.StringPtrInput
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
DomainUsername pulumi.StringPtrInput
// The Azure Region where the Dev Center Network Connection should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center Network Connection. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The Azure Active Directory domain Organization Unit (OU).
OrganizationUnit pulumi.StringPtrInput
// Specifies the name of the Resource Group within which this Dev Center Network Connection should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The ID of the Subnet that is used to attach Virtual Machines.
SubnetId pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Network Connection.
Tags pulumi.StringMapInput
}
func (NetworkConnectionState) ElementType() reflect.Type {
return reflect.TypeOf((*networkConnectionState)(nil)).Elem()
}
type networkConnectionArgs struct {
// The Azure Active Directory Join type. Possible values are `AzureADJoin`, `HybridAzureADJoin` and `None`. Changing this forces a new resource to be created.
DomainJoinType string `pulumi:"domainJoinType"`
// The name of the Azure Active Directory domain.
DomainName *string `pulumi:"domainName"`
// The password for the account used to join domain.
DomainPassword *string `pulumi:"domainPassword"`
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
DomainUsername *string `pulumi:"domainUsername"`
// The Azure Region where the Dev Center Network Connection should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center Network Connection. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The Azure Active Directory domain Organization Unit (OU).
OrganizationUnit *string `pulumi:"organizationUnit"`
// Specifies the name of the Resource Group within which this Dev Center Network Connection should exist. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The ID of the Subnet that is used to attach Virtual Machines.
SubnetId string `pulumi:"subnetId"`
// A mapping of tags which should be assigned to the Dev Center Network Connection.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a NetworkConnection resource.
type NetworkConnectionArgs struct {
// The Azure Active Directory Join type. Possible values are `AzureADJoin`, `HybridAzureADJoin` and `None`. Changing this forces a new resource to be created.
DomainJoinType pulumi.StringInput
// The name of the Azure Active Directory domain.
DomainName pulumi.StringPtrInput
// The password for the account used to join domain.
DomainPassword pulumi.StringPtrInput
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
DomainUsername pulumi.StringPtrInput
// The Azure Region where the Dev Center Network Connection should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center Network Connection. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The Azure Active Directory domain Organization Unit (OU).
OrganizationUnit pulumi.StringPtrInput
// Specifies the name of the Resource Group within which this Dev Center Network Connection should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The ID of the Subnet that is used to attach Virtual Machines.
SubnetId pulumi.StringInput
// A mapping of tags which should be assigned to the Dev Center Network Connection.
Tags pulumi.StringMapInput
}
func (NetworkConnectionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*networkConnectionArgs)(nil)).Elem()
}
type NetworkConnectionInput interface {
pulumi.Input
ToNetworkConnectionOutput() NetworkConnectionOutput
ToNetworkConnectionOutputWithContext(ctx context.Context) NetworkConnectionOutput
}
func (*NetworkConnection) ElementType() reflect.Type {
return reflect.TypeOf((**NetworkConnection)(nil)).Elem()
}
func (i *NetworkConnection) ToNetworkConnectionOutput() NetworkConnectionOutput {
return i.ToNetworkConnectionOutputWithContext(context.Background())
}
func (i *NetworkConnection) ToNetworkConnectionOutputWithContext(ctx context.Context) NetworkConnectionOutput {
return pulumi.ToOutputWithContext(ctx, i).(NetworkConnectionOutput)
}
// NetworkConnectionArrayInput is an input type that accepts NetworkConnectionArray and NetworkConnectionArrayOutput values.
// You can construct a concrete instance of `NetworkConnectionArrayInput` via:
//
// NetworkConnectionArray{ NetworkConnectionArgs{...} }
type NetworkConnectionArrayInput interface {
pulumi.Input
ToNetworkConnectionArrayOutput() NetworkConnectionArrayOutput
ToNetworkConnectionArrayOutputWithContext(context.Context) NetworkConnectionArrayOutput
}
type NetworkConnectionArray []NetworkConnectionInput
func (NetworkConnectionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NetworkConnection)(nil)).Elem()
}
func (i NetworkConnectionArray) ToNetworkConnectionArrayOutput() NetworkConnectionArrayOutput {
return i.ToNetworkConnectionArrayOutputWithContext(context.Background())
}
func (i NetworkConnectionArray) ToNetworkConnectionArrayOutputWithContext(ctx context.Context) NetworkConnectionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(NetworkConnectionArrayOutput)
}
// NetworkConnectionMapInput is an input type that accepts NetworkConnectionMap and NetworkConnectionMapOutput values.
// You can construct a concrete instance of `NetworkConnectionMapInput` via:
//
// NetworkConnectionMap{ "key": NetworkConnectionArgs{...} }
type NetworkConnectionMapInput interface {
pulumi.Input
ToNetworkConnectionMapOutput() NetworkConnectionMapOutput
ToNetworkConnectionMapOutputWithContext(context.Context) NetworkConnectionMapOutput
}
type NetworkConnectionMap map[string]NetworkConnectionInput
func (NetworkConnectionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NetworkConnection)(nil)).Elem()
}
func (i NetworkConnectionMap) ToNetworkConnectionMapOutput() NetworkConnectionMapOutput {
return i.ToNetworkConnectionMapOutputWithContext(context.Background())
}
func (i NetworkConnectionMap) ToNetworkConnectionMapOutputWithContext(ctx context.Context) NetworkConnectionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(NetworkConnectionMapOutput)
}
type NetworkConnectionOutput struct{ *pulumi.OutputState }
func (NetworkConnectionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**NetworkConnection)(nil)).Elem()
}
func (o NetworkConnectionOutput) ToNetworkConnectionOutput() NetworkConnectionOutput {
return o
}
func (o NetworkConnectionOutput) ToNetworkConnectionOutputWithContext(ctx context.Context) NetworkConnectionOutput {
return o
}
// The Azure Active Directory Join type. Possible values are `AzureADJoin`, `HybridAzureADJoin` and `None`. Changing this forces a new resource to be created.
func (o NetworkConnectionOutput) DomainJoinType() pulumi.StringOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringOutput { return v.DomainJoinType }).(pulumi.StringOutput)
}
// The name of the Azure Active Directory domain.
func (o NetworkConnectionOutput) DomainName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringPtrOutput { return v.DomainName }).(pulumi.StringPtrOutput)
}
// The password for the account used to join domain.
func (o NetworkConnectionOutput) DomainPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringPtrOutput { return v.DomainPassword }).(pulumi.StringPtrOutput)
}
// The username of the Azure Active Directory account (user or service account) that has permissions to create computer objects in Active Directory.
func (o NetworkConnectionOutput) DomainUsername() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringPtrOutput { return v.DomainUsername }).(pulumi.StringPtrOutput)
}
// The Azure Region where the Dev Center Network Connection should exist. Changing this forces a new resource to be created.
func (o NetworkConnectionOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Network Connection. Changing this forces a new resource to be created.
func (o NetworkConnectionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The Azure Active Directory domain Organization Unit (OU).
func (o NetworkConnectionOutput) OrganizationUnit() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringPtrOutput { return v.OrganizationUnit }).(pulumi.StringPtrOutput)
}
// Specifies the name of the Resource Group within which this Dev Center Network Connection should exist. Changing this forces a new resource to be created.
func (o NetworkConnectionOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The ID of the Subnet that is used to attach Virtual Machines.
func (o NetworkConnectionOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringOutput { return v.SubnetId }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Dev Center Network Connection.
func (o NetworkConnectionOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *NetworkConnection) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type NetworkConnectionArrayOutput struct{ *pulumi.OutputState }
func (NetworkConnectionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NetworkConnection)(nil)).Elem()
}
func (o NetworkConnectionArrayOutput) ToNetworkConnectionArrayOutput() NetworkConnectionArrayOutput {
return o
}
func (o NetworkConnectionArrayOutput) ToNetworkConnectionArrayOutputWithContext(ctx context.Context) NetworkConnectionArrayOutput {
return o
}
func (o NetworkConnectionArrayOutput) Index(i pulumi.IntInput) NetworkConnectionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NetworkConnection {
return vs[0].([]*NetworkConnection)[vs[1].(int)]
}).(NetworkConnectionOutput)
}
type NetworkConnectionMapOutput struct{ *pulumi.OutputState }
func (NetworkConnectionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NetworkConnection)(nil)).Elem()
}
func (o NetworkConnectionMapOutput) ToNetworkConnectionMapOutput() NetworkConnectionMapOutput {
return o
}
func (o NetworkConnectionMapOutput) ToNetworkConnectionMapOutputWithContext(ctx context.Context) NetworkConnectionMapOutput {
return o
}
func (o NetworkConnectionMapOutput) MapIndex(k pulumi.StringInput) NetworkConnectionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NetworkConnection {
return vs[0].(map[string]*NetworkConnection)[vs[1].(string)]
}).(NetworkConnectionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NetworkConnectionInput)(nil)).Elem(), &NetworkConnection{})
pulumi.RegisterInputType(reflect.TypeOf((*NetworkConnectionArrayInput)(nil)).Elem(), NetworkConnectionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*NetworkConnectionMapInput)(nil)).Elem(), NetworkConnectionMap{})
pulumi.RegisterOutputType(NetworkConnectionOutput{})
pulumi.RegisterOutputType(NetworkConnectionArrayOutput{})
pulumi.RegisterOutputType(NetworkConnectionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/devBoxDefinition.go | sdk/go/azure/devcenter/devBoxDefinition.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Dev Box Definition.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleDevCenter, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Name: pulumi.String("example-dc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewDevBoxDefinition(ctx, "example", &devcenter.DevBoxDefinitionArgs{
// Name: pulumi.String("example-dcet"),
// Location: example.Location,
// DevCenterId: exampleDevCenter.ID(),
// ImageReferenceId: exampleDevCenter.ID().ApplyT(func(id string) (string, error) {
// return fmt.Sprintf("%v/galleries/default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win10-m365-gen2", id), nil
// }).(pulumi.StringOutput),
// SkuName: pulumi.String("general_i_8c32gb256ssd_v2"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Dev Box Definition can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/devBoxDefinition:DevBoxDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/devCenters/dc1/devBoxDefinitions/et1
// ```
type DevBoxDefinition struct {
pulumi.CustomResourceState
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringOutput `pulumi:"devCenterId"`
// Whether the Dev Boxes created with this definition are capable of hibernation. Defaults to `false`.
//
// > **Note:** Not all images are capable of supporting hibernation, for more information see https://aka.ms/devbox/hibernate.
HibernateSupportEnabled pulumi.BoolPtrOutput `pulumi:"hibernateSupportEnabled"`
// The ID of the image for the Dev Center Dev Box Definition.
ImageReferenceId pulumi.StringOutput `pulumi:"imageReferenceId"`
// The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the SKU for the Dev Center Dev Box Definition.
SkuName pulumi.StringOutput `pulumi:"skuName"`
// A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewDevBoxDefinition registers a new resource with the given unique name, arguments, and options.
func NewDevBoxDefinition(ctx *pulumi.Context,
name string, args *DevBoxDefinitionArgs, opts ...pulumi.ResourceOption) (*DevBoxDefinition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevCenterId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterId'")
}
if args.ImageReferenceId == nil {
return nil, errors.New("invalid value for required argument 'ImageReferenceId'")
}
if args.SkuName == nil {
return nil, errors.New("invalid value for required argument 'SkuName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DevBoxDefinition
err := ctx.RegisterResource("azure:devcenter/devBoxDefinition:DevBoxDefinition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDevBoxDefinition gets an existing DevBoxDefinition resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDevBoxDefinition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DevBoxDefinitionState, opts ...pulumi.ResourceOption) (*DevBoxDefinition, error) {
var resource DevBoxDefinition
err := ctx.ReadResource("azure:devcenter/devBoxDefinition:DevBoxDefinition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DevBoxDefinition resources.
type devBoxDefinitionState struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId *string `pulumi:"devCenterId"`
// Whether the Dev Boxes created with this definition are capable of hibernation. Defaults to `false`.
//
// > **Note:** Not all images are capable of supporting hibernation, for more information see https://aka.ms/devbox/hibernate.
HibernateSupportEnabled *bool `pulumi:"hibernateSupportEnabled"`
// The ID of the image for the Dev Center Dev Box Definition.
ImageReferenceId *string `pulumi:"imageReferenceId"`
// The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the SKU for the Dev Center Dev Box Definition.
SkuName *string `pulumi:"skuName"`
// A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
Tags map[string]string `pulumi:"tags"`
}
type DevBoxDefinitionState struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringPtrInput
// Whether the Dev Boxes created with this definition are capable of hibernation. Defaults to `false`.
//
// > **Note:** Not all images are capable of supporting hibernation, for more information see https://aka.ms/devbox/hibernate.
HibernateSupportEnabled pulumi.BoolPtrInput
// The ID of the image for the Dev Center Dev Box Definition.
ImageReferenceId pulumi.StringPtrInput
// The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the SKU for the Dev Center Dev Box Definition.
SkuName pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
Tags pulumi.StringMapInput
}
func (DevBoxDefinitionState) ElementType() reflect.Type {
return reflect.TypeOf((*devBoxDefinitionState)(nil)).Elem()
}
type devBoxDefinitionArgs struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId string `pulumi:"devCenterId"`
// Whether the Dev Boxes created with this definition are capable of hibernation. Defaults to `false`.
//
// > **Note:** Not all images are capable of supporting hibernation, for more information see https://aka.ms/devbox/hibernate.
HibernateSupportEnabled *bool `pulumi:"hibernateSupportEnabled"`
// The ID of the image for the Dev Center Dev Box Definition.
ImageReferenceId string `pulumi:"imageReferenceId"`
// The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the SKU for the Dev Center Dev Box Definition.
SkuName string `pulumi:"skuName"`
// A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a DevBoxDefinition resource.
type DevBoxDefinitionArgs struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringInput
// Whether the Dev Boxes created with this definition are capable of hibernation. Defaults to `false`.
//
// > **Note:** Not all images are capable of supporting hibernation, for more information see https://aka.ms/devbox/hibernate.
HibernateSupportEnabled pulumi.BoolPtrInput
// The ID of the image for the Dev Center Dev Box Definition.
ImageReferenceId pulumi.StringInput
// The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the SKU for the Dev Center Dev Box Definition.
SkuName pulumi.StringInput
// A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
Tags pulumi.StringMapInput
}
func (DevBoxDefinitionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*devBoxDefinitionArgs)(nil)).Elem()
}
type DevBoxDefinitionInput interface {
pulumi.Input
ToDevBoxDefinitionOutput() DevBoxDefinitionOutput
ToDevBoxDefinitionOutputWithContext(ctx context.Context) DevBoxDefinitionOutput
}
func (*DevBoxDefinition) ElementType() reflect.Type {
return reflect.TypeOf((**DevBoxDefinition)(nil)).Elem()
}
func (i *DevBoxDefinition) ToDevBoxDefinitionOutput() DevBoxDefinitionOutput {
return i.ToDevBoxDefinitionOutputWithContext(context.Background())
}
func (i *DevBoxDefinition) ToDevBoxDefinitionOutputWithContext(ctx context.Context) DevBoxDefinitionOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevBoxDefinitionOutput)
}
// DevBoxDefinitionArrayInput is an input type that accepts DevBoxDefinitionArray and DevBoxDefinitionArrayOutput values.
// You can construct a concrete instance of `DevBoxDefinitionArrayInput` via:
//
// DevBoxDefinitionArray{ DevBoxDefinitionArgs{...} }
type DevBoxDefinitionArrayInput interface {
pulumi.Input
ToDevBoxDefinitionArrayOutput() DevBoxDefinitionArrayOutput
ToDevBoxDefinitionArrayOutputWithContext(context.Context) DevBoxDefinitionArrayOutput
}
type DevBoxDefinitionArray []DevBoxDefinitionInput
func (DevBoxDefinitionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DevBoxDefinition)(nil)).Elem()
}
func (i DevBoxDefinitionArray) ToDevBoxDefinitionArrayOutput() DevBoxDefinitionArrayOutput {
return i.ToDevBoxDefinitionArrayOutputWithContext(context.Background())
}
func (i DevBoxDefinitionArray) ToDevBoxDefinitionArrayOutputWithContext(ctx context.Context) DevBoxDefinitionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevBoxDefinitionArrayOutput)
}
// DevBoxDefinitionMapInput is an input type that accepts DevBoxDefinitionMap and DevBoxDefinitionMapOutput values.
// You can construct a concrete instance of `DevBoxDefinitionMapInput` via:
//
// DevBoxDefinitionMap{ "key": DevBoxDefinitionArgs{...} }
type DevBoxDefinitionMapInput interface {
pulumi.Input
ToDevBoxDefinitionMapOutput() DevBoxDefinitionMapOutput
ToDevBoxDefinitionMapOutputWithContext(context.Context) DevBoxDefinitionMapOutput
}
type DevBoxDefinitionMap map[string]DevBoxDefinitionInput
func (DevBoxDefinitionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DevBoxDefinition)(nil)).Elem()
}
func (i DevBoxDefinitionMap) ToDevBoxDefinitionMapOutput() DevBoxDefinitionMapOutput {
return i.ToDevBoxDefinitionMapOutputWithContext(context.Background())
}
func (i DevBoxDefinitionMap) ToDevBoxDefinitionMapOutputWithContext(ctx context.Context) DevBoxDefinitionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevBoxDefinitionMapOutput)
}
type DevBoxDefinitionOutput struct{ *pulumi.OutputState }
func (DevBoxDefinitionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DevBoxDefinition)(nil)).Elem()
}
func (o DevBoxDefinitionOutput) ToDevBoxDefinitionOutput() DevBoxDefinitionOutput {
return o
}
func (o DevBoxDefinitionOutput) ToDevBoxDefinitionOutputWithContext(ctx context.Context) DevBoxDefinitionOutput {
return o
}
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
func (o DevBoxDefinitionOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.StringOutput { return v.DevCenterId }).(pulumi.StringOutput)
}
// Whether the Dev Boxes created with this definition are capable of hibernation. Defaults to `false`.
//
// > **Note:** Not all images are capable of supporting hibernation, for more information see https://aka.ms/devbox/hibernate.
func (o DevBoxDefinitionOutput) HibernateSupportEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.BoolPtrOutput { return v.HibernateSupportEnabled }).(pulumi.BoolPtrOutput)
}
// The ID of the image for the Dev Center Dev Box Definition.
func (o DevBoxDefinitionOutput) ImageReferenceId() pulumi.StringOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.StringOutput { return v.ImageReferenceId }).(pulumi.StringOutput)
}
// The Azure Region where the Dev Center Dev Box Definition should exist. Changing this forces a new resource to be created.
func (o DevBoxDefinitionOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Dev Box Definition. Changing this forces a new resource to be created.
func (o DevBoxDefinitionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the SKU for the Dev Center Dev Box Definition.
func (o DevBoxDefinitionOutput) SkuName() pulumi.StringOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.StringOutput { return v.SkuName }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Dev Center Dev Box Definition.
func (o DevBoxDefinitionOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *DevBoxDefinition) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type DevBoxDefinitionArrayOutput struct{ *pulumi.OutputState }
func (DevBoxDefinitionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DevBoxDefinition)(nil)).Elem()
}
func (o DevBoxDefinitionArrayOutput) ToDevBoxDefinitionArrayOutput() DevBoxDefinitionArrayOutput {
return o
}
func (o DevBoxDefinitionArrayOutput) ToDevBoxDefinitionArrayOutputWithContext(ctx context.Context) DevBoxDefinitionArrayOutput {
return o
}
func (o DevBoxDefinitionArrayOutput) Index(i pulumi.IntInput) DevBoxDefinitionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DevBoxDefinition {
return vs[0].([]*DevBoxDefinition)[vs[1].(int)]
}).(DevBoxDefinitionOutput)
}
type DevBoxDefinitionMapOutput struct{ *pulumi.OutputState }
func (DevBoxDefinitionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DevBoxDefinition)(nil)).Elem()
}
func (o DevBoxDefinitionMapOutput) ToDevBoxDefinitionMapOutput() DevBoxDefinitionMapOutput {
return o
}
func (o DevBoxDefinitionMapOutput) ToDevBoxDefinitionMapOutputWithContext(ctx context.Context) DevBoxDefinitionMapOutput {
return o
}
func (o DevBoxDefinitionMapOutput) MapIndex(k pulumi.StringInput) DevBoxDefinitionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DevBoxDefinition {
return vs[0].(map[string]*DevBoxDefinition)[vs[1].(string)]
}).(DevBoxDefinitionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DevBoxDefinitionInput)(nil)).Elem(), &DevBoxDefinition{})
pulumi.RegisterInputType(reflect.TypeOf((*DevBoxDefinitionArrayInput)(nil)).Elem(), DevBoxDefinitionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DevBoxDefinitionMapInput)(nil)).Elem(), DevBoxDefinitionMap{})
pulumi.RegisterOutputType(DevBoxDefinitionOutput{})
pulumi.RegisterOutputType(DevBoxDefinitionArrayOutput{})
pulumi.RegisterOutputType(DevBoxDefinitionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/project.go | sdk/go/azure/devcenter/project.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Project.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// example, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Name: pulumi.String("example"),
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("example-value"),
// },
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewProject(ctx, "example", &devcenter.ProjectArgs{
// DevCenterId: example.ID(),
// Location: exampleResourceGroup.Location,
// Name: pulumi.String("example"),
// ResourceGroupName: exampleResourceGroup.Name,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Project can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/project:Project example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}
// ```
//
// * Where `{subscriptionId}` is the ID of the Azure Subscription where the Dev Center Project exists. For example `12345678-1234-9876-4563-123456789012`.
//
// * Where `{resourceGroupName}` is the name of Resource Group where this Dev Center Project exists. For example `example-resource-group`.
//
// * Where `{projectName}` is the name of the Project. For example `projectValue`.
type Project struct {
pulumi.CustomResourceState
// Description of the project. Changing this forces a new Dev Center Project to be created.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Resource Id of an associated DevCenter. Changing this forces a new Dev Center Project to be created.
DevCenterId pulumi.StringOutput `pulumi:"devCenterId"`
// The URI of the Dev Center resource this project is associated with.
DevCenterUri pulumi.StringOutput `pulumi:"devCenterUri"`
// An `identity` block as defined below.
Identity ProjectIdentityPtrOutput `pulumi:"identity"`
// The Azure Region where the Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
Location pulumi.StringOutput `pulumi:"location"`
// When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
MaximumDevBoxesPerUser pulumi.IntPtrOutput `pulumi:"maximumDevBoxesPerUser"`
// Specifies the name of this Dev Center Project. Changing this forces a new Dev Center Project to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the name of the Resource Group within which this Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Dev Center Project.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewProject registers a new resource with the given unique name, arguments, and options.
func NewProject(ctx *pulumi.Context,
name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevCenterId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Project
err := ctx.RegisterResource("azure:devcenter/project:Project", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProject gets an existing Project resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetProject(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error) {
var resource Project
err := ctx.ReadResource("azure:devcenter/project:Project", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Project resources.
type projectState struct {
// Description of the project. Changing this forces a new Dev Center Project to be created.
Description *string `pulumi:"description"`
// Resource Id of an associated DevCenter. Changing this forces a new Dev Center Project to be created.
DevCenterId *string `pulumi:"devCenterId"`
// The URI of the Dev Center resource this project is associated with.
DevCenterUri *string `pulumi:"devCenterUri"`
// An `identity` block as defined below.
Identity *ProjectIdentity `pulumi:"identity"`
// The Azure Region where the Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
Location *string `pulumi:"location"`
// When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
MaximumDevBoxesPerUser *int `pulumi:"maximumDevBoxesPerUser"`
// Specifies the name of this Dev Center Project. Changing this forces a new Dev Center Project to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group within which this Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Dev Center Project.
Tags map[string]string `pulumi:"tags"`
}
type ProjectState struct {
// Description of the project. Changing this forces a new Dev Center Project to be created.
Description pulumi.StringPtrInput
// Resource Id of an associated DevCenter. Changing this forces a new Dev Center Project to be created.
DevCenterId pulumi.StringPtrInput
// The URI of the Dev Center resource this project is associated with.
DevCenterUri pulumi.StringPtrInput
// An `identity` block as defined below.
Identity ProjectIdentityPtrInput
// The Azure Region where the Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
Location pulumi.StringPtrInput
// When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
MaximumDevBoxesPerUser pulumi.IntPtrInput
// Specifies the name of this Dev Center Project. Changing this forces a new Dev Center Project to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group within which this Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Dev Center Project.
Tags pulumi.StringMapInput
}
func (ProjectState) ElementType() reflect.Type {
return reflect.TypeOf((*projectState)(nil)).Elem()
}
type projectArgs struct {
// Description of the project. Changing this forces a new Dev Center Project to be created.
Description *string `pulumi:"description"`
// Resource Id of an associated DevCenter. Changing this forces a new Dev Center Project to be created.
DevCenterId string `pulumi:"devCenterId"`
// An `identity` block as defined below.
Identity *ProjectIdentity `pulumi:"identity"`
// The Azure Region where the Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
Location *string `pulumi:"location"`
// When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
MaximumDevBoxesPerUser *int `pulumi:"maximumDevBoxesPerUser"`
// Specifies the name of this Dev Center Project. Changing this forces a new Dev Center Project to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group within which this Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Dev Center Project.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Project resource.
type ProjectArgs struct {
// Description of the project. Changing this forces a new Dev Center Project to be created.
Description pulumi.StringPtrInput
// Resource Id of an associated DevCenter. Changing this forces a new Dev Center Project to be created.
DevCenterId pulumi.StringInput
// An `identity` block as defined below.
Identity ProjectIdentityPtrInput
// The Azure Region where the Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
Location pulumi.StringPtrInput
// When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
MaximumDevBoxesPerUser pulumi.IntPtrInput
// Specifies the name of this Dev Center Project. Changing this forces a new Dev Center Project to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group within which this Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags which should be assigned to the Dev Center Project.
Tags pulumi.StringMapInput
}
func (ProjectArgs) ElementType() reflect.Type {
return reflect.TypeOf((*projectArgs)(nil)).Elem()
}
type ProjectInput interface {
pulumi.Input
ToProjectOutput() ProjectOutput
ToProjectOutputWithContext(ctx context.Context) ProjectOutput
}
func (*Project) ElementType() reflect.Type {
return reflect.TypeOf((**Project)(nil)).Elem()
}
func (i *Project) ToProjectOutput() ProjectOutput {
return i.ToProjectOutputWithContext(context.Background())
}
func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectOutput)
}
// ProjectArrayInput is an input type that accepts ProjectArray and ProjectArrayOutput values.
// You can construct a concrete instance of `ProjectArrayInput` via:
//
// ProjectArray{ ProjectArgs{...} }
type ProjectArrayInput interface {
pulumi.Input
ToProjectArrayOutput() ProjectArrayOutput
ToProjectArrayOutputWithContext(context.Context) ProjectArrayOutput
}
type ProjectArray []ProjectInput
func (ProjectArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Project)(nil)).Elem()
}
func (i ProjectArray) ToProjectArrayOutput() ProjectArrayOutput {
return i.ToProjectArrayOutputWithContext(context.Background())
}
func (i ProjectArray) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectArrayOutput)
}
// ProjectMapInput is an input type that accepts ProjectMap and ProjectMapOutput values.
// You can construct a concrete instance of `ProjectMapInput` via:
//
// ProjectMap{ "key": ProjectArgs{...} }
type ProjectMapInput interface {
pulumi.Input
ToProjectMapOutput() ProjectMapOutput
ToProjectMapOutputWithContext(context.Context) ProjectMapOutput
}
type ProjectMap map[string]ProjectInput
func (ProjectMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Project)(nil)).Elem()
}
func (i ProjectMap) ToProjectMapOutput() ProjectMapOutput {
return i.ToProjectMapOutputWithContext(context.Background())
}
func (i ProjectMap) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectMapOutput)
}
type ProjectOutput struct{ *pulumi.OutputState }
func (ProjectOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Project)(nil)).Elem()
}
func (o ProjectOutput) ToProjectOutput() ProjectOutput {
return o
}
func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput {
return o
}
// Description of the project. Changing this forces a new Dev Center Project to be created.
func (o ProjectOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Project) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Resource Id of an associated DevCenter. Changing this forces a new Dev Center Project to be created.
func (o ProjectOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.DevCenterId }).(pulumi.StringOutput)
}
// The URI of the Dev Center resource this project is associated with.
func (o ProjectOutput) DevCenterUri() pulumi.StringOutput {
return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.DevCenterUri }).(pulumi.StringOutput)
}
// An `identity` block as defined below.
func (o ProjectOutput) Identity() ProjectIdentityPtrOutput {
return o.ApplyT(func(v *Project) ProjectIdentityPtrOutput { return v.Identity }).(ProjectIdentityPtrOutput)
}
// The Azure Region where the Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
func (o ProjectOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
func (o ProjectOutput) MaximumDevBoxesPerUser() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Project) pulumi.IntPtrOutput { return v.MaximumDevBoxesPerUser }).(pulumi.IntPtrOutput)
}
// Specifies the name of this Dev Center Project. Changing this forces a new Dev Center Project to be created.
func (o ProjectOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the name of the Resource Group within which this Dev Center Project should exist. Changing this forces a new Dev Center Project to be created.
func (o ProjectOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Dev Center Project.
func (o ProjectOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Project) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type ProjectArrayOutput struct{ *pulumi.OutputState }
func (ProjectArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Project)(nil)).Elem()
}
func (o ProjectArrayOutput) ToProjectArrayOutput() ProjectArrayOutput {
return o
}
func (o ProjectArrayOutput) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput {
return o
}
func (o ProjectArrayOutput) Index(i pulumi.IntInput) ProjectOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Project {
return vs[0].([]*Project)[vs[1].(int)]
}).(ProjectOutput)
}
type ProjectMapOutput struct{ *pulumi.OutputState }
func (ProjectMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Project)(nil)).Elem()
}
func (o ProjectMapOutput) ToProjectMapOutput() ProjectMapOutput {
return o
}
func (o ProjectMapOutput) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput {
return o
}
func (o ProjectMapOutput) MapIndex(k pulumi.StringInput) ProjectOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Project {
return vs[0].(map[string]*Project)[vs[1].(string)]
}).(ProjectOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProjectInput)(nil)).Elem(), &Project{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectArrayInput)(nil)).Elem(), ProjectArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ProjectMapInput)(nil)).Elem(), ProjectMap{})
pulumi.RegisterOutputType(ProjectOutput{})
pulumi.RegisterOutputType(ProjectArrayOutput{})
pulumi.RegisterOutputType(ProjectMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/attachedNetwork.go | sdk/go/azure/devcenter/attachedNetwork.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Dev Center Attached Network.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-dcan"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-vnet"),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// exampleDevCenter, err := devcenter.NewDevCenter(ctx, "example", &devcenter.DevCenterArgs{
// Name: pulumi.String("example-dc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Identity: &devcenter.DevCenterIdentityArgs{
// Type: pulumi.String("SystemAssigned"),
// },
// })
// if err != nil {
// return err
// }
// exampleNetworkConnection, err := devcenter.NewNetworkConnection(ctx, "example", &devcenter.NetworkConnectionArgs{
// Name: pulumi.String("example-dcnc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// DomainJoinType: pulumi.String("AzureADJoin"),
// SubnetId: exampleSubnet.ID(),
// })
// if err != nil {
// return err
// }
// _, err = devcenter.NewAttachedNetwork(ctx, "example", &devcenter.AttachedNetworkArgs{
// Name: pulumi.String("example-dcet"),
// DevCenterId: exampleDevCenter.ID(),
// NetworkConnectionId: exampleNetworkConnection.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
//
// ## Import
//
// An existing Dev Center Attached Network can be imported into Pulumi using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:devcenter/attachedNetwork:AttachedNetwork example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevCenter/devCenters/dc1/attachedNetworks/et1
// ```
type AttachedNetwork struct {
pulumi.CustomResourceState
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringOutput `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Attached Network. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the Dev Center Network Connection you want to attach. Changing this forces a new resource to be created.
NetworkConnectionId pulumi.StringOutput `pulumi:"networkConnectionId"`
}
// NewAttachedNetwork registers a new resource with the given unique name, arguments, and options.
func NewAttachedNetwork(ctx *pulumi.Context,
name string, args *AttachedNetworkArgs, opts ...pulumi.ResourceOption) (*AttachedNetwork, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DevCenterId == nil {
return nil, errors.New("invalid value for required argument 'DevCenterId'")
}
if args.NetworkConnectionId == nil {
return nil, errors.New("invalid value for required argument 'NetworkConnectionId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AttachedNetwork
err := ctx.RegisterResource("azure:devcenter/attachedNetwork:AttachedNetwork", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAttachedNetwork gets an existing AttachedNetwork resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetAttachedNetwork(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AttachedNetworkState, opts ...pulumi.ResourceOption) (*AttachedNetwork, error) {
var resource AttachedNetwork
err := ctx.ReadResource("azure:devcenter/attachedNetwork:AttachedNetwork", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AttachedNetwork resources.
type attachedNetworkState struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId *string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Attached Network. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The ID of the Dev Center Network Connection you want to attach. Changing this forces a new resource to be created.
NetworkConnectionId *string `pulumi:"networkConnectionId"`
}
type AttachedNetworkState struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringPtrInput
// Specifies the name of this Dev Center Attached Network. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The ID of the Dev Center Network Connection you want to attach. Changing this forces a new resource to be created.
NetworkConnectionId pulumi.StringPtrInput
}
func (AttachedNetworkState) ElementType() reflect.Type {
return reflect.TypeOf((*attachedNetworkState)(nil)).Elem()
}
type attachedNetworkArgs struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId string `pulumi:"devCenterId"`
// Specifies the name of this Dev Center Attached Network. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The ID of the Dev Center Network Connection you want to attach. Changing this forces a new resource to be created.
NetworkConnectionId string `pulumi:"networkConnectionId"`
}
// The set of arguments for constructing a AttachedNetwork resource.
type AttachedNetworkArgs struct {
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
DevCenterId pulumi.StringInput
// Specifies the name of this Dev Center Attached Network. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The ID of the Dev Center Network Connection you want to attach. Changing this forces a new resource to be created.
NetworkConnectionId pulumi.StringInput
}
func (AttachedNetworkArgs) ElementType() reflect.Type {
return reflect.TypeOf((*attachedNetworkArgs)(nil)).Elem()
}
type AttachedNetworkInput interface {
pulumi.Input
ToAttachedNetworkOutput() AttachedNetworkOutput
ToAttachedNetworkOutputWithContext(ctx context.Context) AttachedNetworkOutput
}
func (*AttachedNetwork) ElementType() reflect.Type {
return reflect.TypeOf((**AttachedNetwork)(nil)).Elem()
}
func (i *AttachedNetwork) ToAttachedNetworkOutput() AttachedNetworkOutput {
return i.ToAttachedNetworkOutputWithContext(context.Background())
}
func (i *AttachedNetwork) ToAttachedNetworkOutputWithContext(ctx context.Context) AttachedNetworkOutput {
return pulumi.ToOutputWithContext(ctx, i).(AttachedNetworkOutput)
}
// AttachedNetworkArrayInput is an input type that accepts AttachedNetworkArray and AttachedNetworkArrayOutput values.
// You can construct a concrete instance of `AttachedNetworkArrayInput` via:
//
// AttachedNetworkArray{ AttachedNetworkArgs{...} }
type AttachedNetworkArrayInput interface {
pulumi.Input
ToAttachedNetworkArrayOutput() AttachedNetworkArrayOutput
ToAttachedNetworkArrayOutputWithContext(context.Context) AttachedNetworkArrayOutput
}
type AttachedNetworkArray []AttachedNetworkInput
func (AttachedNetworkArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AttachedNetwork)(nil)).Elem()
}
func (i AttachedNetworkArray) ToAttachedNetworkArrayOutput() AttachedNetworkArrayOutput {
return i.ToAttachedNetworkArrayOutputWithContext(context.Background())
}
func (i AttachedNetworkArray) ToAttachedNetworkArrayOutputWithContext(ctx context.Context) AttachedNetworkArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AttachedNetworkArrayOutput)
}
// AttachedNetworkMapInput is an input type that accepts AttachedNetworkMap and AttachedNetworkMapOutput values.
// You can construct a concrete instance of `AttachedNetworkMapInput` via:
//
// AttachedNetworkMap{ "key": AttachedNetworkArgs{...} }
type AttachedNetworkMapInput interface {
pulumi.Input
ToAttachedNetworkMapOutput() AttachedNetworkMapOutput
ToAttachedNetworkMapOutputWithContext(context.Context) AttachedNetworkMapOutput
}
type AttachedNetworkMap map[string]AttachedNetworkInput
func (AttachedNetworkMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AttachedNetwork)(nil)).Elem()
}
func (i AttachedNetworkMap) ToAttachedNetworkMapOutput() AttachedNetworkMapOutput {
return i.ToAttachedNetworkMapOutputWithContext(context.Background())
}
func (i AttachedNetworkMap) ToAttachedNetworkMapOutputWithContext(ctx context.Context) AttachedNetworkMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AttachedNetworkMapOutput)
}
type AttachedNetworkOutput struct{ *pulumi.OutputState }
func (AttachedNetworkOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AttachedNetwork)(nil)).Elem()
}
func (o AttachedNetworkOutput) ToAttachedNetworkOutput() AttachedNetworkOutput {
return o
}
func (o AttachedNetworkOutput) ToAttachedNetworkOutputWithContext(ctx context.Context) AttachedNetworkOutput {
return o
}
// The ID of the associated Dev Center. Changing this forces a new resource to be created.
func (o AttachedNetworkOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v *AttachedNetwork) pulumi.StringOutput { return v.DevCenterId }).(pulumi.StringOutput)
}
// Specifies the name of this Dev Center Attached Network. Changing this forces a new resource to be created.
func (o AttachedNetworkOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AttachedNetwork) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the Dev Center Network Connection you want to attach. Changing this forces a new resource to be created.
func (o AttachedNetworkOutput) NetworkConnectionId() pulumi.StringOutput {
return o.ApplyT(func(v *AttachedNetwork) pulumi.StringOutput { return v.NetworkConnectionId }).(pulumi.StringOutput)
}
type AttachedNetworkArrayOutput struct{ *pulumi.OutputState }
func (AttachedNetworkArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AttachedNetwork)(nil)).Elem()
}
func (o AttachedNetworkArrayOutput) ToAttachedNetworkArrayOutput() AttachedNetworkArrayOutput {
return o
}
func (o AttachedNetworkArrayOutput) ToAttachedNetworkArrayOutputWithContext(ctx context.Context) AttachedNetworkArrayOutput {
return o
}
func (o AttachedNetworkArrayOutput) Index(i pulumi.IntInput) AttachedNetworkOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AttachedNetwork {
return vs[0].([]*AttachedNetwork)[vs[1].(int)]
}).(AttachedNetworkOutput)
}
type AttachedNetworkMapOutput struct{ *pulumi.OutputState }
func (AttachedNetworkMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AttachedNetwork)(nil)).Elem()
}
func (o AttachedNetworkMapOutput) ToAttachedNetworkMapOutput() AttachedNetworkMapOutput {
return o
}
func (o AttachedNetworkMapOutput) ToAttachedNetworkMapOutputWithContext(ctx context.Context) AttachedNetworkMapOutput {
return o
}
func (o AttachedNetworkMapOutput) MapIndex(k pulumi.StringInput) AttachedNetworkOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AttachedNetwork {
return vs[0].(map[string]*AttachedNetwork)[vs[1].(string)]
}).(AttachedNetworkOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AttachedNetworkInput)(nil)).Elem(), &AttachedNetwork{})
pulumi.RegisterInputType(reflect.TypeOf((*AttachedNetworkArrayInput)(nil)).Elem(), AttachedNetworkArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AttachedNetworkMapInput)(nil)).Elem(), AttachedNetworkMap{})
pulumi.RegisterOutputType(AttachedNetworkOutput{})
pulumi.RegisterOutputType(AttachedNetworkArrayOutput{})
pulumi.RegisterOutputType(AttachedNetworkMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/devcenter/getGallery.go | sdk/go/azure/devcenter/getGallery.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devcenter
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dev Center Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devcenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := devcenter.LookupGallery(ctx, &devcenter.LookupGalleryArgs{
// Name: exampleAzurermDevCenterGallery.Name,
// DevCenterId: exampleAzurermDevCenterGallery.DevCenterId,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DevCenter` - 2025-02-01
func LookupGallery(ctx *pulumi.Context, args *LookupGalleryArgs, opts ...pulumi.InvokeOption) (*LookupGalleryResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupGalleryResult
err := ctx.Invoke("azure:devcenter/getGallery:getGallery", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getGallery.
type LookupGalleryArgs struct {
// The ID of the Dev Center which contains the Dev Center Gallery.
DevCenterId string `pulumi:"devCenterId"`
// The name of this Dev Center Gallery.
Name string `pulumi:"name"`
}
// A collection of values returned by getGallery.
type LookupGalleryResult struct {
DevCenterId string `pulumi:"devCenterId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// The ID of the Shared Gallery connected to the Dev Center Gallery.
SharedGalleryId string `pulumi:"sharedGalleryId"`
}
func LookupGalleryOutput(ctx *pulumi.Context, args LookupGalleryOutputArgs, opts ...pulumi.InvokeOption) LookupGalleryResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupGalleryResultOutput, error) {
args := v.(LookupGalleryArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:devcenter/getGallery:getGallery", args, LookupGalleryResultOutput{}, options).(LookupGalleryResultOutput), nil
}).(LookupGalleryResultOutput)
}
// A collection of arguments for invoking getGallery.
type LookupGalleryOutputArgs struct {
// The ID of the Dev Center which contains the Dev Center Gallery.
DevCenterId pulumi.StringInput `pulumi:"devCenterId"`
// The name of this Dev Center Gallery.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupGalleryOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGalleryArgs)(nil)).Elem()
}
// A collection of values returned by getGallery.
type LookupGalleryResultOutput struct{ *pulumi.OutputState }
func (LookupGalleryResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGalleryResult)(nil)).Elem()
}
func (o LookupGalleryResultOutput) ToLookupGalleryResultOutput() LookupGalleryResultOutput {
return o
}
func (o LookupGalleryResultOutput) ToLookupGalleryResultOutputWithContext(ctx context.Context) LookupGalleryResultOutput {
return o
}
func (o LookupGalleryResultOutput) DevCenterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupGalleryResult) string { return v.DevCenterId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupGalleryResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupGalleryResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupGalleryResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupGalleryResult) string { return v.Name }).(pulumi.StringOutput)
}
// The ID of the Shared Gallery connected to the Dev Center Gallery.
func (o LookupGalleryResultOutput) SharedGalleryId() pulumi.StringOutput {
return o.ApplyT(func(v LookupGalleryResult) string { return v.SharedGalleryId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupGalleryResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/getSqlRoleDefinition.go | sdk/go/azure/cosmosdb/getSqlRoleDefinition.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Cosmos DB SQL Role Definition.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cosmosdb.LookupSqlRoleDefinition(ctx, &cosmosdb.LookupSqlRoleDefinitionArgs{
// ResourceGroupName: "tfex-cosmosdb-sql-role-definition-rg",
// AccountName: "tfex-cosmosdb-sql-role-definition-account-name",
// RoleDefinitionId: "00000000-0000-0000-0000-000000000000",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupSqlRoleDefinition(ctx *pulumi.Context, args *LookupSqlRoleDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupSqlRoleDefinitionResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSqlRoleDefinitionResult
err := ctx.Invoke("azure:cosmosdb/getSqlRoleDefinition:getSqlRoleDefinition", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSqlRoleDefinition.
type LookupSqlRoleDefinitionArgs struct {
// The name of the Cosmos DB Account.
AccountName string `pulumi:"accountName"`
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The GUID as the name of the Cosmos DB SQL Role Definition.
RoleDefinitionId string `pulumi:"roleDefinitionId"`
}
// A collection of values returned by getSqlRoleDefinition.
type LookupSqlRoleDefinitionResult struct {
AccountName string `pulumi:"accountName"`
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
AssignableScopes []string `pulumi:"assignableScopes"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The role name of the Cosmos DB SQL Role Definition.
Name string `pulumi:"name"`
// A `permissions` block as defined below.
Permissions []GetSqlRoleDefinitionPermission `pulumi:"permissions"`
ResourceGroupName string `pulumi:"resourceGroupName"`
RoleDefinitionId string `pulumi:"roleDefinitionId"`
// The type of the Cosmos DB SQL Role Definition.
Type string `pulumi:"type"`
}
func LookupSqlRoleDefinitionOutput(ctx *pulumi.Context, args LookupSqlRoleDefinitionOutputArgs, opts ...pulumi.InvokeOption) LookupSqlRoleDefinitionResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupSqlRoleDefinitionResultOutput, error) {
args := v.(LookupSqlRoleDefinitionArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:cosmosdb/getSqlRoleDefinition:getSqlRoleDefinition", args, LookupSqlRoleDefinitionResultOutput{}, options).(LookupSqlRoleDefinitionResultOutput), nil
}).(LookupSqlRoleDefinitionResultOutput)
}
// A collection of arguments for invoking getSqlRoleDefinition.
type LookupSqlRoleDefinitionOutputArgs struct {
// The name of the Cosmos DB Account.
AccountName pulumi.StringInput `pulumi:"accountName"`
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// The GUID as the name of the Cosmos DB SQL Role Definition.
RoleDefinitionId pulumi.StringInput `pulumi:"roleDefinitionId"`
}
func (LookupSqlRoleDefinitionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSqlRoleDefinitionArgs)(nil)).Elem()
}
// A collection of values returned by getSqlRoleDefinition.
type LookupSqlRoleDefinitionResultOutput struct{ *pulumi.OutputState }
func (LookupSqlRoleDefinitionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSqlRoleDefinitionResult)(nil)).Elem()
}
func (o LookupSqlRoleDefinitionResultOutput) ToLookupSqlRoleDefinitionResultOutput() LookupSqlRoleDefinitionResultOutput {
return o
}
func (o LookupSqlRoleDefinitionResultOutput) ToLookupSqlRoleDefinitionResultOutputWithContext(ctx context.Context) LookupSqlRoleDefinitionResultOutput {
return o
}
func (o LookupSqlRoleDefinitionResultOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) string { return v.AccountName }).(pulumi.StringOutput)
}
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
func (o LookupSqlRoleDefinitionResultOutput) AssignableScopes() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) []string { return v.AssignableScopes }).(pulumi.StringArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSqlRoleDefinitionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) string { return v.Id }).(pulumi.StringOutput)
}
// The role name of the Cosmos DB SQL Role Definition.
func (o LookupSqlRoleDefinitionResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) string { return v.Name }).(pulumi.StringOutput)
}
// A `permissions` block as defined below.
func (o LookupSqlRoleDefinitionResultOutput) Permissions() GetSqlRoleDefinitionPermissionArrayOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) []GetSqlRoleDefinitionPermission { return v.Permissions }).(GetSqlRoleDefinitionPermissionArrayOutput)
}
func (o LookupSqlRoleDefinitionResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o LookupSqlRoleDefinitionResultOutput) RoleDefinitionId() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) string { return v.RoleDefinitionId }).(pulumi.StringOutput)
}
// The type of the Cosmos DB SQL Role Definition.
func (o LookupSqlRoleDefinitionResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlRoleDefinitionResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSqlRoleDefinitionResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/init.go | sdk/go/azure/cosmosdb/init.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"fmt"
"github.com/blang/semver"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type module struct {
version semver.Version
}
func (m *module) Version() semver.Version {
return m.version
}
func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) {
switch typ {
case "azure:cosmosdb/account:Account":
r = &Account{}
case "azure:cosmosdb/cassandraCluster:CassandraCluster":
r = &CassandraCluster{}
case "azure:cosmosdb/cassandraDatacenter:CassandraDatacenter":
r = &CassandraDatacenter{}
case "azure:cosmosdb/cassandraKeyspace:CassandraKeyspace":
r = &CassandraKeyspace{}
case "azure:cosmosdb/cassandraTable:CassandraTable":
r = &CassandraTable{}
case "azure:cosmosdb/gremlinDatabase:GremlinDatabase":
r = &GremlinDatabase{}
case "azure:cosmosdb/gremlinGraph:GremlinGraph":
r = &GremlinGraph{}
case "azure:cosmosdb/mongoCluster:MongoCluster":
r = &MongoCluster{}
case "azure:cosmosdb/mongoCollection:MongoCollection":
r = &MongoCollection{}
case "azure:cosmosdb/mongoDatabase:MongoDatabase":
r = &MongoDatabase{}
case "azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition":
r = &MongoRoleDefinition{}
case "azure:cosmosdb/mongoUserDefinition:MongoUserDefinition":
r = &MongoUserDefinition{}
case "azure:cosmosdb/postgresqlCluster:PostgresqlCluster":
r = &PostgresqlCluster{}
case "azure:cosmosdb/postgresqlCoordinatorConfiguration:PostgresqlCoordinatorConfiguration":
r = &PostgresqlCoordinatorConfiguration{}
case "azure:cosmosdb/postgresqlFirewallRule:PostgresqlFirewallRule":
r = &PostgresqlFirewallRule{}
case "azure:cosmosdb/postgresqlNodeConfiguration:PostgresqlNodeConfiguration":
r = &PostgresqlNodeConfiguration{}
case "azure:cosmosdb/postgresqlRole:PostgresqlRole":
r = &PostgresqlRole{}
case "azure:cosmosdb/sqlContainer:SqlContainer":
r = &SqlContainer{}
case "azure:cosmosdb/sqlDatabase:SqlDatabase":
r = &SqlDatabase{}
case "azure:cosmosdb/sqlDedicatedGateway:SqlDedicatedGateway":
r = &SqlDedicatedGateway{}
case "azure:cosmosdb/sqlFunction:SqlFunction":
r = &SqlFunction{}
case "azure:cosmosdb/sqlRoleAssignment:SqlRoleAssignment":
r = &SqlRoleAssignment{}
case "azure:cosmosdb/sqlRoleDefinition:SqlRoleDefinition":
r = &SqlRoleDefinition{}
case "azure:cosmosdb/sqlStoredProcedure:SqlStoredProcedure":
r = &SqlStoredProcedure{}
case "azure:cosmosdb/sqlTrigger:SqlTrigger":
r = &SqlTrigger{}
case "azure:cosmosdb/table:Table":
r = &Table{}
default:
return nil, fmt.Errorf("unknown resource type: %s", typ)
}
err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn))
return
}
func init() {
version, err := internal.PkgVersion()
if err != nil {
version = semver.Version{Major: 1}
}
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/account",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/cassandraCluster",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/cassandraDatacenter",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/cassandraKeyspace",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/cassandraTable",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/gremlinDatabase",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/gremlinGraph",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/mongoCluster",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/mongoCollection",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/mongoDatabase",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/mongoRoleDefinition",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/mongoUserDefinition",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/postgresqlCluster",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/postgresqlCoordinatorConfiguration",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/postgresqlFirewallRule",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/postgresqlNodeConfiguration",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/postgresqlRole",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlContainer",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlDatabase",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlDedicatedGateway",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlFunction",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlRoleAssignment",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlRoleDefinition",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlStoredProcedure",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/sqlTrigger",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"cosmosdb/table",
&module{version},
)
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/pulumiTypes.go | sdk/go/azure/cosmosdb/pulumiTypes.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
var _ = internal.GetEnvOrDefault
type AccountAnalyticalStorage struct {
// The schema type of the Analytical Storage for this Cosmos DB account. Possible values are `FullFidelity` and `WellDefined`.
SchemaType string `pulumi:"schemaType"`
}
// AccountAnalyticalStorageInput is an input type that accepts AccountAnalyticalStorageArgs and AccountAnalyticalStorageOutput values.
// You can construct a concrete instance of `AccountAnalyticalStorageInput` via:
//
// AccountAnalyticalStorageArgs{...}
type AccountAnalyticalStorageInput interface {
pulumi.Input
ToAccountAnalyticalStorageOutput() AccountAnalyticalStorageOutput
ToAccountAnalyticalStorageOutputWithContext(context.Context) AccountAnalyticalStorageOutput
}
type AccountAnalyticalStorageArgs struct {
// The schema type of the Analytical Storage for this Cosmos DB account. Possible values are `FullFidelity` and `WellDefined`.
SchemaType pulumi.StringInput `pulumi:"schemaType"`
}
func (AccountAnalyticalStorageArgs) ElementType() reflect.Type {
return reflect.TypeOf((*AccountAnalyticalStorage)(nil)).Elem()
}
func (i AccountAnalyticalStorageArgs) ToAccountAnalyticalStorageOutput() AccountAnalyticalStorageOutput {
return i.ToAccountAnalyticalStorageOutputWithContext(context.Background())
}
func (i AccountAnalyticalStorageArgs) ToAccountAnalyticalStorageOutputWithContext(ctx context.Context) AccountAnalyticalStorageOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountAnalyticalStorageOutput)
}
func (i AccountAnalyticalStorageArgs) ToAccountAnalyticalStoragePtrOutput() AccountAnalyticalStoragePtrOutput {
return i.ToAccountAnalyticalStoragePtrOutputWithContext(context.Background())
}
func (i AccountAnalyticalStorageArgs) ToAccountAnalyticalStoragePtrOutputWithContext(ctx context.Context) AccountAnalyticalStoragePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountAnalyticalStorageOutput).ToAccountAnalyticalStoragePtrOutputWithContext(ctx)
}
// AccountAnalyticalStoragePtrInput is an input type that accepts AccountAnalyticalStorageArgs, AccountAnalyticalStoragePtr and AccountAnalyticalStoragePtrOutput values.
// You can construct a concrete instance of `AccountAnalyticalStoragePtrInput` via:
//
// AccountAnalyticalStorageArgs{...}
//
// or:
//
// nil
type AccountAnalyticalStoragePtrInput interface {
pulumi.Input
ToAccountAnalyticalStoragePtrOutput() AccountAnalyticalStoragePtrOutput
ToAccountAnalyticalStoragePtrOutputWithContext(context.Context) AccountAnalyticalStoragePtrOutput
}
type accountAnalyticalStoragePtrType AccountAnalyticalStorageArgs
func AccountAnalyticalStoragePtr(v *AccountAnalyticalStorageArgs) AccountAnalyticalStoragePtrInput {
return (*accountAnalyticalStoragePtrType)(v)
}
func (*accountAnalyticalStoragePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AccountAnalyticalStorage)(nil)).Elem()
}
func (i *accountAnalyticalStoragePtrType) ToAccountAnalyticalStoragePtrOutput() AccountAnalyticalStoragePtrOutput {
return i.ToAccountAnalyticalStoragePtrOutputWithContext(context.Background())
}
func (i *accountAnalyticalStoragePtrType) ToAccountAnalyticalStoragePtrOutputWithContext(ctx context.Context) AccountAnalyticalStoragePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountAnalyticalStoragePtrOutput)
}
type AccountAnalyticalStorageOutput struct{ *pulumi.OutputState }
func (AccountAnalyticalStorageOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccountAnalyticalStorage)(nil)).Elem()
}
func (o AccountAnalyticalStorageOutput) ToAccountAnalyticalStorageOutput() AccountAnalyticalStorageOutput {
return o
}
func (o AccountAnalyticalStorageOutput) ToAccountAnalyticalStorageOutputWithContext(ctx context.Context) AccountAnalyticalStorageOutput {
return o
}
func (o AccountAnalyticalStorageOutput) ToAccountAnalyticalStoragePtrOutput() AccountAnalyticalStoragePtrOutput {
return o.ToAccountAnalyticalStoragePtrOutputWithContext(context.Background())
}
func (o AccountAnalyticalStorageOutput) ToAccountAnalyticalStoragePtrOutputWithContext(ctx context.Context) AccountAnalyticalStoragePtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v AccountAnalyticalStorage) *AccountAnalyticalStorage {
return &v
}).(AccountAnalyticalStoragePtrOutput)
}
// The schema type of the Analytical Storage for this Cosmos DB account. Possible values are `FullFidelity` and `WellDefined`.
func (o AccountAnalyticalStorageOutput) SchemaType() pulumi.StringOutput {
return o.ApplyT(func(v AccountAnalyticalStorage) string { return v.SchemaType }).(pulumi.StringOutput)
}
type AccountAnalyticalStoragePtrOutput struct{ *pulumi.OutputState }
func (AccountAnalyticalStoragePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccountAnalyticalStorage)(nil)).Elem()
}
func (o AccountAnalyticalStoragePtrOutput) ToAccountAnalyticalStoragePtrOutput() AccountAnalyticalStoragePtrOutput {
return o
}
func (o AccountAnalyticalStoragePtrOutput) ToAccountAnalyticalStoragePtrOutputWithContext(ctx context.Context) AccountAnalyticalStoragePtrOutput {
return o
}
func (o AccountAnalyticalStoragePtrOutput) Elem() AccountAnalyticalStorageOutput {
return o.ApplyT(func(v *AccountAnalyticalStorage) AccountAnalyticalStorage {
if v != nil {
return *v
}
var ret AccountAnalyticalStorage
return ret
}).(AccountAnalyticalStorageOutput)
}
// The schema type of the Analytical Storage for this Cosmos DB account. Possible values are `FullFidelity` and `WellDefined`.
func (o AccountAnalyticalStoragePtrOutput) SchemaType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AccountAnalyticalStorage) *string {
if v == nil {
return nil
}
return &v.SchemaType
}).(pulumi.StringPtrOutput)
}
type AccountBackup struct {
// The interval in minutes between two backups. Possible values are between 60 and 1440. Defaults to `240`.
IntervalInMinutes *int `pulumi:"intervalInMinutes"`
// The time in hours that each backup is retained. Possible values are between 8 and 720. Defaults to `8`.
RetentionInHours *int `pulumi:"retentionInHours"`
// The storage redundancy is used to indicate the type of backup residency. Possible values are `Geo`, `Local` and `Zone`. Defaults to `Geo`.
//
// > **Note:** You can only configure `intervalInMinutes`, `retentionInHours` and `storageRedundancy` when the `type` field is set to `Periodic`.
StorageRedundancy *string `pulumi:"storageRedundancy"`
// The continuous backup tier. Possible values are `Continuous7Days` and `Continuous30Days`.
Tier *string `pulumi:"tier"`
// The type of the `backup`. Possible values are `Continuous` and `Periodic`.
//
// > **Note:** Migration of `Periodic` to `Continuous` is one-way, changing `Continuous` to `Periodic` forces a new resource to be created.
Type string `pulumi:"type"`
}
// AccountBackupInput is an input type that accepts AccountBackupArgs and AccountBackupOutput values.
// You can construct a concrete instance of `AccountBackupInput` via:
//
// AccountBackupArgs{...}
type AccountBackupInput interface {
pulumi.Input
ToAccountBackupOutput() AccountBackupOutput
ToAccountBackupOutputWithContext(context.Context) AccountBackupOutput
}
type AccountBackupArgs struct {
// The interval in minutes between two backups. Possible values are between 60 and 1440. Defaults to `240`.
IntervalInMinutes pulumi.IntPtrInput `pulumi:"intervalInMinutes"`
// The time in hours that each backup is retained. Possible values are between 8 and 720. Defaults to `8`.
RetentionInHours pulumi.IntPtrInput `pulumi:"retentionInHours"`
// The storage redundancy is used to indicate the type of backup residency. Possible values are `Geo`, `Local` and `Zone`. Defaults to `Geo`.
//
// > **Note:** You can only configure `intervalInMinutes`, `retentionInHours` and `storageRedundancy` when the `type` field is set to `Periodic`.
StorageRedundancy pulumi.StringPtrInput `pulumi:"storageRedundancy"`
// The continuous backup tier. Possible values are `Continuous7Days` and `Continuous30Days`.
Tier pulumi.StringPtrInput `pulumi:"tier"`
// The type of the `backup`. Possible values are `Continuous` and `Periodic`.
//
// > **Note:** Migration of `Periodic` to `Continuous` is one-way, changing `Continuous` to `Periodic` forces a new resource to be created.
Type pulumi.StringInput `pulumi:"type"`
}
func (AccountBackupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*AccountBackup)(nil)).Elem()
}
func (i AccountBackupArgs) ToAccountBackupOutput() AccountBackupOutput {
return i.ToAccountBackupOutputWithContext(context.Background())
}
func (i AccountBackupArgs) ToAccountBackupOutputWithContext(ctx context.Context) AccountBackupOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountBackupOutput)
}
func (i AccountBackupArgs) ToAccountBackupPtrOutput() AccountBackupPtrOutput {
return i.ToAccountBackupPtrOutputWithContext(context.Background())
}
func (i AccountBackupArgs) ToAccountBackupPtrOutputWithContext(ctx context.Context) AccountBackupPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountBackupOutput).ToAccountBackupPtrOutputWithContext(ctx)
}
// AccountBackupPtrInput is an input type that accepts AccountBackupArgs, AccountBackupPtr and AccountBackupPtrOutput values.
// You can construct a concrete instance of `AccountBackupPtrInput` via:
//
// AccountBackupArgs{...}
//
// or:
//
// nil
type AccountBackupPtrInput interface {
pulumi.Input
ToAccountBackupPtrOutput() AccountBackupPtrOutput
ToAccountBackupPtrOutputWithContext(context.Context) AccountBackupPtrOutput
}
type accountBackupPtrType AccountBackupArgs
func AccountBackupPtr(v *AccountBackupArgs) AccountBackupPtrInput {
return (*accountBackupPtrType)(v)
}
func (*accountBackupPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AccountBackup)(nil)).Elem()
}
func (i *accountBackupPtrType) ToAccountBackupPtrOutput() AccountBackupPtrOutput {
return i.ToAccountBackupPtrOutputWithContext(context.Background())
}
func (i *accountBackupPtrType) ToAccountBackupPtrOutputWithContext(ctx context.Context) AccountBackupPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountBackupPtrOutput)
}
type AccountBackupOutput struct{ *pulumi.OutputState }
func (AccountBackupOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccountBackup)(nil)).Elem()
}
func (o AccountBackupOutput) ToAccountBackupOutput() AccountBackupOutput {
return o
}
func (o AccountBackupOutput) ToAccountBackupOutputWithContext(ctx context.Context) AccountBackupOutput {
return o
}
func (o AccountBackupOutput) ToAccountBackupPtrOutput() AccountBackupPtrOutput {
return o.ToAccountBackupPtrOutputWithContext(context.Background())
}
func (o AccountBackupOutput) ToAccountBackupPtrOutputWithContext(ctx context.Context) AccountBackupPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v AccountBackup) *AccountBackup {
return &v
}).(AccountBackupPtrOutput)
}
// The interval in minutes between two backups. Possible values are between 60 and 1440. Defaults to `240`.
func (o AccountBackupOutput) IntervalInMinutes() pulumi.IntPtrOutput {
return o.ApplyT(func(v AccountBackup) *int { return v.IntervalInMinutes }).(pulumi.IntPtrOutput)
}
// The time in hours that each backup is retained. Possible values are between 8 and 720. Defaults to `8`.
func (o AccountBackupOutput) RetentionInHours() pulumi.IntPtrOutput {
return o.ApplyT(func(v AccountBackup) *int { return v.RetentionInHours }).(pulumi.IntPtrOutput)
}
// The storage redundancy is used to indicate the type of backup residency. Possible values are `Geo`, `Local` and `Zone`. Defaults to `Geo`.
//
// > **Note:** You can only configure `intervalInMinutes`, `retentionInHours` and `storageRedundancy` when the `type` field is set to `Periodic`.
func (o AccountBackupOutput) StorageRedundancy() pulumi.StringPtrOutput {
return o.ApplyT(func(v AccountBackup) *string { return v.StorageRedundancy }).(pulumi.StringPtrOutput)
}
// The continuous backup tier. Possible values are `Continuous7Days` and `Continuous30Days`.
func (o AccountBackupOutput) Tier() pulumi.StringPtrOutput {
return o.ApplyT(func(v AccountBackup) *string { return v.Tier }).(pulumi.StringPtrOutput)
}
// The type of the `backup`. Possible values are `Continuous` and `Periodic`.
//
// > **Note:** Migration of `Periodic` to `Continuous` is one-way, changing `Continuous` to `Periodic` forces a new resource to be created.
func (o AccountBackupOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v AccountBackup) string { return v.Type }).(pulumi.StringOutput)
}
type AccountBackupPtrOutput struct{ *pulumi.OutputState }
func (AccountBackupPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccountBackup)(nil)).Elem()
}
func (o AccountBackupPtrOutput) ToAccountBackupPtrOutput() AccountBackupPtrOutput {
return o
}
func (o AccountBackupPtrOutput) ToAccountBackupPtrOutputWithContext(ctx context.Context) AccountBackupPtrOutput {
return o
}
func (o AccountBackupPtrOutput) Elem() AccountBackupOutput {
return o.ApplyT(func(v *AccountBackup) AccountBackup {
if v != nil {
return *v
}
var ret AccountBackup
return ret
}).(AccountBackupOutput)
}
// The interval in minutes between two backups. Possible values are between 60 and 1440. Defaults to `240`.
func (o AccountBackupPtrOutput) IntervalInMinutes() pulumi.IntPtrOutput {
return o.ApplyT(func(v *AccountBackup) *int {
if v == nil {
return nil
}
return v.IntervalInMinutes
}).(pulumi.IntPtrOutput)
}
// The time in hours that each backup is retained. Possible values are between 8 and 720. Defaults to `8`.
func (o AccountBackupPtrOutput) RetentionInHours() pulumi.IntPtrOutput {
return o.ApplyT(func(v *AccountBackup) *int {
if v == nil {
return nil
}
return v.RetentionInHours
}).(pulumi.IntPtrOutput)
}
// The storage redundancy is used to indicate the type of backup residency. Possible values are `Geo`, `Local` and `Zone`. Defaults to `Geo`.
//
// > **Note:** You can only configure `intervalInMinutes`, `retentionInHours` and `storageRedundancy` when the `type` field is set to `Periodic`.
func (o AccountBackupPtrOutput) StorageRedundancy() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AccountBackup) *string {
if v == nil {
return nil
}
return v.StorageRedundancy
}).(pulumi.StringPtrOutput)
}
// The continuous backup tier. Possible values are `Continuous7Days` and `Continuous30Days`.
func (o AccountBackupPtrOutput) Tier() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AccountBackup) *string {
if v == nil {
return nil
}
return v.Tier
}).(pulumi.StringPtrOutput)
}
// The type of the `backup`. Possible values are `Continuous` and `Periodic`.
//
// > **Note:** Migration of `Periodic` to `Continuous` is one-way, changing `Continuous` to `Periodic` forces a new resource to be created.
func (o AccountBackupPtrOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AccountBackup) *string {
if v == nil {
return nil
}
return &v.Type
}).(pulumi.StringPtrOutput)
}
type AccountCapability struct {
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name string `pulumi:"name"`
}
// AccountCapabilityInput is an input type that accepts AccountCapabilityArgs and AccountCapabilityOutput values.
// You can construct a concrete instance of `AccountCapabilityInput` via:
//
// AccountCapabilityArgs{...}
type AccountCapabilityInput interface {
pulumi.Input
ToAccountCapabilityOutput() AccountCapabilityOutput
ToAccountCapabilityOutputWithContext(context.Context) AccountCapabilityOutput
}
type AccountCapabilityArgs struct {
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name pulumi.StringInput `pulumi:"name"`
}
func (AccountCapabilityArgs) ElementType() reflect.Type {
return reflect.TypeOf((*AccountCapability)(nil)).Elem()
}
func (i AccountCapabilityArgs) ToAccountCapabilityOutput() AccountCapabilityOutput {
return i.ToAccountCapabilityOutputWithContext(context.Background())
}
func (i AccountCapabilityArgs) ToAccountCapabilityOutputWithContext(ctx context.Context) AccountCapabilityOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountCapabilityOutput)
}
// AccountCapabilityArrayInput is an input type that accepts AccountCapabilityArray and AccountCapabilityArrayOutput values.
// You can construct a concrete instance of `AccountCapabilityArrayInput` via:
//
// AccountCapabilityArray{ AccountCapabilityArgs{...} }
type AccountCapabilityArrayInput interface {
pulumi.Input
ToAccountCapabilityArrayOutput() AccountCapabilityArrayOutput
ToAccountCapabilityArrayOutputWithContext(context.Context) AccountCapabilityArrayOutput
}
type AccountCapabilityArray []AccountCapabilityInput
func (AccountCapabilityArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]AccountCapability)(nil)).Elem()
}
func (i AccountCapabilityArray) ToAccountCapabilityArrayOutput() AccountCapabilityArrayOutput {
return i.ToAccountCapabilityArrayOutputWithContext(context.Background())
}
func (i AccountCapabilityArray) ToAccountCapabilityArrayOutputWithContext(ctx context.Context) AccountCapabilityArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountCapabilityArrayOutput)
}
type AccountCapabilityOutput struct{ *pulumi.OutputState }
func (AccountCapabilityOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccountCapability)(nil)).Elem()
}
func (o AccountCapabilityOutput) ToAccountCapabilityOutput() AccountCapabilityOutput {
return o
}
func (o AccountCapabilityOutput) ToAccountCapabilityOutputWithContext(ctx context.Context) AccountCapabilityOutput {
return o
}
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
func (o AccountCapabilityOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v AccountCapability) string { return v.Name }).(pulumi.StringOutput)
}
type AccountCapabilityArrayOutput struct{ *pulumi.OutputState }
func (AccountCapabilityArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]AccountCapability)(nil)).Elem()
}
func (o AccountCapabilityArrayOutput) ToAccountCapabilityArrayOutput() AccountCapabilityArrayOutput {
return o
}
func (o AccountCapabilityArrayOutput) ToAccountCapabilityArrayOutputWithContext(ctx context.Context) AccountCapabilityArrayOutput {
return o
}
func (o AccountCapabilityArrayOutput) Index(i pulumi.IntInput) AccountCapabilityOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) AccountCapability {
return vs[0].([]AccountCapability)[vs[1].(int)]
}).(AccountCapabilityOutput)
}
type AccountCapacity struct {
// The total throughput limit imposed on this Cosmos DB account (RU/s). Possible values are at least `-1`. `-1` means no limit.
TotalThroughputLimit int `pulumi:"totalThroughputLimit"`
}
// AccountCapacityInput is an input type that accepts AccountCapacityArgs and AccountCapacityOutput values.
// You can construct a concrete instance of `AccountCapacityInput` via:
//
// AccountCapacityArgs{...}
type AccountCapacityInput interface {
pulumi.Input
ToAccountCapacityOutput() AccountCapacityOutput
ToAccountCapacityOutputWithContext(context.Context) AccountCapacityOutput
}
type AccountCapacityArgs struct {
// The total throughput limit imposed on this Cosmos DB account (RU/s). Possible values are at least `-1`. `-1` means no limit.
TotalThroughputLimit pulumi.IntInput `pulumi:"totalThroughputLimit"`
}
func (AccountCapacityArgs) ElementType() reflect.Type {
return reflect.TypeOf((*AccountCapacity)(nil)).Elem()
}
func (i AccountCapacityArgs) ToAccountCapacityOutput() AccountCapacityOutput {
return i.ToAccountCapacityOutputWithContext(context.Background())
}
func (i AccountCapacityArgs) ToAccountCapacityOutputWithContext(ctx context.Context) AccountCapacityOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountCapacityOutput)
}
func (i AccountCapacityArgs) ToAccountCapacityPtrOutput() AccountCapacityPtrOutput {
return i.ToAccountCapacityPtrOutputWithContext(context.Background())
}
func (i AccountCapacityArgs) ToAccountCapacityPtrOutputWithContext(ctx context.Context) AccountCapacityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountCapacityOutput).ToAccountCapacityPtrOutputWithContext(ctx)
}
// AccountCapacityPtrInput is an input type that accepts AccountCapacityArgs, AccountCapacityPtr and AccountCapacityPtrOutput values.
// You can construct a concrete instance of `AccountCapacityPtrInput` via:
//
// AccountCapacityArgs{...}
//
// or:
//
// nil
type AccountCapacityPtrInput interface {
pulumi.Input
ToAccountCapacityPtrOutput() AccountCapacityPtrOutput
ToAccountCapacityPtrOutputWithContext(context.Context) AccountCapacityPtrOutput
}
type accountCapacityPtrType AccountCapacityArgs
func AccountCapacityPtr(v *AccountCapacityArgs) AccountCapacityPtrInput {
return (*accountCapacityPtrType)(v)
}
func (*accountCapacityPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AccountCapacity)(nil)).Elem()
}
func (i *accountCapacityPtrType) ToAccountCapacityPtrOutput() AccountCapacityPtrOutput {
return i.ToAccountCapacityPtrOutputWithContext(context.Background())
}
func (i *accountCapacityPtrType) ToAccountCapacityPtrOutputWithContext(ctx context.Context) AccountCapacityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountCapacityPtrOutput)
}
type AccountCapacityOutput struct{ *pulumi.OutputState }
func (AccountCapacityOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccountCapacity)(nil)).Elem()
}
func (o AccountCapacityOutput) ToAccountCapacityOutput() AccountCapacityOutput {
return o
}
func (o AccountCapacityOutput) ToAccountCapacityOutputWithContext(ctx context.Context) AccountCapacityOutput {
return o
}
func (o AccountCapacityOutput) ToAccountCapacityPtrOutput() AccountCapacityPtrOutput {
return o.ToAccountCapacityPtrOutputWithContext(context.Background())
}
func (o AccountCapacityOutput) ToAccountCapacityPtrOutputWithContext(ctx context.Context) AccountCapacityPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v AccountCapacity) *AccountCapacity {
return &v
}).(AccountCapacityPtrOutput)
}
// The total throughput limit imposed on this Cosmos DB account (RU/s). Possible values are at least `-1`. `-1` means no limit.
func (o AccountCapacityOutput) TotalThroughputLimit() pulumi.IntOutput {
return o.ApplyT(func(v AccountCapacity) int { return v.TotalThroughputLimit }).(pulumi.IntOutput)
}
type AccountCapacityPtrOutput struct{ *pulumi.OutputState }
func (AccountCapacityPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccountCapacity)(nil)).Elem()
}
func (o AccountCapacityPtrOutput) ToAccountCapacityPtrOutput() AccountCapacityPtrOutput {
return o
}
func (o AccountCapacityPtrOutput) ToAccountCapacityPtrOutputWithContext(ctx context.Context) AccountCapacityPtrOutput {
return o
}
func (o AccountCapacityPtrOutput) Elem() AccountCapacityOutput {
return o.ApplyT(func(v *AccountCapacity) AccountCapacity {
if v != nil {
return *v
}
var ret AccountCapacity
return ret
}).(AccountCapacityOutput)
}
// The total throughput limit imposed on this Cosmos DB account (RU/s). Possible values are at least `-1`. `-1` means no limit.
func (o AccountCapacityPtrOutput) TotalThroughputLimit() pulumi.IntPtrOutput {
return o.ApplyT(func(v *AccountCapacity) *int {
if v == nil {
return nil
}
return &v.TotalThroughputLimit
}).(pulumi.IntPtrOutput)
}
type AccountConsistencyPolicy struct {
// The Consistency Level to use for this CosmosDB Account - can be either `BoundedStaleness`, `Eventual`, `Session`, `Strong` or `ConsistentPrefix`.
ConsistencyLevel string `pulumi:"consistencyLevel"`
// When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. The accepted range for this value is `5` - `86400` (1 day). Defaults to `5`. Required when `consistencyLevel` is set to `BoundedStaleness`.
MaxIntervalInSeconds *int `pulumi:"maxIntervalInSeconds"`
// When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. The accepted range for this value is `10` – `2147483647`. Defaults to `100`. Required when `consistencyLevel` is set to `BoundedStaleness`.
//
// > **Note:** `maxIntervalInSeconds` and `maxStalenessPrefix` can only be set to values other than default when the `consistencyLevel` is set to `BoundedStaleness`.
MaxStalenessPrefix *int `pulumi:"maxStalenessPrefix"`
}
// AccountConsistencyPolicyInput is an input type that accepts AccountConsistencyPolicyArgs and AccountConsistencyPolicyOutput values.
// You can construct a concrete instance of `AccountConsistencyPolicyInput` via:
//
// AccountConsistencyPolicyArgs{...}
type AccountConsistencyPolicyInput interface {
pulumi.Input
ToAccountConsistencyPolicyOutput() AccountConsistencyPolicyOutput
ToAccountConsistencyPolicyOutputWithContext(context.Context) AccountConsistencyPolicyOutput
}
type AccountConsistencyPolicyArgs struct {
// The Consistency Level to use for this CosmosDB Account - can be either `BoundedStaleness`, `Eventual`, `Session`, `Strong` or `ConsistentPrefix`.
ConsistencyLevel pulumi.StringInput `pulumi:"consistencyLevel"`
// When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. The accepted range for this value is `5` - `86400` (1 day). Defaults to `5`. Required when `consistencyLevel` is set to `BoundedStaleness`.
MaxIntervalInSeconds pulumi.IntPtrInput `pulumi:"maxIntervalInSeconds"`
// When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. The accepted range for this value is `10` – `2147483647`. Defaults to `100`. Required when `consistencyLevel` is set to `BoundedStaleness`.
//
// > **Note:** `maxIntervalInSeconds` and `maxStalenessPrefix` can only be set to values other than default when the `consistencyLevel` is set to `BoundedStaleness`.
MaxStalenessPrefix pulumi.IntPtrInput `pulumi:"maxStalenessPrefix"`
}
func (AccountConsistencyPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*AccountConsistencyPolicy)(nil)).Elem()
}
func (i AccountConsistencyPolicyArgs) ToAccountConsistencyPolicyOutput() AccountConsistencyPolicyOutput {
return i.ToAccountConsistencyPolicyOutputWithContext(context.Background())
}
func (i AccountConsistencyPolicyArgs) ToAccountConsistencyPolicyOutputWithContext(ctx context.Context) AccountConsistencyPolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountConsistencyPolicyOutput)
}
func (i AccountConsistencyPolicyArgs) ToAccountConsistencyPolicyPtrOutput() AccountConsistencyPolicyPtrOutput {
return i.ToAccountConsistencyPolicyPtrOutputWithContext(context.Background())
}
func (i AccountConsistencyPolicyArgs) ToAccountConsistencyPolicyPtrOutputWithContext(ctx context.Context) AccountConsistencyPolicyPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountConsistencyPolicyOutput).ToAccountConsistencyPolicyPtrOutputWithContext(ctx)
}
// AccountConsistencyPolicyPtrInput is an input type that accepts AccountConsistencyPolicyArgs, AccountConsistencyPolicyPtr and AccountConsistencyPolicyPtrOutput values.
// You can construct a concrete instance of `AccountConsistencyPolicyPtrInput` via:
//
// AccountConsistencyPolicyArgs{...}
//
// or:
//
// nil
type AccountConsistencyPolicyPtrInput interface {
pulumi.Input
ToAccountConsistencyPolicyPtrOutput() AccountConsistencyPolicyPtrOutput
ToAccountConsistencyPolicyPtrOutputWithContext(context.Context) AccountConsistencyPolicyPtrOutput
}
type accountConsistencyPolicyPtrType AccountConsistencyPolicyArgs
func AccountConsistencyPolicyPtr(v *AccountConsistencyPolicyArgs) AccountConsistencyPolicyPtrInput {
return (*accountConsistencyPolicyPtrType)(v)
}
func (*accountConsistencyPolicyPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AccountConsistencyPolicy)(nil)).Elem()
}
func (i *accountConsistencyPolicyPtrType) ToAccountConsistencyPolicyPtrOutput() AccountConsistencyPolicyPtrOutput {
return i.ToAccountConsistencyPolicyPtrOutputWithContext(context.Background())
}
func (i *accountConsistencyPolicyPtrType) ToAccountConsistencyPolicyPtrOutputWithContext(ctx context.Context) AccountConsistencyPolicyPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountConsistencyPolicyPtrOutput)
}
type AccountConsistencyPolicyOutput struct{ *pulumi.OutputState }
func (AccountConsistencyPolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccountConsistencyPolicy)(nil)).Elem()
}
func (o AccountConsistencyPolicyOutput) ToAccountConsistencyPolicyOutput() AccountConsistencyPolicyOutput {
return o
}
func (o AccountConsistencyPolicyOutput) ToAccountConsistencyPolicyOutputWithContext(ctx context.Context) AccountConsistencyPolicyOutput {
return o
}
func (o AccountConsistencyPolicyOutput) ToAccountConsistencyPolicyPtrOutput() AccountConsistencyPolicyPtrOutput {
return o.ToAccountConsistencyPolicyPtrOutputWithContext(context.Background())
}
func (o AccountConsistencyPolicyOutput) ToAccountConsistencyPolicyPtrOutputWithContext(ctx context.Context) AccountConsistencyPolicyPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v AccountConsistencyPolicy) *AccountConsistencyPolicy {
return &v
}).(AccountConsistencyPolicyPtrOutput)
}
// The Consistency Level to use for this CosmosDB Account - can be either `BoundedStaleness`, `Eventual`, `Session`, `Strong` or `ConsistentPrefix`.
func (o AccountConsistencyPolicyOutput) ConsistencyLevel() pulumi.StringOutput {
return o.ApplyT(func(v AccountConsistencyPolicy) string { return v.ConsistencyLevel }).(pulumi.StringOutput)
}
// When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. The accepted range for this value is `5` - `86400` (1 day). Defaults to `5`. Required when `consistencyLevel` is set to `BoundedStaleness`.
func (o AccountConsistencyPolicyOutput) MaxIntervalInSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v AccountConsistencyPolicy) *int { return v.MaxIntervalInSeconds }).(pulumi.IntPtrOutput)
}
// When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. The accepted range for this value is `10` – `2147483647`. Defaults to `100`. Required when `consistencyLevel` is set to `BoundedStaleness`.
//
// > **Note:** `maxIntervalInSeconds` and `maxStalenessPrefix` can only be set to values other than default when the `consistencyLevel` is set to `BoundedStaleness`.
func (o AccountConsistencyPolicyOutput) MaxStalenessPrefix() pulumi.IntPtrOutput {
return o.ApplyT(func(v AccountConsistencyPolicy) *int { return v.MaxStalenessPrefix }).(pulumi.IntPtrOutput)
}
type AccountConsistencyPolicyPtrOutput struct{ *pulumi.OutputState }
func (AccountConsistencyPolicyPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccountConsistencyPolicy)(nil)).Elem()
}
func (o AccountConsistencyPolicyPtrOutput) ToAccountConsistencyPolicyPtrOutput() AccountConsistencyPolicyPtrOutput {
return o
}
func (o AccountConsistencyPolicyPtrOutput) ToAccountConsistencyPolicyPtrOutputWithContext(ctx context.Context) AccountConsistencyPolicyPtrOutput {
return o
}
func (o AccountConsistencyPolicyPtrOutput) Elem() AccountConsistencyPolicyOutput {
return o.ApplyT(func(v *AccountConsistencyPolicy) AccountConsistencyPolicy {
if v != nil {
return *v
}
var ret AccountConsistencyPolicy
return ret
}).(AccountConsistencyPolicyOutput)
}
// The Consistency Level to use for this CosmosDB Account - can be either `BoundedStaleness`, `Eventual`, `Session`, `Strong` or `ConsistentPrefix`.
func (o AccountConsistencyPolicyPtrOutput) ConsistencyLevel() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AccountConsistencyPolicy) *string {
if v == nil {
return nil
}
return &v.ConsistencyLevel
}).(pulumi.StringPtrOutput)
}
// When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. The accepted range for this value is `5` - `86400` (1 day). Defaults to `5`. Required when `consistencyLevel` is set to `BoundedStaleness`.
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/cassandraCluster.go | sdk/go/azure/cosmosdb/cassandraCluster.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cassandra Cluster.
//
// > **Note:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant:
//
// ## Import
//
// Cassandra Clusters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/cassandraCluster:CassandraCluster example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DocumentDB/cassandraClusters/cluster1
// ```
type CassandraCluster struct {
pulumi.CustomResourceState
// The authentication method that is used to authenticate clients. Possible values are `None` and `Cassandra`. Defaults to `Cassandra`.
AuthenticationMethod pulumi.StringPtrOutput `pulumi:"authenticationMethod"`
// A list of TLS certificates that is used to authorize client connecting to the Cassandra Cluster.
ClientCertificatePems pulumi.StringArrayOutput `pulumi:"clientCertificatePems"`
// The initial admin password for this Cassandra Cluster. Changing this forces a new resource to be created.
DefaultAdminPassword pulumi.StringOutput `pulumi:"defaultAdminPassword"`
// The ID of the delegated management subnet for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
DelegatedManagementSubnetId pulumi.StringOutput `pulumi:"delegatedManagementSubnetId"`
// A list of TLS certificates that is used to authorize gossip from unmanaged Cassandra Data Center.
ExternalGossipCertificatePems pulumi.StringArrayOutput `pulumi:"externalGossipCertificatePems"`
// A list of IP Addresses of the seed nodes in unmanaged the Cassandra Data Center which will be added to the seed node lists of all managed nodes.
ExternalSeedNodeIpAddresses pulumi.StringArrayOutput `pulumi:"externalSeedNodeIpAddresses"`
// The number of hours to wait between taking a backup of the Cassandra Cluster. Defaults to `24`.
//
// > **Note:** To disable this feature, set this property to `0`.
HoursBetweenBackups pulumi.IntPtrOutput `pulumi:"hoursBetweenBackups"`
// An `identity` block as defined below.
Identity CassandraClusterIdentityPtrOutput `pulumi:"identity"`
// The Azure Region where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The name which should be used for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Is the automatic repair enabled on the Cassandra Cluster? Defaults to `true`.
RepairEnabled pulumi.BoolPtrOutput `pulumi:"repairEnabled"`
// The name of the Resource Group where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The version of Cassandra what the Cluster converges to run. Possible values are `3.11` and `4.0`. Defaults to `3.11`. Changing this forces a new Cassandra Cluster to be created.
Version pulumi.StringPtrOutput `pulumi:"version"`
}
// NewCassandraCluster registers a new resource with the given unique name, arguments, and options.
func NewCassandraCluster(ctx *pulumi.Context,
name string, args *CassandraClusterArgs, opts ...pulumi.ResourceOption) (*CassandraCluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DefaultAdminPassword == nil {
return nil, errors.New("invalid value for required argument 'DefaultAdminPassword'")
}
if args.DelegatedManagementSubnetId == nil {
return nil, errors.New("invalid value for required argument 'DelegatedManagementSubnetId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.DefaultAdminPassword != nil {
args.DefaultAdminPassword = pulumi.ToSecret(args.DefaultAdminPassword).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"defaultAdminPassword",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource CassandraCluster
err := ctx.RegisterResource("azure:cosmosdb/cassandraCluster:CassandraCluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCassandraCluster gets an existing CassandraCluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCassandraCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CassandraClusterState, opts ...pulumi.ResourceOption) (*CassandraCluster, error) {
var resource CassandraCluster
err := ctx.ReadResource("azure:cosmosdb/cassandraCluster:CassandraCluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CassandraCluster resources.
type cassandraClusterState struct {
// The authentication method that is used to authenticate clients. Possible values are `None` and `Cassandra`. Defaults to `Cassandra`.
AuthenticationMethod *string `pulumi:"authenticationMethod"`
// A list of TLS certificates that is used to authorize client connecting to the Cassandra Cluster.
ClientCertificatePems []string `pulumi:"clientCertificatePems"`
// The initial admin password for this Cassandra Cluster. Changing this forces a new resource to be created.
DefaultAdminPassword *string `pulumi:"defaultAdminPassword"`
// The ID of the delegated management subnet for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
DelegatedManagementSubnetId *string `pulumi:"delegatedManagementSubnetId"`
// A list of TLS certificates that is used to authorize gossip from unmanaged Cassandra Data Center.
ExternalGossipCertificatePems []string `pulumi:"externalGossipCertificatePems"`
// A list of IP Addresses of the seed nodes in unmanaged the Cassandra Data Center which will be added to the seed node lists of all managed nodes.
ExternalSeedNodeIpAddresses []string `pulumi:"externalSeedNodeIpAddresses"`
// The number of hours to wait between taking a backup of the Cassandra Cluster. Defaults to `24`.
//
// > **Note:** To disable this feature, set this property to `0`.
HoursBetweenBackups *int `pulumi:"hoursBetweenBackups"`
// An `identity` block as defined below.
Identity *CassandraClusterIdentity `pulumi:"identity"`
// The Azure Region where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
Location *string `pulumi:"location"`
// The name which should be used for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
Name *string `pulumi:"name"`
// Is the automatic repair enabled on the Cassandra Cluster? Defaults to `true`.
RepairEnabled *bool `pulumi:"repairEnabled"`
// The name of the Resource Group where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// The version of Cassandra what the Cluster converges to run. Possible values are `3.11` and `4.0`. Defaults to `3.11`. Changing this forces a new Cassandra Cluster to be created.
Version *string `pulumi:"version"`
}
type CassandraClusterState struct {
// The authentication method that is used to authenticate clients. Possible values are `None` and `Cassandra`. Defaults to `Cassandra`.
AuthenticationMethod pulumi.StringPtrInput
// A list of TLS certificates that is used to authorize client connecting to the Cassandra Cluster.
ClientCertificatePems pulumi.StringArrayInput
// The initial admin password for this Cassandra Cluster. Changing this forces a new resource to be created.
DefaultAdminPassword pulumi.StringPtrInput
// The ID of the delegated management subnet for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
DelegatedManagementSubnetId pulumi.StringPtrInput
// A list of TLS certificates that is used to authorize gossip from unmanaged Cassandra Data Center.
ExternalGossipCertificatePems pulumi.StringArrayInput
// A list of IP Addresses of the seed nodes in unmanaged the Cassandra Data Center which will be added to the seed node lists of all managed nodes.
ExternalSeedNodeIpAddresses pulumi.StringArrayInput
// The number of hours to wait between taking a backup of the Cassandra Cluster. Defaults to `24`.
//
// > **Note:** To disable this feature, set this property to `0`.
HoursBetweenBackups pulumi.IntPtrInput
// An `identity` block as defined below.
Identity CassandraClusterIdentityPtrInput
// The Azure Region where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
Location pulumi.StringPtrInput
// The name which should be used for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
Name pulumi.StringPtrInput
// Is the automatic repair enabled on the Cassandra Cluster? Defaults to `true`.
RepairEnabled pulumi.BoolPtrInput
// The name of the Resource Group where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags assigned to the resource.
Tags pulumi.StringMapInput
// The version of Cassandra what the Cluster converges to run. Possible values are `3.11` and `4.0`. Defaults to `3.11`. Changing this forces a new Cassandra Cluster to be created.
Version pulumi.StringPtrInput
}
func (CassandraClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraClusterState)(nil)).Elem()
}
type cassandraClusterArgs struct {
// The authentication method that is used to authenticate clients. Possible values are `None` and `Cassandra`. Defaults to `Cassandra`.
AuthenticationMethod *string `pulumi:"authenticationMethod"`
// A list of TLS certificates that is used to authorize client connecting to the Cassandra Cluster.
ClientCertificatePems []string `pulumi:"clientCertificatePems"`
// The initial admin password for this Cassandra Cluster. Changing this forces a new resource to be created.
DefaultAdminPassword string `pulumi:"defaultAdminPassword"`
// The ID of the delegated management subnet for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
DelegatedManagementSubnetId string `pulumi:"delegatedManagementSubnetId"`
// A list of TLS certificates that is used to authorize gossip from unmanaged Cassandra Data Center.
ExternalGossipCertificatePems []string `pulumi:"externalGossipCertificatePems"`
// A list of IP Addresses of the seed nodes in unmanaged the Cassandra Data Center which will be added to the seed node lists of all managed nodes.
ExternalSeedNodeIpAddresses []string `pulumi:"externalSeedNodeIpAddresses"`
// The number of hours to wait between taking a backup of the Cassandra Cluster. Defaults to `24`.
//
// > **Note:** To disable this feature, set this property to `0`.
HoursBetweenBackups *int `pulumi:"hoursBetweenBackups"`
// An `identity` block as defined below.
Identity *CassandraClusterIdentity `pulumi:"identity"`
// The Azure Region where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
Location *string `pulumi:"location"`
// The name which should be used for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
Name *string `pulumi:"name"`
// Is the automatic repair enabled on the Cassandra Cluster? Defaults to `true`.
RepairEnabled *bool `pulumi:"repairEnabled"`
// The name of the Resource Group where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// The version of Cassandra what the Cluster converges to run. Possible values are `3.11` and `4.0`. Defaults to `3.11`. Changing this forces a new Cassandra Cluster to be created.
Version *string `pulumi:"version"`
}
// The set of arguments for constructing a CassandraCluster resource.
type CassandraClusterArgs struct {
// The authentication method that is used to authenticate clients. Possible values are `None` and `Cassandra`. Defaults to `Cassandra`.
AuthenticationMethod pulumi.StringPtrInput
// A list of TLS certificates that is used to authorize client connecting to the Cassandra Cluster.
ClientCertificatePems pulumi.StringArrayInput
// The initial admin password for this Cassandra Cluster. Changing this forces a new resource to be created.
DefaultAdminPassword pulumi.StringInput
// The ID of the delegated management subnet for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
DelegatedManagementSubnetId pulumi.StringInput
// A list of TLS certificates that is used to authorize gossip from unmanaged Cassandra Data Center.
ExternalGossipCertificatePems pulumi.StringArrayInput
// A list of IP Addresses of the seed nodes in unmanaged the Cassandra Data Center which will be added to the seed node lists of all managed nodes.
ExternalSeedNodeIpAddresses pulumi.StringArrayInput
// The number of hours to wait between taking a backup of the Cassandra Cluster. Defaults to `24`.
//
// > **Note:** To disable this feature, set this property to `0`.
HoursBetweenBackups pulumi.IntPtrInput
// An `identity` block as defined below.
Identity CassandraClusterIdentityPtrInput
// The Azure Region where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
Location pulumi.StringPtrInput
// The name which should be used for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
Name pulumi.StringPtrInput
// Is the automatic repair enabled on the Cassandra Cluster? Defaults to `true`.
RepairEnabled pulumi.BoolPtrInput
// The name of the Resource Group where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags assigned to the resource.
Tags pulumi.StringMapInput
// The version of Cassandra what the Cluster converges to run. Possible values are `3.11` and `4.0`. Defaults to `3.11`. Changing this forces a new Cassandra Cluster to be created.
Version pulumi.StringPtrInput
}
func (CassandraClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraClusterArgs)(nil)).Elem()
}
type CassandraClusterInput interface {
pulumi.Input
ToCassandraClusterOutput() CassandraClusterOutput
ToCassandraClusterOutputWithContext(ctx context.Context) CassandraClusterOutput
}
func (*CassandraCluster) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraCluster)(nil)).Elem()
}
func (i *CassandraCluster) ToCassandraClusterOutput() CassandraClusterOutput {
return i.ToCassandraClusterOutputWithContext(context.Background())
}
func (i *CassandraCluster) ToCassandraClusterOutputWithContext(ctx context.Context) CassandraClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraClusterOutput)
}
// CassandraClusterArrayInput is an input type that accepts CassandraClusterArray and CassandraClusterArrayOutput values.
// You can construct a concrete instance of `CassandraClusterArrayInput` via:
//
// CassandraClusterArray{ CassandraClusterArgs{...} }
type CassandraClusterArrayInput interface {
pulumi.Input
ToCassandraClusterArrayOutput() CassandraClusterArrayOutput
ToCassandraClusterArrayOutputWithContext(context.Context) CassandraClusterArrayOutput
}
type CassandraClusterArray []CassandraClusterInput
func (CassandraClusterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraCluster)(nil)).Elem()
}
func (i CassandraClusterArray) ToCassandraClusterArrayOutput() CassandraClusterArrayOutput {
return i.ToCassandraClusterArrayOutputWithContext(context.Background())
}
func (i CassandraClusterArray) ToCassandraClusterArrayOutputWithContext(ctx context.Context) CassandraClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraClusterArrayOutput)
}
// CassandraClusterMapInput is an input type that accepts CassandraClusterMap and CassandraClusterMapOutput values.
// You can construct a concrete instance of `CassandraClusterMapInput` via:
//
// CassandraClusterMap{ "key": CassandraClusterArgs{...} }
type CassandraClusterMapInput interface {
pulumi.Input
ToCassandraClusterMapOutput() CassandraClusterMapOutput
ToCassandraClusterMapOutputWithContext(context.Context) CassandraClusterMapOutput
}
type CassandraClusterMap map[string]CassandraClusterInput
func (CassandraClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraCluster)(nil)).Elem()
}
func (i CassandraClusterMap) ToCassandraClusterMapOutput() CassandraClusterMapOutput {
return i.ToCassandraClusterMapOutputWithContext(context.Background())
}
func (i CassandraClusterMap) ToCassandraClusterMapOutputWithContext(ctx context.Context) CassandraClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraClusterMapOutput)
}
type CassandraClusterOutput struct{ *pulumi.OutputState }
func (CassandraClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraCluster)(nil)).Elem()
}
func (o CassandraClusterOutput) ToCassandraClusterOutput() CassandraClusterOutput {
return o
}
func (o CassandraClusterOutput) ToCassandraClusterOutputWithContext(ctx context.Context) CassandraClusterOutput {
return o
}
// The authentication method that is used to authenticate clients. Possible values are `None` and `Cassandra`. Defaults to `Cassandra`.
func (o CassandraClusterOutput) AuthenticationMethod() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringPtrOutput { return v.AuthenticationMethod }).(pulumi.StringPtrOutput)
}
// A list of TLS certificates that is used to authorize client connecting to the Cassandra Cluster.
func (o CassandraClusterOutput) ClientCertificatePems() pulumi.StringArrayOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringArrayOutput { return v.ClientCertificatePems }).(pulumi.StringArrayOutput)
}
// The initial admin password for this Cassandra Cluster. Changing this forces a new resource to be created.
func (o CassandraClusterOutput) DefaultAdminPassword() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringOutput { return v.DefaultAdminPassword }).(pulumi.StringOutput)
}
// The ID of the delegated management subnet for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
func (o CassandraClusterOutput) DelegatedManagementSubnetId() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringOutput { return v.DelegatedManagementSubnetId }).(pulumi.StringOutput)
}
// A list of TLS certificates that is used to authorize gossip from unmanaged Cassandra Data Center.
func (o CassandraClusterOutput) ExternalGossipCertificatePems() pulumi.StringArrayOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringArrayOutput { return v.ExternalGossipCertificatePems }).(pulumi.StringArrayOutput)
}
// A list of IP Addresses of the seed nodes in unmanaged the Cassandra Data Center which will be added to the seed node lists of all managed nodes.
func (o CassandraClusterOutput) ExternalSeedNodeIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringArrayOutput { return v.ExternalSeedNodeIpAddresses }).(pulumi.StringArrayOutput)
}
// The number of hours to wait between taking a backup of the Cassandra Cluster. Defaults to `24`.
//
// > **Note:** To disable this feature, set this property to `0`.
func (o CassandraClusterOutput) HoursBetweenBackups() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.IntPtrOutput { return v.HoursBetweenBackups }).(pulumi.IntPtrOutput)
}
// An `identity` block as defined below.
func (o CassandraClusterOutput) Identity() CassandraClusterIdentityPtrOutput {
return o.ApplyT(func(v *CassandraCluster) CassandraClusterIdentityPtrOutput { return v.Identity }).(CassandraClusterIdentityPtrOutput)
}
// The Azure Region where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
func (o CassandraClusterOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The name which should be used for this Cassandra Cluster. Changing this forces a new Cassandra Cluster to be created.
func (o CassandraClusterOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Is the automatic repair enabled on the Cassandra Cluster? Defaults to `true`.
func (o CassandraClusterOutput) RepairEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.BoolPtrOutput { return v.RepairEnabled }).(pulumi.BoolPtrOutput)
}
// The name of the Resource Group where the Cassandra Cluster should exist. Changing this forces a new Cassandra Cluster to be created.
func (o CassandraClusterOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the resource.
func (o CassandraClusterOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The version of Cassandra what the Cluster converges to run. Possible values are `3.11` and `4.0`. Defaults to `3.11`. Changing this forces a new Cassandra Cluster to be created.
func (o CassandraClusterOutput) Version() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraCluster) pulumi.StringPtrOutput { return v.Version }).(pulumi.StringPtrOutput)
}
type CassandraClusterArrayOutput struct{ *pulumi.OutputState }
func (CassandraClusterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraCluster)(nil)).Elem()
}
func (o CassandraClusterArrayOutput) ToCassandraClusterArrayOutput() CassandraClusterArrayOutput {
return o
}
func (o CassandraClusterArrayOutput) ToCassandraClusterArrayOutputWithContext(ctx context.Context) CassandraClusterArrayOutput {
return o
}
func (o CassandraClusterArrayOutput) Index(i pulumi.IntInput) CassandraClusterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CassandraCluster {
return vs[0].([]*CassandraCluster)[vs[1].(int)]
}).(CassandraClusterOutput)
}
type CassandraClusterMapOutput struct{ *pulumi.OutputState }
func (CassandraClusterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraCluster)(nil)).Elem()
}
func (o CassandraClusterMapOutput) ToCassandraClusterMapOutput() CassandraClusterMapOutput {
return o
}
func (o CassandraClusterMapOutput) ToCassandraClusterMapOutputWithContext(ctx context.Context) CassandraClusterMapOutput {
return o
}
func (o CassandraClusterMapOutput) MapIndex(k pulumi.StringInput) CassandraClusterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CassandraCluster {
return vs[0].(map[string]*CassandraCluster)[vs[1].(string)]
}).(CassandraClusterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CassandraClusterInput)(nil)).Elem(), &CassandraCluster{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraClusterArrayInput)(nil)).Elem(), CassandraClusterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraClusterMapInput)(nil)).Elem(), CassandraClusterMap{})
pulumi.RegisterOutputType(CassandraClusterOutput{})
pulumi.RegisterOutputType(CassandraClusterArrayOutput{})
pulumi.RegisterOutputType(CassandraClusterMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlRoleAssignment.go | sdk/go/azure/cosmosdb/sqlRoleAssignment.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cosmos DB SQL Role Assignment.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// current, err := core.GetClientConfig(ctx, map[string]interface{}{}, nil)
// if err != nil {
// return err
// }
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("example-cosmosdb"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("GlobalDocumentDB"),
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleSqlRoleDefinition, err := cosmosdb.NewSqlRoleDefinition(ctx, "example", &cosmosdb.SqlRoleDefinitionArgs{
// Name: pulumi.String("examplesqlroledef"),
// ResourceGroupName: example.Name,
// AccountName: exampleAccount.Name,
// Type: pulumi.String("CustomRole"),
// AssignableScopes: pulumi.StringArray{
// exampleAccount.ID(),
// },
// Permissions: cosmosdb.SqlRoleDefinitionPermissionArray{
// &cosmosdb.SqlRoleDefinitionPermissionArgs{
// DataActions: pulumi.StringArray{
// pulumi.String("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlRoleAssignment(ctx, "example", &cosmosdb.SqlRoleAssignmentArgs{
// Name: pulumi.String("736180af-7fbc-4c7f-9004-22735173c1c3"),
// ResourceGroupName: example.Name,
// AccountName: exampleAccount.Name,
// RoleDefinitionId: exampleSqlRoleDefinition.ID(),
// PrincipalId: pulumi.String(current.ObjectId),
// Scope: exampleAccount.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cosmos DB SQL Role Assignments can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlRoleAssignment:SqlRoleAssignment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlRoleAssignments/9e007587-dbcd-4190-84cb-fcab5a09ca39
// ```
type SqlRoleAssignment struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
PrincipalId pulumi.StringOutput `pulumi:"principalId"`
// The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The resource ID of the Cosmos DB SQL Role Definition.
RoleDefinitionId pulumi.StringOutput `pulumi:"roleDefinitionId"`
// The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Scope pulumi.StringOutput `pulumi:"scope"`
}
// NewSqlRoleAssignment registers a new resource with the given unique name, arguments, and options.
func NewSqlRoleAssignment(ctx *pulumi.Context,
name string, args *SqlRoleAssignmentArgs, opts ...pulumi.ResourceOption) (*SqlRoleAssignment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.PrincipalId == nil {
return nil, errors.New("invalid value for required argument 'PrincipalId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.RoleDefinitionId == nil {
return nil, errors.New("invalid value for required argument 'RoleDefinitionId'")
}
if args.Scope == nil {
return nil, errors.New("invalid value for required argument 'Scope'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlRoleAssignment
err := ctx.RegisterResource("azure:cosmosdb/sqlRoleAssignment:SqlRoleAssignment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlRoleAssignment gets an existing SqlRoleAssignment resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlRoleAssignment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlRoleAssignmentState, opts ...pulumi.ResourceOption) (*SqlRoleAssignment, error) {
var resource SqlRoleAssignment
err := ctx.ReadResource("azure:cosmosdb/sqlRoleAssignment:SqlRoleAssignment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlRoleAssignment resources.
type sqlRoleAssignmentState struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
PrincipalId *string `pulumi:"principalId"`
// The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The resource ID of the Cosmos DB SQL Role Definition.
RoleDefinitionId *string `pulumi:"roleDefinitionId"`
// The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Scope *string `pulumi:"scope"`
}
type SqlRoleAssignmentState struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
PrincipalId pulumi.StringPtrInput
// The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The resource ID of the Cosmos DB SQL Role Definition.
RoleDefinitionId pulumi.StringPtrInput
// The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Scope pulumi.StringPtrInput
}
func (SqlRoleAssignmentState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlRoleAssignmentState)(nil)).Elem()
}
type sqlRoleAssignmentArgs struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
PrincipalId string `pulumi:"principalId"`
// The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The resource ID of the Cosmos DB SQL Role Definition.
RoleDefinitionId string `pulumi:"roleDefinitionId"`
// The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Scope string `pulumi:"scope"`
}
// The set of arguments for constructing a SqlRoleAssignment resource.
type SqlRoleAssignmentArgs struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
PrincipalId pulumi.StringInput
// The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The resource ID of the Cosmos DB SQL Role Definition.
RoleDefinitionId pulumi.StringInput
// The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Scope pulumi.StringInput
}
func (SqlRoleAssignmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlRoleAssignmentArgs)(nil)).Elem()
}
type SqlRoleAssignmentInput interface {
pulumi.Input
ToSqlRoleAssignmentOutput() SqlRoleAssignmentOutput
ToSqlRoleAssignmentOutputWithContext(ctx context.Context) SqlRoleAssignmentOutput
}
func (*SqlRoleAssignment) ElementType() reflect.Type {
return reflect.TypeOf((**SqlRoleAssignment)(nil)).Elem()
}
func (i *SqlRoleAssignment) ToSqlRoleAssignmentOutput() SqlRoleAssignmentOutput {
return i.ToSqlRoleAssignmentOutputWithContext(context.Background())
}
func (i *SqlRoleAssignment) ToSqlRoleAssignmentOutputWithContext(ctx context.Context) SqlRoleAssignmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlRoleAssignmentOutput)
}
// SqlRoleAssignmentArrayInput is an input type that accepts SqlRoleAssignmentArray and SqlRoleAssignmentArrayOutput values.
// You can construct a concrete instance of `SqlRoleAssignmentArrayInput` via:
//
// SqlRoleAssignmentArray{ SqlRoleAssignmentArgs{...} }
type SqlRoleAssignmentArrayInput interface {
pulumi.Input
ToSqlRoleAssignmentArrayOutput() SqlRoleAssignmentArrayOutput
ToSqlRoleAssignmentArrayOutputWithContext(context.Context) SqlRoleAssignmentArrayOutput
}
type SqlRoleAssignmentArray []SqlRoleAssignmentInput
func (SqlRoleAssignmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlRoleAssignment)(nil)).Elem()
}
func (i SqlRoleAssignmentArray) ToSqlRoleAssignmentArrayOutput() SqlRoleAssignmentArrayOutput {
return i.ToSqlRoleAssignmentArrayOutputWithContext(context.Background())
}
func (i SqlRoleAssignmentArray) ToSqlRoleAssignmentArrayOutputWithContext(ctx context.Context) SqlRoleAssignmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlRoleAssignmentArrayOutput)
}
// SqlRoleAssignmentMapInput is an input type that accepts SqlRoleAssignmentMap and SqlRoleAssignmentMapOutput values.
// You can construct a concrete instance of `SqlRoleAssignmentMapInput` via:
//
// SqlRoleAssignmentMap{ "key": SqlRoleAssignmentArgs{...} }
type SqlRoleAssignmentMapInput interface {
pulumi.Input
ToSqlRoleAssignmentMapOutput() SqlRoleAssignmentMapOutput
ToSqlRoleAssignmentMapOutputWithContext(context.Context) SqlRoleAssignmentMapOutput
}
type SqlRoleAssignmentMap map[string]SqlRoleAssignmentInput
func (SqlRoleAssignmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlRoleAssignment)(nil)).Elem()
}
func (i SqlRoleAssignmentMap) ToSqlRoleAssignmentMapOutput() SqlRoleAssignmentMapOutput {
return i.ToSqlRoleAssignmentMapOutputWithContext(context.Background())
}
func (i SqlRoleAssignmentMap) ToSqlRoleAssignmentMapOutputWithContext(ctx context.Context) SqlRoleAssignmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlRoleAssignmentMapOutput)
}
type SqlRoleAssignmentOutput struct{ *pulumi.OutputState }
func (SqlRoleAssignmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlRoleAssignment)(nil)).Elem()
}
func (o SqlRoleAssignmentOutput) ToSqlRoleAssignmentOutput() SqlRoleAssignmentOutput {
return o
}
func (o SqlRoleAssignmentOutput) ToSqlRoleAssignmentOutputWithContext(ctx context.Context) SqlRoleAssignmentOutput {
return o
}
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
func (o SqlRoleAssignmentOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleAssignment) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
func (o SqlRoleAssignmentOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleAssignment) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
func (o SqlRoleAssignmentOutput) PrincipalId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleAssignment) pulumi.StringOutput { return v.PrincipalId }).(pulumi.StringOutput)
}
// The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
func (o SqlRoleAssignmentOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleAssignment) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The resource ID of the Cosmos DB SQL Role Definition.
func (o SqlRoleAssignmentOutput) RoleDefinitionId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleAssignment) pulumi.StringOutput { return v.RoleDefinitionId }).(pulumi.StringOutput)
}
// The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
func (o SqlRoleAssignmentOutput) Scope() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleAssignment) pulumi.StringOutput { return v.Scope }).(pulumi.StringOutput)
}
type SqlRoleAssignmentArrayOutput struct{ *pulumi.OutputState }
func (SqlRoleAssignmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlRoleAssignment)(nil)).Elem()
}
func (o SqlRoleAssignmentArrayOutput) ToSqlRoleAssignmentArrayOutput() SqlRoleAssignmentArrayOutput {
return o
}
func (o SqlRoleAssignmentArrayOutput) ToSqlRoleAssignmentArrayOutputWithContext(ctx context.Context) SqlRoleAssignmentArrayOutput {
return o
}
func (o SqlRoleAssignmentArrayOutput) Index(i pulumi.IntInput) SqlRoleAssignmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlRoleAssignment {
return vs[0].([]*SqlRoleAssignment)[vs[1].(int)]
}).(SqlRoleAssignmentOutput)
}
type SqlRoleAssignmentMapOutput struct{ *pulumi.OutputState }
func (SqlRoleAssignmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlRoleAssignment)(nil)).Elem()
}
func (o SqlRoleAssignmentMapOutput) ToSqlRoleAssignmentMapOutput() SqlRoleAssignmentMapOutput {
return o
}
func (o SqlRoleAssignmentMapOutput) ToSqlRoleAssignmentMapOutputWithContext(ctx context.Context) SqlRoleAssignmentMapOutput {
return o
}
func (o SqlRoleAssignmentMapOutput) MapIndex(k pulumi.StringInput) SqlRoleAssignmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlRoleAssignment {
return vs[0].(map[string]*SqlRoleAssignment)[vs[1].(string)]
}).(SqlRoleAssignmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlRoleAssignmentInput)(nil)).Elem(), &SqlRoleAssignment{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlRoleAssignmentArrayInput)(nil)).Elem(), SqlRoleAssignmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlRoleAssignmentMapInput)(nil)).Elem(), SqlRoleAssignmentMap{})
pulumi.RegisterOutputType(SqlRoleAssignmentOutput{})
pulumi.RegisterOutputType(SqlRoleAssignmentArrayOutput{})
pulumi.RegisterOutputType(SqlRoleAssignmentMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/mongoCluster.go | sdk/go/azure/cosmosdb/mongoCluster.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a MongoDB Cluster using vCore Architecture.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/mongocluster"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-rg"),
// Location: pulumi.String("East US"),
// })
// if err != nil {
// return err
// }
// _, err = mongocluster.NewMongoCluster(ctx, "example", &mongocluster.MongoClusterArgs{
// Name: pulumi.String("example-mc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AdministratorUsername: pulumi.String("adminTerraform"),
// AdministratorPassword: pulumi.String("QAZwsx123"),
// ShardCount: pulumi.Int(1),
// ComputeTier: pulumi.String("Free"),
// HighAvailabilityMode: pulumi.String("Disabled"),
// StorageSizeInGb: pulumi.Int(32),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ### Preview Feature GeoReplicas)
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/mongocluster"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-rg"),
// Location: pulumi.String("East US"),
// })
// if err != nil {
// return err
// }
// exampleMongoCluster, err := mongocluster.NewMongoCluster(ctx, "example", &mongocluster.MongoClusterArgs{
// Name: pulumi.String("example-mc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AdministratorUsername: pulumi.String("adminTerraform"),
// AdministratorPassword: pulumi.String("QAZwsx123"),
// ShardCount: pulumi.Int(1),
// ComputeTier: pulumi.String("M30"),
// HighAvailabilityMode: pulumi.String("ZoneRedundantPreferred"),
// StorageSizeInGb: pulumi.Int(64),
// PreviewFeatures: pulumi.StringArray{
// pulumi.String("GeoReplicas"),
// },
// })
// if err != nil {
// return err
// }
// _, err = mongocluster.NewMongoCluster(ctx, "example_geo_replica", &mongocluster.MongoClusterArgs{
// Name: pulumi.String("example-mc-geo"),
// ResourceGroupName: example.Name,
// Location: pulumi.String("Central US"),
// SourceServerId: exampleMongoCluster.ID(),
// SourceLocation: exampleMongoCluster.Location,
// CreateMode: pulumi.String("GeoReplica"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2025-09-01
//
// ## Import
//
// MongoDB Clusters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/mongoCluster:MongoCluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster
// ```
//
// Deprecated: azure.cosmosdb/mongocluster.MongoCluster has been deprecated in favor of azure.mongocluster/mongocluster.MongoCluster
type MongoCluster struct {
pulumi.CustomResourceState
// The Password associated with the `administratorUsername` for the MongoDB Cluster.
AdministratorPassword pulumi.StringPtrOutput `pulumi:"administratorPassword"`
// The administrator username of the MongoDB Cluster. Changing this forces a new resource to be created.
AdministratorUsername pulumi.StringPtrOutput `pulumi:"administratorUsername"`
// A list of allowed authentication modes for the MongoDB Cluster. Possible values are `NativeAuth` and `MicrosoftEntraID`.
AuthenticationMethods pulumi.StringArrayOutput `pulumi:"authenticationMethods"`
// The compute tier to assign to the MongoDB Cluster. Possible values are `Free`, `M10`, `M20`, `M25`, `M30`, `M40`, `M50`, `M60`, `M80`, and `M200`.
ComputeTier pulumi.StringPtrOutput `pulumi:"computeTier"`
// One or more `connectionStrings` blocks as defined below.
ConnectionStrings MongoClusterConnectionStringArrayOutput `pulumi:"connectionStrings"`
// The creation mode for the MongoDB Cluster. Possible values are `Default`, `GeoReplica` and `PointInTimeRestore`. Defaults to `Default`. Changing this forces a new resource to be created.
CreateMode pulumi.StringPtrOutput `pulumi:"createMode"`
// A `customerManagedKey` block as defined below. Changing this forces a new resource to be created.
CustomerManagedKey MongoClusterCustomerManagedKeyPtrOutput `pulumi:"customerManagedKey"`
// Is the Data API for the MongoDB Cluster enabled? Defaults to `false`.
//
// > **Note:** `dataApiModeEnabled` can only be set when `createMode` is `Default`. Once enabled, it can only be disabled by recreating the resource.
DataApiModeEnabled pulumi.BoolPtrOutput `pulumi:"dataApiModeEnabled"`
// The high availability mode for the MongoDB Cluster. Possibles values are `Disabled` and `ZoneRedundantPreferred`.
HighAvailabilityMode pulumi.StringPtrOutput `pulumi:"highAvailabilityMode"`
// An `identity` block as detailed below.
//
// > **Note:** When adding or removing `identity`, a resource recreation will be triggered.
Identity MongoClusterIdentityPtrOutput `pulumi:"identity"`
// The supported Azure location where the MongoDB Cluster exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The name which should be used for the MongoDB Cluster. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The preview features that can be enabled on the MongoDB Cluster. Changing this forces a new resource to be created.
PreviewFeatures pulumi.StringArrayOutput `pulumi:"previewFeatures"`
// The Public Network Access setting for the MongoDB Cluster. Possibles values are `Disabled` and `Enabled`. Defaults to `Enabled`.
PublicNetworkAccess pulumi.StringPtrOutput `pulumi:"publicNetworkAccess"`
// The name of the resource group in which to create the MongoDB Cluster. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
Restore MongoClusterRestorePtrOutput `pulumi:"restore"`
// The Number of shards to provision on the MongoDB Cluster. Changing this forces a new resource to be created.
ShardCount pulumi.IntPtrOutput `pulumi:"shardCount"`
// The location of the source MongoDB Cluster. Changing this forces a new resource to be created.
SourceLocation pulumi.StringPtrOutput `pulumi:"sourceLocation"`
// The ID of the replication source MongoDB Cluster. Changing this forces a new resource to be created.
SourceServerId pulumi.StringPtrOutput `pulumi:"sourceServerId"`
// The size of the data disk space for the MongoDB Cluster.
StorageSizeInGb pulumi.IntPtrOutput `pulumi:"storageSizeInGb"`
// The storage type for the MongoDB Cluster. Possible values are `PremiumSSD` and `PremiumSSDv2`. Defaults to `PremiumSSD`. Changing this forces a new resource to be created.
StorageType pulumi.StringPtrOutput `pulumi:"storageType"`
// A mapping of tags to assign to the MongoDB Cluster.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The version for the MongoDB Cluster. Possibles values are `5.0`, `6.0`, `7.0` and `8.0`.
Version pulumi.StringPtrOutput `pulumi:"version"`
}
// NewMongoCluster registers a new resource with the given unique name, arguments, and options.
func NewMongoCluster(ctx *pulumi.Context,
name string, args *MongoClusterArgs, opts ...pulumi.ResourceOption) (*MongoCluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure:cosmosdb/mongoCluster:MongoCluster"),
},
})
opts = append(opts, aliases)
if args.AdministratorPassword != nil {
args.AdministratorPassword = pulumi.ToSecret(args.AdministratorPassword).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"administratorPassword",
"connectionStrings",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource MongoCluster
err := ctx.RegisterResource("azure:cosmosdb/mongoCluster:MongoCluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMongoCluster gets an existing MongoCluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMongoCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MongoClusterState, opts ...pulumi.ResourceOption) (*MongoCluster, error) {
var resource MongoCluster
err := ctx.ReadResource("azure:cosmosdb/mongoCluster:MongoCluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MongoCluster resources.
type mongoClusterState struct {
// The Password associated with the `administratorUsername` for the MongoDB Cluster.
AdministratorPassword *string `pulumi:"administratorPassword"`
// The administrator username of the MongoDB Cluster. Changing this forces a new resource to be created.
AdministratorUsername *string `pulumi:"administratorUsername"`
// A list of allowed authentication modes for the MongoDB Cluster. Possible values are `NativeAuth` and `MicrosoftEntraID`.
AuthenticationMethods []string `pulumi:"authenticationMethods"`
// The compute tier to assign to the MongoDB Cluster. Possible values are `Free`, `M10`, `M20`, `M25`, `M30`, `M40`, `M50`, `M60`, `M80`, and `M200`.
ComputeTier *string `pulumi:"computeTier"`
// One or more `connectionStrings` blocks as defined below.
ConnectionStrings []MongoClusterConnectionString `pulumi:"connectionStrings"`
// The creation mode for the MongoDB Cluster. Possible values are `Default`, `GeoReplica` and `PointInTimeRestore`. Defaults to `Default`. Changing this forces a new resource to be created.
CreateMode *string `pulumi:"createMode"`
// A `customerManagedKey` block as defined below. Changing this forces a new resource to be created.
CustomerManagedKey *MongoClusterCustomerManagedKey `pulumi:"customerManagedKey"`
// Is the Data API for the MongoDB Cluster enabled? Defaults to `false`.
//
// > **Note:** `dataApiModeEnabled` can only be set when `createMode` is `Default`. Once enabled, it can only be disabled by recreating the resource.
DataApiModeEnabled *bool `pulumi:"dataApiModeEnabled"`
// The high availability mode for the MongoDB Cluster. Possibles values are `Disabled` and `ZoneRedundantPreferred`.
HighAvailabilityMode *string `pulumi:"highAvailabilityMode"`
// An `identity` block as detailed below.
//
// > **Note:** When adding or removing `identity`, a resource recreation will be triggered.
Identity *MongoClusterIdentity `pulumi:"identity"`
// The supported Azure location where the MongoDB Cluster exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The name which should be used for the MongoDB Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The preview features that can be enabled on the MongoDB Cluster. Changing this forces a new resource to be created.
PreviewFeatures []string `pulumi:"previewFeatures"`
// The Public Network Access setting for the MongoDB Cluster. Possibles values are `Disabled` and `Enabled`. Defaults to `Enabled`.
PublicNetworkAccess *string `pulumi:"publicNetworkAccess"`
// The name of the resource group in which to create the MongoDB Cluster. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
Restore *MongoClusterRestore `pulumi:"restore"`
// The Number of shards to provision on the MongoDB Cluster. Changing this forces a new resource to be created.
ShardCount *int `pulumi:"shardCount"`
// The location of the source MongoDB Cluster. Changing this forces a new resource to be created.
SourceLocation *string `pulumi:"sourceLocation"`
// The ID of the replication source MongoDB Cluster. Changing this forces a new resource to be created.
SourceServerId *string `pulumi:"sourceServerId"`
// The size of the data disk space for the MongoDB Cluster.
StorageSizeInGb *int `pulumi:"storageSizeInGb"`
// The storage type for the MongoDB Cluster. Possible values are `PremiumSSD` and `PremiumSSDv2`. Defaults to `PremiumSSD`. Changing this forces a new resource to be created.
StorageType *string `pulumi:"storageType"`
// A mapping of tags to assign to the MongoDB Cluster.
Tags map[string]string `pulumi:"tags"`
// The version for the MongoDB Cluster. Possibles values are `5.0`, `6.0`, `7.0` and `8.0`.
Version *string `pulumi:"version"`
}
type MongoClusterState struct {
// The Password associated with the `administratorUsername` for the MongoDB Cluster.
AdministratorPassword pulumi.StringPtrInput
// The administrator username of the MongoDB Cluster. Changing this forces a new resource to be created.
AdministratorUsername pulumi.StringPtrInput
// A list of allowed authentication modes for the MongoDB Cluster. Possible values are `NativeAuth` and `MicrosoftEntraID`.
AuthenticationMethods pulumi.StringArrayInput
// The compute tier to assign to the MongoDB Cluster. Possible values are `Free`, `M10`, `M20`, `M25`, `M30`, `M40`, `M50`, `M60`, `M80`, and `M200`.
ComputeTier pulumi.StringPtrInput
// One or more `connectionStrings` blocks as defined below.
ConnectionStrings MongoClusterConnectionStringArrayInput
// The creation mode for the MongoDB Cluster. Possible values are `Default`, `GeoReplica` and `PointInTimeRestore`. Defaults to `Default`. Changing this forces a new resource to be created.
CreateMode pulumi.StringPtrInput
// A `customerManagedKey` block as defined below. Changing this forces a new resource to be created.
CustomerManagedKey MongoClusterCustomerManagedKeyPtrInput
// Is the Data API for the MongoDB Cluster enabled? Defaults to `false`.
//
// > **Note:** `dataApiModeEnabled` can only be set when `createMode` is `Default`. Once enabled, it can only be disabled by recreating the resource.
DataApiModeEnabled pulumi.BoolPtrInput
// The high availability mode for the MongoDB Cluster. Possibles values are `Disabled` and `ZoneRedundantPreferred`.
HighAvailabilityMode pulumi.StringPtrInput
// An `identity` block as detailed below.
//
// > **Note:** When adding or removing `identity`, a resource recreation will be triggered.
Identity MongoClusterIdentityPtrInput
// The supported Azure location where the MongoDB Cluster exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The name which should be used for the MongoDB Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The preview features that can be enabled on the MongoDB Cluster. Changing this forces a new resource to be created.
PreviewFeatures pulumi.StringArrayInput
// The Public Network Access setting for the MongoDB Cluster. Possibles values are `Disabled` and `Enabled`. Defaults to `Enabled`.
PublicNetworkAccess pulumi.StringPtrInput
// The name of the resource group in which to create the MongoDB Cluster. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
Restore MongoClusterRestorePtrInput
// The Number of shards to provision on the MongoDB Cluster. Changing this forces a new resource to be created.
ShardCount pulumi.IntPtrInput
// The location of the source MongoDB Cluster. Changing this forces a new resource to be created.
SourceLocation pulumi.StringPtrInput
// The ID of the replication source MongoDB Cluster. Changing this forces a new resource to be created.
SourceServerId pulumi.StringPtrInput
// The size of the data disk space for the MongoDB Cluster.
StorageSizeInGb pulumi.IntPtrInput
// The storage type for the MongoDB Cluster. Possible values are `PremiumSSD` and `PremiumSSDv2`. Defaults to `PremiumSSD`. Changing this forces a new resource to be created.
StorageType pulumi.StringPtrInput
// A mapping of tags to assign to the MongoDB Cluster.
Tags pulumi.StringMapInput
// The version for the MongoDB Cluster. Possibles values are `5.0`, `6.0`, `7.0` and `8.0`.
Version pulumi.StringPtrInput
}
func (MongoClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*mongoClusterState)(nil)).Elem()
}
type mongoClusterArgs struct {
// The Password associated with the `administratorUsername` for the MongoDB Cluster.
AdministratorPassword *string `pulumi:"administratorPassword"`
// The administrator username of the MongoDB Cluster. Changing this forces a new resource to be created.
AdministratorUsername *string `pulumi:"administratorUsername"`
// A list of allowed authentication modes for the MongoDB Cluster. Possible values are `NativeAuth` and `MicrosoftEntraID`.
AuthenticationMethods []string `pulumi:"authenticationMethods"`
// The compute tier to assign to the MongoDB Cluster. Possible values are `Free`, `M10`, `M20`, `M25`, `M30`, `M40`, `M50`, `M60`, `M80`, and `M200`.
ComputeTier *string `pulumi:"computeTier"`
// The creation mode for the MongoDB Cluster. Possible values are `Default`, `GeoReplica` and `PointInTimeRestore`. Defaults to `Default`. Changing this forces a new resource to be created.
CreateMode *string `pulumi:"createMode"`
// A `customerManagedKey` block as defined below. Changing this forces a new resource to be created.
CustomerManagedKey *MongoClusterCustomerManagedKey `pulumi:"customerManagedKey"`
// Is the Data API for the MongoDB Cluster enabled? Defaults to `false`.
//
// > **Note:** `dataApiModeEnabled` can only be set when `createMode` is `Default`. Once enabled, it can only be disabled by recreating the resource.
DataApiModeEnabled *bool `pulumi:"dataApiModeEnabled"`
// The high availability mode for the MongoDB Cluster. Possibles values are `Disabled` and `ZoneRedundantPreferred`.
HighAvailabilityMode *string `pulumi:"highAvailabilityMode"`
// An `identity` block as detailed below.
//
// > **Note:** When adding or removing `identity`, a resource recreation will be triggered.
Identity *MongoClusterIdentity `pulumi:"identity"`
// The supported Azure location where the MongoDB Cluster exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The name which should be used for the MongoDB Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The preview features that can be enabled on the MongoDB Cluster. Changing this forces a new resource to be created.
PreviewFeatures []string `pulumi:"previewFeatures"`
// The Public Network Access setting for the MongoDB Cluster. Possibles values are `Disabled` and `Enabled`. Defaults to `Enabled`.
PublicNetworkAccess *string `pulumi:"publicNetworkAccess"`
// The name of the resource group in which to create the MongoDB Cluster. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
Restore *MongoClusterRestore `pulumi:"restore"`
// The Number of shards to provision on the MongoDB Cluster. Changing this forces a new resource to be created.
ShardCount *int `pulumi:"shardCount"`
// The location of the source MongoDB Cluster. Changing this forces a new resource to be created.
SourceLocation *string `pulumi:"sourceLocation"`
// The ID of the replication source MongoDB Cluster. Changing this forces a new resource to be created.
SourceServerId *string `pulumi:"sourceServerId"`
// The size of the data disk space for the MongoDB Cluster.
StorageSizeInGb *int `pulumi:"storageSizeInGb"`
// The storage type for the MongoDB Cluster. Possible values are `PremiumSSD` and `PremiumSSDv2`. Defaults to `PremiumSSD`. Changing this forces a new resource to be created.
StorageType *string `pulumi:"storageType"`
// A mapping of tags to assign to the MongoDB Cluster.
Tags map[string]string `pulumi:"tags"`
// The version for the MongoDB Cluster. Possibles values are `5.0`, `6.0`, `7.0` and `8.0`.
Version *string `pulumi:"version"`
}
// The set of arguments for constructing a MongoCluster resource.
type MongoClusterArgs struct {
// The Password associated with the `administratorUsername` for the MongoDB Cluster.
AdministratorPassword pulumi.StringPtrInput
// The administrator username of the MongoDB Cluster. Changing this forces a new resource to be created.
AdministratorUsername pulumi.StringPtrInput
// A list of allowed authentication modes for the MongoDB Cluster. Possible values are `NativeAuth` and `MicrosoftEntraID`.
AuthenticationMethods pulumi.StringArrayInput
// The compute tier to assign to the MongoDB Cluster. Possible values are `Free`, `M10`, `M20`, `M25`, `M30`, `M40`, `M50`, `M60`, `M80`, and `M200`.
ComputeTier pulumi.StringPtrInput
// The creation mode for the MongoDB Cluster. Possible values are `Default`, `GeoReplica` and `PointInTimeRestore`. Defaults to `Default`. Changing this forces a new resource to be created.
CreateMode pulumi.StringPtrInput
// A `customerManagedKey` block as defined below. Changing this forces a new resource to be created.
CustomerManagedKey MongoClusterCustomerManagedKeyPtrInput
// Is the Data API for the MongoDB Cluster enabled? Defaults to `false`.
//
// > **Note:** `dataApiModeEnabled` can only be set when `createMode` is `Default`. Once enabled, it can only be disabled by recreating the resource.
DataApiModeEnabled pulumi.BoolPtrInput
// The high availability mode for the MongoDB Cluster. Possibles values are `Disabled` and `ZoneRedundantPreferred`.
HighAvailabilityMode pulumi.StringPtrInput
// An `identity` block as detailed below.
//
// > **Note:** When adding or removing `identity`, a resource recreation will be triggered.
Identity MongoClusterIdentityPtrInput
// The supported Azure location where the MongoDB Cluster exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The name which should be used for the MongoDB Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The preview features that can be enabled on the MongoDB Cluster. Changing this forces a new resource to be created.
PreviewFeatures pulumi.StringArrayInput
// The Public Network Access setting for the MongoDB Cluster. Possibles values are `Disabled` and `Enabled`. Defaults to `Enabled`.
PublicNetworkAccess pulumi.StringPtrInput
// The name of the resource group in which to create the MongoDB Cluster. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
Restore MongoClusterRestorePtrInput
// The Number of shards to provision on the MongoDB Cluster. Changing this forces a new resource to be created.
ShardCount pulumi.IntPtrInput
// The location of the source MongoDB Cluster. Changing this forces a new resource to be created.
SourceLocation pulumi.StringPtrInput
// The ID of the replication source MongoDB Cluster. Changing this forces a new resource to be created.
SourceServerId pulumi.StringPtrInput
// The size of the data disk space for the MongoDB Cluster.
StorageSizeInGb pulumi.IntPtrInput
// The storage type for the MongoDB Cluster. Possible values are `PremiumSSD` and `PremiumSSDv2`. Defaults to `PremiumSSD`. Changing this forces a new resource to be created.
StorageType pulumi.StringPtrInput
// A mapping of tags to assign to the MongoDB Cluster.
Tags pulumi.StringMapInput
// The version for the MongoDB Cluster. Possibles values are `5.0`, `6.0`, `7.0` and `8.0`.
Version pulumi.StringPtrInput
}
func (MongoClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mongoClusterArgs)(nil)).Elem()
}
type MongoClusterInput interface {
pulumi.Input
ToMongoClusterOutput() MongoClusterOutput
ToMongoClusterOutputWithContext(ctx context.Context) MongoClusterOutput
}
func (*MongoCluster) ElementType() reflect.Type {
return reflect.TypeOf((**MongoCluster)(nil)).Elem()
}
func (i *MongoCluster) ToMongoClusterOutput() MongoClusterOutput {
return i.ToMongoClusterOutputWithContext(context.Background())
}
func (i *MongoCluster) ToMongoClusterOutputWithContext(ctx context.Context) MongoClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoClusterOutput)
}
// MongoClusterArrayInput is an input type that accepts MongoClusterArray and MongoClusterArrayOutput values.
// You can construct a concrete instance of `MongoClusterArrayInput` via:
//
// MongoClusterArray{ MongoClusterArgs{...} }
type MongoClusterArrayInput interface {
pulumi.Input
ToMongoClusterArrayOutput() MongoClusterArrayOutput
ToMongoClusterArrayOutputWithContext(context.Context) MongoClusterArrayOutput
}
type MongoClusterArray []MongoClusterInput
func (MongoClusterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoCluster)(nil)).Elem()
}
func (i MongoClusterArray) ToMongoClusterArrayOutput() MongoClusterArrayOutput {
return i.ToMongoClusterArrayOutputWithContext(context.Background())
}
func (i MongoClusterArray) ToMongoClusterArrayOutputWithContext(ctx context.Context) MongoClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoClusterArrayOutput)
}
// MongoClusterMapInput is an input type that accepts MongoClusterMap and MongoClusterMapOutput values.
// You can construct a concrete instance of `MongoClusterMapInput` via:
//
// MongoClusterMap{ "key": MongoClusterArgs{...} }
type MongoClusterMapInput interface {
pulumi.Input
ToMongoClusterMapOutput() MongoClusterMapOutput
ToMongoClusterMapOutputWithContext(context.Context) MongoClusterMapOutput
}
type MongoClusterMap map[string]MongoClusterInput
func (MongoClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoCluster)(nil)).Elem()
}
func (i MongoClusterMap) ToMongoClusterMapOutput() MongoClusterMapOutput {
return i.ToMongoClusterMapOutputWithContext(context.Background())
}
func (i MongoClusterMap) ToMongoClusterMapOutputWithContext(ctx context.Context) MongoClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoClusterMapOutput)
}
type MongoClusterOutput struct{ *pulumi.OutputState }
func (MongoClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MongoCluster)(nil)).Elem()
}
func (o MongoClusterOutput) ToMongoClusterOutput() MongoClusterOutput {
return o
}
func (o MongoClusterOutput) ToMongoClusterOutputWithContext(ctx context.Context) MongoClusterOutput {
return o
}
// The Password associated with the `administratorUsername` for the MongoDB Cluster.
func (o MongoClusterOutput) AdministratorPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringPtrOutput { return v.AdministratorPassword }).(pulumi.StringPtrOutput)
}
// The administrator username of the MongoDB Cluster. Changing this forces a new resource to be created.
func (o MongoClusterOutput) AdministratorUsername() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringPtrOutput { return v.AdministratorUsername }).(pulumi.StringPtrOutput)
}
// A list of allowed authentication modes for the MongoDB Cluster. Possible values are `NativeAuth` and `MicrosoftEntraID`.
func (o MongoClusterOutput) AuthenticationMethods() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringArrayOutput { return v.AuthenticationMethods }).(pulumi.StringArrayOutput)
}
// The compute tier to assign to the MongoDB Cluster. Possible values are `Free`, `M10`, `M20`, `M25`, `M30`, `M40`, `M50`, `M60`, `M80`, and `M200`.
func (o MongoClusterOutput) ComputeTier() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringPtrOutput { return v.ComputeTier }).(pulumi.StringPtrOutput)
}
// One or more `connectionStrings` blocks as defined below.
func (o MongoClusterOutput) ConnectionStrings() MongoClusterConnectionStringArrayOutput {
return o.ApplyT(func(v *MongoCluster) MongoClusterConnectionStringArrayOutput { return v.ConnectionStrings }).(MongoClusterConnectionStringArrayOutput)
}
// The creation mode for the MongoDB Cluster. Possible values are `Default`, `GeoReplica` and `PointInTimeRestore`. Defaults to `Default`. Changing this forces a new resource to be created.
func (o MongoClusterOutput) CreateMode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringPtrOutput { return v.CreateMode }).(pulumi.StringPtrOutput)
}
// A `customerManagedKey` block as defined below. Changing this forces a new resource to be created.
func (o MongoClusterOutput) CustomerManagedKey() MongoClusterCustomerManagedKeyPtrOutput {
return o.ApplyT(func(v *MongoCluster) MongoClusterCustomerManagedKeyPtrOutput { return v.CustomerManagedKey }).(MongoClusterCustomerManagedKeyPtrOutput)
}
// Is the Data API for the MongoDB Cluster enabled? Defaults to `false`.
//
// > **Note:** `dataApiModeEnabled` can only be set when `createMode` is `Default`. Once enabled, it can only be disabled by recreating the resource.
func (o MongoClusterOutput) DataApiModeEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.BoolPtrOutput { return v.DataApiModeEnabled }).(pulumi.BoolPtrOutput)
}
// The high availability mode for the MongoDB Cluster. Possibles values are `Disabled` and `ZoneRedundantPreferred`.
func (o MongoClusterOutput) HighAvailabilityMode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringPtrOutput { return v.HighAvailabilityMode }).(pulumi.StringPtrOutput)
}
// An `identity` block as detailed below.
//
// > **Note:** When adding or removing `identity`, a resource recreation will be triggered.
func (o MongoClusterOutput) Identity() MongoClusterIdentityPtrOutput {
return o.ApplyT(func(v *MongoCluster) MongoClusterIdentityPtrOutput { return v.Identity }).(MongoClusterIdentityPtrOutput)
}
// The supported Azure location where the MongoDB Cluster exists. Changing this forces a new resource to be created.
func (o MongoClusterOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The name which should be used for the MongoDB Cluster. Changing this forces a new resource to be created.
func (o MongoClusterOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The preview features that can be enabled on the MongoDB Cluster. Changing this forces a new resource to be created.
func (o MongoClusterOutput) PreviewFeatures() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringArrayOutput { return v.PreviewFeatures }).(pulumi.StringArrayOutput)
}
// The Public Network Access setting for the MongoDB Cluster. Possibles values are `Disabled` and `Enabled`. Defaults to `Enabled`.
func (o MongoClusterOutput) PublicNetworkAccess() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringPtrOutput { return v.PublicNetworkAccess }).(pulumi.StringPtrOutput)
}
// The name of the resource group in which to create the MongoDB Cluster. Changing this forces a new resource to be created.
func (o MongoClusterOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCluster) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o MongoClusterOutput) Restore() MongoClusterRestorePtrOutput {
return o.ApplyT(func(v *MongoCluster) MongoClusterRestorePtrOutput { return v.Restore }).(MongoClusterRestorePtrOutput)
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlDedicatedGateway.go | sdk/go/azure/cosmosdb/sqlDedicatedGateway.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a SQL Dedicated Gateway within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resource-group"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("example-ca"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("GlobalDocumentDB"),
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("BoundedStaleness"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlDedicatedGateway(ctx, "example", &cosmosdb.SqlDedicatedGatewayArgs{
// CosmosdbAccountId: exampleAccount.ID(),
// InstanceCount: pulumi.Int(1),
// InstanceSize: pulumi.String("Cosmos.D4s"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2022-05-15
//
// ## Import
//
// CosmosDB SQL Dedicated Gateways can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlDedicatedGateway:SqlDedicatedGateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DocumentDB/databaseAccounts/account1/services/SqlDedicatedGateway
// ```
type SqlDedicatedGateway struct {
pulumi.CustomResourceState
// The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
CosmosdbAccountId pulumi.StringOutput `pulumi:"cosmosdbAccountId"`
// The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between `1` and `5`.
InstanceCount pulumi.IntOutput `pulumi:"instanceCount"`
// The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are `Cosmos.D4s`, `Cosmos.D8s` and `Cosmos.D16s`.
InstanceSize pulumi.StringOutput `pulumi:"instanceSize"`
}
// NewSqlDedicatedGateway registers a new resource with the given unique name, arguments, and options.
func NewSqlDedicatedGateway(ctx *pulumi.Context,
name string, args *SqlDedicatedGatewayArgs, opts ...pulumi.ResourceOption) (*SqlDedicatedGateway, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CosmosdbAccountId == nil {
return nil, errors.New("invalid value for required argument 'CosmosdbAccountId'")
}
if args.InstanceCount == nil {
return nil, errors.New("invalid value for required argument 'InstanceCount'")
}
if args.InstanceSize == nil {
return nil, errors.New("invalid value for required argument 'InstanceSize'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlDedicatedGateway
err := ctx.RegisterResource("azure:cosmosdb/sqlDedicatedGateway:SqlDedicatedGateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlDedicatedGateway gets an existing SqlDedicatedGateway resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlDedicatedGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlDedicatedGatewayState, opts ...pulumi.ResourceOption) (*SqlDedicatedGateway, error) {
var resource SqlDedicatedGateway
err := ctx.ReadResource("azure:cosmosdb/sqlDedicatedGateway:SqlDedicatedGateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlDedicatedGateway resources.
type sqlDedicatedGatewayState struct {
// The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
CosmosdbAccountId *string `pulumi:"cosmosdbAccountId"`
// The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between `1` and `5`.
InstanceCount *int `pulumi:"instanceCount"`
// The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are `Cosmos.D4s`, `Cosmos.D8s` and `Cosmos.D16s`.
InstanceSize *string `pulumi:"instanceSize"`
}
type SqlDedicatedGatewayState struct {
// The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
CosmosdbAccountId pulumi.StringPtrInput
// The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between `1` and `5`.
InstanceCount pulumi.IntPtrInput
// The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are `Cosmos.D4s`, `Cosmos.D8s` and `Cosmos.D16s`.
InstanceSize pulumi.StringPtrInput
}
func (SqlDedicatedGatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlDedicatedGatewayState)(nil)).Elem()
}
type sqlDedicatedGatewayArgs struct {
// The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
CosmosdbAccountId string `pulumi:"cosmosdbAccountId"`
// The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between `1` and `5`.
InstanceCount int `pulumi:"instanceCount"`
// The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are `Cosmos.D4s`, `Cosmos.D8s` and `Cosmos.D16s`.
InstanceSize string `pulumi:"instanceSize"`
}
// The set of arguments for constructing a SqlDedicatedGateway resource.
type SqlDedicatedGatewayArgs struct {
// The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
CosmosdbAccountId pulumi.StringInput
// The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between `1` and `5`.
InstanceCount pulumi.IntInput
// The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are `Cosmos.D4s`, `Cosmos.D8s` and `Cosmos.D16s`.
InstanceSize pulumi.StringInput
}
func (SqlDedicatedGatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlDedicatedGatewayArgs)(nil)).Elem()
}
type SqlDedicatedGatewayInput interface {
pulumi.Input
ToSqlDedicatedGatewayOutput() SqlDedicatedGatewayOutput
ToSqlDedicatedGatewayOutputWithContext(ctx context.Context) SqlDedicatedGatewayOutput
}
func (*SqlDedicatedGateway) ElementType() reflect.Type {
return reflect.TypeOf((**SqlDedicatedGateway)(nil)).Elem()
}
func (i *SqlDedicatedGateway) ToSqlDedicatedGatewayOutput() SqlDedicatedGatewayOutput {
return i.ToSqlDedicatedGatewayOutputWithContext(context.Background())
}
func (i *SqlDedicatedGateway) ToSqlDedicatedGatewayOutputWithContext(ctx context.Context) SqlDedicatedGatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlDedicatedGatewayOutput)
}
// SqlDedicatedGatewayArrayInput is an input type that accepts SqlDedicatedGatewayArray and SqlDedicatedGatewayArrayOutput values.
// You can construct a concrete instance of `SqlDedicatedGatewayArrayInput` via:
//
// SqlDedicatedGatewayArray{ SqlDedicatedGatewayArgs{...} }
type SqlDedicatedGatewayArrayInput interface {
pulumi.Input
ToSqlDedicatedGatewayArrayOutput() SqlDedicatedGatewayArrayOutput
ToSqlDedicatedGatewayArrayOutputWithContext(context.Context) SqlDedicatedGatewayArrayOutput
}
type SqlDedicatedGatewayArray []SqlDedicatedGatewayInput
func (SqlDedicatedGatewayArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlDedicatedGateway)(nil)).Elem()
}
func (i SqlDedicatedGatewayArray) ToSqlDedicatedGatewayArrayOutput() SqlDedicatedGatewayArrayOutput {
return i.ToSqlDedicatedGatewayArrayOutputWithContext(context.Background())
}
func (i SqlDedicatedGatewayArray) ToSqlDedicatedGatewayArrayOutputWithContext(ctx context.Context) SqlDedicatedGatewayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlDedicatedGatewayArrayOutput)
}
// SqlDedicatedGatewayMapInput is an input type that accepts SqlDedicatedGatewayMap and SqlDedicatedGatewayMapOutput values.
// You can construct a concrete instance of `SqlDedicatedGatewayMapInput` via:
//
// SqlDedicatedGatewayMap{ "key": SqlDedicatedGatewayArgs{...} }
type SqlDedicatedGatewayMapInput interface {
pulumi.Input
ToSqlDedicatedGatewayMapOutput() SqlDedicatedGatewayMapOutput
ToSqlDedicatedGatewayMapOutputWithContext(context.Context) SqlDedicatedGatewayMapOutput
}
type SqlDedicatedGatewayMap map[string]SqlDedicatedGatewayInput
func (SqlDedicatedGatewayMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlDedicatedGateway)(nil)).Elem()
}
func (i SqlDedicatedGatewayMap) ToSqlDedicatedGatewayMapOutput() SqlDedicatedGatewayMapOutput {
return i.ToSqlDedicatedGatewayMapOutputWithContext(context.Background())
}
func (i SqlDedicatedGatewayMap) ToSqlDedicatedGatewayMapOutputWithContext(ctx context.Context) SqlDedicatedGatewayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlDedicatedGatewayMapOutput)
}
type SqlDedicatedGatewayOutput struct{ *pulumi.OutputState }
func (SqlDedicatedGatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlDedicatedGateway)(nil)).Elem()
}
func (o SqlDedicatedGatewayOutput) ToSqlDedicatedGatewayOutput() SqlDedicatedGatewayOutput {
return o
}
func (o SqlDedicatedGatewayOutput) ToSqlDedicatedGatewayOutputWithContext(ctx context.Context) SqlDedicatedGatewayOutput {
return o
}
// The resource ID of the CosmosDB Account. Changing this forces a new resource to be created.
func (o SqlDedicatedGatewayOutput) CosmosdbAccountId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlDedicatedGateway) pulumi.StringOutput { return v.CosmosdbAccountId }).(pulumi.StringOutput)
}
// The instance count for the CosmosDB SQL Dedicated Gateway. Possible value is between `1` and `5`.
func (o SqlDedicatedGatewayOutput) InstanceCount() pulumi.IntOutput {
return o.ApplyT(func(v *SqlDedicatedGateway) pulumi.IntOutput { return v.InstanceCount }).(pulumi.IntOutput)
}
// The instance size for the CosmosDB SQL Dedicated Gateway. Changing this forces a new resource to be created. Possible values are `Cosmos.D4s`, `Cosmos.D8s` and `Cosmos.D16s`.
func (o SqlDedicatedGatewayOutput) InstanceSize() pulumi.StringOutput {
return o.ApplyT(func(v *SqlDedicatedGateway) pulumi.StringOutput { return v.InstanceSize }).(pulumi.StringOutput)
}
type SqlDedicatedGatewayArrayOutput struct{ *pulumi.OutputState }
func (SqlDedicatedGatewayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlDedicatedGateway)(nil)).Elem()
}
func (o SqlDedicatedGatewayArrayOutput) ToSqlDedicatedGatewayArrayOutput() SqlDedicatedGatewayArrayOutput {
return o
}
func (o SqlDedicatedGatewayArrayOutput) ToSqlDedicatedGatewayArrayOutputWithContext(ctx context.Context) SqlDedicatedGatewayArrayOutput {
return o
}
func (o SqlDedicatedGatewayArrayOutput) Index(i pulumi.IntInput) SqlDedicatedGatewayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlDedicatedGateway {
return vs[0].([]*SqlDedicatedGateway)[vs[1].(int)]
}).(SqlDedicatedGatewayOutput)
}
type SqlDedicatedGatewayMapOutput struct{ *pulumi.OutputState }
func (SqlDedicatedGatewayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlDedicatedGateway)(nil)).Elem()
}
func (o SqlDedicatedGatewayMapOutput) ToSqlDedicatedGatewayMapOutput() SqlDedicatedGatewayMapOutput {
return o
}
func (o SqlDedicatedGatewayMapOutput) ToSqlDedicatedGatewayMapOutputWithContext(ctx context.Context) SqlDedicatedGatewayMapOutput {
return o
}
func (o SqlDedicatedGatewayMapOutput) MapIndex(k pulumi.StringInput) SqlDedicatedGatewayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlDedicatedGateway {
return vs[0].(map[string]*SqlDedicatedGateway)[vs[1].(string)]
}).(SqlDedicatedGatewayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlDedicatedGatewayInput)(nil)).Elem(), &SqlDedicatedGateway{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlDedicatedGatewayArrayInput)(nil)).Elem(), SqlDedicatedGatewayArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlDedicatedGatewayMapInput)(nil)).Elem(), SqlDedicatedGatewayMap{})
pulumi.RegisterOutputType(SqlDedicatedGatewayOutput{})
pulumi.RegisterOutputType(SqlDedicatedGatewayArrayOutput{})
pulumi.RegisterOutputType(SqlDedicatedGatewayMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/gremlinDatabase.go | sdk/go/azure/cosmosdb/gremlinDatabase.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Gremlin Database within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewGremlinDatabase(ctx, "example", &cosmosdb.GremlinDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-gremlin-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2024-08-15
//
// ## Import
//
// CosmosDB Gremlin Databases can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/gremlinDatabase:GremlinDatabase db1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/gremlinDatabases/db1
// ```
type GremlinDatabase struct {
pulumi.CustomResourceState
// The name of the CosmosDB Account to create the Gremlin Database within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings GremlinDatabaseAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Gremlin Database. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Gremlin Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The throughput of the Gremlin database (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewGremlinDatabase registers a new resource with the given unique name, arguments, and options.
func NewGremlinDatabase(ctx *pulumi.Context,
name string, args *GremlinDatabaseArgs, opts ...pulumi.ResourceOption) (*GremlinDatabase, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GremlinDatabase
err := ctx.RegisterResource("azure:cosmosdb/gremlinDatabase:GremlinDatabase", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGremlinDatabase gets an existing GremlinDatabase resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGremlinDatabase(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GremlinDatabaseState, opts ...pulumi.ResourceOption) (*GremlinDatabase, error) {
var resource GremlinDatabase
err := ctx.ReadResource("azure:cosmosdb/gremlinDatabase:GremlinDatabase", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GremlinDatabase resources.
type gremlinDatabaseState struct {
// The name of the CosmosDB Account to create the Gremlin Database within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *GremlinDatabaseAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Gremlin Database. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Gremlin Database is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The throughput of the Gremlin database (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput *int `pulumi:"throughput"`
}
type GremlinDatabaseState struct {
// The name of the CosmosDB Account to create the Gremlin Database within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings GremlinDatabaseAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Gremlin Database. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Gremlin Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The throughput of the Gremlin database (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput pulumi.IntPtrInput
}
func (GremlinDatabaseState) ElementType() reflect.Type {
return reflect.TypeOf((*gremlinDatabaseState)(nil)).Elem()
}
type gremlinDatabaseArgs struct {
// The name of the CosmosDB Account to create the Gremlin Database within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *GremlinDatabaseAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Gremlin Database. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Gremlin Database is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of the Gremlin database (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a GremlinDatabase resource.
type GremlinDatabaseArgs struct {
// The name of the CosmosDB Account to create the Gremlin Database within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings GremlinDatabaseAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Gremlin Database. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Gremlin Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The throughput of the Gremlin database (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput pulumi.IntPtrInput
}
func (GremlinDatabaseArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gremlinDatabaseArgs)(nil)).Elem()
}
type GremlinDatabaseInput interface {
pulumi.Input
ToGremlinDatabaseOutput() GremlinDatabaseOutput
ToGremlinDatabaseOutputWithContext(ctx context.Context) GremlinDatabaseOutput
}
func (*GremlinDatabase) ElementType() reflect.Type {
return reflect.TypeOf((**GremlinDatabase)(nil)).Elem()
}
func (i *GremlinDatabase) ToGremlinDatabaseOutput() GremlinDatabaseOutput {
return i.ToGremlinDatabaseOutputWithContext(context.Background())
}
func (i *GremlinDatabase) ToGremlinDatabaseOutputWithContext(ctx context.Context) GremlinDatabaseOutput {
return pulumi.ToOutputWithContext(ctx, i).(GremlinDatabaseOutput)
}
// GremlinDatabaseArrayInput is an input type that accepts GremlinDatabaseArray and GremlinDatabaseArrayOutput values.
// You can construct a concrete instance of `GremlinDatabaseArrayInput` via:
//
// GremlinDatabaseArray{ GremlinDatabaseArgs{...} }
type GremlinDatabaseArrayInput interface {
pulumi.Input
ToGremlinDatabaseArrayOutput() GremlinDatabaseArrayOutput
ToGremlinDatabaseArrayOutputWithContext(context.Context) GremlinDatabaseArrayOutput
}
type GremlinDatabaseArray []GremlinDatabaseInput
func (GremlinDatabaseArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GremlinDatabase)(nil)).Elem()
}
func (i GremlinDatabaseArray) ToGremlinDatabaseArrayOutput() GremlinDatabaseArrayOutput {
return i.ToGremlinDatabaseArrayOutputWithContext(context.Background())
}
func (i GremlinDatabaseArray) ToGremlinDatabaseArrayOutputWithContext(ctx context.Context) GremlinDatabaseArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GremlinDatabaseArrayOutput)
}
// GremlinDatabaseMapInput is an input type that accepts GremlinDatabaseMap and GremlinDatabaseMapOutput values.
// You can construct a concrete instance of `GremlinDatabaseMapInput` via:
//
// GremlinDatabaseMap{ "key": GremlinDatabaseArgs{...} }
type GremlinDatabaseMapInput interface {
pulumi.Input
ToGremlinDatabaseMapOutput() GremlinDatabaseMapOutput
ToGremlinDatabaseMapOutputWithContext(context.Context) GremlinDatabaseMapOutput
}
type GremlinDatabaseMap map[string]GremlinDatabaseInput
func (GremlinDatabaseMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GremlinDatabase)(nil)).Elem()
}
func (i GremlinDatabaseMap) ToGremlinDatabaseMapOutput() GremlinDatabaseMapOutput {
return i.ToGremlinDatabaseMapOutputWithContext(context.Background())
}
func (i GremlinDatabaseMap) ToGremlinDatabaseMapOutputWithContext(ctx context.Context) GremlinDatabaseMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GremlinDatabaseMapOutput)
}
type GremlinDatabaseOutput struct{ *pulumi.OutputState }
func (GremlinDatabaseOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GremlinDatabase)(nil)).Elem()
}
func (o GremlinDatabaseOutput) ToGremlinDatabaseOutput() GremlinDatabaseOutput {
return o
}
func (o GremlinDatabaseOutput) ToGremlinDatabaseOutputWithContext(ctx context.Context) GremlinDatabaseOutput {
return o
}
// The name of the CosmosDB Account to create the Gremlin Database within. Changing this forces a new resource to be created.
func (o GremlinDatabaseOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinDatabase) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
func (o GremlinDatabaseOutput) AutoscaleSettings() GremlinDatabaseAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *GremlinDatabase) GremlinDatabaseAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(GremlinDatabaseAutoscaleSettingsPtrOutput)
}
// Specifies the name of the Cosmos DB Gremlin Database. Changing this forces a new resource to be created.
func (o GremlinDatabaseOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinDatabase) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB Gremlin Database is created. Changing this forces a new resource to be created.
func (o GremlinDatabaseOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinDatabase) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of the Gremlin database (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
func (o GremlinDatabaseOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *GremlinDatabase) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type GremlinDatabaseArrayOutput struct{ *pulumi.OutputState }
func (GremlinDatabaseArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GremlinDatabase)(nil)).Elem()
}
func (o GremlinDatabaseArrayOutput) ToGremlinDatabaseArrayOutput() GremlinDatabaseArrayOutput {
return o
}
func (o GremlinDatabaseArrayOutput) ToGremlinDatabaseArrayOutputWithContext(ctx context.Context) GremlinDatabaseArrayOutput {
return o
}
func (o GremlinDatabaseArrayOutput) Index(i pulumi.IntInput) GremlinDatabaseOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GremlinDatabase {
return vs[0].([]*GremlinDatabase)[vs[1].(int)]
}).(GremlinDatabaseOutput)
}
type GremlinDatabaseMapOutput struct{ *pulumi.OutputState }
func (GremlinDatabaseMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GremlinDatabase)(nil)).Elem()
}
func (o GremlinDatabaseMapOutput) ToGremlinDatabaseMapOutput() GremlinDatabaseMapOutput {
return o
}
func (o GremlinDatabaseMapOutput) ToGremlinDatabaseMapOutputWithContext(ctx context.Context) GremlinDatabaseMapOutput {
return o
}
func (o GremlinDatabaseMapOutput) MapIndex(k pulumi.StringInput) GremlinDatabaseOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GremlinDatabase {
return vs[0].(map[string]*GremlinDatabase)[vs[1].(string)]
}).(GremlinDatabaseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GremlinDatabaseInput)(nil)).Elem(), &GremlinDatabase{})
pulumi.RegisterInputType(reflect.TypeOf((*GremlinDatabaseArrayInput)(nil)).Elem(), GremlinDatabaseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GremlinDatabaseMapInput)(nil)).Elem(), GremlinDatabaseMap{})
pulumi.RegisterOutputType(GremlinDatabaseOutput{})
pulumi.RegisterOutputType(GremlinDatabaseArrayOutput{})
pulumi.RegisterOutputType(GremlinDatabaseMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/postgresqlNodeConfiguration.go | sdk/go/azure/cosmosdb/postgresqlNodeConfiguration.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Sets a Node Configuration value on Azure Cosmos DB for PostgreSQL Cluster.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "example", &cosmosdb.PostgresqlClusterArgs{
// Name: pulumi.String("examplecluster"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
// CoordinatorStorageQuotaInMb: pulumi.Int(131072),
// CoordinatorVcoreCount: pulumi.Int(2),
// NodeCount: pulumi.Int(2),
// NodeStorageQuotaInMb: pulumi.Int(131072),
// NodeVcores: pulumi.Int(2),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewPostgresqlNodeConfiguration(ctx, "example", &cosmosdb.PostgresqlNodeConfigurationArgs{
// Name: pulumi.String("array_nulls"),
// ClusterId: examplePostgresqlCluster.ID(),
// Value: pulumi.String("on"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DBforPostgreSQL` - 2022-11-08
//
// ## Import
//
// Node Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/postgresqlNodeConfiguration:PostgresqlNodeConfiguration example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1/nodeConfigurations/array_nulls
// ```
type PostgresqlNodeConfiguration struct {
pulumi.CustomResourceState
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// The name of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The value of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value pulumi.StringOutput `pulumi:"value"`
}
// NewPostgresqlNodeConfiguration registers a new resource with the given unique name, arguments, and options.
func NewPostgresqlNodeConfiguration(ctx *pulumi.Context,
name string, args *PostgresqlNodeConfigurationArgs, opts ...pulumi.ResourceOption) (*PostgresqlNodeConfiguration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PostgresqlNodeConfiguration
err := ctx.RegisterResource("azure:cosmosdb/postgresqlNodeConfiguration:PostgresqlNodeConfiguration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPostgresqlNodeConfiguration gets an existing PostgresqlNodeConfiguration resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPostgresqlNodeConfiguration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PostgresqlNodeConfigurationState, opts ...pulumi.ResourceOption) (*PostgresqlNodeConfiguration, error) {
var resource PostgresqlNodeConfiguration
err := ctx.ReadResource("azure:cosmosdb/postgresqlNodeConfiguration:PostgresqlNodeConfiguration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PostgresqlNodeConfiguration resources.
type postgresqlNodeConfigurationState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId *string `pulumi:"clusterId"`
// The name of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The value of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value *string `pulumi:"value"`
}
type PostgresqlNodeConfigurationState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId pulumi.StringPtrInput
// The name of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The value of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value pulumi.StringPtrInput
}
func (PostgresqlNodeConfigurationState) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlNodeConfigurationState)(nil)).Elem()
}
type postgresqlNodeConfigurationArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId string `pulumi:"clusterId"`
// The name of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The value of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value string `pulumi:"value"`
}
// The set of arguments for constructing a PostgresqlNodeConfiguration resource.
type PostgresqlNodeConfigurationArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId pulumi.StringInput
// The name of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The value of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value pulumi.StringInput
}
func (PostgresqlNodeConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlNodeConfigurationArgs)(nil)).Elem()
}
type PostgresqlNodeConfigurationInput interface {
pulumi.Input
ToPostgresqlNodeConfigurationOutput() PostgresqlNodeConfigurationOutput
ToPostgresqlNodeConfigurationOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationOutput
}
func (*PostgresqlNodeConfiguration) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlNodeConfiguration)(nil)).Elem()
}
func (i *PostgresqlNodeConfiguration) ToPostgresqlNodeConfigurationOutput() PostgresqlNodeConfigurationOutput {
return i.ToPostgresqlNodeConfigurationOutputWithContext(context.Background())
}
func (i *PostgresqlNodeConfiguration) ToPostgresqlNodeConfigurationOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlNodeConfigurationOutput)
}
// PostgresqlNodeConfigurationArrayInput is an input type that accepts PostgresqlNodeConfigurationArray and PostgresqlNodeConfigurationArrayOutput values.
// You can construct a concrete instance of `PostgresqlNodeConfigurationArrayInput` via:
//
// PostgresqlNodeConfigurationArray{ PostgresqlNodeConfigurationArgs{...} }
type PostgresqlNodeConfigurationArrayInput interface {
pulumi.Input
ToPostgresqlNodeConfigurationArrayOutput() PostgresqlNodeConfigurationArrayOutput
ToPostgresqlNodeConfigurationArrayOutputWithContext(context.Context) PostgresqlNodeConfigurationArrayOutput
}
type PostgresqlNodeConfigurationArray []PostgresqlNodeConfigurationInput
func (PostgresqlNodeConfigurationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlNodeConfiguration)(nil)).Elem()
}
func (i PostgresqlNodeConfigurationArray) ToPostgresqlNodeConfigurationArrayOutput() PostgresqlNodeConfigurationArrayOutput {
return i.ToPostgresqlNodeConfigurationArrayOutputWithContext(context.Background())
}
func (i PostgresqlNodeConfigurationArray) ToPostgresqlNodeConfigurationArrayOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlNodeConfigurationArrayOutput)
}
// PostgresqlNodeConfigurationMapInput is an input type that accepts PostgresqlNodeConfigurationMap and PostgresqlNodeConfigurationMapOutput values.
// You can construct a concrete instance of `PostgresqlNodeConfigurationMapInput` via:
//
// PostgresqlNodeConfigurationMap{ "key": PostgresqlNodeConfigurationArgs{...} }
type PostgresqlNodeConfigurationMapInput interface {
pulumi.Input
ToPostgresqlNodeConfigurationMapOutput() PostgresqlNodeConfigurationMapOutput
ToPostgresqlNodeConfigurationMapOutputWithContext(context.Context) PostgresqlNodeConfigurationMapOutput
}
type PostgresqlNodeConfigurationMap map[string]PostgresqlNodeConfigurationInput
func (PostgresqlNodeConfigurationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlNodeConfiguration)(nil)).Elem()
}
func (i PostgresqlNodeConfigurationMap) ToPostgresqlNodeConfigurationMapOutput() PostgresqlNodeConfigurationMapOutput {
return i.ToPostgresqlNodeConfigurationMapOutputWithContext(context.Background())
}
func (i PostgresqlNodeConfigurationMap) ToPostgresqlNodeConfigurationMapOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlNodeConfigurationMapOutput)
}
type PostgresqlNodeConfigurationOutput struct{ *pulumi.OutputState }
func (PostgresqlNodeConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlNodeConfiguration)(nil)).Elem()
}
func (o PostgresqlNodeConfigurationOutput) ToPostgresqlNodeConfigurationOutput() PostgresqlNodeConfigurationOutput {
return o
}
func (o PostgresqlNodeConfigurationOutput) ToPostgresqlNodeConfigurationOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationOutput {
return o
}
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
func (o PostgresqlNodeConfigurationOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlNodeConfiguration) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// The name of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
func (o PostgresqlNodeConfigurationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlNodeConfiguration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The value of the Node Configuration on Azure Cosmos DB for PostgreSQL Cluster.
func (o PostgresqlNodeConfigurationOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlNodeConfiguration) pulumi.StringOutput { return v.Value }).(pulumi.StringOutput)
}
type PostgresqlNodeConfigurationArrayOutput struct{ *pulumi.OutputState }
func (PostgresqlNodeConfigurationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlNodeConfiguration)(nil)).Elem()
}
func (o PostgresqlNodeConfigurationArrayOutput) ToPostgresqlNodeConfigurationArrayOutput() PostgresqlNodeConfigurationArrayOutput {
return o
}
func (o PostgresqlNodeConfigurationArrayOutput) ToPostgresqlNodeConfigurationArrayOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationArrayOutput {
return o
}
func (o PostgresqlNodeConfigurationArrayOutput) Index(i pulumi.IntInput) PostgresqlNodeConfigurationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PostgresqlNodeConfiguration {
return vs[0].([]*PostgresqlNodeConfiguration)[vs[1].(int)]
}).(PostgresqlNodeConfigurationOutput)
}
type PostgresqlNodeConfigurationMapOutput struct{ *pulumi.OutputState }
func (PostgresqlNodeConfigurationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlNodeConfiguration)(nil)).Elem()
}
func (o PostgresqlNodeConfigurationMapOutput) ToPostgresqlNodeConfigurationMapOutput() PostgresqlNodeConfigurationMapOutput {
return o
}
func (o PostgresqlNodeConfigurationMapOutput) ToPostgresqlNodeConfigurationMapOutputWithContext(ctx context.Context) PostgresqlNodeConfigurationMapOutput {
return o
}
func (o PostgresqlNodeConfigurationMapOutput) MapIndex(k pulumi.StringInput) PostgresqlNodeConfigurationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PostgresqlNodeConfiguration {
return vs[0].(map[string]*PostgresqlNodeConfiguration)[vs[1].(string)]
}).(PostgresqlNodeConfigurationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlNodeConfigurationInput)(nil)).Elem(), &PostgresqlNodeConfiguration{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlNodeConfigurationArrayInput)(nil)).Elem(), PostgresqlNodeConfigurationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlNodeConfigurationMapInput)(nil)).Elem(), PostgresqlNodeConfigurationMap{})
pulumi.RegisterOutputType(PostgresqlNodeConfigurationOutput{})
pulumi.RegisterOutputType(PostgresqlNodeConfigurationArrayOutput{})
pulumi.RegisterOutputType(PostgresqlNodeConfigurationMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/table.go | sdk/go/azure/cosmosdb/table.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Table within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewTable(ctx, "example", &cosmosdb.TableArgs{
// Name: pulumi.String("tfex-cosmos-table"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// CosmosDB Tables can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/table:Table table1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/tables/table1
// ```
type Table struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings TableAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The throughput of Table (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewTable registers a new resource with the given unique name, arguments, and options.
func NewTable(ctx *pulumi.Context,
name string, args *TableArgs, opts ...pulumi.ResourceOption) (*Table, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Table
err := ctx.RegisterResource("azure:cosmosdb/table:Table", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTable gets an existing Table resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetTable(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TableState, opts ...pulumi.ResourceOption) (*Table, error) {
var resource Table
err := ctx.ReadResource("azure:cosmosdb/table:Table", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Table resources.
type tableState struct {
// The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *TableAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The throughput of Table (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput *int `pulumi:"throughput"`
}
type TableState struct {
// The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings TableAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The throughput of Table (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput pulumi.IntPtrInput
}
func (TableState) ElementType() reflect.Type {
return reflect.TypeOf((*tableState)(nil)).Elem()
}
type tableArgs struct {
// The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *TableAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of Table (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a Table resource.
type TableArgs struct {
// The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings TableAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The throughput of Table (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
Throughput pulumi.IntPtrInput
}
func (TableArgs) ElementType() reflect.Type {
return reflect.TypeOf((*tableArgs)(nil)).Elem()
}
type TableInput interface {
pulumi.Input
ToTableOutput() TableOutput
ToTableOutputWithContext(ctx context.Context) TableOutput
}
func (*Table) ElementType() reflect.Type {
return reflect.TypeOf((**Table)(nil)).Elem()
}
func (i *Table) ToTableOutput() TableOutput {
return i.ToTableOutputWithContext(context.Background())
}
func (i *Table) ToTableOutputWithContext(ctx context.Context) TableOutput {
return pulumi.ToOutputWithContext(ctx, i).(TableOutput)
}
// TableArrayInput is an input type that accepts TableArray and TableArrayOutput values.
// You can construct a concrete instance of `TableArrayInput` via:
//
// TableArray{ TableArgs{...} }
type TableArrayInput interface {
pulumi.Input
ToTableArrayOutput() TableArrayOutput
ToTableArrayOutputWithContext(context.Context) TableArrayOutput
}
type TableArray []TableInput
func (TableArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Table)(nil)).Elem()
}
func (i TableArray) ToTableArrayOutput() TableArrayOutput {
return i.ToTableArrayOutputWithContext(context.Background())
}
func (i TableArray) ToTableArrayOutputWithContext(ctx context.Context) TableArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TableArrayOutput)
}
// TableMapInput is an input type that accepts TableMap and TableMapOutput values.
// You can construct a concrete instance of `TableMapInput` via:
//
// TableMap{ "key": TableArgs{...} }
type TableMapInput interface {
pulumi.Input
ToTableMapOutput() TableMapOutput
ToTableMapOutputWithContext(context.Context) TableMapOutput
}
type TableMap map[string]TableInput
func (TableMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Table)(nil)).Elem()
}
func (i TableMap) ToTableMapOutput() TableMapOutput {
return i.ToTableMapOutputWithContext(context.Background())
}
func (i TableMap) ToTableMapOutputWithContext(ctx context.Context) TableMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TableMapOutput)
}
type TableOutput struct{ *pulumi.OutputState }
func (TableOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Table)(nil)).Elem()
}
func (o TableOutput) ToTableOutput() TableOutput {
return o
}
func (o TableOutput) ToTableOutputWithContext(ctx context.Context) TableOutput {
return o
}
// The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.
func (o TableOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *Table) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
func (o TableOutput) AutoscaleSettings() TableAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *Table) TableAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(TableAutoscaleSettingsPtrOutput)
}
// Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.
func (o TableOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Table) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.
func (o TableOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Table) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of Table (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
func (o TableOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *Table) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type TableArrayOutput struct{ *pulumi.OutputState }
func (TableArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Table)(nil)).Elem()
}
func (o TableArrayOutput) ToTableArrayOutput() TableArrayOutput {
return o
}
func (o TableArrayOutput) ToTableArrayOutputWithContext(ctx context.Context) TableArrayOutput {
return o
}
func (o TableArrayOutput) Index(i pulumi.IntInput) TableOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Table {
return vs[0].([]*Table)[vs[1].(int)]
}).(TableOutput)
}
type TableMapOutput struct{ *pulumi.OutputState }
func (TableMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Table)(nil)).Elem()
}
func (o TableMapOutput) ToTableMapOutput() TableMapOutput {
return o
}
func (o TableMapOutput) ToTableMapOutputWithContext(ctx context.Context) TableMapOutput {
return o
}
func (o TableMapOutput) MapIndex(k pulumi.StringInput) TableOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Table {
return vs[0].(map[string]*Table)[vs[1].(string)]
}).(TableOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TableInput)(nil)).Elem(), &Table{})
pulumi.RegisterInputType(reflect.TypeOf((*TableArrayInput)(nil)).Elem(), TableArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TableMapInput)(nil)).Elem(), TableMap{})
pulumi.RegisterOutputType(TableOutput{})
pulumi.RegisterOutputType(TableArrayOutput{})
pulumi.RegisterOutputType(TableMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlRoleDefinition.go | sdk/go/azure/cosmosdb/sqlRoleDefinition.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cosmos DB SQL Role Definition.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := core.GetClientConfig(ctx, map[string]interface{}{}, nil)
// if err != nil {
// return err
// }
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("example-cosmosdb"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("GlobalDocumentDB"),
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlRoleDefinition(ctx, "example", &cosmosdb.SqlRoleDefinitionArgs{
// RoleDefinitionId: pulumi.String("84cf3a8b-4122-4448-bce2-fa423cfe0a15"),
// ResourceGroupName: example.Name,
// AccountName: exampleAccount.Name,
// Name: pulumi.String("acctestsqlrole"),
// AssignableScopes: pulumi.StringArray{
// exampleAccount.ID().ApplyT(func(id string) (string, error) {
// return fmt.Sprintf("%v/dbs/sales", id), nil
// }).(pulumi.StringOutput),
// },
// Permissions: cosmosdb.SqlRoleDefinitionPermissionArray{
// &cosmosdb.SqlRoleDefinitionPermissionArgs{
// DataActions: pulumi.StringArray{
// pulumi.String("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cosmos DB SQL Role Definitions can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlRoleDefinition:SqlRoleDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlRoleDefinitions/28b3c337-f436-482b-a167-c2618dc52033
// ```
type SqlRoleDefinition struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.
//
// > **Note:** The resources referenced in assignable scopes need not exist.
AssignableScopes pulumi.StringArrayOutput `pulumi:"assignableScopes"`
// An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.
Name pulumi.StringOutput `pulumi:"name"`
// A `permissions` block as defined below.
Permissions SqlRoleDefinitionPermissionArrayOutput `pulumi:"permissions"`
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.
RoleDefinitionId pulumi.StringOutput `pulumi:"roleDefinitionId"`
// The type of the Cosmos DB SQL Role Definition. Possible values are `BuiltInRole` and `CustomRole`. Defaults to `CustomRole`. Changing this forces a new resource to be created.
Type pulumi.StringPtrOutput `pulumi:"type"`
}
// NewSqlRoleDefinition registers a new resource with the given unique name, arguments, and options.
func NewSqlRoleDefinition(ctx *pulumi.Context,
name string, args *SqlRoleDefinitionArgs, opts ...pulumi.ResourceOption) (*SqlRoleDefinition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.AssignableScopes == nil {
return nil, errors.New("invalid value for required argument 'AssignableScopes'")
}
if args.Permissions == nil {
return nil, errors.New("invalid value for required argument 'Permissions'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlRoleDefinition
err := ctx.RegisterResource("azure:cosmosdb/sqlRoleDefinition:SqlRoleDefinition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlRoleDefinition gets an existing SqlRoleDefinition resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlRoleDefinition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlRoleDefinitionState, opts ...pulumi.ResourceOption) (*SqlRoleDefinition, error) {
var resource SqlRoleDefinition
err := ctx.ReadResource("azure:cosmosdb/sqlRoleDefinition:SqlRoleDefinition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlRoleDefinition resources.
type sqlRoleDefinitionState struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.
//
// > **Note:** The resources referenced in assignable scopes need not exist.
AssignableScopes []string `pulumi:"assignableScopes"`
// An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.
Name *string `pulumi:"name"`
// A `permissions` block as defined below.
Permissions []SqlRoleDefinitionPermission `pulumi:"permissions"`
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.
RoleDefinitionId *string `pulumi:"roleDefinitionId"`
// The type of the Cosmos DB SQL Role Definition. Possible values are `BuiltInRole` and `CustomRole`. Defaults to `CustomRole`. Changing this forces a new resource to be created.
Type *string `pulumi:"type"`
}
type SqlRoleDefinitionState struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.
//
// > **Note:** The resources referenced in assignable scopes need not exist.
AssignableScopes pulumi.StringArrayInput
// An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.
Name pulumi.StringPtrInput
// A `permissions` block as defined below.
Permissions SqlRoleDefinitionPermissionArrayInput
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.
RoleDefinitionId pulumi.StringPtrInput
// The type of the Cosmos DB SQL Role Definition. Possible values are `BuiltInRole` and `CustomRole`. Defaults to `CustomRole`. Changing this forces a new resource to be created.
Type pulumi.StringPtrInput
}
func (SqlRoleDefinitionState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlRoleDefinitionState)(nil)).Elem()
}
type sqlRoleDefinitionArgs struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.
//
// > **Note:** The resources referenced in assignable scopes need not exist.
AssignableScopes []string `pulumi:"assignableScopes"`
// An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.
Name *string `pulumi:"name"`
// A `permissions` block as defined below.
Permissions []SqlRoleDefinitionPermission `pulumi:"permissions"`
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.
RoleDefinitionId *string `pulumi:"roleDefinitionId"`
// The type of the Cosmos DB SQL Role Definition. Possible values are `BuiltInRole` and `CustomRole`. Defaults to `CustomRole`. Changing this forces a new resource to be created.
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a SqlRoleDefinition resource.
type SqlRoleDefinitionArgs struct {
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.
//
// > **Note:** The resources referenced in assignable scopes need not exist.
AssignableScopes pulumi.StringArrayInput
// An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.
Name pulumi.StringPtrInput
// A `permissions` block as defined below.
Permissions SqlRoleDefinitionPermissionArrayInput
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.
RoleDefinitionId pulumi.StringPtrInput
// The type of the Cosmos DB SQL Role Definition. Possible values are `BuiltInRole` and `CustomRole`. Defaults to `CustomRole`. Changing this forces a new resource to be created.
Type pulumi.StringPtrInput
}
func (SqlRoleDefinitionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlRoleDefinitionArgs)(nil)).Elem()
}
type SqlRoleDefinitionInput interface {
pulumi.Input
ToSqlRoleDefinitionOutput() SqlRoleDefinitionOutput
ToSqlRoleDefinitionOutputWithContext(ctx context.Context) SqlRoleDefinitionOutput
}
func (*SqlRoleDefinition) ElementType() reflect.Type {
return reflect.TypeOf((**SqlRoleDefinition)(nil)).Elem()
}
func (i *SqlRoleDefinition) ToSqlRoleDefinitionOutput() SqlRoleDefinitionOutput {
return i.ToSqlRoleDefinitionOutputWithContext(context.Background())
}
func (i *SqlRoleDefinition) ToSqlRoleDefinitionOutputWithContext(ctx context.Context) SqlRoleDefinitionOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlRoleDefinitionOutput)
}
// SqlRoleDefinitionArrayInput is an input type that accepts SqlRoleDefinitionArray and SqlRoleDefinitionArrayOutput values.
// You can construct a concrete instance of `SqlRoleDefinitionArrayInput` via:
//
// SqlRoleDefinitionArray{ SqlRoleDefinitionArgs{...} }
type SqlRoleDefinitionArrayInput interface {
pulumi.Input
ToSqlRoleDefinitionArrayOutput() SqlRoleDefinitionArrayOutput
ToSqlRoleDefinitionArrayOutputWithContext(context.Context) SqlRoleDefinitionArrayOutput
}
type SqlRoleDefinitionArray []SqlRoleDefinitionInput
func (SqlRoleDefinitionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlRoleDefinition)(nil)).Elem()
}
func (i SqlRoleDefinitionArray) ToSqlRoleDefinitionArrayOutput() SqlRoleDefinitionArrayOutput {
return i.ToSqlRoleDefinitionArrayOutputWithContext(context.Background())
}
func (i SqlRoleDefinitionArray) ToSqlRoleDefinitionArrayOutputWithContext(ctx context.Context) SqlRoleDefinitionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlRoleDefinitionArrayOutput)
}
// SqlRoleDefinitionMapInput is an input type that accepts SqlRoleDefinitionMap and SqlRoleDefinitionMapOutput values.
// You can construct a concrete instance of `SqlRoleDefinitionMapInput` via:
//
// SqlRoleDefinitionMap{ "key": SqlRoleDefinitionArgs{...} }
type SqlRoleDefinitionMapInput interface {
pulumi.Input
ToSqlRoleDefinitionMapOutput() SqlRoleDefinitionMapOutput
ToSqlRoleDefinitionMapOutputWithContext(context.Context) SqlRoleDefinitionMapOutput
}
type SqlRoleDefinitionMap map[string]SqlRoleDefinitionInput
func (SqlRoleDefinitionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlRoleDefinition)(nil)).Elem()
}
func (i SqlRoleDefinitionMap) ToSqlRoleDefinitionMapOutput() SqlRoleDefinitionMapOutput {
return i.ToSqlRoleDefinitionMapOutputWithContext(context.Background())
}
func (i SqlRoleDefinitionMap) ToSqlRoleDefinitionMapOutputWithContext(ctx context.Context) SqlRoleDefinitionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlRoleDefinitionMapOutput)
}
type SqlRoleDefinitionOutput struct{ *pulumi.OutputState }
func (SqlRoleDefinitionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlRoleDefinition)(nil)).Elem()
}
func (o SqlRoleDefinitionOutput) ToSqlRoleDefinitionOutput() SqlRoleDefinitionOutput {
return o
}
func (o SqlRoleDefinitionOutput) ToSqlRoleDefinitionOutputWithContext(ctx context.Context) SqlRoleDefinitionOutput {
return o
}
// The name of the Cosmos DB Account. Changing this forces a new resource to be created.
func (o SqlRoleDefinitionOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleDefinition) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.
//
// > **Note:** The resources referenced in assignable scopes need not exist.
func (o SqlRoleDefinitionOutput) AssignableScopes() pulumi.StringArrayOutput {
return o.ApplyT(func(v *SqlRoleDefinition) pulumi.StringArrayOutput { return v.AssignableScopes }).(pulumi.StringArrayOutput)
}
// An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.
func (o SqlRoleDefinitionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleDefinition) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A `permissions` block as defined below.
func (o SqlRoleDefinitionOutput) Permissions() SqlRoleDefinitionPermissionArrayOutput {
return o.ApplyT(func(v *SqlRoleDefinition) SqlRoleDefinitionPermissionArrayOutput { return v.Permissions }).(SqlRoleDefinitionPermissionArrayOutput)
}
// The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.
func (o SqlRoleDefinitionOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleDefinition) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.
func (o SqlRoleDefinitionOutput) RoleDefinitionId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlRoleDefinition) pulumi.StringOutput { return v.RoleDefinitionId }).(pulumi.StringOutput)
}
// The type of the Cosmos DB SQL Role Definition. Possible values are `BuiltInRole` and `CustomRole`. Defaults to `CustomRole`. Changing this forces a new resource to be created.
func (o SqlRoleDefinitionOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SqlRoleDefinition) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput)
}
type SqlRoleDefinitionArrayOutput struct{ *pulumi.OutputState }
func (SqlRoleDefinitionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlRoleDefinition)(nil)).Elem()
}
func (o SqlRoleDefinitionArrayOutput) ToSqlRoleDefinitionArrayOutput() SqlRoleDefinitionArrayOutput {
return o
}
func (o SqlRoleDefinitionArrayOutput) ToSqlRoleDefinitionArrayOutputWithContext(ctx context.Context) SqlRoleDefinitionArrayOutput {
return o
}
func (o SqlRoleDefinitionArrayOutput) Index(i pulumi.IntInput) SqlRoleDefinitionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlRoleDefinition {
return vs[0].([]*SqlRoleDefinition)[vs[1].(int)]
}).(SqlRoleDefinitionOutput)
}
type SqlRoleDefinitionMapOutput struct{ *pulumi.OutputState }
func (SqlRoleDefinitionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlRoleDefinition)(nil)).Elem()
}
func (o SqlRoleDefinitionMapOutput) ToSqlRoleDefinitionMapOutput() SqlRoleDefinitionMapOutput {
return o
}
func (o SqlRoleDefinitionMapOutput) ToSqlRoleDefinitionMapOutputWithContext(ctx context.Context) SqlRoleDefinitionMapOutput {
return o
}
func (o SqlRoleDefinitionMapOutput) MapIndex(k pulumi.StringInput) SqlRoleDefinitionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlRoleDefinition {
return vs[0].(map[string]*SqlRoleDefinition)[vs[1].(string)]
}).(SqlRoleDefinitionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlRoleDefinitionInput)(nil)).Elem(), &SqlRoleDefinition{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlRoleDefinitionArrayInput)(nil)).Elem(), SqlRoleDefinitionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlRoleDefinitionMapInput)(nil)).Elem(), SqlRoleDefinitionMap{})
pulumi.RegisterOutputType(SqlRoleDefinitionOutput{})
pulumi.RegisterOutputType(SqlRoleDefinitionArrayOutput{})
pulumi.RegisterOutputType(SqlRoleDefinitionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/cassandraDatacenter.go | sdk/go/azure/cosmosdb/cassandraDatacenter.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cassandra Datacenter.
//
// > **Note:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant:
//
// ## Import
//
// Cassandra Datacenters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/cassandraDatacenter:CassandraDatacenter example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DocumentDB/cassandraClusters/cluster1/dataCenters/dc1
// ```
type CassandraDatacenter struct {
pulumi.CustomResourceState
// Determines whether availability zones are enabled. Defaults to `true`.
AvailabilityZonesEnabled pulumi.BoolPtrOutput `pulumi:"availabilityZonesEnabled"`
// The key URI of the customer key to use for the encryption of the backup Storage Account.
BackupStorageCustomerKeyUri pulumi.StringPtrOutput `pulumi:"backupStorageCustomerKeyUri"`
// The fragment of the cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this Cassandra Datacenter. The fragment should be Base64 encoded and only a subset of keys is allowed.
Base64EncodedYamlFragment pulumi.StringPtrOutput `pulumi:"base64EncodedYamlFragment"`
// The ID of the Cassandra Cluster. Changing this forces a new Cassandra Datacenter to be created.
CassandraClusterId pulumi.StringOutput `pulumi:"cassandraClusterId"`
// The ID of the delegated management subnet for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
DelegatedManagementSubnetId pulumi.StringOutput `pulumi:"delegatedManagementSubnetId"`
// Determines the number of p30 disks that are attached to each node.
DiskCount pulumi.IntPtrOutput `pulumi:"diskCount"`
// The Disk SKU that is used for this Cassandra Datacenter. Defaults to `P30`.
DiskSku pulumi.StringPtrOutput `pulumi:"diskSku"`
// The Azure Region where the Cassandra Datacenter should exist. Changing this forces a new Cassandra Datacenter to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The key URI of the customer key to use for the encryption of the Managed Disk.
ManagedDiskCustomerKeyUri pulumi.StringPtrOutput `pulumi:"managedDiskCustomerKeyUri"`
// The name which should be used for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The number of nodes the Cassandra Datacenter should have. The number should be equal or greater than `3`. Defaults to `3`.
NodeCount pulumi.IntPtrOutput `pulumi:"nodeCount"`
// A list of IP Address for the seed nodes in this Cassandra Datacenter.
SeedNodeIpAddresses pulumi.StringArrayOutput `pulumi:"seedNodeIpAddresses"`
// Determines the selected sku. Defaults to `Standard_E16s_v5`.
//
// > **Note:** In v4.0 of the provider the `skuName` will have a default value of `Standard_E16s_v5`.
SkuName pulumi.StringPtrOutput `pulumi:"skuName"`
}
// NewCassandraDatacenter registers a new resource with the given unique name, arguments, and options.
func NewCassandraDatacenter(ctx *pulumi.Context,
name string, args *CassandraDatacenterArgs, opts ...pulumi.ResourceOption) (*CassandraDatacenter, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CassandraClusterId == nil {
return nil, errors.New("invalid value for required argument 'CassandraClusterId'")
}
if args.DelegatedManagementSubnetId == nil {
return nil, errors.New("invalid value for required argument 'DelegatedManagementSubnetId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource CassandraDatacenter
err := ctx.RegisterResource("azure:cosmosdb/cassandraDatacenter:CassandraDatacenter", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCassandraDatacenter gets an existing CassandraDatacenter resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCassandraDatacenter(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CassandraDatacenterState, opts ...pulumi.ResourceOption) (*CassandraDatacenter, error) {
var resource CassandraDatacenter
err := ctx.ReadResource("azure:cosmosdb/cassandraDatacenter:CassandraDatacenter", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CassandraDatacenter resources.
type cassandraDatacenterState struct {
// Determines whether availability zones are enabled. Defaults to `true`.
AvailabilityZonesEnabled *bool `pulumi:"availabilityZonesEnabled"`
// The key URI of the customer key to use for the encryption of the backup Storage Account.
BackupStorageCustomerKeyUri *string `pulumi:"backupStorageCustomerKeyUri"`
// The fragment of the cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this Cassandra Datacenter. The fragment should be Base64 encoded and only a subset of keys is allowed.
Base64EncodedYamlFragment *string `pulumi:"base64EncodedYamlFragment"`
// The ID of the Cassandra Cluster. Changing this forces a new Cassandra Datacenter to be created.
CassandraClusterId *string `pulumi:"cassandraClusterId"`
// The ID of the delegated management subnet for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
DelegatedManagementSubnetId *string `pulumi:"delegatedManagementSubnetId"`
// Determines the number of p30 disks that are attached to each node.
DiskCount *int `pulumi:"diskCount"`
// The Disk SKU that is used for this Cassandra Datacenter. Defaults to `P30`.
DiskSku *string `pulumi:"diskSku"`
// The Azure Region where the Cassandra Datacenter should exist. Changing this forces a new Cassandra Datacenter to be created.
Location *string `pulumi:"location"`
// The key URI of the customer key to use for the encryption of the Managed Disk.
ManagedDiskCustomerKeyUri *string `pulumi:"managedDiskCustomerKeyUri"`
// The name which should be used for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
Name *string `pulumi:"name"`
// The number of nodes the Cassandra Datacenter should have. The number should be equal or greater than `3`. Defaults to `3`.
NodeCount *int `pulumi:"nodeCount"`
// A list of IP Address for the seed nodes in this Cassandra Datacenter.
SeedNodeIpAddresses []string `pulumi:"seedNodeIpAddresses"`
// Determines the selected sku. Defaults to `Standard_E16s_v5`.
//
// > **Note:** In v4.0 of the provider the `skuName` will have a default value of `Standard_E16s_v5`.
SkuName *string `pulumi:"skuName"`
}
type CassandraDatacenterState struct {
// Determines whether availability zones are enabled. Defaults to `true`.
AvailabilityZonesEnabled pulumi.BoolPtrInput
// The key URI of the customer key to use for the encryption of the backup Storage Account.
BackupStorageCustomerKeyUri pulumi.StringPtrInput
// The fragment of the cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this Cassandra Datacenter. The fragment should be Base64 encoded and only a subset of keys is allowed.
Base64EncodedYamlFragment pulumi.StringPtrInput
// The ID of the Cassandra Cluster. Changing this forces a new Cassandra Datacenter to be created.
CassandraClusterId pulumi.StringPtrInput
// The ID of the delegated management subnet for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
DelegatedManagementSubnetId pulumi.StringPtrInput
// Determines the number of p30 disks that are attached to each node.
DiskCount pulumi.IntPtrInput
// The Disk SKU that is used for this Cassandra Datacenter. Defaults to `P30`.
DiskSku pulumi.StringPtrInput
// The Azure Region where the Cassandra Datacenter should exist. Changing this forces a new Cassandra Datacenter to be created.
Location pulumi.StringPtrInput
// The key URI of the customer key to use for the encryption of the Managed Disk.
ManagedDiskCustomerKeyUri pulumi.StringPtrInput
// The name which should be used for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
Name pulumi.StringPtrInput
// The number of nodes the Cassandra Datacenter should have. The number should be equal or greater than `3`. Defaults to `3`.
NodeCount pulumi.IntPtrInput
// A list of IP Address for the seed nodes in this Cassandra Datacenter.
SeedNodeIpAddresses pulumi.StringArrayInput
// Determines the selected sku. Defaults to `Standard_E16s_v5`.
//
// > **Note:** In v4.0 of the provider the `skuName` will have a default value of `Standard_E16s_v5`.
SkuName pulumi.StringPtrInput
}
func (CassandraDatacenterState) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraDatacenterState)(nil)).Elem()
}
type cassandraDatacenterArgs struct {
// Determines whether availability zones are enabled. Defaults to `true`.
AvailabilityZonesEnabled *bool `pulumi:"availabilityZonesEnabled"`
// The key URI of the customer key to use for the encryption of the backup Storage Account.
BackupStorageCustomerKeyUri *string `pulumi:"backupStorageCustomerKeyUri"`
// The fragment of the cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this Cassandra Datacenter. The fragment should be Base64 encoded and only a subset of keys is allowed.
Base64EncodedYamlFragment *string `pulumi:"base64EncodedYamlFragment"`
// The ID of the Cassandra Cluster. Changing this forces a new Cassandra Datacenter to be created.
CassandraClusterId string `pulumi:"cassandraClusterId"`
// The ID of the delegated management subnet for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
DelegatedManagementSubnetId string `pulumi:"delegatedManagementSubnetId"`
// Determines the number of p30 disks that are attached to each node.
DiskCount *int `pulumi:"diskCount"`
// The Disk SKU that is used for this Cassandra Datacenter. Defaults to `P30`.
DiskSku *string `pulumi:"diskSku"`
// The Azure Region where the Cassandra Datacenter should exist. Changing this forces a new Cassandra Datacenter to be created.
Location *string `pulumi:"location"`
// The key URI of the customer key to use for the encryption of the Managed Disk.
ManagedDiskCustomerKeyUri *string `pulumi:"managedDiskCustomerKeyUri"`
// The name which should be used for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
Name *string `pulumi:"name"`
// The number of nodes the Cassandra Datacenter should have. The number should be equal or greater than `3`. Defaults to `3`.
NodeCount *int `pulumi:"nodeCount"`
// Determines the selected sku. Defaults to `Standard_E16s_v5`.
//
// > **Note:** In v4.0 of the provider the `skuName` will have a default value of `Standard_E16s_v5`.
SkuName *string `pulumi:"skuName"`
}
// The set of arguments for constructing a CassandraDatacenter resource.
type CassandraDatacenterArgs struct {
// Determines whether availability zones are enabled. Defaults to `true`.
AvailabilityZonesEnabled pulumi.BoolPtrInput
// The key URI of the customer key to use for the encryption of the backup Storage Account.
BackupStorageCustomerKeyUri pulumi.StringPtrInput
// The fragment of the cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this Cassandra Datacenter. The fragment should be Base64 encoded and only a subset of keys is allowed.
Base64EncodedYamlFragment pulumi.StringPtrInput
// The ID of the Cassandra Cluster. Changing this forces a new Cassandra Datacenter to be created.
CassandraClusterId pulumi.StringInput
// The ID of the delegated management subnet for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
DelegatedManagementSubnetId pulumi.StringInput
// Determines the number of p30 disks that are attached to each node.
DiskCount pulumi.IntPtrInput
// The Disk SKU that is used for this Cassandra Datacenter. Defaults to `P30`.
DiskSku pulumi.StringPtrInput
// The Azure Region where the Cassandra Datacenter should exist. Changing this forces a new Cassandra Datacenter to be created.
Location pulumi.StringPtrInput
// The key URI of the customer key to use for the encryption of the Managed Disk.
ManagedDiskCustomerKeyUri pulumi.StringPtrInput
// The name which should be used for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
Name pulumi.StringPtrInput
// The number of nodes the Cassandra Datacenter should have. The number should be equal or greater than `3`. Defaults to `3`.
NodeCount pulumi.IntPtrInput
// Determines the selected sku. Defaults to `Standard_E16s_v5`.
//
// > **Note:** In v4.0 of the provider the `skuName` will have a default value of `Standard_E16s_v5`.
SkuName pulumi.StringPtrInput
}
func (CassandraDatacenterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraDatacenterArgs)(nil)).Elem()
}
type CassandraDatacenterInput interface {
pulumi.Input
ToCassandraDatacenterOutput() CassandraDatacenterOutput
ToCassandraDatacenterOutputWithContext(ctx context.Context) CassandraDatacenterOutput
}
func (*CassandraDatacenter) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraDatacenter)(nil)).Elem()
}
func (i *CassandraDatacenter) ToCassandraDatacenterOutput() CassandraDatacenterOutput {
return i.ToCassandraDatacenterOutputWithContext(context.Background())
}
func (i *CassandraDatacenter) ToCassandraDatacenterOutputWithContext(ctx context.Context) CassandraDatacenterOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraDatacenterOutput)
}
// CassandraDatacenterArrayInput is an input type that accepts CassandraDatacenterArray and CassandraDatacenterArrayOutput values.
// You can construct a concrete instance of `CassandraDatacenterArrayInput` via:
//
// CassandraDatacenterArray{ CassandraDatacenterArgs{...} }
type CassandraDatacenterArrayInput interface {
pulumi.Input
ToCassandraDatacenterArrayOutput() CassandraDatacenterArrayOutput
ToCassandraDatacenterArrayOutputWithContext(context.Context) CassandraDatacenterArrayOutput
}
type CassandraDatacenterArray []CassandraDatacenterInput
func (CassandraDatacenterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraDatacenter)(nil)).Elem()
}
func (i CassandraDatacenterArray) ToCassandraDatacenterArrayOutput() CassandraDatacenterArrayOutput {
return i.ToCassandraDatacenterArrayOutputWithContext(context.Background())
}
func (i CassandraDatacenterArray) ToCassandraDatacenterArrayOutputWithContext(ctx context.Context) CassandraDatacenterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraDatacenterArrayOutput)
}
// CassandraDatacenterMapInput is an input type that accepts CassandraDatacenterMap and CassandraDatacenterMapOutput values.
// You can construct a concrete instance of `CassandraDatacenterMapInput` via:
//
// CassandraDatacenterMap{ "key": CassandraDatacenterArgs{...} }
type CassandraDatacenterMapInput interface {
pulumi.Input
ToCassandraDatacenterMapOutput() CassandraDatacenterMapOutput
ToCassandraDatacenterMapOutputWithContext(context.Context) CassandraDatacenterMapOutput
}
type CassandraDatacenterMap map[string]CassandraDatacenterInput
func (CassandraDatacenterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraDatacenter)(nil)).Elem()
}
func (i CassandraDatacenterMap) ToCassandraDatacenterMapOutput() CassandraDatacenterMapOutput {
return i.ToCassandraDatacenterMapOutputWithContext(context.Background())
}
func (i CassandraDatacenterMap) ToCassandraDatacenterMapOutputWithContext(ctx context.Context) CassandraDatacenterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraDatacenterMapOutput)
}
type CassandraDatacenterOutput struct{ *pulumi.OutputState }
func (CassandraDatacenterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraDatacenter)(nil)).Elem()
}
func (o CassandraDatacenterOutput) ToCassandraDatacenterOutput() CassandraDatacenterOutput {
return o
}
func (o CassandraDatacenterOutput) ToCassandraDatacenterOutputWithContext(ctx context.Context) CassandraDatacenterOutput {
return o
}
// Determines whether availability zones are enabled. Defaults to `true`.
func (o CassandraDatacenterOutput) AvailabilityZonesEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.BoolPtrOutput { return v.AvailabilityZonesEnabled }).(pulumi.BoolPtrOutput)
}
// The key URI of the customer key to use for the encryption of the backup Storage Account.
func (o CassandraDatacenterOutput) BackupStorageCustomerKeyUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringPtrOutput { return v.BackupStorageCustomerKeyUri }).(pulumi.StringPtrOutput)
}
// The fragment of the cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this Cassandra Datacenter. The fragment should be Base64 encoded and only a subset of keys is allowed.
func (o CassandraDatacenterOutput) Base64EncodedYamlFragment() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringPtrOutput { return v.Base64EncodedYamlFragment }).(pulumi.StringPtrOutput)
}
// The ID of the Cassandra Cluster. Changing this forces a new Cassandra Datacenter to be created.
func (o CassandraDatacenterOutput) CassandraClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringOutput { return v.CassandraClusterId }).(pulumi.StringOutput)
}
// The ID of the delegated management subnet for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
func (o CassandraDatacenterOutput) DelegatedManagementSubnetId() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringOutput { return v.DelegatedManagementSubnetId }).(pulumi.StringOutput)
}
// Determines the number of p30 disks that are attached to each node.
func (o CassandraDatacenterOutput) DiskCount() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.IntPtrOutput { return v.DiskCount }).(pulumi.IntPtrOutput)
}
// The Disk SKU that is used for this Cassandra Datacenter. Defaults to `P30`.
func (o CassandraDatacenterOutput) DiskSku() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringPtrOutput { return v.DiskSku }).(pulumi.StringPtrOutput)
}
// The Azure Region where the Cassandra Datacenter should exist. Changing this forces a new Cassandra Datacenter to be created.
func (o CassandraDatacenterOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The key URI of the customer key to use for the encryption of the Managed Disk.
func (o CassandraDatacenterOutput) ManagedDiskCustomerKeyUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringPtrOutput { return v.ManagedDiskCustomerKeyUri }).(pulumi.StringPtrOutput)
}
// The name which should be used for this Cassandra Datacenter. Changing this forces a new Cassandra Datacenter to be created.
func (o CassandraDatacenterOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The number of nodes the Cassandra Datacenter should have. The number should be equal or greater than `3`. Defaults to `3`.
func (o CassandraDatacenterOutput) NodeCount() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.IntPtrOutput { return v.NodeCount }).(pulumi.IntPtrOutput)
}
// A list of IP Address for the seed nodes in this Cassandra Datacenter.
func (o CassandraDatacenterOutput) SeedNodeIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringArrayOutput { return v.SeedNodeIpAddresses }).(pulumi.StringArrayOutput)
}
// Determines the selected sku. Defaults to `Standard_E16s_v5`.
//
// > **Note:** In v4.0 of the provider the `skuName` will have a default value of `Standard_E16s_v5`.
func (o CassandraDatacenterOutput) SkuName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CassandraDatacenter) pulumi.StringPtrOutput { return v.SkuName }).(pulumi.StringPtrOutput)
}
type CassandraDatacenterArrayOutput struct{ *pulumi.OutputState }
func (CassandraDatacenterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraDatacenter)(nil)).Elem()
}
func (o CassandraDatacenterArrayOutput) ToCassandraDatacenterArrayOutput() CassandraDatacenterArrayOutput {
return o
}
func (o CassandraDatacenterArrayOutput) ToCassandraDatacenterArrayOutputWithContext(ctx context.Context) CassandraDatacenterArrayOutput {
return o
}
func (o CassandraDatacenterArrayOutput) Index(i pulumi.IntInput) CassandraDatacenterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CassandraDatacenter {
return vs[0].([]*CassandraDatacenter)[vs[1].(int)]
}).(CassandraDatacenterOutput)
}
type CassandraDatacenterMapOutput struct{ *pulumi.OutputState }
func (CassandraDatacenterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraDatacenter)(nil)).Elem()
}
func (o CassandraDatacenterMapOutput) ToCassandraDatacenterMapOutput() CassandraDatacenterMapOutput {
return o
}
func (o CassandraDatacenterMapOutput) ToCassandraDatacenterMapOutputWithContext(ctx context.Context) CassandraDatacenterMapOutput {
return o
}
func (o CassandraDatacenterMapOutput) MapIndex(k pulumi.StringInput) CassandraDatacenterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CassandraDatacenter {
return vs[0].(map[string]*CassandraDatacenter)[vs[1].(string)]
}).(CassandraDatacenterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CassandraDatacenterInput)(nil)).Elem(), &CassandraDatacenter{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraDatacenterArrayInput)(nil)).Elem(), CassandraDatacenterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraDatacenterMapInput)(nil)).Elem(), CassandraDatacenterMap{})
pulumi.RegisterOutputType(CassandraDatacenterOutput{})
pulumi.RegisterOutputType(CassandraDatacenterArrayOutput{})
pulumi.RegisterOutputType(CassandraDatacenterMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlTrigger.go | sdk/go/azure/cosmosdb/sqlTrigger.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an SQL Trigger.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "example", &cosmosdb.SqlContainerArgs{
// Name: pulumi.String("example-container"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleSqlDatabase.Name,
// PartitionKeyPath: "/id",
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlTrigger(ctx, "example", &cosmosdb.SqlTriggerArgs{
// Name: pulumi.String("test-trigger"),
// ContainerId: exampleSqlContainer.ID(),
// Body: pulumi.String("function trigger(){}"),
// Operation: pulumi.String("Delete"),
// Type: pulumi.String("Post"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// SQL Triggers can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlTrigger:SqlTrigger example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/database1/containers/container1/triggers/trigger1
// ```
type SqlTrigger struct {
pulumi.CustomResourceState
// Body of the Trigger.
Body pulumi.StringOutput `pulumi:"body"`
// The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
ContainerId pulumi.StringOutput `pulumi:"containerId"`
// The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The operation the trigger is associated with. Possible values are `All`, `Create`, `Update`, `Delete` and `Replace`.
Operation pulumi.StringOutput `pulumi:"operation"`
// Type of the Trigger. Possible values are `Pre` and `Post`.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewSqlTrigger registers a new resource with the given unique name, arguments, and options.
func NewSqlTrigger(ctx *pulumi.Context,
name string, args *SqlTriggerArgs, opts ...pulumi.ResourceOption) (*SqlTrigger, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Body == nil {
return nil, errors.New("invalid value for required argument 'Body'")
}
if args.ContainerId == nil {
return nil, errors.New("invalid value for required argument 'ContainerId'")
}
if args.Operation == nil {
return nil, errors.New("invalid value for required argument 'Operation'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlTrigger
err := ctx.RegisterResource("azure:cosmosdb/sqlTrigger:SqlTrigger", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlTrigger gets an existing SqlTrigger resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlTrigger(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlTriggerState, opts ...pulumi.ResourceOption) (*SqlTrigger, error) {
var resource SqlTrigger
err := ctx.ReadResource("azure:cosmosdb/sqlTrigger:SqlTrigger", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlTrigger resources.
type sqlTriggerState struct {
// Body of the Trigger.
Body *string `pulumi:"body"`
// The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
ContainerId *string `pulumi:"containerId"`
// The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
Name *string `pulumi:"name"`
// The operation the trigger is associated with. Possible values are `All`, `Create`, `Update`, `Delete` and `Replace`.
Operation *string `pulumi:"operation"`
// Type of the Trigger. Possible values are `Pre` and `Post`.
Type *string `pulumi:"type"`
}
type SqlTriggerState struct {
// Body of the Trigger.
Body pulumi.StringPtrInput
// The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
ContainerId pulumi.StringPtrInput
// The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
Name pulumi.StringPtrInput
// The operation the trigger is associated with. Possible values are `All`, `Create`, `Update`, `Delete` and `Replace`.
Operation pulumi.StringPtrInput
// Type of the Trigger. Possible values are `Pre` and `Post`.
Type pulumi.StringPtrInput
}
func (SqlTriggerState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlTriggerState)(nil)).Elem()
}
type sqlTriggerArgs struct {
// Body of the Trigger.
Body string `pulumi:"body"`
// The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
ContainerId string `pulumi:"containerId"`
// The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
Name *string `pulumi:"name"`
// The operation the trigger is associated with. Possible values are `All`, `Create`, `Update`, `Delete` and `Replace`.
Operation string `pulumi:"operation"`
// Type of the Trigger. Possible values are `Pre` and `Post`.
Type string `pulumi:"type"`
}
// The set of arguments for constructing a SqlTrigger resource.
type SqlTriggerArgs struct {
// Body of the Trigger.
Body pulumi.StringInput
// The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
ContainerId pulumi.StringInput
// The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
Name pulumi.StringPtrInput
// The operation the trigger is associated with. Possible values are `All`, `Create`, `Update`, `Delete` and `Replace`.
Operation pulumi.StringInput
// Type of the Trigger. Possible values are `Pre` and `Post`.
Type pulumi.StringInput
}
func (SqlTriggerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlTriggerArgs)(nil)).Elem()
}
type SqlTriggerInput interface {
pulumi.Input
ToSqlTriggerOutput() SqlTriggerOutput
ToSqlTriggerOutputWithContext(ctx context.Context) SqlTriggerOutput
}
func (*SqlTrigger) ElementType() reflect.Type {
return reflect.TypeOf((**SqlTrigger)(nil)).Elem()
}
func (i *SqlTrigger) ToSqlTriggerOutput() SqlTriggerOutput {
return i.ToSqlTriggerOutputWithContext(context.Background())
}
func (i *SqlTrigger) ToSqlTriggerOutputWithContext(ctx context.Context) SqlTriggerOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlTriggerOutput)
}
// SqlTriggerArrayInput is an input type that accepts SqlTriggerArray and SqlTriggerArrayOutput values.
// You can construct a concrete instance of `SqlTriggerArrayInput` via:
//
// SqlTriggerArray{ SqlTriggerArgs{...} }
type SqlTriggerArrayInput interface {
pulumi.Input
ToSqlTriggerArrayOutput() SqlTriggerArrayOutput
ToSqlTriggerArrayOutputWithContext(context.Context) SqlTriggerArrayOutput
}
type SqlTriggerArray []SqlTriggerInput
func (SqlTriggerArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlTrigger)(nil)).Elem()
}
func (i SqlTriggerArray) ToSqlTriggerArrayOutput() SqlTriggerArrayOutput {
return i.ToSqlTriggerArrayOutputWithContext(context.Background())
}
func (i SqlTriggerArray) ToSqlTriggerArrayOutputWithContext(ctx context.Context) SqlTriggerArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlTriggerArrayOutput)
}
// SqlTriggerMapInput is an input type that accepts SqlTriggerMap and SqlTriggerMapOutput values.
// You can construct a concrete instance of `SqlTriggerMapInput` via:
//
// SqlTriggerMap{ "key": SqlTriggerArgs{...} }
type SqlTriggerMapInput interface {
pulumi.Input
ToSqlTriggerMapOutput() SqlTriggerMapOutput
ToSqlTriggerMapOutputWithContext(context.Context) SqlTriggerMapOutput
}
type SqlTriggerMap map[string]SqlTriggerInput
func (SqlTriggerMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlTrigger)(nil)).Elem()
}
func (i SqlTriggerMap) ToSqlTriggerMapOutput() SqlTriggerMapOutput {
return i.ToSqlTriggerMapOutputWithContext(context.Background())
}
func (i SqlTriggerMap) ToSqlTriggerMapOutputWithContext(ctx context.Context) SqlTriggerMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlTriggerMapOutput)
}
type SqlTriggerOutput struct{ *pulumi.OutputState }
func (SqlTriggerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlTrigger)(nil)).Elem()
}
func (o SqlTriggerOutput) ToSqlTriggerOutput() SqlTriggerOutput {
return o
}
func (o SqlTriggerOutput) ToSqlTriggerOutputWithContext(ctx context.Context) SqlTriggerOutput {
return o
}
// Body of the Trigger.
func (o SqlTriggerOutput) Body() pulumi.StringOutput {
return o.ApplyT(func(v *SqlTrigger) pulumi.StringOutput { return v.Body }).(pulumi.StringOutput)
}
// The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
func (o SqlTriggerOutput) ContainerId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlTrigger) pulumi.StringOutput { return v.ContainerId }).(pulumi.StringOutput)
}
// The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
func (o SqlTriggerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlTrigger) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The operation the trigger is associated with. Possible values are `All`, `Create`, `Update`, `Delete` and `Replace`.
func (o SqlTriggerOutput) Operation() pulumi.StringOutput {
return o.ApplyT(func(v *SqlTrigger) pulumi.StringOutput { return v.Operation }).(pulumi.StringOutput)
}
// Type of the Trigger. Possible values are `Pre` and `Post`.
func (o SqlTriggerOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *SqlTrigger) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type SqlTriggerArrayOutput struct{ *pulumi.OutputState }
func (SqlTriggerArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlTrigger)(nil)).Elem()
}
func (o SqlTriggerArrayOutput) ToSqlTriggerArrayOutput() SqlTriggerArrayOutput {
return o
}
func (o SqlTriggerArrayOutput) ToSqlTriggerArrayOutputWithContext(ctx context.Context) SqlTriggerArrayOutput {
return o
}
func (o SqlTriggerArrayOutput) Index(i pulumi.IntInput) SqlTriggerOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlTrigger {
return vs[0].([]*SqlTrigger)[vs[1].(int)]
}).(SqlTriggerOutput)
}
type SqlTriggerMapOutput struct{ *pulumi.OutputState }
func (SqlTriggerMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlTrigger)(nil)).Elem()
}
func (o SqlTriggerMapOutput) ToSqlTriggerMapOutput() SqlTriggerMapOutput {
return o
}
func (o SqlTriggerMapOutput) ToSqlTriggerMapOutputWithContext(ctx context.Context) SqlTriggerMapOutput {
return o
}
func (o SqlTriggerMapOutput) MapIndex(k pulumi.StringInput) SqlTriggerOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlTrigger {
return vs[0].(map[string]*SqlTrigger)[vs[1].(string)]
}).(SqlTriggerOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlTriggerInput)(nil)).Elem(), &SqlTrigger{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlTriggerArrayInput)(nil)).Elem(), SqlTriggerArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlTriggerMapInput)(nil)).Elem(), SqlTriggerMap{})
pulumi.RegisterOutputType(SqlTriggerOutput{})
pulumi.RegisterOutputType(SqlTriggerArrayOutput{})
pulumi.RegisterOutputType(SqlTriggerMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/mongoUserDefinition.go | sdk/go/azure/cosmosdb/mongoUserDefinition.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cosmos DB Mongo User Definition.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("example-ca"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("MongoDB"),
// Capabilities: cosmosdb.AccountCapabilityArray{
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableMongo"),
// },
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableMongoRoleBasedAccessControl"),
// },
// },
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleMongoDatabase, err := cosmosdb.NewMongoDatabase(ctx, "example", &cosmosdb.MongoDatabaseArgs{
// Name: pulumi.String("example-mongodb"),
// ResourceGroupName: exampleAccount.ResourceGroupName,
// AccountName: exampleAccount.Name,
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewMongoUserDefinition(ctx, "example", &cosmosdb.MongoUserDefinitionArgs{
// CosmosMongoDatabaseId: exampleMongoDatabase.ID(),
// Username: pulumi.String("myUserName"),
// Password: pulumi.String("myPassword"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2022-11-15
//
// ## Import
//
// Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/mongoUserDefinition:MongoUserDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/mongodbUserDefinitions/dbname1.username1
// ```
type MongoUserDefinition struct {
pulumi.CustomResourceState
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId pulumi.StringOutput `pulumi:"cosmosMongoDatabaseId"`
// A list of Mongo Roles that are inherited to the Mongo User Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames pulumi.StringArrayOutput `pulumi:"inheritedRoleNames"`
// The password for the Mongo User Definition.
Password pulumi.StringOutput `pulumi:"password"`
// The username for the Mongo User Definition. Changing this forces a new resource to be created.
Username pulumi.StringOutput `pulumi:"username"`
}
// NewMongoUserDefinition registers a new resource with the given unique name, arguments, and options.
func NewMongoUserDefinition(ctx *pulumi.Context,
name string, args *MongoUserDefinitionArgs, opts ...pulumi.ResourceOption) (*MongoUserDefinition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CosmosMongoDatabaseId == nil {
return nil, errors.New("invalid value for required argument 'CosmosMongoDatabaseId'")
}
if args.Password == nil {
return nil, errors.New("invalid value for required argument 'Password'")
}
if args.Username == nil {
return nil, errors.New("invalid value for required argument 'Username'")
}
if args.Password != nil {
args.Password = pulumi.ToSecret(args.Password).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"password",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource MongoUserDefinition
err := ctx.RegisterResource("azure:cosmosdb/mongoUserDefinition:MongoUserDefinition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMongoUserDefinition gets an existing MongoUserDefinition resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMongoUserDefinition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MongoUserDefinitionState, opts ...pulumi.ResourceOption) (*MongoUserDefinition, error) {
var resource MongoUserDefinition
err := ctx.ReadResource("azure:cosmosdb/mongoUserDefinition:MongoUserDefinition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MongoUserDefinition resources.
type mongoUserDefinitionState struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId *string `pulumi:"cosmosMongoDatabaseId"`
// A list of Mongo Roles that are inherited to the Mongo User Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames []string `pulumi:"inheritedRoleNames"`
// The password for the Mongo User Definition.
Password *string `pulumi:"password"`
// The username for the Mongo User Definition. Changing this forces a new resource to be created.
Username *string `pulumi:"username"`
}
type MongoUserDefinitionState struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId pulumi.StringPtrInput
// A list of Mongo Roles that are inherited to the Mongo User Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames pulumi.StringArrayInput
// The password for the Mongo User Definition.
Password pulumi.StringPtrInput
// The username for the Mongo User Definition. Changing this forces a new resource to be created.
Username pulumi.StringPtrInput
}
func (MongoUserDefinitionState) ElementType() reflect.Type {
return reflect.TypeOf((*mongoUserDefinitionState)(nil)).Elem()
}
type mongoUserDefinitionArgs struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId string `pulumi:"cosmosMongoDatabaseId"`
// A list of Mongo Roles that are inherited to the Mongo User Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames []string `pulumi:"inheritedRoleNames"`
// The password for the Mongo User Definition.
Password string `pulumi:"password"`
// The username for the Mongo User Definition. Changing this forces a new resource to be created.
Username string `pulumi:"username"`
}
// The set of arguments for constructing a MongoUserDefinition resource.
type MongoUserDefinitionArgs struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId pulumi.StringInput
// A list of Mongo Roles that are inherited to the Mongo User Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames pulumi.StringArrayInput
// The password for the Mongo User Definition.
Password pulumi.StringInput
// The username for the Mongo User Definition. Changing this forces a new resource to be created.
Username pulumi.StringInput
}
func (MongoUserDefinitionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mongoUserDefinitionArgs)(nil)).Elem()
}
type MongoUserDefinitionInput interface {
pulumi.Input
ToMongoUserDefinitionOutput() MongoUserDefinitionOutput
ToMongoUserDefinitionOutputWithContext(ctx context.Context) MongoUserDefinitionOutput
}
func (*MongoUserDefinition) ElementType() reflect.Type {
return reflect.TypeOf((**MongoUserDefinition)(nil)).Elem()
}
func (i *MongoUserDefinition) ToMongoUserDefinitionOutput() MongoUserDefinitionOutput {
return i.ToMongoUserDefinitionOutputWithContext(context.Background())
}
func (i *MongoUserDefinition) ToMongoUserDefinitionOutputWithContext(ctx context.Context) MongoUserDefinitionOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoUserDefinitionOutput)
}
// MongoUserDefinitionArrayInput is an input type that accepts MongoUserDefinitionArray and MongoUserDefinitionArrayOutput values.
// You can construct a concrete instance of `MongoUserDefinitionArrayInput` via:
//
// MongoUserDefinitionArray{ MongoUserDefinitionArgs{...} }
type MongoUserDefinitionArrayInput interface {
pulumi.Input
ToMongoUserDefinitionArrayOutput() MongoUserDefinitionArrayOutput
ToMongoUserDefinitionArrayOutputWithContext(context.Context) MongoUserDefinitionArrayOutput
}
type MongoUserDefinitionArray []MongoUserDefinitionInput
func (MongoUserDefinitionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoUserDefinition)(nil)).Elem()
}
func (i MongoUserDefinitionArray) ToMongoUserDefinitionArrayOutput() MongoUserDefinitionArrayOutput {
return i.ToMongoUserDefinitionArrayOutputWithContext(context.Background())
}
func (i MongoUserDefinitionArray) ToMongoUserDefinitionArrayOutputWithContext(ctx context.Context) MongoUserDefinitionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoUserDefinitionArrayOutput)
}
// MongoUserDefinitionMapInput is an input type that accepts MongoUserDefinitionMap and MongoUserDefinitionMapOutput values.
// You can construct a concrete instance of `MongoUserDefinitionMapInput` via:
//
// MongoUserDefinitionMap{ "key": MongoUserDefinitionArgs{...} }
type MongoUserDefinitionMapInput interface {
pulumi.Input
ToMongoUserDefinitionMapOutput() MongoUserDefinitionMapOutput
ToMongoUserDefinitionMapOutputWithContext(context.Context) MongoUserDefinitionMapOutput
}
type MongoUserDefinitionMap map[string]MongoUserDefinitionInput
func (MongoUserDefinitionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoUserDefinition)(nil)).Elem()
}
func (i MongoUserDefinitionMap) ToMongoUserDefinitionMapOutput() MongoUserDefinitionMapOutput {
return i.ToMongoUserDefinitionMapOutputWithContext(context.Background())
}
func (i MongoUserDefinitionMap) ToMongoUserDefinitionMapOutputWithContext(ctx context.Context) MongoUserDefinitionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoUserDefinitionMapOutput)
}
type MongoUserDefinitionOutput struct{ *pulumi.OutputState }
func (MongoUserDefinitionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MongoUserDefinition)(nil)).Elem()
}
func (o MongoUserDefinitionOutput) ToMongoUserDefinitionOutput() MongoUserDefinitionOutput {
return o
}
func (o MongoUserDefinitionOutput) ToMongoUserDefinitionOutputWithContext(ctx context.Context) MongoUserDefinitionOutput {
return o
}
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
func (o MongoUserDefinitionOutput) CosmosMongoDatabaseId() pulumi.StringOutput {
return o.ApplyT(func(v *MongoUserDefinition) pulumi.StringOutput { return v.CosmosMongoDatabaseId }).(pulumi.StringOutput)
}
// A list of Mongo Roles that are inherited to the Mongo User Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
func (o MongoUserDefinitionOutput) InheritedRoleNames() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MongoUserDefinition) pulumi.StringArrayOutput { return v.InheritedRoleNames }).(pulumi.StringArrayOutput)
}
// The password for the Mongo User Definition.
func (o MongoUserDefinitionOutput) Password() pulumi.StringOutput {
return o.ApplyT(func(v *MongoUserDefinition) pulumi.StringOutput { return v.Password }).(pulumi.StringOutput)
}
// The username for the Mongo User Definition. Changing this forces a new resource to be created.
func (o MongoUserDefinitionOutput) Username() pulumi.StringOutput {
return o.ApplyT(func(v *MongoUserDefinition) pulumi.StringOutput { return v.Username }).(pulumi.StringOutput)
}
type MongoUserDefinitionArrayOutput struct{ *pulumi.OutputState }
func (MongoUserDefinitionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoUserDefinition)(nil)).Elem()
}
func (o MongoUserDefinitionArrayOutput) ToMongoUserDefinitionArrayOutput() MongoUserDefinitionArrayOutput {
return o
}
func (o MongoUserDefinitionArrayOutput) ToMongoUserDefinitionArrayOutputWithContext(ctx context.Context) MongoUserDefinitionArrayOutput {
return o
}
func (o MongoUserDefinitionArrayOutput) Index(i pulumi.IntInput) MongoUserDefinitionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MongoUserDefinition {
return vs[0].([]*MongoUserDefinition)[vs[1].(int)]
}).(MongoUserDefinitionOutput)
}
type MongoUserDefinitionMapOutput struct{ *pulumi.OutputState }
func (MongoUserDefinitionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoUserDefinition)(nil)).Elem()
}
func (o MongoUserDefinitionMapOutput) ToMongoUserDefinitionMapOutput() MongoUserDefinitionMapOutput {
return o
}
func (o MongoUserDefinitionMapOutput) ToMongoUserDefinitionMapOutputWithContext(ctx context.Context) MongoUserDefinitionMapOutput {
return o
}
func (o MongoUserDefinitionMapOutput) MapIndex(k pulumi.StringInput) MongoUserDefinitionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MongoUserDefinition {
return vs[0].(map[string]*MongoUserDefinition)[vs[1].(string)]
}).(MongoUserDefinitionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MongoUserDefinitionInput)(nil)).Elem(), &MongoUserDefinition{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoUserDefinitionArrayInput)(nil)).Elem(), MongoUserDefinitionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoUserDefinitionMapInput)(nil)).Elem(), MongoUserDefinitionMap{})
pulumi.RegisterOutputType(MongoUserDefinitionOutput{})
pulumi.RegisterOutputType(MongoUserDefinitionArrayOutput{})
pulumi.RegisterOutputType(MongoUserDefinitionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/postgresqlFirewallRule.go | sdk/go/azure/cosmosdb/postgresqlFirewallRule.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an Azure Cosmos DB for PostgreSQL Firewall Rule.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "example", &cosmosdb.PostgresqlClusterArgs{
// Name: pulumi.String("examplecluster"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
// CoordinatorStorageQuotaInMb: pulumi.Int(131072),
// CoordinatorVcoreCount: pulumi.Int(2),
// NodeCount: pulumi.Int(0),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewPostgresqlFirewallRule(ctx, "example", &cosmosdb.PostgresqlFirewallRuleArgs{
// Name: pulumi.String("example-firewallrule"),
// ClusterId: examplePostgresqlCluster.ID(),
// StartIpAddress: pulumi.String("10.0.17.62"),
// EndIpAddress: pulumi.String("10.0.17.64"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DBforPostgreSQL` - 2022-11-08
//
// ## Import
//
// Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/postgresqlFirewallRule:PostgresqlFirewallRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1/firewallRules/firewallRule1
// ```
type PostgresqlFirewallRule struct {
pulumi.CustomResourceState
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
EndIpAddress pulumi.StringOutput `pulumi:"endIpAddress"`
// The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
StartIpAddress pulumi.StringOutput `pulumi:"startIpAddress"`
}
// NewPostgresqlFirewallRule registers a new resource with the given unique name, arguments, and options.
func NewPostgresqlFirewallRule(ctx *pulumi.Context,
name string, args *PostgresqlFirewallRuleArgs, opts ...pulumi.ResourceOption) (*PostgresqlFirewallRule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.EndIpAddress == nil {
return nil, errors.New("invalid value for required argument 'EndIpAddress'")
}
if args.StartIpAddress == nil {
return nil, errors.New("invalid value for required argument 'StartIpAddress'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PostgresqlFirewallRule
err := ctx.RegisterResource("azure:cosmosdb/postgresqlFirewallRule:PostgresqlFirewallRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPostgresqlFirewallRule gets an existing PostgresqlFirewallRule resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPostgresqlFirewallRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PostgresqlFirewallRuleState, opts ...pulumi.ResourceOption) (*PostgresqlFirewallRule, error) {
var resource PostgresqlFirewallRule
err := ctx.ReadResource("azure:cosmosdb/postgresqlFirewallRule:PostgresqlFirewallRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PostgresqlFirewallRule resources.
type postgresqlFirewallRuleState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId *string `pulumi:"clusterId"`
// The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
EndIpAddress *string `pulumi:"endIpAddress"`
// The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
StartIpAddress *string `pulumi:"startIpAddress"`
}
type PostgresqlFirewallRuleState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId pulumi.StringPtrInput
// The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
EndIpAddress pulumi.StringPtrInput
// The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
StartIpAddress pulumi.StringPtrInput
}
func (PostgresqlFirewallRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlFirewallRuleState)(nil)).Elem()
}
type postgresqlFirewallRuleArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId string `pulumi:"clusterId"`
// The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
EndIpAddress string `pulumi:"endIpAddress"`
// The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
StartIpAddress string `pulumi:"startIpAddress"`
}
// The set of arguments for constructing a PostgresqlFirewallRule resource.
type PostgresqlFirewallRuleArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId pulumi.StringInput
// The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
EndIpAddress pulumi.StringInput
// The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
StartIpAddress pulumi.StringInput
}
func (PostgresqlFirewallRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlFirewallRuleArgs)(nil)).Elem()
}
type PostgresqlFirewallRuleInput interface {
pulumi.Input
ToPostgresqlFirewallRuleOutput() PostgresqlFirewallRuleOutput
ToPostgresqlFirewallRuleOutputWithContext(ctx context.Context) PostgresqlFirewallRuleOutput
}
func (*PostgresqlFirewallRule) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlFirewallRule)(nil)).Elem()
}
func (i *PostgresqlFirewallRule) ToPostgresqlFirewallRuleOutput() PostgresqlFirewallRuleOutput {
return i.ToPostgresqlFirewallRuleOutputWithContext(context.Background())
}
func (i *PostgresqlFirewallRule) ToPostgresqlFirewallRuleOutputWithContext(ctx context.Context) PostgresqlFirewallRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlFirewallRuleOutput)
}
// PostgresqlFirewallRuleArrayInput is an input type that accepts PostgresqlFirewallRuleArray and PostgresqlFirewallRuleArrayOutput values.
// You can construct a concrete instance of `PostgresqlFirewallRuleArrayInput` via:
//
// PostgresqlFirewallRuleArray{ PostgresqlFirewallRuleArgs{...} }
type PostgresqlFirewallRuleArrayInput interface {
pulumi.Input
ToPostgresqlFirewallRuleArrayOutput() PostgresqlFirewallRuleArrayOutput
ToPostgresqlFirewallRuleArrayOutputWithContext(context.Context) PostgresqlFirewallRuleArrayOutput
}
type PostgresqlFirewallRuleArray []PostgresqlFirewallRuleInput
func (PostgresqlFirewallRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlFirewallRule)(nil)).Elem()
}
func (i PostgresqlFirewallRuleArray) ToPostgresqlFirewallRuleArrayOutput() PostgresqlFirewallRuleArrayOutput {
return i.ToPostgresqlFirewallRuleArrayOutputWithContext(context.Background())
}
func (i PostgresqlFirewallRuleArray) ToPostgresqlFirewallRuleArrayOutputWithContext(ctx context.Context) PostgresqlFirewallRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlFirewallRuleArrayOutput)
}
// PostgresqlFirewallRuleMapInput is an input type that accepts PostgresqlFirewallRuleMap and PostgresqlFirewallRuleMapOutput values.
// You can construct a concrete instance of `PostgresqlFirewallRuleMapInput` via:
//
// PostgresqlFirewallRuleMap{ "key": PostgresqlFirewallRuleArgs{...} }
type PostgresqlFirewallRuleMapInput interface {
pulumi.Input
ToPostgresqlFirewallRuleMapOutput() PostgresqlFirewallRuleMapOutput
ToPostgresqlFirewallRuleMapOutputWithContext(context.Context) PostgresqlFirewallRuleMapOutput
}
type PostgresqlFirewallRuleMap map[string]PostgresqlFirewallRuleInput
func (PostgresqlFirewallRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlFirewallRule)(nil)).Elem()
}
func (i PostgresqlFirewallRuleMap) ToPostgresqlFirewallRuleMapOutput() PostgresqlFirewallRuleMapOutput {
return i.ToPostgresqlFirewallRuleMapOutputWithContext(context.Background())
}
func (i PostgresqlFirewallRuleMap) ToPostgresqlFirewallRuleMapOutputWithContext(ctx context.Context) PostgresqlFirewallRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlFirewallRuleMapOutput)
}
type PostgresqlFirewallRuleOutput struct{ *pulumi.OutputState }
func (PostgresqlFirewallRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlFirewallRule)(nil)).Elem()
}
func (o PostgresqlFirewallRuleOutput) ToPostgresqlFirewallRuleOutput() PostgresqlFirewallRuleOutput {
return o
}
func (o PostgresqlFirewallRuleOutput) ToPostgresqlFirewallRuleOutputWithContext(ctx context.Context) PostgresqlFirewallRuleOutput {
return o
}
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
func (o PostgresqlFirewallRuleOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlFirewallRule) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// The end IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
func (o PostgresqlFirewallRuleOutput) EndIpAddress() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlFirewallRule) pulumi.StringOutput { return v.EndIpAddress }).(pulumi.StringOutput)
}
// The name which should be used for the Azure Cosmos DB for PostgreSQL Firewall Rule. Changing this forces a new resource to be created.
func (o PostgresqlFirewallRuleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlFirewallRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The start IP address of the Azure Cosmos DB for PostgreSQL Firewall Rule.
func (o PostgresqlFirewallRuleOutput) StartIpAddress() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlFirewallRule) pulumi.StringOutput { return v.StartIpAddress }).(pulumi.StringOutput)
}
type PostgresqlFirewallRuleArrayOutput struct{ *pulumi.OutputState }
func (PostgresqlFirewallRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlFirewallRule)(nil)).Elem()
}
func (o PostgresqlFirewallRuleArrayOutput) ToPostgresqlFirewallRuleArrayOutput() PostgresqlFirewallRuleArrayOutput {
return o
}
func (o PostgresqlFirewallRuleArrayOutput) ToPostgresqlFirewallRuleArrayOutputWithContext(ctx context.Context) PostgresqlFirewallRuleArrayOutput {
return o
}
func (o PostgresqlFirewallRuleArrayOutput) Index(i pulumi.IntInput) PostgresqlFirewallRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PostgresqlFirewallRule {
return vs[0].([]*PostgresqlFirewallRule)[vs[1].(int)]
}).(PostgresqlFirewallRuleOutput)
}
type PostgresqlFirewallRuleMapOutput struct{ *pulumi.OutputState }
func (PostgresqlFirewallRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlFirewallRule)(nil)).Elem()
}
func (o PostgresqlFirewallRuleMapOutput) ToPostgresqlFirewallRuleMapOutput() PostgresqlFirewallRuleMapOutput {
return o
}
func (o PostgresqlFirewallRuleMapOutput) ToPostgresqlFirewallRuleMapOutputWithContext(ctx context.Context) PostgresqlFirewallRuleMapOutput {
return o
}
func (o PostgresqlFirewallRuleMapOutput) MapIndex(k pulumi.StringInput) PostgresqlFirewallRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PostgresqlFirewallRule {
return vs[0].(map[string]*PostgresqlFirewallRule)[vs[1].(string)]
}).(PostgresqlFirewallRuleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlFirewallRuleInput)(nil)).Elem(), &PostgresqlFirewallRule{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlFirewallRuleArrayInput)(nil)).Elem(), PostgresqlFirewallRuleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlFirewallRuleMapInput)(nil)).Elem(), PostgresqlFirewallRuleMap{})
pulumi.RegisterOutputType(PostgresqlFirewallRuleOutput{})
pulumi.RegisterOutputType(PostgresqlFirewallRuleArrayOutput{})
pulumi.RegisterOutputType(PostgresqlFirewallRuleMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/getMongoDatabase.go | sdk/go/azure/cosmosdb/getMongoDatabase.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Cosmos DB Mongo Database.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupMongoDatabase(ctx, &cosmosdb.LookupMongoDatabaseArgs{
// Name: "test-cosmosdb-mongo-db",
// ResourceGroupName: "test-cosmosdb-account-rg",
// AccountName: "test-cosmosdb-account",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
func LookupMongoDatabase(ctx *pulumi.Context, args *LookupMongoDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupMongoDatabaseResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupMongoDatabaseResult
err := ctx.Invoke("azure:cosmosdb/getMongoDatabase:getMongoDatabase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getMongoDatabase.
type LookupMongoDatabaseArgs struct {
// The name of the Cosmos DB Account where the Mongo Database exists.
AccountName string `pulumi:"accountName"`
// The name of this Cosmos DB Mongo Database.
Name string `pulumi:"name"`
// The name of the Resource Group where the Cosmos DB Mongo Database exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getMongoDatabase.
type LookupMongoDatabaseResult struct {
AccountName string `pulumi:"accountName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the Cosmos DB Mongo Database.
Tags map[string]string `pulumi:"tags"`
}
func LookupMongoDatabaseOutput(ctx *pulumi.Context, args LookupMongoDatabaseOutputArgs, opts ...pulumi.InvokeOption) LookupMongoDatabaseResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupMongoDatabaseResultOutput, error) {
args := v.(LookupMongoDatabaseArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:cosmosdb/getMongoDatabase:getMongoDatabase", args, LookupMongoDatabaseResultOutput{}, options).(LookupMongoDatabaseResultOutput), nil
}).(LookupMongoDatabaseResultOutput)
}
// A collection of arguments for invoking getMongoDatabase.
type LookupMongoDatabaseOutputArgs struct {
// The name of the Cosmos DB Account where the Mongo Database exists.
AccountName pulumi.StringInput `pulumi:"accountName"`
// The name of this Cosmos DB Mongo Database.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Cosmos DB Mongo Database exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupMongoDatabaseOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMongoDatabaseArgs)(nil)).Elem()
}
// A collection of values returned by getMongoDatabase.
type LookupMongoDatabaseResultOutput struct{ *pulumi.OutputState }
func (LookupMongoDatabaseResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMongoDatabaseResult)(nil)).Elem()
}
func (o LookupMongoDatabaseResultOutput) ToLookupMongoDatabaseResultOutput() LookupMongoDatabaseResultOutput {
return o
}
func (o LookupMongoDatabaseResultOutput) ToLookupMongoDatabaseResultOutputWithContext(ctx context.Context) LookupMongoDatabaseResultOutput {
return o
}
func (o LookupMongoDatabaseResultOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v LookupMongoDatabaseResult) string { return v.AccountName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupMongoDatabaseResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupMongoDatabaseResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupMongoDatabaseResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupMongoDatabaseResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupMongoDatabaseResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupMongoDatabaseResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the Cosmos DB Mongo Database.
func (o LookupMongoDatabaseResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupMongoDatabaseResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupMongoDatabaseResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/cassandraKeyspace.go | sdk/go/azure/cosmosdb/cassandraKeyspace.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cassandra KeySpace within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("tflex-cosmosdb-account-rg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("tfex-cosmosdb-account"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// OfferType: pulumi.String("Standard"),
// Capabilities: cosmosdb.AccountCapabilityArray{
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableCassandra"),
// },
// },
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewCassandraKeyspace(ctx, "example", &cosmosdb.CassandraKeyspaceArgs{
// Name: pulumi.String("tfex-cosmos-cassandra-keyspace"),
// ResourceGroupName: exampleAccount.ResourceGroupName,
// AccountName: exampleAccount.Name,
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cosmos Cassandra KeySpace can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/cassandraKeyspace:CassandraKeyspace ks1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/cassandraKeyspaces/ks1
// ```
type CassandraKeyspace struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings CassandraKeyspaceAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The throughput of Cassandra KeySpace (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewCassandraKeyspace registers a new resource with the given unique name, arguments, and options.
func NewCassandraKeyspace(ctx *pulumi.Context,
name string, args *CassandraKeyspaceArgs, opts ...pulumi.ResourceOption) (*CassandraKeyspace, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource CassandraKeyspace
err := ctx.RegisterResource("azure:cosmosdb/cassandraKeyspace:CassandraKeyspace", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCassandraKeyspace gets an existing CassandraKeyspace resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCassandraKeyspace(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CassandraKeyspaceState, opts ...pulumi.ResourceOption) (*CassandraKeyspace, error) {
var resource CassandraKeyspace
err := ctx.ReadResource("azure:cosmosdb/cassandraKeyspace:CassandraKeyspace", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CassandraKeyspace resources.
type cassandraKeyspaceState struct {
// The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *CassandraKeyspaceAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The throughput of Cassandra KeySpace (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput *int `pulumi:"throughput"`
}
type CassandraKeyspaceState struct {
// The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings CassandraKeyspaceAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The throughput of Cassandra KeySpace (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput pulumi.IntPtrInput
}
func (CassandraKeyspaceState) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraKeyspaceState)(nil)).Elem()
}
type cassandraKeyspaceArgs struct {
// The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *CassandraKeyspaceAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of Cassandra KeySpace (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a CassandraKeyspace resource.
type CassandraKeyspaceArgs struct {
// The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings CassandraKeyspaceAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The throughput of Cassandra KeySpace (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput pulumi.IntPtrInput
}
func (CassandraKeyspaceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraKeyspaceArgs)(nil)).Elem()
}
type CassandraKeyspaceInput interface {
pulumi.Input
ToCassandraKeyspaceOutput() CassandraKeyspaceOutput
ToCassandraKeyspaceOutputWithContext(ctx context.Context) CassandraKeyspaceOutput
}
func (*CassandraKeyspace) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraKeyspace)(nil)).Elem()
}
func (i *CassandraKeyspace) ToCassandraKeyspaceOutput() CassandraKeyspaceOutput {
return i.ToCassandraKeyspaceOutputWithContext(context.Background())
}
func (i *CassandraKeyspace) ToCassandraKeyspaceOutputWithContext(ctx context.Context) CassandraKeyspaceOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraKeyspaceOutput)
}
// CassandraKeyspaceArrayInput is an input type that accepts CassandraKeyspaceArray and CassandraKeyspaceArrayOutput values.
// You can construct a concrete instance of `CassandraKeyspaceArrayInput` via:
//
// CassandraKeyspaceArray{ CassandraKeyspaceArgs{...} }
type CassandraKeyspaceArrayInput interface {
pulumi.Input
ToCassandraKeyspaceArrayOutput() CassandraKeyspaceArrayOutput
ToCassandraKeyspaceArrayOutputWithContext(context.Context) CassandraKeyspaceArrayOutput
}
type CassandraKeyspaceArray []CassandraKeyspaceInput
func (CassandraKeyspaceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraKeyspace)(nil)).Elem()
}
func (i CassandraKeyspaceArray) ToCassandraKeyspaceArrayOutput() CassandraKeyspaceArrayOutput {
return i.ToCassandraKeyspaceArrayOutputWithContext(context.Background())
}
func (i CassandraKeyspaceArray) ToCassandraKeyspaceArrayOutputWithContext(ctx context.Context) CassandraKeyspaceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraKeyspaceArrayOutput)
}
// CassandraKeyspaceMapInput is an input type that accepts CassandraKeyspaceMap and CassandraKeyspaceMapOutput values.
// You can construct a concrete instance of `CassandraKeyspaceMapInput` via:
//
// CassandraKeyspaceMap{ "key": CassandraKeyspaceArgs{...} }
type CassandraKeyspaceMapInput interface {
pulumi.Input
ToCassandraKeyspaceMapOutput() CassandraKeyspaceMapOutput
ToCassandraKeyspaceMapOutputWithContext(context.Context) CassandraKeyspaceMapOutput
}
type CassandraKeyspaceMap map[string]CassandraKeyspaceInput
func (CassandraKeyspaceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraKeyspace)(nil)).Elem()
}
func (i CassandraKeyspaceMap) ToCassandraKeyspaceMapOutput() CassandraKeyspaceMapOutput {
return i.ToCassandraKeyspaceMapOutputWithContext(context.Background())
}
func (i CassandraKeyspaceMap) ToCassandraKeyspaceMapOutputWithContext(ctx context.Context) CassandraKeyspaceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraKeyspaceMapOutput)
}
type CassandraKeyspaceOutput struct{ *pulumi.OutputState }
func (CassandraKeyspaceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraKeyspace)(nil)).Elem()
}
func (o CassandraKeyspaceOutput) ToCassandraKeyspaceOutput() CassandraKeyspaceOutput {
return o
}
func (o CassandraKeyspaceOutput) ToCassandraKeyspaceOutputWithContext(ctx context.Context) CassandraKeyspaceOutput {
return o
}
// The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.
func (o CassandraKeyspaceOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraKeyspace) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
func (o CassandraKeyspaceOutput) AutoscaleSettings() CassandraKeyspaceAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *CassandraKeyspace) CassandraKeyspaceAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(CassandraKeyspaceAutoscaleSettingsPtrOutput)
}
// Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.
func (o CassandraKeyspaceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraKeyspace) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.
func (o CassandraKeyspaceOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraKeyspace) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of Cassandra KeySpace (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
func (o CassandraKeyspaceOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *CassandraKeyspace) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type CassandraKeyspaceArrayOutput struct{ *pulumi.OutputState }
func (CassandraKeyspaceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraKeyspace)(nil)).Elem()
}
func (o CassandraKeyspaceArrayOutput) ToCassandraKeyspaceArrayOutput() CassandraKeyspaceArrayOutput {
return o
}
func (o CassandraKeyspaceArrayOutput) ToCassandraKeyspaceArrayOutputWithContext(ctx context.Context) CassandraKeyspaceArrayOutput {
return o
}
func (o CassandraKeyspaceArrayOutput) Index(i pulumi.IntInput) CassandraKeyspaceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CassandraKeyspace {
return vs[0].([]*CassandraKeyspace)[vs[1].(int)]
}).(CassandraKeyspaceOutput)
}
type CassandraKeyspaceMapOutput struct{ *pulumi.OutputState }
func (CassandraKeyspaceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraKeyspace)(nil)).Elem()
}
func (o CassandraKeyspaceMapOutput) ToCassandraKeyspaceMapOutput() CassandraKeyspaceMapOutput {
return o
}
func (o CassandraKeyspaceMapOutput) ToCassandraKeyspaceMapOutputWithContext(ctx context.Context) CassandraKeyspaceMapOutput {
return o
}
func (o CassandraKeyspaceMapOutput) MapIndex(k pulumi.StringInput) CassandraKeyspaceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CassandraKeyspace {
return vs[0].(map[string]*CassandraKeyspace)[vs[1].(string)]
}).(CassandraKeyspaceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CassandraKeyspaceInput)(nil)).Elem(), &CassandraKeyspace{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraKeyspaceArrayInput)(nil)).Elem(), CassandraKeyspaceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraKeyspaceMapInput)(nil)).Elem(), CassandraKeyspaceMap{})
pulumi.RegisterOutputType(CassandraKeyspaceOutput{})
pulumi.RegisterOutputType(CassandraKeyspaceArrayOutput{})
pulumi.RegisterOutputType(CassandraKeyspaceMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlFunction.go | sdk/go/azure/cosmosdb/sqlFunction.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an SQL User Defined Function.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "example", &cosmosdb.SqlContainerArgs{
// Name: pulumi.String("example-container"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleSqlDatabase.Name,
// PartitionKeyPath: "/id",
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlFunction(ctx, "example", &cosmosdb.SqlFunctionArgs{
// Name: pulumi.String("test-function"),
// ContainerId: exampleSqlContainer.ID(),
// Body: pulumi.String("function trigger(){}"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// SQL User Defined Functions can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlFunction:SqlFunction example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/database1/containers/container1/userDefinedFunctions/userDefinedFunction1
// ```
type SqlFunction struct {
pulumi.CustomResourceState
// Body of the User Defined Function.
Body pulumi.StringOutput `pulumi:"body"`
// The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
ContainerId pulumi.StringOutput `pulumi:"containerId"`
// The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewSqlFunction registers a new resource with the given unique name, arguments, and options.
func NewSqlFunction(ctx *pulumi.Context,
name string, args *SqlFunctionArgs, opts ...pulumi.ResourceOption) (*SqlFunction, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Body == nil {
return nil, errors.New("invalid value for required argument 'Body'")
}
if args.ContainerId == nil {
return nil, errors.New("invalid value for required argument 'ContainerId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlFunction
err := ctx.RegisterResource("azure:cosmosdb/sqlFunction:SqlFunction", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlFunction gets an existing SqlFunction resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlFunction(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlFunctionState, opts ...pulumi.ResourceOption) (*SqlFunction, error) {
var resource SqlFunction
err := ctx.ReadResource("azure:cosmosdb/sqlFunction:SqlFunction", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlFunction resources.
type sqlFunctionState struct {
// Body of the User Defined Function.
Body *string `pulumi:"body"`
// The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
ContainerId *string `pulumi:"containerId"`
// The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
Name *string `pulumi:"name"`
}
type SqlFunctionState struct {
// Body of the User Defined Function.
Body pulumi.StringPtrInput
// The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
ContainerId pulumi.StringPtrInput
// The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
Name pulumi.StringPtrInput
}
func (SqlFunctionState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlFunctionState)(nil)).Elem()
}
type sqlFunctionArgs struct {
// Body of the User Defined Function.
Body string `pulumi:"body"`
// The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
ContainerId string `pulumi:"containerId"`
// The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a SqlFunction resource.
type SqlFunctionArgs struct {
// Body of the User Defined Function.
Body pulumi.StringInput
// The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
ContainerId pulumi.StringInput
// The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
Name pulumi.StringPtrInput
}
func (SqlFunctionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlFunctionArgs)(nil)).Elem()
}
type SqlFunctionInput interface {
pulumi.Input
ToSqlFunctionOutput() SqlFunctionOutput
ToSqlFunctionOutputWithContext(ctx context.Context) SqlFunctionOutput
}
func (*SqlFunction) ElementType() reflect.Type {
return reflect.TypeOf((**SqlFunction)(nil)).Elem()
}
func (i *SqlFunction) ToSqlFunctionOutput() SqlFunctionOutput {
return i.ToSqlFunctionOutputWithContext(context.Background())
}
func (i *SqlFunction) ToSqlFunctionOutputWithContext(ctx context.Context) SqlFunctionOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlFunctionOutput)
}
// SqlFunctionArrayInput is an input type that accepts SqlFunctionArray and SqlFunctionArrayOutput values.
// You can construct a concrete instance of `SqlFunctionArrayInput` via:
//
// SqlFunctionArray{ SqlFunctionArgs{...} }
type SqlFunctionArrayInput interface {
pulumi.Input
ToSqlFunctionArrayOutput() SqlFunctionArrayOutput
ToSqlFunctionArrayOutputWithContext(context.Context) SqlFunctionArrayOutput
}
type SqlFunctionArray []SqlFunctionInput
func (SqlFunctionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlFunction)(nil)).Elem()
}
func (i SqlFunctionArray) ToSqlFunctionArrayOutput() SqlFunctionArrayOutput {
return i.ToSqlFunctionArrayOutputWithContext(context.Background())
}
func (i SqlFunctionArray) ToSqlFunctionArrayOutputWithContext(ctx context.Context) SqlFunctionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlFunctionArrayOutput)
}
// SqlFunctionMapInput is an input type that accepts SqlFunctionMap and SqlFunctionMapOutput values.
// You can construct a concrete instance of `SqlFunctionMapInput` via:
//
// SqlFunctionMap{ "key": SqlFunctionArgs{...} }
type SqlFunctionMapInput interface {
pulumi.Input
ToSqlFunctionMapOutput() SqlFunctionMapOutput
ToSqlFunctionMapOutputWithContext(context.Context) SqlFunctionMapOutput
}
type SqlFunctionMap map[string]SqlFunctionInput
func (SqlFunctionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlFunction)(nil)).Elem()
}
func (i SqlFunctionMap) ToSqlFunctionMapOutput() SqlFunctionMapOutput {
return i.ToSqlFunctionMapOutputWithContext(context.Background())
}
func (i SqlFunctionMap) ToSqlFunctionMapOutputWithContext(ctx context.Context) SqlFunctionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlFunctionMapOutput)
}
type SqlFunctionOutput struct{ *pulumi.OutputState }
func (SqlFunctionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlFunction)(nil)).Elem()
}
func (o SqlFunctionOutput) ToSqlFunctionOutput() SqlFunctionOutput {
return o
}
func (o SqlFunctionOutput) ToSqlFunctionOutputWithContext(ctx context.Context) SqlFunctionOutput {
return o
}
// Body of the User Defined Function.
func (o SqlFunctionOutput) Body() pulumi.StringOutput {
return o.ApplyT(func(v *SqlFunction) pulumi.StringOutput { return v.Body }).(pulumi.StringOutput)
}
// The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
func (o SqlFunctionOutput) ContainerId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlFunction) pulumi.StringOutput { return v.ContainerId }).(pulumi.StringOutput)
}
// The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
func (o SqlFunctionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlFunction) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type SqlFunctionArrayOutput struct{ *pulumi.OutputState }
func (SqlFunctionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlFunction)(nil)).Elem()
}
func (o SqlFunctionArrayOutput) ToSqlFunctionArrayOutput() SqlFunctionArrayOutput {
return o
}
func (o SqlFunctionArrayOutput) ToSqlFunctionArrayOutputWithContext(ctx context.Context) SqlFunctionArrayOutput {
return o
}
func (o SqlFunctionArrayOutput) Index(i pulumi.IntInput) SqlFunctionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlFunction {
return vs[0].([]*SqlFunction)[vs[1].(int)]
}).(SqlFunctionOutput)
}
type SqlFunctionMapOutput struct{ *pulumi.OutputState }
func (SqlFunctionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlFunction)(nil)).Elem()
}
func (o SqlFunctionMapOutput) ToSqlFunctionMapOutput() SqlFunctionMapOutput {
return o
}
func (o SqlFunctionMapOutput) ToSqlFunctionMapOutputWithContext(ctx context.Context) SqlFunctionMapOutput {
return o
}
func (o SqlFunctionMapOutput) MapIndex(k pulumi.StringInput) SqlFunctionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlFunction {
return vs[0].(map[string]*SqlFunction)[vs[1].(string)]
}).(SqlFunctionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlFunctionInput)(nil)).Elem(), &SqlFunction{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlFunctionArrayInput)(nil)).Elem(), SqlFunctionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlFunctionMapInput)(nil)).Elem(), SqlFunctionMap{})
pulumi.RegisterOutputType(SqlFunctionOutput{})
pulumi.RegisterOutputType(SqlFunctionArrayOutput{})
pulumi.RegisterOutputType(SqlFunctionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/getAccount.go | sdk/go/azure/cosmosdb/getAccount.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("cosmosdbAccountEndpoint", example.Endpoint)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2024-08-15
func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupAccountResult
err := ctx.Invoke("azure:cosmosdb/getAccount:getAccount", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAccount.
type LookupAccountArgs struct {
// Specifies the name of the CosmosDB Account.
Name string `pulumi:"name"`
// Specifies the name of the resource group in which the CosmosDB Account resides.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getAccount.
type LookupAccountResult struct {
// If automatic failover is enabled for this CosmosDB Account.
AutomaticFailoverEnabled bool `pulumi:"automaticFailoverEnabled"`
// Capabilities enabled on this Cosmos DB account.
Capabilities []GetAccountCapability `pulumi:"capabilities"`
ConsistencyPolicies []GetAccountConsistencyPolicy `pulumi:"consistencyPolicies"`
// The endpoint used to connect to the CosmosDB account.
Endpoint string `pulumi:"endpoint"`
// If Free Tier pricing option is enabled for this CosmosDB Account. You can have up to one free tier Azure Cosmos DB account per Azure subscription.
FreeTierEnabled bool `pulumi:"freeTierEnabled"`
GeoLocations []GetAccountGeoLocation `pulumi:"geoLocations"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The current IP Filter for this CosmosDB account
IpRangeFilter string `pulumi:"ipRangeFilter"`
// If virtual network filtering is enabled for this Cosmos DB account.
IsVirtualNetworkFilterEnabled bool `pulumi:"isVirtualNetworkFilterEnabled"`
// The Key Vault key URI for CMK encryption.
KeyVaultKeyId string `pulumi:"keyVaultKeyId"`
// The Kind of the CosmosDB account.
Kind string `pulumi:"kind"`
// The name of the Azure region hosting replicated data.
Location string `pulumi:"location"`
// If multiple write locations are enabled for this Cosmos DB account.
MultipleWriteLocationsEnabled bool `pulumi:"multipleWriteLocationsEnabled"`
Name string `pulumi:"name"`
// The Offer Type to used by this CosmosDB Account.
OfferType string `pulumi:"offerType"`
// The primary key for the CosmosDB account.
PrimaryKey string `pulumi:"primaryKey"`
// The primary Mongodb connection string for the CosmosDB account.
PrimaryMongodbConnectionString string `pulumi:"primaryMongodbConnectionString"`
// The primary read-only Key for the CosmosDB account.
PrimaryReadonlyKey string `pulumi:"primaryReadonlyKey"`
// The primary readonly Mongodb connection string for the CosmosDB account.
PrimaryReadonlyMongodbConnectionString string `pulumi:"primaryReadonlyMongodbConnectionString"`
// The primary read-only SQL connection string for the CosmosDB account.
PrimaryReadonlySqlConnectionString string `pulumi:"primaryReadonlySqlConnectionString"`
// The primary SQL connection string for the CosmosDB Account.
PrimarySqlConnectionString string `pulumi:"primarySqlConnectionString"`
// A list of read endpoints available for this CosmosDB account.
ReadEndpoints []string `pulumi:"readEndpoints"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The secondary key for the CosmosDB account.
SecondaryKey string `pulumi:"secondaryKey"`
// The secondary Mongodb connection string for the CosmosDB account.
SecondaryMongodbConnectionString string `pulumi:"secondaryMongodbConnectionString"`
// The secondary read-only key for the CosmosDB account.
SecondaryReadonlyKey string `pulumi:"secondaryReadonlyKey"`
// The secondary readonly Mongodb connection string for the CosmosDB account.
SecondaryReadonlyMongodbConnectionString string `pulumi:"secondaryReadonlyMongodbConnectionString"`
// The secondary read-only SQL connection string for the CosmosDB account.
SecondaryReadonlySqlConnectionString string `pulumi:"secondaryReadonlySqlConnectionString"`
// The secondary SQL connection string for the CosmosDB Account.
SecondarySqlConnectionString string `pulumi:"secondarySqlConnectionString"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// Subnets that are allowed to access this CosmosDB account.
VirtualNetworkRules []GetAccountVirtualNetworkRule `pulumi:"virtualNetworkRules"`
// A list of write endpoints available for this CosmosDB account.
WriteEndpoints []string `pulumi:"writeEndpoints"`
}
func LookupAccountOutput(ctx *pulumi.Context, args LookupAccountOutputArgs, opts ...pulumi.InvokeOption) LookupAccountResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupAccountResultOutput, error) {
args := v.(LookupAccountArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:cosmosdb/getAccount:getAccount", args, LookupAccountResultOutput{}, options).(LookupAccountResultOutput), nil
}).(LookupAccountResultOutput)
}
// A collection of arguments for invoking getAccount.
type LookupAccountOutputArgs struct {
// Specifies the name of the CosmosDB Account.
Name pulumi.StringInput `pulumi:"name"`
// Specifies the name of the resource group in which the CosmosDB Account resides.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupAccountOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAccountArgs)(nil)).Elem()
}
// A collection of values returned by getAccount.
type LookupAccountResultOutput struct{ *pulumi.OutputState }
func (LookupAccountResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAccountResult)(nil)).Elem()
}
func (o LookupAccountResultOutput) ToLookupAccountResultOutput() LookupAccountResultOutput {
return o
}
func (o LookupAccountResultOutput) ToLookupAccountResultOutputWithContext(ctx context.Context) LookupAccountResultOutput {
return o
}
// If automatic failover is enabled for this CosmosDB Account.
func (o LookupAccountResultOutput) AutomaticFailoverEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAccountResult) bool { return v.AutomaticFailoverEnabled }).(pulumi.BoolOutput)
}
// Capabilities enabled on this Cosmos DB account.
func (o LookupAccountResultOutput) Capabilities() GetAccountCapabilityArrayOutput {
return o.ApplyT(func(v LookupAccountResult) []GetAccountCapability { return v.Capabilities }).(GetAccountCapabilityArrayOutput)
}
func (o LookupAccountResultOutput) ConsistencyPolicies() GetAccountConsistencyPolicyArrayOutput {
return o.ApplyT(func(v LookupAccountResult) []GetAccountConsistencyPolicy { return v.ConsistencyPolicies }).(GetAccountConsistencyPolicyArrayOutput)
}
// The endpoint used to connect to the CosmosDB account.
func (o LookupAccountResultOutput) Endpoint() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.Endpoint }).(pulumi.StringOutput)
}
// If Free Tier pricing option is enabled for this CosmosDB Account. You can have up to one free tier Azure Cosmos DB account per Azure subscription.
func (o LookupAccountResultOutput) FreeTierEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAccountResult) bool { return v.FreeTierEnabled }).(pulumi.BoolOutput)
}
func (o LookupAccountResultOutput) GeoLocations() GetAccountGeoLocationArrayOutput {
return o.ApplyT(func(v LookupAccountResult) []GetAccountGeoLocation { return v.GeoLocations }).(GetAccountGeoLocationArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupAccountResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.Id }).(pulumi.StringOutput)
}
// The current IP Filter for this CosmosDB account
func (o LookupAccountResultOutput) IpRangeFilter() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.IpRangeFilter }).(pulumi.StringOutput)
}
// If virtual network filtering is enabled for this Cosmos DB account.
func (o LookupAccountResultOutput) IsVirtualNetworkFilterEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAccountResult) bool { return v.IsVirtualNetworkFilterEnabled }).(pulumi.BoolOutput)
}
// The Key Vault key URI for CMK encryption.
func (o LookupAccountResultOutput) KeyVaultKeyId() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.KeyVaultKeyId }).(pulumi.StringOutput)
}
// The Kind of the CosmosDB account.
func (o LookupAccountResultOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.Kind }).(pulumi.StringOutput)
}
// The name of the Azure region hosting replicated data.
func (o LookupAccountResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.Location }).(pulumi.StringOutput)
}
// If multiple write locations are enabled for this Cosmos DB account.
func (o LookupAccountResultOutput) MultipleWriteLocationsEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAccountResult) bool { return v.MultipleWriteLocationsEnabled }).(pulumi.BoolOutput)
}
func (o LookupAccountResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.Name }).(pulumi.StringOutput)
}
// The Offer Type to used by this CosmosDB Account.
func (o LookupAccountResultOutput) OfferType() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.OfferType }).(pulumi.StringOutput)
}
// The primary key for the CosmosDB account.
func (o LookupAccountResultOutput) PrimaryKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.PrimaryKey }).(pulumi.StringOutput)
}
// The primary Mongodb connection string for the CosmosDB account.
func (o LookupAccountResultOutput) PrimaryMongodbConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.PrimaryMongodbConnectionString }).(pulumi.StringOutput)
}
// The primary read-only Key for the CosmosDB account.
func (o LookupAccountResultOutput) PrimaryReadonlyKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.PrimaryReadonlyKey }).(pulumi.StringOutput)
}
// The primary readonly Mongodb connection string for the CosmosDB account.
func (o LookupAccountResultOutput) PrimaryReadonlyMongodbConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.PrimaryReadonlyMongodbConnectionString }).(pulumi.StringOutput)
}
// The primary read-only SQL connection string for the CosmosDB account.
func (o LookupAccountResultOutput) PrimaryReadonlySqlConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.PrimaryReadonlySqlConnectionString }).(pulumi.StringOutput)
}
// The primary SQL connection string for the CosmosDB Account.
func (o LookupAccountResultOutput) PrimarySqlConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.PrimarySqlConnectionString }).(pulumi.StringOutput)
}
// A list of read endpoints available for this CosmosDB account.
func (o LookupAccountResultOutput) ReadEndpoints() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupAccountResult) []string { return v.ReadEndpoints }).(pulumi.StringArrayOutput)
}
func (o LookupAccountResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The secondary key for the CosmosDB account.
func (o LookupAccountResultOutput) SecondaryKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.SecondaryKey }).(pulumi.StringOutput)
}
// The secondary Mongodb connection string for the CosmosDB account.
func (o LookupAccountResultOutput) SecondaryMongodbConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.SecondaryMongodbConnectionString }).(pulumi.StringOutput)
}
// The secondary read-only key for the CosmosDB account.
func (o LookupAccountResultOutput) SecondaryReadonlyKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.SecondaryReadonlyKey }).(pulumi.StringOutput)
}
// The secondary readonly Mongodb connection string for the CosmosDB account.
func (o LookupAccountResultOutput) SecondaryReadonlyMongodbConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.SecondaryReadonlyMongodbConnectionString }).(pulumi.StringOutput)
}
// The secondary read-only SQL connection string for the CosmosDB account.
func (o LookupAccountResultOutput) SecondaryReadonlySqlConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.SecondaryReadonlySqlConnectionString }).(pulumi.StringOutput)
}
// The secondary SQL connection string for the CosmosDB Account.
func (o LookupAccountResultOutput) SecondarySqlConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v LookupAccountResult) string { return v.SecondarySqlConnectionString }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the resource.
func (o LookupAccountResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupAccountResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// Subnets that are allowed to access this CosmosDB account.
func (o LookupAccountResultOutput) VirtualNetworkRules() GetAccountVirtualNetworkRuleArrayOutput {
return o.ApplyT(func(v LookupAccountResult) []GetAccountVirtualNetworkRule { return v.VirtualNetworkRules }).(GetAccountVirtualNetworkRuleArrayOutput)
}
// A list of write endpoints available for this CosmosDB account.
func (o LookupAccountResultOutput) WriteEndpoints() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupAccountResult) []string { return v.WriteEndpoints }).(pulumi.StringArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupAccountResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/postgresqlCoordinatorConfiguration.go | sdk/go/azure/cosmosdb/postgresqlCoordinatorConfiguration.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Sets a Coordinator Configuration value on Azure Cosmos DB for PostgreSQL Cluster.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := core.NewResourceGroup(ctx, "test", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// example, err := cosmosdb.NewPostgresqlCluster(ctx, "example", &cosmosdb.PostgresqlClusterArgs{
// Name: pulumi.String("examplecluster"),
// ResourceGroupName: pulumi.Any(exampleAzurermResourceGroup.Name),
// Location: pulumi.Any(exampleAzurermResourceGroup.Location),
// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
// CoordinatorStorageQuotaInMb: pulumi.Int(131072),
// CoordinatorVcoreCount: pulumi.Int(2),
// NodeCount: pulumi.Int(2),
// NodeStorageQuotaInMb: pulumi.Int(131072),
// NodeVcores: pulumi.Int(2),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewPostgresqlCoordinatorConfiguration(ctx, "example", &cosmosdb.PostgresqlCoordinatorConfigurationArgs{
// Name: pulumi.String("array_nulls"),
// ClusterId: example.ID(),
// Value: pulumi.String("on"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DBforPostgreSQL` - 2022-11-08
//
// ## Import
//
// Coordinator Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/postgresqlCoordinatorConfiguration:PostgresqlCoordinatorConfiguration example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1/coordinatorConfigurations/array_nulls
// ```
type PostgresqlCoordinatorConfiguration struct {
pulumi.CustomResourceState
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// The name of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The value of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value pulumi.StringOutput `pulumi:"value"`
}
// NewPostgresqlCoordinatorConfiguration registers a new resource with the given unique name, arguments, and options.
func NewPostgresqlCoordinatorConfiguration(ctx *pulumi.Context,
name string, args *PostgresqlCoordinatorConfigurationArgs, opts ...pulumi.ResourceOption) (*PostgresqlCoordinatorConfiguration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PostgresqlCoordinatorConfiguration
err := ctx.RegisterResource("azure:cosmosdb/postgresqlCoordinatorConfiguration:PostgresqlCoordinatorConfiguration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPostgresqlCoordinatorConfiguration gets an existing PostgresqlCoordinatorConfiguration resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPostgresqlCoordinatorConfiguration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PostgresqlCoordinatorConfigurationState, opts ...pulumi.ResourceOption) (*PostgresqlCoordinatorConfiguration, error) {
var resource PostgresqlCoordinatorConfiguration
err := ctx.ReadResource("azure:cosmosdb/postgresqlCoordinatorConfiguration:PostgresqlCoordinatorConfiguration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PostgresqlCoordinatorConfiguration resources.
type postgresqlCoordinatorConfigurationState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId *string `pulumi:"clusterId"`
// The name of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The value of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value *string `pulumi:"value"`
}
type PostgresqlCoordinatorConfigurationState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId pulumi.StringPtrInput
// The name of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The value of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value pulumi.StringPtrInput
}
func (PostgresqlCoordinatorConfigurationState) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlCoordinatorConfigurationState)(nil)).Elem()
}
type postgresqlCoordinatorConfigurationArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId string `pulumi:"clusterId"`
// The name of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The value of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value string `pulumi:"value"`
}
// The set of arguments for constructing a PostgresqlCoordinatorConfiguration resource.
type PostgresqlCoordinatorConfigurationArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
ClusterId pulumi.StringInput
// The name of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The value of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster.
Value pulumi.StringInput
}
func (PostgresqlCoordinatorConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlCoordinatorConfigurationArgs)(nil)).Elem()
}
type PostgresqlCoordinatorConfigurationInput interface {
pulumi.Input
ToPostgresqlCoordinatorConfigurationOutput() PostgresqlCoordinatorConfigurationOutput
ToPostgresqlCoordinatorConfigurationOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationOutput
}
func (*PostgresqlCoordinatorConfiguration) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlCoordinatorConfiguration)(nil)).Elem()
}
func (i *PostgresqlCoordinatorConfiguration) ToPostgresqlCoordinatorConfigurationOutput() PostgresqlCoordinatorConfigurationOutput {
return i.ToPostgresqlCoordinatorConfigurationOutputWithContext(context.Background())
}
func (i *PostgresqlCoordinatorConfiguration) ToPostgresqlCoordinatorConfigurationOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlCoordinatorConfigurationOutput)
}
// PostgresqlCoordinatorConfigurationArrayInput is an input type that accepts PostgresqlCoordinatorConfigurationArray and PostgresqlCoordinatorConfigurationArrayOutput values.
// You can construct a concrete instance of `PostgresqlCoordinatorConfigurationArrayInput` via:
//
// PostgresqlCoordinatorConfigurationArray{ PostgresqlCoordinatorConfigurationArgs{...} }
type PostgresqlCoordinatorConfigurationArrayInput interface {
pulumi.Input
ToPostgresqlCoordinatorConfigurationArrayOutput() PostgresqlCoordinatorConfigurationArrayOutput
ToPostgresqlCoordinatorConfigurationArrayOutputWithContext(context.Context) PostgresqlCoordinatorConfigurationArrayOutput
}
type PostgresqlCoordinatorConfigurationArray []PostgresqlCoordinatorConfigurationInput
func (PostgresqlCoordinatorConfigurationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlCoordinatorConfiguration)(nil)).Elem()
}
func (i PostgresqlCoordinatorConfigurationArray) ToPostgresqlCoordinatorConfigurationArrayOutput() PostgresqlCoordinatorConfigurationArrayOutput {
return i.ToPostgresqlCoordinatorConfigurationArrayOutputWithContext(context.Background())
}
func (i PostgresqlCoordinatorConfigurationArray) ToPostgresqlCoordinatorConfigurationArrayOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlCoordinatorConfigurationArrayOutput)
}
// PostgresqlCoordinatorConfigurationMapInput is an input type that accepts PostgresqlCoordinatorConfigurationMap and PostgresqlCoordinatorConfigurationMapOutput values.
// You can construct a concrete instance of `PostgresqlCoordinatorConfigurationMapInput` via:
//
// PostgresqlCoordinatorConfigurationMap{ "key": PostgresqlCoordinatorConfigurationArgs{...} }
type PostgresqlCoordinatorConfigurationMapInput interface {
pulumi.Input
ToPostgresqlCoordinatorConfigurationMapOutput() PostgresqlCoordinatorConfigurationMapOutput
ToPostgresqlCoordinatorConfigurationMapOutputWithContext(context.Context) PostgresqlCoordinatorConfigurationMapOutput
}
type PostgresqlCoordinatorConfigurationMap map[string]PostgresqlCoordinatorConfigurationInput
func (PostgresqlCoordinatorConfigurationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlCoordinatorConfiguration)(nil)).Elem()
}
func (i PostgresqlCoordinatorConfigurationMap) ToPostgresqlCoordinatorConfigurationMapOutput() PostgresqlCoordinatorConfigurationMapOutput {
return i.ToPostgresqlCoordinatorConfigurationMapOutputWithContext(context.Background())
}
func (i PostgresqlCoordinatorConfigurationMap) ToPostgresqlCoordinatorConfigurationMapOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlCoordinatorConfigurationMapOutput)
}
type PostgresqlCoordinatorConfigurationOutput struct{ *pulumi.OutputState }
func (PostgresqlCoordinatorConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlCoordinatorConfiguration)(nil)).Elem()
}
func (o PostgresqlCoordinatorConfigurationOutput) ToPostgresqlCoordinatorConfigurationOutput() PostgresqlCoordinatorConfigurationOutput {
return o
}
func (o PostgresqlCoordinatorConfigurationOutput) ToPostgresqlCoordinatorConfigurationOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationOutput {
return o
}
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster where we want to change configuration. Changing this forces a new resource to be created.
func (o PostgresqlCoordinatorConfigurationOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlCoordinatorConfiguration) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// The name of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
func (o PostgresqlCoordinatorConfigurationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlCoordinatorConfiguration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The value of the Coordinator Configuration on Azure Cosmos DB for PostgreSQL Cluster.
func (o PostgresqlCoordinatorConfigurationOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlCoordinatorConfiguration) pulumi.StringOutput { return v.Value }).(pulumi.StringOutput)
}
type PostgresqlCoordinatorConfigurationArrayOutput struct{ *pulumi.OutputState }
func (PostgresqlCoordinatorConfigurationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlCoordinatorConfiguration)(nil)).Elem()
}
func (o PostgresqlCoordinatorConfigurationArrayOutput) ToPostgresqlCoordinatorConfigurationArrayOutput() PostgresqlCoordinatorConfigurationArrayOutput {
return o
}
func (o PostgresqlCoordinatorConfigurationArrayOutput) ToPostgresqlCoordinatorConfigurationArrayOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationArrayOutput {
return o
}
func (o PostgresqlCoordinatorConfigurationArrayOutput) Index(i pulumi.IntInput) PostgresqlCoordinatorConfigurationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PostgresqlCoordinatorConfiguration {
return vs[0].([]*PostgresqlCoordinatorConfiguration)[vs[1].(int)]
}).(PostgresqlCoordinatorConfigurationOutput)
}
type PostgresqlCoordinatorConfigurationMapOutput struct{ *pulumi.OutputState }
func (PostgresqlCoordinatorConfigurationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlCoordinatorConfiguration)(nil)).Elem()
}
func (o PostgresqlCoordinatorConfigurationMapOutput) ToPostgresqlCoordinatorConfigurationMapOutput() PostgresqlCoordinatorConfigurationMapOutput {
return o
}
func (o PostgresqlCoordinatorConfigurationMapOutput) ToPostgresqlCoordinatorConfigurationMapOutputWithContext(ctx context.Context) PostgresqlCoordinatorConfigurationMapOutput {
return o
}
func (o PostgresqlCoordinatorConfigurationMapOutput) MapIndex(k pulumi.StringInput) PostgresqlCoordinatorConfigurationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PostgresqlCoordinatorConfiguration {
return vs[0].(map[string]*PostgresqlCoordinatorConfiguration)[vs[1].(string)]
}).(PostgresqlCoordinatorConfigurationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlCoordinatorConfigurationInput)(nil)).Elem(), &PostgresqlCoordinatorConfiguration{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlCoordinatorConfigurationArrayInput)(nil)).Elem(), PostgresqlCoordinatorConfigurationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlCoordinatorConfigurationMapInput)(nil)).Elem(), PostgresqlCoordinatorConfigurationMap{})
pulumi.RegisterOutputType(PostgresqlCoordinatorConfigurationOutput{})
pulumi.RegisterOutputType(PostgresqlCoordinatorConfigurationArrayOutput{})
pulumi.RegisterOutputType(PostgresqlCoordinatorConfigurationMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/mongoCollection.go | sdk/go/azure/cosmosdb/mongoCollection.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Mongo Collection within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// exampleMongoDatabase, err := cosmosdb.NewMongoDatabase(ctx, "example", &cosmosdb.MongoDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-mongo-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewMongoCollection(ctx, "example", &cosmosdb.MongoCollectionArgs{
// Name: pulumi.String("tfex-cosmos-mongo-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleMongoDatabase.Name,
// DefaultTtlSeconds: pulumi.Int(777),
// ShardKey: pulumi.String("uniqueKey"),
// Throughput: pulumi.Int(400),
// Indices: cosmosdb.MongoCollectionIndexArray{
// &cosmosdb.MongoCollectionIndexArgs{
// Keys: pulumi.StringArray{
// pulumi.String("_id"),
// },
// Unique: pulumi.Bool(true),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// CosmosDB Mongo Collection can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/mongoCollection:MongoCollection collection1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/mongodbDatabases/db1/collections/collection1
// ```
type MongoCollection struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Account in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// The default time to live of Analytical Storage for this Mongo Collection. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl pulumi.IntPtrOutput `pulumi:"analyticalStorageTtl"`
AutoscaleSettings MongoCollectionAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
DatabaseName pulumi.StringOutput `pulumi:"databaseName"`
// The default Time To Live in seconds. If the value is `-1`, items are not automatically expired.
DefaultTtlSeconds pulumi.IntPtrOutput `pulumi:"defaultTtlSeconds"`
// One or more `index` blocks as defined below.
Indices MongoCollectionIndexArrayOutput `pulumi:"indices"`
// Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The name of the key to partition on for sharding. There must not be any other unique index keys. Changing this forces a new resource to be created.
ShardKey pulumi.StringPtrOutput `pulumi:"shardKey"`
// One or more `systemIndexes` blocks as defined below.
SystemIndexes MongoCollectionSystemIndexArrayOutput `pulumi:"systemIndexes"`
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewMongoCollection registers a new resource with the given unique name, arguments, and options.
func NewMongoCollection(ctx *pulumi.Context,
name string, args *MongoCollectionArgs, opts ...pulumi.ResourceOption) (*MongoCollection, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.DatabaseName == nil {
return nil, errors.New("invalid value for required argument 'DatabaseName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource MongoCollection
err := ctx.RegisterResource("azure:cosmosdb/mongoCollection:MongoCollection", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMongoCollection gets an existing MongoCollection resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMongoCollection(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MongoCollectionState, opts ...pulumi.ResourceOption) (*MongoCollection, error) {
var resource MongoCollection
err := ctx.ReadResource("azure:cosmosdb/mongoCollection:MongoCollection", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MongoCollection resources.
type mongoCollectionState struct {
// The name of the Cosmos DB Account in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// The default time to live of Analytical Storage for this Mongo Collection. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
AutoscaleSettings *MongoCollectionAutoscaleSettings `pulumi:"autoscaleSettings"`
// The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
DatabaseName *string `pulumi:"databaseName"`
// The default Time To Live in seconds. If the value is `-1`, items are not automatically expired.
DefaultTtlSeconds *int `pulumi:"defaultTtlSeconds"`
// One or more `index` blocks as defined below.
Indices []MongoCollectionIndex `pulumi:"indices"`
// Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The name of the key to partition on for sharding. There must not be any other unique index keys. Changing this forces a new resource to be created.
ShardKey *string `pulumi:"shardKey"`
// One or more `systemIndexes` blocks as defined below.
SystemIndexes []MongoCollectionSystemIndex `pulumi:"systemIndexes"`
Throughput *int `pulumi:"throughput"`
}
type MongoCollectionState struct {
// The name of the Cosmos DB Account in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// The default time to live of Analytical Storage for this Mongo Collection. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl pulumi.IntPtrInput
AutoscaleSettings MongoCollectionAutoscaleSettingsPtrInput
// The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
DatabaseName pulumi.StringPtrInput
// The default Time To Live in seconds. If the value is `-1`, items are not automatically expired.
DefaultTtlSeconds pulumi.IntPtrInput
// One or more `index` blocks as defined below.
Indices MongoCollectionIndexArrayInput
// Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The name of the key to partition on for sharding. There must not be any other unique index keys. Changing this forces a new resource to be created.
ShardKey pulumi.StringPtrInput
// One or more `systemIndexes` blocks as defined below.
SystemIndexes MongoCollectionSystemIndexArrayInput
Throughput pulumi.IntPtrInput
}
func (MongoCollectionState) ElementType() reflect.Type {
return reflect.TypeOf((*mongoCollectionState)(nil)).Elem()
}
type mongoCollectionArgs struct {
// The name of the Cosmos DB Account in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// The default time to live of Analytical Storage for this Mongo Collection. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
AutoscaleSettings *MongoCollectionAutoscaleSettings `pulumi:"autoscaleSettings"`
// The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
DatabaseName string `pulumi:"databaseName"`
// The default Time To Live in seconds. If the value is `-1`, items are not automatically expired.
DefaultTtlSeconds *int `pulumi:"defaultTtlSeconds"`
// One or more `index` blocks as defined below.
Indices []MongoCollectionIndex `pulumi:"indices"`
// Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the key to partition on for sharding. There must not be any other unique index keys. Changing this forces a new resource to be created.
ShardKey *string `pulumi:"shardKey"`
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a MongoCollection resource.
type MongoCollectionArgs struct {
// The name of the Cosmos DB Account in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// The default time to live of Analytical Storage for this Mongo Collection. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl pulumi.IntPtrInput
AutoscaleSettings MongoCollectionAutoscaleSettingsPtrInput
// The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
DatabaseName pulumi.StringInput
// The default Time To Live in seconds. If the value is `-1`, items are not automatically expired.
DefaultTtlSeconds pulumi.IntPtrInput
// One or more `index` blocks as defined below.
Indices MongoCollectionIndexArrayInput
// Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The name of the key to partition on for sharding. There must not be any other unique index keys. Changing this forces a new resource to be created.
ShardKey pulumi.StringPtrInput
Throughput pulumi.IntPtrInput
}
func (MongoCollectionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mongoCollectionArgs)(nil)).Elem()
}
type MongoCollectionInput interface {
pulumi.Input
ToMongoCollectionOutput() MongoCollectionOutput
ToMongoCollectionOutputWithContext(ctx context.Context) MongoCollectionOutput
}
func (*MongoCollection) ElementType() reflect.Type {
return reflect.TypeOf((**MongoCollection)(nil)).Elem()
}
func (i *MongoCollection) ToMongoCollectionOutput() MongoCollectionOutput {
return i.ToMongoCollectionOutputWithContext(context.Background())
}
func (i *MongoCollection) ToMongoCollectionOutputWithContext(ctx context.Context) MongoCollectionOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoCollectionOutput)
}
// MongoCollectionArrayInput is an input type that accepts MongoCollectionArray and MongoCollectionArrayOutput values.
// You can construct a concrete instance of `MongoCollectionArrayInput` via:
//
// MongoCollectionArray{ MongoCollectionArgs{...} }
type MongoCollectionArrayInput interface {
pulumi.Input
ToMongoCollectionArrayOutput() MongoCollectionArrayOutput
ToMongoCollectionArrayOutputWithContext(context.Context) MongoCollectionArrayOutput
}
type MongoCollectionArray []MongoCollectionInput
func (MongoCollectionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoCollection)(nil)).Elem()
}
func (i MongoCollectionArray) ToMongoCollectionArrayOutput() MongoCollectionArrayOutput {
return i.ToMongoCollectionArrayOutputWithContext(context.Background())
}
func (i MongoCollectionArray) ToMongoCollectionArrayOutputWithContext(ctx context.Context) MongoCollectionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoCollectionArrayOutput)
}
// MongoCollectionMapInput is an input type that accepts MongoCollectionMap and MongoCollectionMapOutput values.
// You can construct a concrete instance of `MongoCollectionMapInput` via:
//
// MongoCollectionMap{ "key": MongoCollectionArgs{...} }
type MongoCollectionMapInput interface {
pulumi.Input
ToMongoCollectionMapOutput() MongoCollectionMapOutput
ToMongoCollectionMapOutputWithContext(context.Context) MongoCollectionMapOutput
}
type MongoCollectionMap map[string]MongoCollectionInput
func (MongoCollectionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoCollection)(nil)).Elem()
}
func (i MongoCollectionMap) ToMongoCollectionMapOutput() MongoCollectionMapOutput {
return i.ToMongoCollectionMapOutputWithContext(context.Background())
}
func (i MongoCollectionMap) ToMongoCollectionMapOutputWithContext(ctx context.Context) MongoCollectionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoCollectionMapOutput)
}
type MongoCollectionOutput struct{ *pulumi.OutputState }
func (MongoCollectionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MongoCollection)(nil)).Elem()
}
func (o MongoCollectionOutput) ToMongoCollectionOutput() MongoCollectionOutput {
return o
}
func (o MongoCollectionOutput) ToMongoCollectionOutputWithContext(ctx context.Context) MongoCollectionOutput {
return o
}
// The name of the Cosmos DB Account in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
func (o MongoCollectionOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// The default time to live of Analytical Storage for this Mongo Collection. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
func (o MongoCollectionOutput) AnalyticalStorageTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.IntPtrOutput { return v.AnalyticalStorageTtl }).(pulumi.IntPtrOutput)
}
func (o MongoCollectionOutput) AutoscaleSettings() MongoCollectionAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *MongoCollection) MongoCollectionAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(MongoCollectionAutoscaleSettingsPtrOutput)
}
// The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
func (o MongoCollectionOutput) DatabaseName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput)
}
// The default Time To Live in seconds. If the value is `-1`, items are not automatically expired.
func (o MongoCollectionOutput) DefaultTtlSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.IntPtrOutput { return v.DefaultTtlSeconds }).(pulumi.IntPtrOutput)
}
// One or more `index` blocks as defined below.
func (o MongoCollectionOutput) Indices() MongoCollectionIndexArrayOutput {
return o.ApplyT(func(v *MongoCollection) MongoCollectionIndexArrayOutput { return v.Indices }).(MongoCollectionIndexArrayOutput)
}
// Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
func (o MongoCollectionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
func (o MongoCollectionOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The name of the key to partition on for sharding. There must not be any other unique index keys. Changing this forces a new resource to be created.
func (o MongoCollectionOutput) ShardKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.StringPtrOutput { return v.ShardKey }).(pulumi.StringPtrOutput)
}
// One or more `systemIndexes` blocks as defined below.
func (o MongoCollectionOutput) SystemIndexes() MongoCollectionSystemIndexArrayOutput {
return o.ApplyT(func(v *MongoCollection) MongoCollectionSystemIndexArrayOutput { return v.SystemIndexes }).(MongoCollectionSystemIndexArrayOutput)
}
func (o MongoCollectionOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *MongoCollection) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type MongoCollectionArrayOutput struct{ *pulumi.OutputState }
func (MongoCollectionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoCollection)(nil)).Elem()
}
func (o MongoCollectionArrayOutput) ToMongoCollectionArrayOutput() MongoCollectionArrayOutput {
return o
}
func (o MongoCollectionArrayOutput) ToMongoCollectionArrayOutputWithContext(ctx context.Context) MongoCollectionArrayOutput {
return o
}
func (o MongoCollectionArrayOutput) Index(i pulumi.IntInput) MongoCollectionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MongoCollection {
return vs[0].([]*MongoCollection)[vs[1].(int)]
}).(MongoCollectionOutput)
}
type MongoCollectionMapOutput struct{ *pulumi.OutputState }
func (MongoCollectionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoCollection)(nil)).Elem()
}
func (o MongoCollectionMapOutput) ToMongoCollectionMapOutput() MongoCollectionMapOutput {
return o
}
func (o MongoCollectionMapOutput) ToMongoCollectionMapOutputWithContext(ctx context.Context) MongoCollectionMapOutput {
return o
}
func (o MongoCollectionMapOutput) MapIndex(k pulumi.StringInput) MongoCollectionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MongoCollection {
return vs[0].(map[string]*MongoCollection)[vs[1].(string)]
}).(MongoCollectionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MongoCollectionInput)(nil)).Elem(), &MongoCollection{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoCollectionArrayInput)(nil)).Elem(), MongoCollectionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoCollectionMapInput)(nil)).Elem(), MongoCollectionMap{})
pulumi.RegisterOutputType(MongoCollectionOutput{})
pulumi.RegisterOutputType(MongoCollectionArrayOutput{})
pulumi.RegisterOutputType(MongoCollectionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/gremlinGraph.go | sdk/go/azure/cosmosdb/gremlinGraph.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Gremlin Graph within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// exampleGremlinDatabase, err := cosmosdb.NewGremlinDatabase(ctx, "example", &cosmosdb.GremlinDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-gremlin-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewGremlinGraph(ctx, "example", &cosmosdb.GremlinGraphArgs{
// Name: pulumi.String("tfex-cosmos-gremlin-graph"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleGremlinDatabase.Name,
// PartitionKeyPath: pulumi.String("/Example"),
// Throughput: pulumi.Int(400),
// IndexPolicy: &cosmosdb.GremlinGraphIndexPolicyArgs{
// Automatic: pulumi.Bool(true),
// IndexingMode: pulumi.String("consistent"),
// IncludedPaths: pulumi.StringArray{
// pulumi.String("/*"),
// },
// ExcludedPaths: pulumi.StringArray{
// pulumi.String("/\"_etag\"/?"),
// },
// },
// ConflictResolutionPolicy: &cosmosdb.GremlinGraphConflictResolutionPolicyArgs{
// Mode: pulumi.String("LastWriterWins"),
// ConflictResolutionPath: pulumi.String("/_ts"),
// },
// UniqueKeys: cosmosdb.GremlinGraphUniqueKeyArray{
// &cosmosdb.GremlinGraphUniqueKeyArgs{
// Paths: pulumi.StringArray{
// pulumi.String("/definition/id1"),
// pulumi.String("/definition/id2"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// > **Note:** The CosmosDB Account needs to have the `EnableGremlin` capability enabled to use this resource - which can be done by adding this to the `capabilities` list within the `cosmosdb.Account` resource.
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2024-08-15
//
// ## Import
//
// Cosmos Gremlin Graphs can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/gremlinGraph:GremlinGraph example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/gremlinDatabases/db1/graphs/graphs1
// ```
type GremlinGraph struct {
pulumi.CustomResourceState
// The name of the CosmosDB Account to create the Gremlin Graph within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// The time to live of Analytical Storage for this Cosmos DB Gremlin Graph. Possible values are between `-1` to `2147483647` not including `0`. If present and the value is set to `-1`, it means never expire.
//
// > **Note:** Disabling `analyticalStorageTtl` will force a new resource to be created since it can't be disabled once it's enabled.
AnalyticalStorageTtl pulumi.IntPtrOutput `pulumi:"analyticalStorageTtl"`
AutoscaleSettings GremlinGraphAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy GremlinGraphConflictResolutionPolicyOutput `pulumi:"conflictResolutionPolicy"`
// The name of the Cosmos DB Graph Database in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
DatabaseName pulumi.StringOutput `pulumi:"databaseName"`
// The default time to live (TTL) of the Gremlin graph. If the value is missing or set to "-1", items don’t expire.
DefaultTtl pulumi.IntPtrOutput `pulumi:"defaultTtl"`
// The configuration of the indexing policy. One or more `indexPolicy` blocks as defined below.
IndexPolicy GremlinGraphIndexPolicyOutput `pulumi:"indexPolicy"`
// Specifies the name of the Cosmos DB Gremlin Graph. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Define a partition key. Changing this forces a new resource to be created.
PartitionKeyPath pulumi.StringOutput `pulumi:"partitionKeyPath"`
// Define a partition key version. Changing this forces a new resource to be created. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
PartitionKeyVersion pulumi.IntPtrOutput `pulumi:"partitionKeyVersion"`
// The name of the resource group in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The throughput of the Gremlin graph (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
Throughput pulumi.IntOutput `pulumi:"throughput"`
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys GremlinGraphUniqueKeyArrayOutput `pulumi:"uniqueKeys"`
}
// NewGremlinGraph registers a new resource with the given unique name, arguments, and options.
func NewGremlinGraph(ctx *pulumi.Context,
name string, args *GremlinGraphArgs, opts ...pulumi.ResourceOption) (*GremlinGraph, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.DatabaseName == nil {
return nil, errors.New("invalid value for required argument 'DatabaseName'")
}
if args.PartitionKeyPath == nil {
return nil, errors.New("invalid value for required argument 'PartitionKeyPath'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GremlinGraph
err := ctx.RegisterResource("azure:cosmosdb/gremlinGraph:GremlinGraph", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGremlinGraph gets an existing GremlinGraph resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGremlinGraph(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GremlinGraphState, opts ...pulumi.ResourceOption) (*GremlinGraph, error) {
var resource GremlinGraph
err := ctx.ReadResource("azure:cosmosdb/gremlinGraph:GremlinGraph", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GremlinGraph resources.
type gremlinGraphState struct {
// The name of the CosmosDB Account to create the Gremlin Graph within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// The time to live of Analytical Storage for this Cosmos DB Gremlin Graph. Possible values are between `-1` to `2147483647` not including `0`. If present and the value is set to `-1`, it means never expire.
//
// > **Note:** Disabling `analyticalStorageTtl` will force a new resource to be created since it can't be disabled once it's enabled.
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
AutoscaleSettings *GremlinGraphAutoscaleSettings `pulumi:"autoscaleSettings"`
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy *GremlinGraphConflictResolutionPolicy `pulumi:"conflictResolutionPolicy"`
// The name of the Cosmos DB Graph Database in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
DatabaseName *string `pulumi:"databaseName"`
// The default time to live (TTL) of the Gremlin graph. If the value is missing or set to "-1", items don’t expire.
DefaultTtl *int `pulumi:"defaultTtl"`
// The configuration of the indexing policy. One or more `indexPolicy` blocks as defined below.
IndexPolicy *GremlinGraphIndexPolicy `pulumi:"indexPolicy"`
// Specifies the name of the Cosmos DB Gremlin Graph. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Define a partition key. Changing this forces a new resource to be created.
PartitionKeyPath *string `pulumi:"partitionKeyPath"`
// Define a partition key version. Changing this forces a new resource to be created. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
PartitionKeyVersion *int `pulumi:"partitionKeyVersion"`
// The name of the resource group in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The throughput of the Gremlin graph (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
Throughput *int `pulumi:"throughput"`
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys []GremlinGraphUniqueKey `pulumi:"uniqueKeys"`
}
type GremlinGraphState struct {
// The name of the CosmosDB Account to create the Gremlin Graph within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// The time to live of Analytical Storage for this Cosmos DB Gremlin Graph. Possible values are between `-1` to `2147483647` not including `0`. If present and the value is set to `-1`, it means never expire.
//
// > **Note:** Disabling `analyticalStorageTtl` will force a new resource to be created since it can't be disabled once it's enabled.
AnalyticalStorageTtl pulumi.IntPtrInput
AutoscaleSettings GremlinGraphAutoscaleSettingsPtrInput
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy GremlinGraphConflictResolutionPolicyPtrInput
// The name of the Cosmos DB Graph Database in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
DatabaseName pulumi.StringPtrInput
// The default time to live (TTL) of the Gremlin graph. If the value is missing or set to "-1", items don’t expire.
DefaultTtl pulumi.IntPtrInput
// The configuration of the indexing policy. One or more `indexPolicy` blocks as defined below.
IndexPolicy GremlinGraphIndexPolicyPtrInput
// Specifies the name of the Cosmos DB Gremlin Graph. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Define a partition key. Changing this forces a new resource to be created.
PartitionKeyPath pulumi.StringPtrInput
// Define a partition key version. Changing this forces a new resource to be created. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
PartitionKeyVersion pulumi.IntPtrInput
// The name of the resource group in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The throughput of the Gremlin graph (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
Throughput pulumi.IntPtrInput
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys GremlinGraphUniqueKeyArrayInput
}
func (GremlinGraphState) ElementType() reflect.Type {
return reflect.TypeOf((*gremlinGraphState)(nil)).Elem()
}
type gremlinGraphArgs struct {
// The name of the CosmosDB Account to create the Gremlin Graph within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// The time to live of Analytical Storage for this Cosmos DB Gremlin Graph. Possible values are between `-1` to `2147483647` not including `0`. If present and the value is set to `-1`, it means never expire.
//
// > **Note:** Disabling `analyticalStorageTtl` will force a new resource to be created since it can't be disabled once it's enabled.
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
AutoscaleSettings *GremlinGraphAutoscaleSettings `pulumi:"autoscaleSettings"`
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy *GremlinGraphConflictResolutionPolicy `pulumi:"conflictResolutionPolicy"`
// The name of the Cosmos DB Graph Database in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
DatabaseName string `pulumi:"databaseName"`
// The default time to live (TTL) of the Gremlin graph. If the value is missing or set to "-1", items don’t expire.
DefaultTtl *int `pulumi:"defaultTtl"`
// The configuration of the indexing policy. One or more `indexPolicy` blocks as defined below.
IndexPolicy *GremlinGraphIndexPolicy `pulumi:"indexPolicy"`
// Specifies the name of the Cosmos DB Gremlin Graph. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Define a partition key. Changing this forces a new resource to be created.
PartitionKeyPath string `pulumi:"partitionKeyPath"`
// Define a partition key version. Changing this forces a new resource to be created. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
PartitionKeyVersion *int `pulumi:"partitionKeyVersion"`
// The name of the resource group in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of the Gremlin graph (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
Throughput *int `pulumi:"throughput"`
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys []GremlinGraphUniqueKey `pulumi:"uniqueKeys"`
}
// The set of arguments for constructing a GremlinGraph resource.
type GremlinGraphArgs struct {
// The name of the CosmosDB Account to create the Gremlin Graph within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// The time to live of Analytical Storage for this Cosmos DB Gremlin Graph. Possible values are between `-1` to `2147483647` not including `0`. If present and the value is set to `-1`, it means never expire.
//
// > **Note:** Disabling `analyticalStorageTtl` will force a new resource to be created since it can't be disabled once it's enabled.
AnalyticalStorageTtl pulumi.IntPtrInput
AutoscaleSettings GremlinGraphAutoscaleSettingsPtrInput
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy GremlinGraphConflictResolutionPolicyPtrInput
// The name of the Cosmos DB Graph Database in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
DatabaseName pulumi.StringInput
// The default time to live (TTL) of the Gremlin graph. If the value is missing or set to "-1", items don’t expire.
DefaultTtl pulumi.IntPtrInput
// The configuration of the indexing policy. One or more `indexPolicy` blocks as defined below.
IndexPolicy GremlinGraphIndexPolicyPtrInput
// Specifies the name of the Cosmos DB Gremlin Graph. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Define a partition key. Changing this forces a new resource to be created.
PartitionKeyPath pulumi.StringInput
// Define a partition key version. Changing this forces a new resource to be created. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
PartitionKeyVersion pulumi.IntPtrInput
// The name of the resource group in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The throughput of the Gremlin graph (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
Throughput pulumi.IntPtrInput
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys GremlinGraphUniqueKeyArrayInput
}
func (GremlinGraphArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gremlinGraphArgs)(nil)).Elem()
}
type GremlinGraphInput interface {
pulumi.Input
ToGremlinGraphOutput() GremlinGraphOutput
ToGremlinGraphOutputWithContext(ctx context.Context) GremlinGraphOutput
}
func (*GremlinGraph) ElementType() reflect.Type {
return reflect.TypeOf((**GremlinGraph)(nil)).Elem()
}
func (i *GremlinGraph) ToGremlinGraphOutput() GremlinGraphOutput {
return i.ToGremlinGraphOutputWithContext(context.Background())
}
func (i *GremlinGraph) ToGremlinGraphOutputWithContext(ctx context.Context) GremlinGraphOutput {
return pulumi.ToOutputWithContext(ctx, i).(GremlinGraphOutput)
}
// GremlinGraphArrayInput is an input type that accepts GremlinGraphArray and GremlinGraphArrayOutput values.
// You can construct a concrete instance of `GremlinGraphArrayInput` via:
//
// GremlinGraphArray{ GremlinGraphArgs{...} }
type GremlinGraphArrayInput interface {
pulumi.Input
ToGremlinGraphArrayOutput() GremlinGraphArrayOutput
ToGremlinGraphArrayOutputWithContext(context.Context) GremlinGraphArrayOutput
}
type GremlinGraphArray []GremlinGraphInput
func (GremlinGraphArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GremlinGraph)(nil)).Elem()
}
func (i GremlinGraphArray) ToGremlinGraphArrayOutput() GremlinGraphArrayOutput {
return i.ToGremlinGraphArrayOutputWithContext(context.Background())
}
func (i GremlinGraphArray) ToGremlinGraphArrayOutputWithContext(ctx context.Context) GremlinGraphArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GremlinGraphArrayOutput)
}
// GremlinGraphMapInput is an input type that accepts GremlinGraphMap and GremlinGraphMapOutput values.
// You can construct a concrete instance of `GremlinGraphMapInput` via:
//
// GremlinGraphMap{ "key": GremlinGraphArgs{...} }
type GremlinGraphMapInput interface {
pulumi.Input
ToGremlinGraphMapOutput() GremlinGraphMapOutput
ToGremlinGraphMapOutputWithContext(context.Context) GremlinGraphMapOutput
}
type GremlinGraphMap map[string]GremlinGraphInput
func (GremlinGraphMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GremlinGraph)(nil)).Elem()
}
func (i GremlinGraphMap) ToGremlinGraphMapOutput() GremlinGraphMapOutput {
return i.ToGremlinGraphMapOutputWithContext(context.Background())
}
func (i GremlinGraphMap) ToGremlinGraphMapOutputWithContext(ctx context.Context) GremlinGraphMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GremlinGraphMapOutput)
}
type GremlinGraphOutput struct{ *pulumi.OutputState }
func (GremlinGraphOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GremlinGraph)(nil)).Elem()
}
func (o GremlinGraphOutput) ToGremlinGraphOutput() GremlinGraphOutput {
return o
}
func (o GremlinGraphOutput) ToGremlinGraphOutputWithContext(ctx context.Context) GremlinGraphOutput {
return o
}
// The name of the CosmosDB Account to create the Gremlin Graph within. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// The time to live of Analytical Storage for this Cosmos DB Gremlin Graph. Possible values are between `-1` to `2147483647` not including `0`. If present and the value is set to `-1`, it means never expire.
//
// > **Note:** Disabling `analyticalStorageTtl` will force a new resource to be created since it can't be disabled once it's enabled.
func (o GremlinGraphOutput) AnalyticalStorageTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.IntPtrOutput { return v.AnalyticalStorageTtl }).(pulumi.IntPtrOutput)
}
func (o GremlinGraphOutput) AutoscaleSettings() GremlinGraphAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *GremlinGraph) GremlinGraphAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(GremlinGraphAutoscaleSettingsPtrOutput)
}
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) ConflictResolutionPolicy() GremlinGraphConflictResolutionPolicyOutput {
return o.ApplyT(func(v *GremlinGraph) GremlinGraphConflictResolutionPolicyOutput { return v.ConflictResolutionPolicy }).(GremlinGraphConflictResolutionPolicyOutput)
}
// The name of the Cosmos DB Graph Database in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) DatabaseName() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput)
}
// The default time to live (TTL) of the Gremlin graph. If the value is missing or set to "-1", items don’t expire.
func (o GremlinGraphOutput) DefaultTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.IntPtrOutput { return v.DefaultTtl }).(pulumi.IntPtrOutput)
}
// The configuration of the indexing policy. One or more `indexPolicy` blocks as defined below.
func (o GremlinGraphOutput) IndexPolicy() GremlinGraphIndexPolicyOutput {
return o.ApplyT(func(v *GremlinGraph) GremlinGraphIndexPolicyOutput { return v.IndexPolicy }).(GremlinGraphIndexPolicyOutput)
}
// Specifies the name of the Cosmos DB Gremlin Graph. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Define a partition key. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) PartitionKeyPath() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.StringOutput { return v.PartitionKeyPath }).(pulumi.StringOutput)
}
// Define a partition key version. Changing this forces a new resource to be created. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
func (o GremlinGraphOutput) PartitionKeyVersion() pulumi.IntPtrOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.IntPtrOutput { return v.PartitionKeyVersion }).(pulumi.IntPtrOutput)
}
// The name of the resource group in which the Cosmos DB Gremlin Graph is created. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of the Gremlin graph (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
func (o GremlinGraphOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *GremlinGraph) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
func (o GremlinGraphOutput) UniqueKeys() GremlinGraphUniqueKeyArrayOutput {
return o.ApplyT(func(v *GremlinGraph) GremlinGraphUniqueKeyArrayOutput { return v.UniqueKeys }).(GremlinGraphUniqueKeyArrayOutput)
}
type GremlinGraphArrayOutput struct{ *pulumi.OutputState }
func (GremlinGraphArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GremlinGraph)(nil)).Elem()
}
func (o GremlinGraphArrayOutput) ToGremlinGraphArrayOutput() GremlinGraphArrayOutput {
return o
}
func (o GremlinGraphArrayOutput) ToGremlinGraphArrayOutputWithContext(ctx context.Context) GremlinGraphArrayOutput {
return o
}
func (o GremlinGraphArrayOutput) Index(i pulumi.IntInput) GremlinGraphOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GremlinGraph {
return vs[0].([]*GremlinGraph)[vs[1].(int)]
}).(GremlinGraphOutput)
}
type GremlinGraphMapOutput struct{ *pulumi.OutputState }
func (GremlinGraphMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GremlinGraph)(nil)).Elem()
}
func (o GremlinGraphMapOutput) ToGremlinGraphMapOutput() GremlinGraphMapOutput {
return o
}
func (o GremlinGraphMapOutput) ToGremlinGraphMapOutputWithContext(ctx context.Context) GremlinGraphMapOutput {
return o
}
func (o GremlinGraphMapOutput) MapIndex(k pulumi.StringInput) GremlinGraphOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GremlinGraph {
return vs[0].(map[string]*GremlinGraph)[vs[1].(string)]
}).(GremlinGraphOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GremlinGraphInput)(nil)).Elem(), &GremlinGraph{})
pulumi.RegisterInputType(reflect.TypeOf((*GremlinGraphArrayInput)(nil)).Elem(), GremlinGraphArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GremlinGraphMapInput)(nil)).Elem(), GremlinGraphMap{})
pulumi.RegisterOutputType(GremlinGraphOutput{})
pulumi.RegisterOutputType(GremlinGraphArrayOutput{})
pulumi.RegisterOutputType(GremlinGraphMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlStoredProcedure.go | sdk/go/azure/cosmosdb/sqlStoredProcedure.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "example", &cosmosdb.SqlContainerArgs{
// Name: pulumi.String("example-container"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleSqlDatabase.Name,
// PartitionKeyPath: "/id",
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlStoredProcedure(ctx, "example", &cosmosdb.SqlStoredProcedureArgs{
// Name: pulumi.String("test-stored-proc"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleSqlDatabase.Name,
// ContainerName: exampleSqlContainer.Name,
// Body: pulumi.String(" function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); }\n"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// CosmosDB SQL Stored Procedures can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlStoredProcedure:SqlStoredProcedure db1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/db1/containers/c1/storedProcedures/sp1
// ```
type SqlStoredProcedure struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// The body of the stored procedure.
Body pulumi.StringOutput `pulumi:"body"`
// The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
ContainerName pulumi.StringOutput `pulumi:"containerName"`
// The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
DatabaseName pulumi.StringOutput `pulumi:"databaseName"`
// Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewSqlStoredProcedure registers a new resource with the given unique name, arguments, and options.
func NewSqlStoredProcedure(ctx *pulumi.Context,
name string, args *SqlStoredProcedureArgs, opts ...pulumi.ResourceOption) (*SqlStoredProcedure, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.Body == nil {
return nil, errors.New("invalid value for required argument 'Body'")
}
if args.ContainerName == nil {
return nil, errors.New("invalid value for required argument 'ContainerName'")
}
if args.DatabaseName == nil {
return nil, errors.New("invalid value for required argument 'DatabaseName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlStoredProcedure
err := ctx.RegisterResource("azure:cosmosdb/sqlStoredProcedure:SqlStoredProcedure", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlStoredProcedure gets an existing SqlStoredProcedure resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlStoredProcedure(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlStoredProcedureState, opts ...pulumi.ResourceOption) (*SqlStoredProcedure, error) {
var resource SqlStoredProcedure
err := ctx.ReadResource("azure:cosmosdb/sqlStoredProcedure:SqlStoredProcedure", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlStoredProcedure resources.
type sqlStoredProcedureState struct {
// The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// The body of the stored procedure.
Body *string `pulumi:"body"`
// The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
ContainerName *string `pulumi:"containerName"`
// The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
DatabaseName *string `pulumi:"databaseName"`
// Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type SqlStoredProcedureState struct {
// The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// The body of the stored procedure.
Body pulumi.StringPtrInput
// The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
ContainerName pulumi.StringPtrInput
// The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
DatabaseName pulumi.StringPtrInput
// Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
}
func (SqlStoredProcedureState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlStoredProcedureState)(nil)).Elem()
}
type sqlStoredProcedureArgs struct {
// The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// The body of the stored procedure.
Body string `pulumi:"body"`
// The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
ContainerName string `pulumi:"containerName"`
// The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
DatabaseName string `pulumi:"databaseName"`
// Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a SqlStoredProcedure resource.
type SqlStoredProcedureArgs struct {
// The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// The body of the stored procedure.
Body pulumi.StringInput
// The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
ContainerName pulumi.StringInput
// The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
DatabaseName pulumi.StringInput
// Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
}
func (SqlStoredProcedureArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlStoredProcedureArgs)(nil)).Elem()
}
type SqlStoredProcedureInput interface {
pulumi.Input
ToSqlStoredProcedureOutput() SqlStoredProcedureOutput
ToSqlStoredProcedureOutputWithContext(ctx context.Context) SqlStoredProcedureOutput
}
func (*SqlStoredProcedure) ElementType() reflect.Type {
return reflect.TypeOf((**SqlStoredProcedure)(nil)).Elem()
}
func (i *SqlStoredProcedure) ToSqlStoredProcedureOutput() SqlStoredProcedureOutput {
return i.ToSqlStoredProcedureOutputWithContext(context.Background())
}
func (i *SqlStoredProcedure) ToSqlStoredProcedureOutputWithContext(ctx context.Context) SqlStoredProcedureOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlStoredProcedureOutput)
}
// SqlStoredProcedureArrayInput is an input type that accepts SqlStoredProcedureArray and SqlStoredProcedureArrayOutput values.
// You can construct a concrete instance of `SqlStoredProcedureArrayInput` via:
//
// SqlStoredProcedureArray{ SqlStoredProcedureArgs{...} }
type SqlStoredProcedureArrayInput interface {
pulumi.Input
ToSqlStoredProcedureArrayOutput() SqlStoredProcedureArrayOutput
ToSqlStoredProcedureArrayOutputWithContext(context.Context) SqlStoredProcedureArrayOutput
}
type SqlStoredProcedureArray []SqlStoredProcedureInput
func (SqlStoredProcedureArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlStoredProcedure)(nil)).Elem()
}
func (i SqlStoredProcedureArray) ToSqlStoredProcedureArrayOutput() SqlStoredProcedureArrayOutput {
return i.ToSqlStoredProcedureArrayOutputWithContext(context.Background())
}
func (i SqlStoredProcedureArray) ToSqlStoredProcedureArrayOutputWithContext(ctx context.Context) SqlStoredProcedureArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlStoredProcedureArrayOutput)
}
// SqlStoredProcedureMapInput is an input type that accepts SqlStoredProcedureMap and SqlStoredProcedureMapOutput values.
// You can construct a concrete instance of `SqlStoredProcedureMapInput` via:
//
// SqlStoredProcedureMap{ "key": SqlStoredProcedureArgs{...} }
type SqlStoredProcedureMapInput interface {
pulumi.Input
ToSqlStoredProcedureMapOutput() SqlStoredProcedureMapOutput
ToSqlStoredProcedureMapOutputWithContext(context.Context) SqlStoredProcedureMapOutput
}
type SqlStoredProcedureMap map[string]SqlStoredProcedureInput
func (SqlStoredProcedureMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlStoredProcedure)(nil)).Elem()
}
func (i SqlStoredProcedureMap) ToSqlStoredProcedureMapOutput() SqlStoredProcedureMapOutput {
return i.ToSqlStoredProcedureMapOutputWithContext(context.Background())
}
func (i SqlStoredProcedureMap) ToSqlStoredProcedureMapOutputWithContext(ctx context.Context) SqlStoredProcedureMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlStoredProcedureMapOutput)
}
type SqlStoredProcedureOutput struct{ *pulumi.OutputState }
func (SqlStoredProcedureOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlStoredProcedure)(nil)).Elem()
}
func (o SqlStoredProcedureOutput) ToSqlStoredProcedureOutput() SqlStoredProcedureOutput {
return o
}
func (o SqlStoredProcedureOutput) ToSqlStoredProcedureOutputWithContext(ctx context.Context) SqlStoredProcedureOutput {
return o
}
// The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
func (o SqlStoredProcedureOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlStoredProcedure) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// The body of the stored procedure.
func (o SqlStoredProcedureOutput) Body() pulumi.StringOutput {
return o.ApplyT(func(v *SqlStoredProcedure) pulumi.StringOutput { return v.Body }).(pulumi.StringOutput)
}
// The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
func (o SqlStoredProcedureOutput) ContainerName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlStoredProcedure) pulumi.StringOutput { return v.ContainerName }).(pulumi.StringOutput)
}
// The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
func (o SqlStoredProcedureOutput) DatabaseName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlStoredProcedure) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput)
}
// Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
func (o SqlStoredProcedureOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlStoredProcedure) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
func (o SqlStoredProcedureOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlStoredProcedure) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
type SqlStoredProcedureArrayOutput struct{ *pulumi.OutputState }
func (SqlStoredProcedureArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlStoredProcedure)(nil)).Elem()
}
func (o SqlStoredProcedureArrayOutput) ToSqlStoredProcedureArrayOutput() SqlStoredProcedureArrayOutput {
return o
}
func (o SqlStoredProcedureArrayOutput) ToSqlStoredProcedureArrayOutputWithContext(ctx context.Context) SqlStoredProcedureArrayOutput {
return o
}
func (o SqlStoredProcedureArrayOutput) Index(i pulumi.IntInput) SqlStoredProcedureOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlStoredProcedure {
return vs[0].([]*SqlStoredProcedure)[vs[1].(int)]
}).(SqlStoredProcedureOutput)
}
type SqlStoredProcedureMapOutput struct{ *pulumi.OutputState }
func (SqlStoredProcedureMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlStoredProcedure)(nil)).Elem()
}
func (o SqlStoredProcedureMapOutput) ToSqlStoredProcedureMapOutput() SqlStoredProcedureMapOutput {
return o
}
func (o SqlStoredProcedureMapOutput) ToSqlStoredProcedureMapOutputWithContext(ctx context.Context) SqlStoredProcedureMapOutput {
return o
}
func (o SqlStoredProcedureMapOutput) MapIndex(k pulumi.StringInput) SqlStoredProcedureOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlStoredProcedure {
return vs[0].(map[string]*SqlStoredProcedure)[vs[1].(string)]
}).(SqlStoredProcedureOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlStoredProcedureInput)(nil)).Elem(), &SqlStoredProcedure{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlStoredProcedureArrayInput)(nil)).Elem(), SqlStoredProcedureArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlStoredProcedureMapInput)(nil)).Elem(), SqlStoredProcedureMap{})
pulumi.RegisterOutputType(SqlStoredProcedureOutput{})
pulumi.RegisterOutputType(SqlStoredProcedureArrayOutput{})
pulumi.RegisterOutputType(SqlStoredProcedureMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/mongoRoleDefinition.go | sdk/go/azure/cosmosdb/mongoRoleDefinition.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cosmos DB Mongo Role Definition.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("example-ca"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("MongoDB"),
// Capabilities: cosmosdb.AccountCapabilityArray{
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableMongo"),
// },
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableMongoRoleBasedAccessControl"),
// },
// },
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleMongoDatabase, err := cosmosdb.NewMongoDatabase(ctx, "example", &cosmosdb.MongoDatabaseArgs{
// Name: pulumi.String("example-mongodb"),
// ResourceGroupName: exampleAccount.ResourceGroupName,
// AccountName: exampleAccount.Name,
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewMongoRoleDefinition(ctx, "example", &cosmosdb.MongoRoleDefinitionArgs{
// CosmosMongoDatabaseId: exampleMongoDatabase.ID(),
// RoleName: pulumi.String("example-roledefinition"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2022-11-15
//
// ## Import
//
// Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/mongodbRoleDefinitions/dbname1.rolename1
// ```
type MongoRoleDefinition struct {
pulumi.CustomResourceState
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId pulumi.StringOutput `pulumi:"cosmosMongoDatabaseId"`
// A list of Mongo Roles which are inherited to the Mongo Role Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames pulumi.StringArrayOutput `pulumi:"inheritedRoleNames"`
// A `privilege` block as defined below.
Privileges MongoRoleDefinitionPrivilegeArrayOutput `pulumi:"privileges"`
// The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created.
RoleName pulumi.StringOutput `pulumi:"roleName"`
}
// NewMongoRoleDefinition registers a new resource with the given unique name, arguments, and options.
func NewMongoRoleDefinition(ctx *pulumi.Context,
name string, args *MongoRoleDefinitionArgs, opts ...pulumi.ResourceOption) (*MongoRoleDefinition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CosmosMongoDatabaseId == nil {
return nil, errors.New("invalid value for required argument 'CosmosMongoDatabaseId'")
}
if args.RoleName == nil {
return nil, errors.New("invalid value for required argument 'RoleName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource MongoRoleDefinition
err := ctx.RegisterResource("azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMongoRoleDefinition gets an existing MongoRoleDefinition resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMongoRoleDefinition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MongoRoleDefinitionState, opts ...pulumi.ResourceOption) (*MongoRoleDefinition, error) {
var resource MongoRoleDefinition
err := ctx.ReadResource("azure:cosmosdb/mongoRoleDefinition:MongoRoleDefinition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MongoRoleDefinition resources.
type mongoRoleDefinitionState struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId *string `pulumi:"cosmosMongoDatabaseId"`
// A list of Mongo Roles which are inherited to the Mongo Role Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames []string `pulumi:"inheritedRoleNames"`
// A `privilege` block as defined below.
Privileges []MongoRoleDefinitionPrivilege `pulumi:"privileges"`
// The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created.
RoleName *string `pulumi:"roleName"`
}
type MongoRoleDefinitionState struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId pulumi.StringPtrInput
// A list of Mongo Roles which are inherited to the Mongo Role Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames pulumi.StringArrayInput
// A `privilege` block as defined below.
Privileges MongoRoleDefinitionPrivilegeArrayInput
// The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created.
RoleName pulumi.StringPtrInput
}
func (MongoRoleDefinitionState) ElementType() reflect.Type {
return reflect.TypeOf((*mongoRoleDefinitionState)(nil)).Elem()
}
type mongoRoleDefinitionArgs struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId string `pulumi:"cosmosMongoDatabaseId"`
// A list of Mongo Roles which are inherited to the Mongo Role Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames []string `pulumi:"inheritedRoleNames"`
// A `privilege` block as defined below.
Privileges []MongoRoleDefinitionPrivilege `pulumi:"privileges"`
// The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created.
RoleName string `pulumi:"roleName"`
}
// The set of arguments for constructing a MongoRoleDefinition resource.
type MongoRoleDefinitionArgs struct {
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
CosmosMongoDatabaseId pulumi.StringInput
// A list of Mongo Roles which are inherited to the Mongo Role Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
InheritedRoleNames pulumi.StringArrayInput
// A `privilege` block as defined below.
Privileges MongoRoleDefinitionPrivilegeArrayInput
// The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created.
RoleName pulumi.StringInput
}
func (MongoRoleDefinitionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mongoRoleDefinitionArgs)(nil)).Elem()
}
type MongoRoleDefinitionInput interface {
pulumi.Input
ToMongoRoleDefinitionOutput() MongoRoleDefinitionOutput
ToMongoRoleDefinitionOutputWithContext(ctx context.Context) MongoRoleDefinitionOutput
}
func (*MongoRoleDefinition) ElementType() reflect.Type {
return reflect.TypeOf((**MongoRoleDefinition)(nil)).Elem()
}
func (i *MongoRoleDefinition) ToMongoRoleDefinitionOutput() MongoRoleDefinitionOutput {
return i.ToMongoRoleDefinitionOutputWithContext(context.Background())
}
func (i *MongoRoleDefinition) ToMongoRoleDefinitionOutputWithContext(ctx context.Context) MongoRoleDefinitionOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoRoleDefinitionOutput)
}
// MongoRoleDefinitionArrayInput is an input type that accepts MongoRoleDefinitionArray and MongoRoleDefinitionArrayOutput values.
// You can construct a concrete instance of `MongoRoleDefinitionArrayInput` via:
//
// MongoRoleDefinitionArray{ MongoRoleDefinitionArgs{...} }
type MongoRoleDefinitionArrayInput interface {
pulumi.Input
ToMongoRoleDefinitionArrayOutput() MongoRoleDefinitionArrayOutput
ToMongoRoleDefinitionArrayOutputWithContext(context.Context) MongoRoleDefinitionArrayOutput
}
type MongoRoleDefinitionArray []MongoRoleDefinitionInput
func (MongoRoleDefinitionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoRoleDefinition)(nil)).Elem()
}
func (i MongoRoleDefinitionArray) ToMongoRoleDefinitionArrayOutput() MongoRoleDefinitionArrayOutput {
return i.ToMongoRoleDefinitionArrayOutputWithContext(context.Background())
}
func (i MongoRoleDefinitionArray) ToMongoRoleDefinitionArrayOutputWithContext(ctx context.Context) MongoRoleDefinitionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoRoleDefinitionArrayOutput)
}
// MongoRoleDefinitionMapInput is an input type that accepts MongoRoleDefinitionMap and MongoRoleDefinitionMapOutput values.
// You can construct a concrete instance of `MongoRoleDefinitionMapInput` via:
//
// MongoRoleDefinitionMap{ "key": MongoRoleDefinitionArgs{...} }
type MongoRoleDefinitionMapInput interface {
pulumi.Input
ToMongoRoleDefinitionMapOutput() MongoRoleDefinitionMapOutput
ToMongoRoleDefinitionMapOutputWithContext(context.Context) MongoRoleDefinitionMapOutput
}
type MongoRoleDefinitionMap map[string]MongoRoleDefinitionInput
func (MongoRoleDefinitionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoRoleDefinition)(nil)).Elem()
}
func (i MongoRoleDefinitionMap) ToMongoRoleDefinitionMapOutput() MongoRoleDefinitionMapOutput {
return i.ToMongoRoleDefinitionMapOutputWithContext(context.Background())
}
func (i MongoRoleDefinitionMap) ToMongoRoleDefinitionMapOutputWithContext(ctx context.Context) MongoRoleDefinitionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoRoleDefinitionMapOutput)
}
type MongoRoleDefinitionOutput struct{ *pulumi.OutputState }
func (MongoRoleDefinitionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MongoRoleDefinition)(nil)).Elem()
}
func (o MongoRoleDefinitionOutput) ToMongoRoleDefinitionOutput() MongoRoleDefinitionOutput {
return o
}
func (o MongoRoleDefinitionOutput) ToMongoRoleDefinitionOutputWithContext(ctx context.Context) MongoRoleDefinitionOutput {
return o
}
// The resource ID of the Mongo DB. Changing this forces a new resource to be created.
func (o MongoRoleDefinitionOutput) CosmosMongoDatabaseId() pulumi.StringOutput {
return o.ApplyT(func(v *MongoRoleDefinition) pulumi.StringOutput { return v.CosmosMongoDatabaseId }).(pulumi.StringOutput)
}
// A list of Mongo Roles which are inherited to the Mongo Role Definition.
//
// > **Note:** The role that needs to be inherited should exist in the Mongo DB of `cosmosMongoDatabaseId`.
func (o MongoRoleDefinitionOutput) InheritedRoleNames() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MongoRoleDefinition) pulumi.StringArrayOutput { return v.InheritedRoleNames }).(pulumi.StringArrayOutput)
}
// A `privilege` block as defined below.
func (o MongoRoleDefinitionOutput) Privileges() MongoRoleDefinitionPrivilegeArrayOutput {
return o.ApplyT(func(v *MongoRoleDefinition) MongoRoleDefinitionPrivilegeArrayOutput { return v.Privileges }).(MongoRoleDefinitionPrivilegeArrayOutput)
}
// The user-friendly name for the Mongo Role Definition. It must be unique for the database account. Changing this forces a new resource to be created.
func (o MongoRoleDefinitionOutput) RoleName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoRoleDefinition) pulumi.StringOutput { return v.RoleName }).(pulumi.StringOutput)
}
type MongoRoleDefinitionArrayOutput struct{ *pulumi.OutputState }
func (MongoRoleDefinitionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoRoleDefinition)(nil)).Elem()
}
func (o MongoRoleDefinitionArrayOutput) ToMongoRoleDefinitionArrayOutput() MongoRoleDefinitionArrayOutput {
return o
}
func (o MongoRoleDefinitionArrayOutput) ToMongoRoleDefinitionArrayOutputWithContext(ctx context.Context) MongoRoleDefinitionArrayOutput {
return o
}
func (o MongoRoleDefinitionArrayOutput) Index(i pulumi.IntInput) MongoRoleDefinitionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MongoRoleDefinition {
return vs[0].([]*MongoRoleDefinition)[vs[1].(int)]
}).(MongoRoleDefinitionOutput)
}
type MongoRoleDefinitionMapOutput struct{ *pulumi.OutputState }
func (MongoRoleDefinitionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoRoleDefinition)(nil)).Elem()
}
func (o MongoRoleDefinitionMapOutput) ToMongoRoleDefinitionMapOutput() MongoRoleDefinitionMapOutput {
return o
}
func (o MongoRoleDefinitionMapOutput) ToMongoRoleDefinitionMapOutputWithContext(ctx context.Context) MongoRoleDefinitionMapOutput {
return o
}
func (o MongoRoleDefinitionMapOutput) MapIndex(k pulumi.StringInput) MongoRoleDefinitionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MongoRoleDefinition {
return vs[0].(map[string]*MongoRoleDefinition)[vs[1].(string)]
}).(MongoRoleDefinitionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MongoRoleDefinitionInput)(nil)).Elem(), &MongoRoleDefinition{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoRoleDefinitionArrayInput)(nil)).Elem(), MongoRoleDefinitionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoRoleDefinitionMapInput)(nil)).Elem(), MongoRoleDefinitionMap{})
pulumi.RegisterOutputType(MongoRoleDefinitionOutput{})
pulumi.RegisterOutputType(MongoRoleDefinitionArrayOutput{})
pulumi.RegisterOutputType(MongoRoleDefinitionMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlDatabase.go | sdk/go/azure/cosmosdb/sqlDatabase.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a SQL Database within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-sql-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cosmos SQL Database can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlDatabase:SqlDatabase db1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/db1
// ```
type SqlDatabase struct {
pulumi.CustomResourceState
// The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings SqlDatabaseAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewSqlDatabase registers a new resource with the given unique name, arguments, and options.
func NewSqlDatabase(ctx *pulumi.Context,
name string, args *SqlDatabaseArgs, opts ...pulumi.ResourceOption) (*SqlDatabase, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlDatabase
err := ctx.RegisterResource("azure:cosmosdb/sqlDatabase:SqlDatabase", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlDatabase gets an existing SqlDatabase resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlDatabase(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlDatabaseState, opts ...pulumi.ResourceOption) (*SqlDatabase, error) {
var resource SqlDatabase
err := ctx.ReadResource("azure:cosmosdb/sqlDatabase:SqlDatabase", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlDatabase resources.
type sqlDatabaseState struct {
// The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *SqlDatabaseAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
Throughput *int `pulumi:"throughput"`
}
type SqlDatabaseState struct {
// The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings SqlDatabaseAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
Throughput pulumi.IntPtrInput
}
func (SqlDatabaseState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlDatabaseState)(nil)).Elem()
}
type sqlDatabaseArgs struct {
// The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *SqlDatabaseAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a SqlDatabase resource.
type SqlDatabaseArgs struct {
// The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings SqlDatabaseAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
Throughput pulumi.IntPtrInput
}
func (SqlDatabaseArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlDatabaseArgs)(nil)).Elem()
}
type SqlDatabaseInput interface {
pulumi.Input
ToSqlDatabaseOutput() SqlDatabaseOutput
ToSqlDatabaseOutputWithContext(ctx context.Context) SqlDatabaseOutput
}
func (*SqlDatabase) ElementType() reflect.Type {
return reflect.TypeOf((**SqlDatabase)(nil)).Elem()
}
func (i *SqlDatabase) ToSqlDatabaseOutput() SqlDatabaseOutput {
return i.ToSqlDatabaseOutputWithContext(context.Background())
}
func (i *SqlDatabase) ToSqlDatabaseOutputWithContext(ctx context.Context) SqlDatabaseOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlDatabaseOutput)
}
// SqlDatabaseArrayInput is an input type that accepts SqlDatabaseArray and SqlDatabaseArrayOutput values.
// You can construct a concrete instance of `SqlDatabaseArrayInput` via:
//
// SqlDatabaseArray{ SqlDatabaseArgs{...} }
type SqlDatabaseArrayInput interface {
pulumi.Input
ToSqlDatabaseArrayOutput() SqlDatabaseArrayOutput
ToSqlDatabaseArrayOutputWithContext(context.Context) SqlDatabaseArrayOutput
}
type SqlDatabaseArray []SqlDatabaseInput
func (SqlDatabaseArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlDatabase)(nil)).Elem()
}
func (i SqlDatabaseArray) ToSqlDatabaseArrayOutput() SqlDatabaseArrayOutput {
return i.ToSqlDatabaseArrayOutputWithContext(context.Background())
}
func (i SqlDatabaseArray) ToSqlDatabaseArrayOutputWithContext(ctx context.Context) SqlDatabaseArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlDatabaseArrayOutput)
}
// SqlDatabaseMapInput is an input type that accepts SqlDatabaseMap and SqlDatabaseMapOutput values.
// You can construct a concrete instance of `SqlDatabaseMapInput` via:
//
// SqlDatabaseMap{ "key": SqlDatabaseArgs{...} }
type SqlDatabaseMapInput interface {
pulumi.Input
ToSqlDatabaseMapOutput() SqlDatabaseMapOutput
ToSqlDatabaseMapOutputWithContext(context.Context) SqlDatabaseMapOutput
}
type SqlDatabaseMap map[string]SqlDatabaseInput
func (SqlDatabaseMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlDatabase)(nil)).Elem()
}
func (i SqlDatabaseMap) ToSqlDatabaseMapOutput() SqlDatabaseMapOutput {
return i.ToSqlDatabaseMapOutputWithContext(context.Background())
}
func (i SqlDatabaseMap) ToSqlDatabaseMapOutputWithContext(ctx context.Context) SqlDatabaseMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlDatabaseMapOutput)
}
type SqlDatabaseOutput struct{ *pulumi.OutputState }
func (SqlDatabaseOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlDatabase)(nil)).Elem()
}
func (o SqlDatabaseOutput) ToSqlDatabaseOutput() SqlDatabaseOutput {
return o
}
func (o SqlDatabaseOutput) ToSqlDatabaseOutputWithContext(ctx context.Context) SqlDatabaseOutput {
return o
}
// The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.
func (o SqlDatabaseOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlDatabase) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
func (o SqlDatabaseOutput) AutoscaleSettings() SqlDatabaseAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *SqlDatabase) SqlDatabaseAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(SqlDatabaseAutoscaleSettingsPtrOutput)
}
// Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.
func (o SqlDatabaseOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlDatabase) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
func (o SqlDatabaseOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlDatabase) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o SqlDatabaseOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *SqlDatabase) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type SqlDatabaseArrayOutput struct{ *pulumi.OutputState }
func (SqlDatabaseArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlDatabase)(nil)).Elem()
}
func (o SqlDatabaseArrayOutput) ToSqlDatabaseArrayOutput() SqlDatabaseArrayOutput {
return o
}
func (o SqlDatabaseArrayOutput) ToSqlDatabaseArrayOutputWithContext(ctx context.Context) SqlDatabaseArrayOutput {
return o
}
func (o SqlDatabaseArrayOutput) Index(i pulumi.IntInput) SqlDatabaseOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlDatabase {
return vs[0].([]*SqlDatabase)[vs[1].(int)]
}).(SqlDatabaseOutput)
}
type SqlDatabaseMapOutput struct{ *pulumi.OutputState }
func (SqlDatabaseMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlDatabase)(nil)).Elem()
}
func (o SqlDatabaseMapOutput) ToSqlDatabaseMapOutput() SqlDatabaseMapOutput {
return o
}
func (o SqlDatabaseMapOutput) ToSqlDatabaseMapOutputWithContext(ctx context.Context) SqlDatabaseMapOutput {
return o
}
func (o SqlDatabaseMapOutput) MapIndex(k pulumi.StringInput) SqlDatabaseOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlDatabase {
return vs[0].(map[string]*SqlDatabase)[vs[1].(string)]
}).(SqlDatabaseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlDatabaseInput)(nil)).Elem(), &SqlDatabase{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlDatabaseArrayInput)(nil)).Elem(), SqlDatabaseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlDatabaseMapInput)(nil)).Elem(), SqlDatabaseMap{})
pulumi.RegisterOutputType(SqlDatabaseOutput{})
pulumi.RegisterOutputType(SqlDatabaseArrayOutput{})
pulumi.RegisterOutputType(SqlDatabaseMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/getSqlDatabase.go | sdk/go/azure/cosmosdb/getSqlDatabase.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing CosmosDB SQL Database.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cosmosdb.LookupSqlDatabase(ctx, &cosmosdb.LookupSqlDatabaseArgs{
// Name: "tfex-cosmosdb-sql-database",
// ResourceGroupName: "tfex-cosmosdb-sql-database-rg",
// AccountName: "tfex-cosmosdb-sql-database-account-name",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupSqlDatabase(ctx *pulumi.Context, args *LookupSqlDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupSqlDatabaseResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSqlDatabaseResult
err := ctx.Invoke("azure:cosmosdb/getSqlDatabase:getSqlDatabase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSqlDatabase.
type LookupSqlDatabaseArgs struct {
// The name of the Cosmos DB SQL Database to create the table within.
AccountName string `pulumi:"accountName"`
// Specifies the name of the Cosmos DB SQL Database.
Name string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getSqlDatabase.
type LookupSqlDatabaseResult struct {
AccountName string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below.
AutoscaleSettings []GetSqlDatabaseAutoscaleSetting `pulumi:"autoscaleSettings"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of SQL database (RU/s).
Throughput int `pulumi:"throughput"`
}
func LookupSqlDatabaseOutput(ctx *pulumi.Context, args LookupSqlDatabaseOutputArgs, opts ...pulumi.InvokeOption) LookupSqlDatabaseResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupSqlDatabaseResultOutput, error) {
args := v.(LookupSqlDatabaseArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:cosmosdb/getSqlDatabase:getSqlDatabase", args, LookupSqlDatabaseResultOutput{}, options).(LookupSqlDatabaseResultOutput), nil
}).(LookupSqlDatabaseResultOutput)
}
// A collection of arguments for invoking getSqlDatabase.
type LookupSqlDatabaseOutputArgs struct {
// The name of the Cosmos DB SQL Database to create the table within.
AccountName pulumi.StringInput `pulumi:"accountName"`
// Specifies the name of the Cosmos DB SQL Database.
Name pulumi.StringInput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB SQL Database is created.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupSqlDatabaseOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSqlDatabaseArgs)(nil)).Elem()
}
// A collection of values returned by getSqlDatabase.
type LookupSqlDatabaseResultOutput struct{ *pulumi.OutputState }
func (LookupSqlDatabaseResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSqlDatabaseResult)(nil)).Elem()
}
func (o LookupSqlDatabaseResultOutput) ToLookupSqlDatabaseResultOutput() LookupSqlDatabaseResultOutput {
return o
}
func (o LookupSqlDatabaseResultOutput) ToLookupSqlDatabaseResultOutputWithContext(ctx context.Context) LookupSqlDatabaseResultOutput {
return o
}
func (o LookupSqlDatabaseResultOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlDatabaseResult) string { return v.AccountName }).(pulumi.StringOutput)
}
// An `autoscaleSettings` block as defined below.
func (o LookupSqlDatabaseResultOutput) AutoscaleSettings() GetSqlDatabaseAutoscaleSettingArrayOutput {
return o.ApplyT(func(v LookupSqlDatabaseResult) []GetSqlDatabaseAutoscaleSetting { return v.AutoscaleSettings }).(GetSqlDatabaseAutoscaleSettingArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSqlDatabaseResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlDatabaseResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupSqlDatabaseResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlDatabaseResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupSqlDatabaseResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSqlDatabaseResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of SQL database (RU/s).
func (o LookupSqlDatabaseResultOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v LookupSqlDatabaseResult) int { return v.Throughput }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSqlDatabaseResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/cassandraTable.go | sdk/go/azure/cosmosdb/cassandraTable.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Cassandra Table within a Cosmos DB Cassandra Keyspace.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("tflex-cosmosdb-account-rg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("tfex-cosmosdb-account"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// OfferType: pulumi.String("Standard"),
// Capabilities: cosmosdb.AccountCapabilityArray{
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableCassandra"),
// },
// },
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: example.Location,
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleCassandraKeyspace, err := cosmosdb.NewCassandraKeyspace(ctx, "example", &cosmosdb.CassandraKeyspaceArgs{
// Name: pulumi.String("tfex-cosmos-cassandra-keyspace"),
// ResourceGroupName: exampleAccount.ResourceGroupName,
// AccountName: exampleAccount.Name,
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewCassandraTable(ctx, "example", &cosmosdb.CassandraTableArgs{
// Name: pulumi.String("testtable"),
// CassandraKeyspaceId: exampleCassandraKeyspace.ID(),
// Schema: &cosmosdb.CassandraTableSchemaArgs{
// Columns: cosmosdb.CassandraTableSchemaColumnArray{
// &cosmosdb.CassandraTableSchemaColumnArgs{
// Name: pulumi.String("test1"),
// Type: pulumi.String("ascii"),
// },
// &cosmosdb.CassandraTableSchemaColumnArgs{
// Name: pulumi.String("test2"),
// Type: pulumi.String("int"),
// },
// },
// PartitionKeys: cosmosdb.CassandraTableSchemaPartitionKeyArray{
// &cosmosdb.CassandraTableSchemaPartitionKeyArgs{
// Name: pulumi.String("test1"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cosmos Cassandra Table can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/cassandraTable:CassandraTable ks1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/cassandraKeyspaces/ks1/tables/table1
// ```
type CassandraTable struct {
pulumi.CustomResourceState
// Time to live of the Analytical Storage. Possible values are between `-1` and `2147483647` except `0`. `-1` means the Analytical Storage never expires. Changing this forces a new resource to be created.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
AnalyticalStorageTtl pulumi.IntPtrOutput `pulumi:"analyticalStorageTtl"`
AutoscaleSettings CassandraTableAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// The ID of the Cosmos DB Cassandra Keyspace to create the table within. Changing this forces a new resource to be created.
CassandraKeyspaceId pulumi.StringOutput `pulumi:"cassandraKeyspaceId"`
// Time to live of the Cosmos DB Cassandra table. Possible values are at least `-1`. `-1` means the Cassandra table never expires.
DefaultTtl pulumi.IntPtrOutput `pulumi:"defaultTtl"`
// Specifies the name of the Cosmos DB Cassandra Table. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A `schema` block as defined below.
Schema CassandraTableSchemaOutput `pulumi:"schema"`
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewCassandraTable registers a new resource with the given unique name, arguments, and options.
func NewCassandraTable(ctx *pulumi.Context,
name string, args *CassandraTableArgs, opts ...pulumi.ResourceOption) (*CassandraTable, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CassandraKeyspaceId == nil {
return nil, errors.New("invalid value for required argument 'CassandraKeyspaceId'")
}
if args.Schema == nil {
return nil, errors.New("invalid value for required argument 'Schema'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource CassandraTable
err := ctx.RegisterResource("azure:cosmosdb/cassandraTable:CassandraTable", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCassandraTable gets an existing CassandraTable resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCassandraTable(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CassandraTableState, opts ...pulumi.ResourceOption) (*CassandraTable, error) {
var resource CassandraTable
err := ctx.ReadResource("azure:cosmosdb/cassandraTable:CassandraTable", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CassandraTable resources.
type cassandraTableState struct {
// Time to live of the Analytical Storage. Possible values are between `-1` and `2147483647` except `0`. `-1` means the Analytical Storage never expires. Changing this forces a new resource to be created.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
AutoscaleSettings *CassandraTableAutoscaleSettings `pulumi:"autoscaleSettings"`
// The ID of the Cosmos DB Cassandra Keyspace to create the table within. Changing this forces a new resource to be created.
CassandraKeyspaceId *string `pulumi:"cassandraKeyspaceId"`
// Time to live of the Cosmos DB Cassandra table. Possible values are at least `-1`. `-1` means the Cassandra table never expires.
DefaultTtl *int `pulumi:"defaultTtl"`
// Specifies the name of the Cosmos DB Cassandra Table. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `schema` block as defined below.
Schema *CassandraTableSchema `pulumi:"schema"`
Throughput *int `pulumi:"throughput"`
}
type CassandraTableState struct {
// Time to live of the Analytical Storage. Possible values are between `-1` and `2147483647` except `0`. `-1` means the Analytical Storage never expires. Changing this forces a new resource to be created.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
AnalyticalStorageTtl pulumi.IntPtrInput
AutoscaleSettings CassandraTableAutoscaleSettingsPtrInput
// The ID of the Cosmos DB Cassandra Keyspace to create the table within. Changing this forces a new resource to be created.
CassandraKeyspaceId pulumi.StringPtrInput
// Time to live of the Cosmos DB Cassandra table. Possible values are at least `-1`. `-1` means the Cassandra table never expires.
DefaultTtl pulumi.IntPtrInput
// Specifies the name of the Cosmos DB Cassandra Table. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `schema` block as defined below.
Schema CassandraTableSchemaPtrInput
Throughput pulumi.IntPtrInput
}
func (CassandraTableState) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraTableState)(nil)).Elem()
}
type cassandraTableArgs struct {
// Time to live of the Analytical Storage. Possible values are between `-1` and `2147483647` except `0`. `-1` means the Analytical Storage never expires. Changing this forces a new resource to be created.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
AutoscaleSettings *CassandraTableAutoscaleSettings `pulumi:"autoscaleSettings"`
// The ID of the Cosmos DB Cassandra Keyspace to create the table within. Changing this forces a new resource to be created.
CassandraKeyspaceId string `pulumi:"cassandraKeyspaceId"`
// Time to live of the Cosmos DB Cassandra table. Possible values are at least `-1`. `-1` means the Cassandra table never expires.
DefaultTtl *int `pulumi:"defaultTtl"`
// Specifies the name of the Cosmos DB Cassandra Table. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `schema` block as defined below.
Schema CassandraTableSchema `pulumi:"schema"`
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a CassandraTable resource.
type CassandraTableArgs struct {
// Time to live of the Analytical Storage. Possible values are between `-1` and `2147483647` except `0`. `-1` means the Analytical Storage never expires. Changing this forces a new resource to be created.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
AnalyticalStorageTtl pulumi.IntPtrInput
AutoscaleSettings CassandraTableAutoscaleSettingsPtrInput
// The ID of the Cosmos DB Cassandra Keyspace to create the table within. Changing this forces a new resource to be created.
CassandraKeyspaceId pulumi.StringInput
// Time to live of the Cosmos DB Cassandra table. Possible values are at least `-1`. `-1` means the Cassandra table never expires.
DefaultTtl pulumi.IntPtrInput
// Specifies the name of the Cosmos DB Cassandra Table. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `schema` block as defined below.
Schema CassandraTableSchemaInput
Throughput pulumi.IntPtrInput
}
func (CassandraTableArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cassandraTableArgs)(nil)).Elem()
}
type CassandraTableInput interface {
pulumi.Input
ToCassandraTableOutput() CassandraTableOutput
ToCassandraTableOutputWithContext(ctx context.Context) CassandraTableOutput
}
func (*CassandraTable) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraTable)(nil)).Elem()
}
func (i *CassandraTable) ToCassandraTableOutput() CassandraTableOutput {
return i.ToCassandraTableOutputWithContext(context.Background())
}
func (i *CassandraTable) ToCassandraTableOutputWithContext(ctx context.Context) CassandraTableOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraTableOutput)
}
// CassandraTableArrayInput is an input type that accepts CassandraTableArray and CassandraTableArrayOutput values.
// You can construct a concrete instance of `CassandraTableArrayInput` via:
//
// CassandraTableArray{ CassandraTableArgs{...} }
type CassandraTableArrayInput interface {
pulumi.Input
ToCassandraTableArrayOutput() CassandraTableArrayOutput
ToCassandraTableArrayOutputWithContext(context.Context) CassandraTableArrayOutput
}
type CassandraTableArray []CassandraTableInput
func (CassandraTableArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraTable)(nil)).Elem()
}
func (i CassandraTableArray) ToCassandraTableArrayOutput() CassandraTableArrayOutput {
return i.ToCassandraTableArrayOutputWithContext(context.Background())
}
func (i CassandraTableArray) ToCassandraTableArrayOutputWithContext(ctx context.Context) CassandraTableArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraTableArrayOutput)
}
// CassandraTableMapInput is an input type that accepts CassandraTableMap and CassandraTableMapOutput values.
// You can construct a concrete instance of `CassandraTableMapInput` via:
//
// CassandraTableMap{ "key": CassandraTableArgs{...} }
type CassandraTableMapInput interface {
pulumi.Input
ToCassandraTableMapOutput() CassandraTableMapOutput
ToCassandraTableMapOutputWithContext(context.Context) CassandraTableMapOutput
}
type CassandraTableMap map[string]CassandraTableInput
func (CassandraTableMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraTable)(nil)).Elem()
}
func (i CassandraTableMap) ToCassandraTableMapOutput() CassandraTableMapOutput {
return i.ToCassandraTableMapOutputWithContext(context.Background())
}
func (i CassandraTableMap) ToCassandraTableMapOutputWithContext(ctx context.Context) CassandraTableMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CassandraTableMapOutput)
}
type CassandraTableOutput struct{ *pulumi.OutputState }
func (CassandraTableOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CassandraTable)(nil)).Elem()
}
func (o CassandraTableOutput) ToCassandraTableOutput() CassandraTableOutput {
return o
}
func (o CassandraTableOutput) ToCassandraTableOutputWithContext(ctx context.Context) CassandraTableOutput {
return o
}
// Time to live of the Analytical Storage. Possible values are between `-1` and `2147483647` except `0`. `-1` means the Analytical Storage never expires. Changing this forces a new resource to be created.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support
func (o CassandraTableOutput) AnalyticalStorageTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CassandraTable) pulumi.IntPtrOutput { return v.AnalyticalStorageTtl }).(pulumi.IntPtrOutput)
}
func (o CassandraTableOutput) AutoscaleSettings() CassandraTableAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *CassandraTable) CassandraTableAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(CassandraTableAutoscaleSettingsPtrOutput)
}
// The ID of the Cosmos DB Cassandra Keyspace to create the table within. Changing this forces a new resource to be created.
func (o CassandraTableOutput) CassandraKeyspaceId() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraTable) pulumi.StringOutput { return v.CassandraKeyspaceId }).(pulumi.StringOutput)
}
// Time to live of the Cosmos DB Cassandra table. Possible values are at least `-1`. `-1` means the Cassandra table never expires.
func (o CassandraTableOutput) DefaultTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CassandraTable) pulumi.IntPtrOutput { return v.DefaultTtl }).(pulumi.IntPtrOutput)
}
// Specifies the name of the Cosmos DB Cassandra Table. Changing this forces a new resource to be created.
func (o CassandraTableOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CassandraTable) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A `schema` block as defined below.
func (o CassandraTableOutput) Schema() CassandraTableSchemaOutput {
return o.ApplyT(func(v *CassandraTable) CassandraTableSchemaOutput { return v.Schema }).(CassandraTableSchemaOutput)
}
func (o CassandraTableOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *CassandraTable) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type CassandraTableArrayOutput struct{ *pulumi.OutputState }
func (CassandraTableArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CassandraTable)(nil)).Elem()
}
func (o CassandraTableArrayOutput) ToCassandraTableArrayOutput() CassandraTableArrayOutput {
return o
}
func (o CassandraTableArrayOutput) ToCassandraTableArrayOutputWithContext(ctx context.Context) CassandraTableArrayOutput {
return o
}
func (o CassandraTableArrayOutput) Index(i pulumi.IntInput) CassandraTableOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CassandraTable {
return vs[0].([]*CassandraTable)[vs[1].(int)]
}).(CassandraTableOutput)
}
type CassandraTableMapOutput struct{ *pulumi.OutputState }
func (CassandraTableMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CassandraTable)(nil)).Elem()
}
func (o CassandraTableMapOutput) ToCassandraTableMapOutput() CassandraTableMapOutput {
return o
}
func (o CassandraTableMapOutput) ToCassandraTableMapOutputWithContext(ctx context.Context) CassandraTableMapOutput {
return o
}
func (o CassandraTableMapOutput) MapIndex(k pulumi.StringInput) CassandraTableOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CassandraTable {
return vs[0].(map[string]*CassandraTable)[vs[1].(string)]
}).(CassandraTableOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CassandraTableInput)(nil)).Elem(), &CassandraTable{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraTableArrayInput)(nil)).Elem(), CassandraTableArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CassandraTableMapInput)(nil)).Elem(), CassandraTableMap{})
pulumi.RegisterOutputType(CassandraTableOutput{})
pulumi.RegisterOutputType(CassandraTableArrayOutput{})
pulumi.RegisterOutputType(CassandraTableMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/postgresqlRole.go | sdk/go/azure/cosmosdb/postgresqlRole.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an Azure Cosmos DB for PostgreSQL Role.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "example", &cosmosdb.PostgresqlClusterArgs{
// Name: pulumi.String("examplecluster"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
// CoordinatorStorageQuotaInMb: pulumi.Int(131072),
// CoordinatorVcoreCount: pulumi.Int(2),
// NodeCount: pulumi.Int(0),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewPostgresqlRole(ctx, "example", &cosmosdb.PostgresqlRoleArgs{
// Name: pulumi.String("examplerole"),
// ClusterId: examplePostgresqlCluster.ID(),
// Password: pulumi.String("H@Sh1CoR3!"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DBforPostgreSQL` - 2022-11-08
//
// ## Import
//
// Azure Cosmos DB for PostgreSQL Roles can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/postgresqlRole:PostgresqlRole example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1/roles/role1
// ```
type PostgresqlRole struct {
pulumi.CustomResourceState
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Password pulumi.StringOutput `pulumi:"password"`
}
// NewPostgresqlRole registers a new resource with the given unique name, arguments, and options.
func NewPostgresqlRole(ctx *pulumi.Context,
name string, args *PostgresqlRoleArgs, opts ...pulumi.ResourceOption) (*PostgresqlRole, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.Password == nil {
return nil, errors.New("invalid value for required argument 'Password'")
}
if args.Password != nil {
args.Password = pulumi.ToSecret(args.Password).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"password",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource PostgresqlRole
err := ctx.RegisterResource("azure:cosmosdb/postgresqlRole:PostgresqlRole", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPostgresqlRole gets an existing PostgresqlRole resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPostgresqlRole(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PostgresqlRoleState, opts ...pulumi.ResourceOption) (*PostgresqlRole, error) {
var resource PostgresqlRole
err := ctx.ReadResource("azure:cosmosdb/postgresqlRole:PostgresqlRole", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PostgresqlRole resources.
type postgresqlRoleState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId *string `pulumi:"clusterId"`
// The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Password *string `pulumi:"password"`
}
type PostgresqlRoleState struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId pulumi.StringPtrInput
// The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Password pulumi.StringPtrInput
}
func (PostgresqlRoleState) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlRoleState)(nil)).Elem()
}
type postgresqlRoleArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId string `pulumi:"clusterId"`
// The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Password string `pulumi:"password"`
}
// The set of arguments for constructing a PostgresqlRole resource.
type PostgresqlRoleArgs struct {
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
ClusterId pulumi.StringInput
// The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
Password pulumi.StringInput
}
func (PostgresqlRoleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlRoleArgs)(nil)).Elem()
}
type PostgresqlRoleInput interface {
pulumi.Input
ToPostgresqlRoleOutput() PostgresqlRoleOutput
ToPostgresqlRoleOutputWithContext(ctx context.Context) PostgresqlRoleOutput
}
func (*PostgresqlRole) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlRole)(nil)).Elem()
}
func (i *PostgresqlRole) ToPostgresqlRoleOutput() PostgresqlRoleOutput {
return i.ToPostgresqlRoleOutputWithContext(context.Background())
}
func (i *PostgresqlRole) ToPostgresqlRoleOutputWithContext(ctx context.Context) PostgresqlRoleOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlRoleOutput)
}
// PostgresqlRoleArrayInput is an input type that accepts PostgresqlRoleArray and PostgresqlRoleArrayOutput values.
// You can construct a concrete instance of `PostgresqlRoleArrayInput` via:
//
// PostgresqlRoleArray{ PostgresqlRoleArgs{...} }
type PostgresqlRoleArrayInput interface {
pulumi.Input
ToPostgresqlRoleArrayOutput() PostgresqlRoleArrayOutput
ToPostgresqlRoleArrayOutputWithContext(context.Context) PostgresqlRoleArrayOutput
}
type PostgresqlRoleArray []PostgresqlRoleInput
func (PostgresqlRoleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlRole)(nil)).Elem()
}
func (i PostgresqlRoleArray) ToPostgresqlRoleArrayOutput() PostgresqlRoleArrayOutput {
return i.ToPostgresqlRoleArrayOutputWithContext(context.Background())
}
func (i PostgresqlRoleArray) ToPostgresqlRoleArrayOutputWithContext(ctx context.Context) PostgresqlRoleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlRoleArrayOutput)
}
// PostgresqlRoleMapInput is an input type that accepts PostgresqlRoleMap and PostgresqlRoleMapOutput values.
// You can construct a concrete instance of `PostgresqlRoleMapInput` via:
//
// PostgresqlRoleMap{ "key": PostgresqlRoleArgs{...} }
type PostgresqlRoleMapInput interface {
pulumi.Input
ToPostgresqlRoleMapOutput() PostgresqlRoleMapOutput
ToPostgresqlRoleMapOutputWithContext(context.Context) PostgresqlRoleMapOutput
}
type PostgresqlRoleMap map[string]PostgresqlRoleInput
func (PostgresqlRoleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlRole)(nil)).Elem()
}
func (i PostgresqlRoleMap) ToPostgresqlRoleMapOutput() PostgresqlRoleMapOutput {
return i.ToPostgresqlRoleMapOutputWithContext(context.Background())
}
func (i PostgresqlRoleMap) ToPostgresqlRoleMapOutputWithContext(ctx context.Context) PostgresqlRoleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlRoleMapOutput)
}
type PostgresqlRoleOutput struct{ *pulumi.OutputState }
func (PostgresqlRoleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlRole)(nil)).Elem()
}
func (o PostgresqlRoleOutput) ToPostgresqlRoleOutput() PostgresqlRoleOutput {
return o
}
func (o PostgresqlRoleOutput) ToPostgresqlRoleOutputWithContext(ctx context.Context) PostgresqlRoleOutput {
return o
}
// The resource ID of the Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
func (o PostgresqlRoleOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlRole) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// The name which should be used for this Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
func (o PostgresqlRoleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlRole) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The password of the Azure Cosmos DB for PostgreSQL Role. Changing this forces a new resource to be created.
func (o PostgresqlRoleOutput) Password() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlRole) pulumi.StringOutput { return v.Password }).(pulumi.StringOutput)
}
type PostgresqlRoleArrayOutput struct{ *pulumi.OutputState }
func (PostgresqlRoleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlRole)(nil)).Elem()
}
func (o PostgresqlRoleArrayOutput) ToPostgresqlRoleArrayOutput() PostgresqlRoleArrayOutput {
return o
}
func (o PostgresqlRoleArrayOutput) ToPostgresqlRoleArrayOutputWithContext(ctx context.Context) PostgresqlRoleArrayOutput {
return o
}
func (o PostgresqlRoleArrayOutput) Index(i pulumi.IntInput) PostgresqlRoleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PostgresqlRole {
return vs[0].([]*PostgresqlRole)[vs[1].(int)]
}).(PostgresqlRoleOutput)
}
type PostgresqlRoleMapOutput struct{ *pulumi.OutputState }
func (PostgresqlRoleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlRole)(nil)).Elem()
}
func (o PostgresqlRoleMapOutput) ToPostgresqlRoleMapOutput() PostgresqlRoleMapOutput {
return o
}
func (o PostgresqlRoleMapOutput) ToPostgresqlRoleMapOutputWithContext(ctx context.Context) PostgresqlRoleMapOutput {
return o
}
func (o PostgresqlRoleMapOutput) MapIndex(k pulumi.StringInput) PostgresqlRoleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PostgresqlRole {
return vs[0].(map[string]*PostgresqlRole)[vs[1].(string)]
}).(PostgresqlRoleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlRoleInput)(nil)).Elem(), &PostgresqlRole{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlRoleArrayInput)(nil)).Elem(), PostgresqlRoleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PostgresqlRoleMapInput)(nil)).Elem(), PostgresqlRoleMap{})
pulumi.RegisterOutputType(PostgresqlRoleOutput{})
pulumi.RegisterOutputType(PostgresqlRoleArrayOutput{})
pulumi.RegisterOutputType(PostgresqlRoleMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/mongoDatabase.go | sdk/go/azure/cosmosdb/mongoDatabase.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Mongo Database within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewMongoDatabase(ctx, "example", &cosmosdb.MongoDatabaseArgs{
// Name: pulumi.String("tfex-cosmos-mongo-db"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// Throughput: pulumi.Int(400),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cosmos Mongo Database can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/mongoDatabase:MongoDatabase db1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/mongodbDatabases/db1
// ```
type MongoDatabase struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings MongoDatabaseAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The throughput of the MongoDB collection (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support.
Throughput pulumi.IntOutput `pulumi:"throughput"`
}
// NewMongoDatabase registers a new resource with the given unique name, arguments, and options.
func NewMongoDatabase(ctx *pulumi.Context,
name string, args *MongoDatabaseArgs, opts ...pulumi.ResourceOption) (*MongoDatabase, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource MongoDatabase
err := ctx.RegisterResource("azure:cosmosdb/mongoDatabase:MongoDatabase", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMongoDatabase gets an existing MongoDatabase resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMongoDatabase(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MongoDatabaseState, opts ...pulumi.ResourceOption) (*MongoDatabase, error) {
var resource MongoDatabase
err := ctx.ReadResource("azure:cosmosdb/mongoDatabase:MongoDatabase", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MongoDatabase resources.
type mongoDatabaseState struct {
// The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *MongoDatabaseAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The throughput of the MongoDB collection (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support.
Throughput *int `pulumi:"throughput"`
}
type MongoDatabaseState struct {
// The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings MongoDatabaseAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The throughput of the MongoDB collection (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support.
Throughput pulumi.IntPtrInput
}
func (MongoDatabaseState) ElementType() reflect.Type {
return reflect.TypeOf((*mongoDatabaseState)(nil)).Elem()
}
type mongoDatabaseArgs struct {
// The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *MongoDatabaseAutoscaleSettings `pulumi:"autoscaleSettings"`
// Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of the MongoDB collection (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support.
Throughput *int `pulumi:"throughput"`
}
// The set of arguments for constructing a MongoDatabase resource.
type MongoDatabaseArgs struct {
// The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings MongoDatabaseAutoscaleSettingsPtrInput
// Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The throughput of the MongoDB collection (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support.
Throughput pulumi.IntPtrInput
}
func (MongoDatabaseArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mongoDatabaseArgs)(nil)).Elem()
}
type MongoDatabaseInput interface {
pulumi.Input
ToMongoDatabaseOutput() MongoDatabaseOutput
ToMongoDatabaseOutputWithContext(ctx context.Context) MongoDatabaseOutput
}
func (*MongoDatabase) ElementType() reflect.Type {
return reflect.TypeOf((**MongoDatabase)(nil)).Elem()
}
func (i *MongoDatabase) ToMongoDatabaseOutput() MongoDatabaseOutput {
return i.ToMongoDatabaseOutputWithContext(context.Background())
}
func (i *MongoDatabase) ToMongoDatabaseOutputWithContext(ctx context.Context) MongoDatabaseOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoDatabaseOutput)
}
// MongoDatabaseArrayInput is an input type that accepts MongoDatabaseArray and MongoDatabaseArrayOutput values.
// You can construct a concrete instance of `MongoDatabaseArrayInput` via:
//
// MongoDatabaseArray{ MongoDatabaseArgs{...} }
type MongoDatabaseArrayInput interface {
pulumi.Input
ToMongoDatabaseArrayOutput() MongoDatabaseArrayOutput
ToMongoDatabaseArrayOutputWithContext(context.Context) MongoDatabaseArrayOutput
}
type MongoDatabaseArray []MongoDatabaseInput
func (MongoDatabaseArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoDatabase)(nil)).Elem()
}
func (i MongoDatabaseArray) ToMongoDatabaseArrayOutput() MongoDatabaseArrayOutput {
return i.ToMongoDatabaseArrayOutputWithContext(context.Background())
}
func (i MongoDatabaseArray) ToMongoDatabaseArrayOutputWithContext(ctx context.Context) MongoDatabaseArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoDatabaseArrayOutput)
}
// MongoDatabaseMapInput is an input type that accepts MongoDatabaseMap and MongoDatabaseMapOutput values.
// You can construct a concrete instance of `MongoDatabaseMapInput` via:
//
// MongoDatabaseMap{ "key": MongoDatabaseArgs{...} }
type MongoDatabaseMapInput interface {
pulumi.Input
ToMongoDatabaseMapOutput() MongoDatabaseMapOutput
ToMongoDatabaseMapOutputWithContext(context.Context) MongoDatabaseMapOutput
}
type MongoDatabaseMap map[string]MongoDatabaseInput
func (MongoDatabaseMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoDatabase)(nil)).Elem()
}
func (i MongoDatabaseMap) ToMongoDatabaseMapOutput() MongoDatabaseMapOutput {
return i.ToMongoDatabaseMapOutputWithContext(context.Background())
}
func (i MongoDatabaseMap) ToMongoDatabaseMapOutputWithContext(ctx context.Context) MongoDatabaseMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MongoDatabaseMapOutput)
}
type MongoDatabaseOutput struct{ *pulumi.OutputState }
func (MongoDatabaseOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MongoDatabase)(nil)).Elem()
}
func (o MongoDatabaseOutput) ToMongoDatabaseOutput() MongoDatabaseOutput {
return o
}
func (o MongoDatabaseOutput) ToMongoDatabaseOutputWithContext(ctx context.Context) MongoDatabaseOutput {
return o
}
// The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.
func (o MongoDatabaseOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoDatabase) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
func (o MongoDatabaseOutput) AutoscaleSettings() MongoDatabaseAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *MongoDatabase) MongoDatabaseAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(MongoDatabaseAutoscaleSettingsPtrOutput)
}
// Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.
func (o MongoDatabaseOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MongoDatabase) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.
func (o MongoDatabaseOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *MongoDatabase) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of the MongoDB collection (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
//
// > **Note:** throughput has a maximum value of `1000000` unless a higher limit is requested via Azure Support.
func (o MongoDatabaseOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *MongoDatabase) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
type MongoDatabaseArrayOutput struct{ *pulumi.OutputState }
func (MongoDatabaseArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MongoDatabase)(nil)).Elem()
}
func (o MongoDatabaseArrayOutput) ToMongoDatabaseArrayOutput() MongoDatabaseArrayOutput {
return o
}
func (o MongoDatabaseArrayOutput) ToMongoDatabaseArrayOutputWithContext(ctx context.Context) MongoDatabaseArrayOutput {
return o
}
func (o MongoDatabaseArrayOutput) Index(i pulumi.IntInput) MongoDatabaseOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MongoDatabase {
return vs[0].([]*MongoDatabase)[vs[1].(int)]
}).(MongoDatabaseOutput)
}
type MongoDatabaseMapOutput struct{ *pulumi.OutputState }
func (MongoDatabaseMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MongoDatabase)(nil)).Elem()
}
func (o MongoDatabaseMapOutput) ToMongoDatabaseMapOutput() MongoDatabaseMapOutput {
return o
}
func (o MongoDatabaseMapOutput) ToMongoDatabaseMapOutputWithContext(ctx context.Context) MongoDatabaseMapOutput {
return o
}
func (o MongoDatabaseMapOutput) MapIndex(k pulumi.StringInput) MongoDatabaseOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MongoDatabase {
return vs[0].(map[string]*MongoDatabase)[vs[1].(string)]
}).(MongoDatabaseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MongoDatabaseInput)(nil)).Elem(), &MongoDatabase{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoDatabaseArrayInput)(nil)).Elem(), MongoDatabaseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MongoDatabaseMapInput)(nil)).Elem(), MongoDatabaseMap{})
pulumi.RegisterOutputType(MongoDatabaseOutput{})
pulumi.RegisterOutputType(MongoDatabaseArrayOutput{})
pulumi.RegisterOutputType(MongoDatabaseMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/sqlContainer.go | sdk/go/azure/cosmosdb/sqlContainer.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a SQL Container within a Cosmos DB Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
// Name: "tfex-cosmosdb-account",
// ResourceGroupName: "tfex-cosmosdb-account-rg",
// }, nil)
// if err != nil {
// return err
// }
// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
// Name: pulumi.String("example-acsd"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewSqlContainer(ctx, "example", &cosmosdb.SqlContainerArgs{
// Name: pulumi.String("example-container"),
// ResourceGroupName: pulumi.String(example.ResourceGroupName),
// AccountName: pulumi.String(example.Name),
// DatabaseName: exampleSqlDatabase.Name,
// PartitionKeyPaths: pulumi.StringArray{
// pulumi.String("/definition/id"),
// },
// PartitionKeyVersion: pulumi.Int(1),
// Throughput: pulumi.Int(400),
// IndexingPolicy: &cosmosdb.SqlContainerIndexingPolicyArgs{
// IndexingMode: pulumi.String("consistent"),
// IncludedPaths: cosmosdb.SqlContainerIndexingPolicyIncludedPathArray{
// &cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs{
// Path: pulumi.String("/*"),
// },
// &cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs{
// Path: pulumi.String("/included/?"),
// },
// },
// ExcludedPaths: cosmosdb.SqlContainerIndexingPolicyExcludedPathArray{
// &cosmosdb.SqlContainerIndexingPolicyExcludedPathArgs{
// Path: pulumi.String("/excluded/?"),
// },
// },
// },
// UniqueKeys: cosmosdb.SqlContainerUniqueKeyArray{
// &cosmosdb.SqlContainerUniqueKeyArgs{
// Paths: pulumi.StringArray{
// pulumi.String("/definition/idlong"),
// pulumi.String("/definition/idshort"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2024-08-15
//
// ## Import
//
// Cosmos SQL Containers can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/sqlContainer:SqlContainer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/database1/containers/container1
// ```
type SqlContainer struct {
pulumi.CustomResourceState
// The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// The default time to live of Analytical Storage for this SQL container. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl pulumi.IntPtrOutput `pulumi:"analyticalStorageTtl"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings SqlContainerAutoscaleSettingsPtrOutput `pulumi:"autoscaleSettings"`
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy SqlContainerConflictResolutionPolicyOutput `pulumi:"conflictResolutionPolicy"`
// The name of the Cosmos DB SQL Database to create the container within. Changing this forces a new resource to be created.
DatabaseName pulumi.StringOutput `pulumi:"databaseName"`
// The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
DefaultTtl pulumi.IntPtrOutput `pulumi:"defaultTtl"`
// An `indexingPolicy` block as defined below.
IndexingPolicy SqlContainerIndexingPolicyOutput `pulumi:"indexingPolicy"`
// Specifies the name of the Cosmos DB SQL Container. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Define a partition key kind. Possible values are `Hash` and `MultiHash`. Defaults to `Hash`. Changing this forces a new resource to be created.
PartitionKeyKind pulumi.StringPtrOutput `pulumi:"partitionKeyKind"`
// A list of partition key paths. Changing this forces a new resource to be created.
PartitionKeyPaths pulumi.StringArrayOutput `pulumi:"partitionKeyPaths"`
// Define a partition key version. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
//
// > **Note:** If `partitionKeyVersion` is not specified when creating a new resource, you can update `partitionKeyVersion` to `1`, updating to `2` forces a new resource to be created.
PartitionKeyVersion pulumi.IntPtrOutput `pulumi:"partitionKeyVersion"`
// The name of the resource group in which the Cosmos DB SQL Container is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The throughput of SQL container (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput pulumi.IntOutput `pulumi:"throughput"`
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys SqlContainerUniqueKeyArrayOutput `pulumi:"uniqueKeys"`
}
// NewSqlContainer registers a new resource with the given unique name, arguments, and options.
func NewSqlContainer(ctx *pulumi.Context,
name string, args *SqlContainerArgs, opts ...pulumi.ResourceOption) (*SqlContainer, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.DatabaseName == nil {
return nil, errors.New("invalid value for required argument 'DatabaseName'")
}
if args.PartitionKeyPaths == nil {
return nil, errors.New("invalid value for required argument 'PartitionKeyPaths'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SqlContainer
err := ctx.RegisterResource("azure:cosmosdb/sqlContainer:SqlContainer", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSqlContainer gets an existing SqlContainer resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSqlContainer(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlContainerState, opts ...pulumi.ResourceOption) (*SqlContainer, error) {
var resource SqlContainer
err := ctx.ReadResource("azure:cosmosdb/sqlContainer:SqlContainer", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SqlContainer resources.
type sqlContainerState struct {
// The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// The default time to live of Analytical Storage for this SQL container. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *SqlContainerAutoscaleSettings `pulumi:"autoscaleSettings"`
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy *SqlContainerConflictResolutionPolicy `pulumi:"conflictResolutionPolicy"`
// The name of the Cosmos DB SQL Database to create the container within. Changing this forces a new resource to be created.
DatabaseName *string `pulumi:"databaseName"`
// The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
DefaultTtl *int `pulumi:"defaultTtl"`
// An `indexingPolicy` block as defined below.
IndexingPolicy *SqlContainerIndexingPolicy `pulumi:"indexingPolicy"`
// Specifies the name of the Cosmos DB SQL Container. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Define a partition key kind. Possible values are `Hash` and `MultiHash`. Defaults to `Hash`. Changing this forces a new resource to be created.
PartitionKeyKind *string `pulumi:"partitionKeyKind"`
// A list of partition key paths. Changing this forces a new resource to be created.
PartitionKeyPaths []string `pulumi:"partitionKeyPaths"`
// Define a partition key version. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
//
// > **Note:** If `partitionKeyVersion` is not specified when creating a new resource, you can update `partitionKeyVersion` to `1`, updating to `2` forces a new resource to be created.
PartitionKeyVersion *int `pulumi:"partitionKeyVersion"`
// The name of the resource group in which the Cosmos DB SQL Container is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The throughput of SQL container (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput *int `pulumi:"throughput"`
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys []SqlContainerUniqueKey `pulumi:"uniqueKeys"`
}
type SqlContainerState struct {
// The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// The default time to live of Analytical Storage for this SQL container. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl pulumi.IntPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings SqlContainerAutoscaleSettingsPtrInput
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy SqlContainerConflictResolutionPolicyPtrInput
// The name of the Cosmos DB SQL Database to create the container within. Changing this forces a new resource to be created.
DatabaseName pulumi.StringPtrInput
// The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
DefaultTtl pulumi.IntPtrInput
// An `indexingPolicy` block as defined below.
IndexingPolicy SqlContainerIndexingPolicyPtrInput
// Specifies the name of the Cosmos DB SQL Container. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Define a partition key kind. Possible values are `Hash` and `MultiHash`. Defaults to `Hash`. Changing this forces a new resource to be created.
PartitionKeyKind pulumi.StringPtrInput
// A list of partition key paths. Changing this forces a new resource to be created.
PartitionKeyPaths pulumi.StringArrayInput
// Define a partition key version. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
//
// > **Note:** If `partitionKeyVersion` is not specified when creating a new resource, you can update `partitionKeyVersion` to `1`, updating to `2` forces a new resource to be created.
PartitionKeyVersion pulumi.IntPtrInput
// The name of the resource group in which the Cosmos DB SQL Container is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The throughput of SQL container (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput pulumi.IntPtrInput
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys SqlContainerUniqueKeyArrayInput
}
func (SqlContainerState) ElementType() reflect.Type {
return reflect.TypeOf((*sqlContainerState)(nil)).Elem()
}
type sqlContainerArgs struct {
// The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// The default time to live of Analytical Storage for this SQL container. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl *int `pulumi:"analyticalStorageTtl"`
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings *SqlContainerAutoscaleSettings `pulumi:"autoscaleSettings"`
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy *SqlContainerConflictResolutionPolicy `pulumi:"conflictResolutionPolicy"`
// The name of the Cosmos DB SQL Database to create the container within. Changing this forces a new resource to be created.
DatabaseName string `pulumi:"databaseName"`
// The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
DefaultTtl *int `pulumi:"defaultTtl"`
// An `indexingPolicy` block as defined below.
IndexingPolicy *SqlContainerIndexingPolicy `pulumi:"indexingPolicy"`
// Specifies the name of the Cosmos DB SQL Container. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Define a partition key kind. Possible values are `Hash` and `MultiHash`. Defaults to `Hash`. Changing this forces a new resource to be created.
PartitionKeyKind *string `pulumi:"partitionKeyKind"`
// A list of partition key paths. Changing this forces a new resource to be created.
PartitionKeyPaths []string `pulumi:"partitionKeyPaths"`
// Define a partition key version. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
//
// > **Note:** If `partitionKeyVersion` is not specified when creating a new resource, you can update `partitionKeyVersion` to `1`, updating to `2` forces a new resource to be created.
PartitionKeyVersion *int `pulumi:"partitionKeyVersion"`
// The name of the resource group in which the Cosmos DB SQL Container is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The throughput of SQL container (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput *int `pulumi:"throughput"`
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys []SqlContainerUniqueKey `pulumi:"uniqueKeys"`
}
// The set of arguments for constructing a SqlContainer resource.
type SqlContainerArgs struct {
// The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// The default time to live of Analytical Storage for this SQL container. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
AnalyticalStorageTtl pulumi.IntPtrInput
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
AutoscaleSettings SqlContainerAutoscaleSettingsPtrInput
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
ConflictResolutionPolicy SqlContainerConflictResolutionPolicyPtrInput
// The name of the Cosmos DB SQL Database to create the container within. Changing this forces a new resource to be created.
DatabaseName pulumi.StringInput
// The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
DefaultTtl pulumi.IntPtrInput
// An `indexingPolicy` block as defined below.
IndexingPolicy SqlContainerIndexingPolicyPtrInput
// Specifies the name of the Cosmos DB SQL Container. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Define a partition key kind. Possible values are `Hash` and `MultiHash`. Defaults to `Hash`. Changing this forces a new resource to be created.
PartitionKeyKind pulumi.StringPtrInput
// A list of partition key paths. Changing this forces a new resource to be created.
PartitionKeyPaths pulumi.StringArrayInput
// Define a partition key version. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
//
// > **Note:** If `partitionKeyVersion` is not specified when creating a new resource, you can update `partitionKeyVersion` to `1`, updating to `2` forces a new resource to be created.
PartitionKeyVersion pulumi.IntPtrInput
// The name of the resource group in which the Cosmos DB SQL Container is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The throughput of SQL container (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.
Throughput pulumi.IntPtrInput
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
UniqueKeys SqlContainerUniqueKeyArrayInput
}
func (SqlContainerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sqlContainerArgs)(nil)).Elem()
}
type SqlContainerInput interface {
pulumi.Input
ToSqlContainerOutput() SqlContainerOutput
ToSqlContainerOutputWithContext(ctx context.Context) SqlContainerOutput
}
func (*SqlContainer) ElementType() reflect.Type {
return reflect.TypeOf((**SqlContainer)(nil)).Elem()
}
func (i *SqlContainer) ToSqlContainerOutput() SqlContainerOutput {
return i.ToSqlContainerOutputWithContext(context.Background())
}
func (i *SqlContainer) ToSqlContainerOutputWithContext(ctx context.Context) SqlContainerOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlContainerOutput)
}
// SqlContainerArrayInput is an input type that accepts SqlContainerArray and SqlContainerArrayOutput values.
// You can construct a concrete instance of `SqlContainerArrayInput` via:
//
// SqlContainerArray{ SqlContainerArgs{...} }
type SqlContainerArrayInput interface {
pulumi.Input
ToSqlContainerArrayOutput() SqlContainerArrayOutput
ToSqlContainerArrayOutputWithContext(context.Context) SqlContainerArrayOutput
}
type SqlContainerArray []SqlContainerInput
func (SqlContainerArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlContainer)(nil)).Elem()
}
func (i SqlContainerArray) ToSqlContainerArrayOutput() SqlContainerArrayOutput {
return i.ToSqlContainerArrayOutputWithContext(context.Background())
}
func (i SqlContainerArray) ToSqlContainerArrayOutputWithContext(ctx context.Context) SqlContainerArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlContainerArrayOutput)
}
// SqlContainerMapInput is an input type that accepts SqlContainerMap and SqlContainerMapOutput values.
// You can construct a concrete instance of `SqlContainerMapInput` via:
//
// SqlContainerMap{ "key": SqlContainerArgs{...} }
type SqlContainerMapInput interface {
pulumi.Input
ToSqlContainerMapOutput() SqlContainerMapOutput
ToSqlContainerMapOutputWithContext(context.Context) SqlContainerMapOutput
}
type SqlContainerMap map[string]SqlContainerInput
func (SqlContainerMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlContainer)(nil)).Elem()
}
func (i SqlContainerMap) ToSqlContainerMapOutput() SqlContainerMapOutput {
return i.ToSqlContainerMapOutputWithContext(context.Background())
}
func (i SqlContainerMap) ToSqlContainerMapOutputWithContext(ctx context.Context) SqlContainerMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SqlContainerMapOutput)
}
type SqlContainerOutput struct{ *pulumi.OutputState }
func (SqlContainerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SqlContainer)(nil)).Elem()
}
func (o SqlContainerOutput) ToSqlContainerOutput() SqlContainerOutput {
return o
}
func (o SqlContainerOutput) ToSqlContainerOutputWithContext(ctx context.Context) SqlContainerOutput {
return o
}
// The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.
func (o SqlContainerOutput) AccountName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.StringOutput { return v.AccountName }).(pulumi.StringOutput)
}
// The default time to live of Analytical Storage for this SQL container. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
func (o SqlContainerOutput) AnalyticalStorageTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.IntPtrOutput { return v.AnalyticalStorageTtl }).(pulumi.IntPtrOutput)
}
// An `autoscaleSettings` block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.
//
// > **Note:** Switching between autoscale and manual throughput is not supported via this provider and must be completed via the Azure Portal and refreshed.
func (o SqlContainerOutput) AutoscaleSettings() SqlContainerAutoscaleSettingsPtrOutput {
return o.ApplyT(func(v *SqlContainer) SqlContainerAutoscaleSettingsPtrOutput { return v.AutoscaleSettings }).(SqlContainerAutoscaleSettingsPtrOutput)
}
// A `conflictResolutionPolicy` blocks as defined below. Changing this forces a new resource to be created.
func (o SqlContainerOutput) ConflictResolutionPolicy() SqlContainerConflictResolutionPolicyOutput {
return o.ApplyT(func(v *SqlContainer) SqlContainerConflictResolutionPolicyOutput { return v.ConflictResolutionPolicy }).(SqlContainerConflictResolutionPolicyOutput)
}
// The name of the Cosmos DB SQL Database to create the container within. Changing this forces a new resource to be created.
func (o SqlContainerOutput) DatabaseName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput)
}
// The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to `-1`, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number `n` – items will expire `n` seconds after their last modified time.
func (o SqlContainerOutput) DefaultTtl() pulumi.IntPtrOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.IntPtrOutput { return v.DefaultTtl }).(pulumi.IntPtrOutput)
}
// An `indexingPolicy` block as defined below.
func (o SqlContainerOutput) IndexingPolicy() SqlContainerIndexingPolicyOutput {
return o.ApplyT(func(v *SqlContainer) SqlContainerIndexingPolicyOutput { return v.IndexingPolicy }).(SqlContainerIndexingPolicyOutput)
}
// Specifies the name of the Cosmos DB SQL Container. Changing this forces a new resource to be created.
func (o SqlContainerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Define a partition key kind. Possible values are `Hash` and `MultiHash`. Defaults to `Hash`. Changing this forces a new resource to be created.
func (o SqlContainerOutput) PartitionKeyKind() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.StringPtrOutput { return v.PartitionKeyKind }).(pulumi.StringPtrOutput)
}
// A list of partition key paths. Changing this forces a new resource to be created.
func (o SqlContainerOutput) PartitionKeyPaths() pulumi.StringArrayOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.StringArrayOutput { return v.PartitionKeyPaths }).(pulumi.StringArrayOutput)
}
// Define a partition key version. Possible values are `1`and `2`. This should be set to `2` in order to use large partition keys.
//
// > **Note:** If `partitionKeyVersion` is not specified when creating a new resource, you can update `partitionKeyVersion` to `1`, updating to `2` forces a new resource to be created.
func (o SqlContainerOutput) PartitionKeyVersion() pulumi.IntPtrOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.IntPtrOutput { return v.PartitionKeyVersion }).(pulumi.IntPtrOutput)
}
// The name of the resource group in which the Cosmos DB SQL Container is created. Changing this forces a new resource to be created.
func (o SqlContainerOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The throughput of SQL container (RU/s). Must be set in increments of `100`. The minimum value is `400`. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.
func (o SqlContainerOutput) Throughput() pulumi.IntOutput {
return o.ApplyT(func(v *SqlContainer) pulumi.IntOutput { return v.Throughput }).(pulumi.IntOutput)
}
// One or more `uniqueKey` blocks as defined below. Changing this forces a new resource to be created.
func (o SqlContainerOutput) UniqueKeys() SqlContainerUniqueKeyArrayOutput {
return o.ApplyT(func(v *SqlContainer) SqlContainerUniqueKeyArrayOutput { return v.UniqueKeys }).(SqlContainerUniqueKeyArrayOutput)
}
type SqlContainerArrayOutput struct{ *pulumi.OutputState }
func (SqlContainerArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SqlContainer)(nil)).Elem()
}
func (o SqlContainerArrayOutput) ToSqlContainerArrayOutput() SqlContainerArrayOutput {
return o
}
func (o SqlContainerArrayOutput) ToSqlContainerArrayOutputWithContext(ctx context.Context) SqlContainerArrayOutput {
return o
}
func (o SqlContainerArrayOutput) Index(i pulumi.IntInput) SqlContainerOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SqlContainer {
return vs[0].([]*SqlContainer)[vs[1].(int)]
}).(SqlContainerOutput)
}
type SqlContainerMapOutput struct{ *pulumi.OutputState }
func (SqlContainerMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SqlContainer)(nil)).Elem()
}
func (o SqlContainerMapOutput) ToSqlContainerMapOutput() SqlContainerMapOutput {
return o
}
func (o SqlContainerMapOutput) ToSqlContainerMapOutputWithContext(ctx context.Context) SqlContainerMapOutput {
return o
}
func (o SqlContainerMapOutput) MapIndex(k pulumi.StringInput) SqlContainerOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SqlContainer {
return vs[0].(map[string]*SqlContainer)[vs[1].(string)]
}).(SqlContainerOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SqlContainerInput)(nil)).Elem(), &SqlContainer{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlContainerArrayInput)(nil)).Elem(), SqlContainerArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SqlContainerMapInput)(nil)).Elem(), SqlContainerMap{})
pulumi.RegisterOutputType(SqlContainerOutput{})
pulumi.RegisterOutputType(SqlContainerArrayOutput{})
pulumi.RegisterOutputType(SqlContainerMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/postgresqlCluster.go | sdk/go/azure/cosmosdb/postgresqlCluster.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an Azure Cosmos DB for PostgreSQL Cluster.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewPostgresqlCluster(ctx, "example", &cosmosdb.PostgresqlClusterArgs{
// Name: pulumi.String("example-cluster"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
// CoordinatorStorageQuotaInMb: pulumi.Int(131072),
// CoordinatorVcoreCount: pulumi.Int(2),
// NodeCount: pulumi.Int(0),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DBforPostgreSQL` - 2022-11-08
//
// ## Import
//
// Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/postgresqlCluster:PostgresqlCluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/cluster1
// ```
type PostgresqlCluster struct {
pulumi.CustomResourceState
// The password of the administrator login. This is required when `sourceResourceId` is not set.
AdministratorLoginPassword pulumi.StringPtrOutput `pulumi:"administratorLoginPassword"`
// The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`.
CitusVersion pulumi.StringOutput `pulumi:"citusVersion"`
// Is public access enabled on coordinator? Defaults to `true`.
CoordinatorPublicIpAccessEnabled pulumi.BoolPtrOutput `pulumi:"coordinatorPublicIpAccessEnabled"`
// The edition of the coordinator server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `GeneralPurpose`.
CoordinatorServerEdition pulumi.StringPtrOutput `pulumi:"coordinatorServerEdition"`
// The coordinator storage allowed for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608`, `16777216`, and `33554432`.
//
// > **Note:** More information on [the types of compute resources available for CosmosDB can be found in the product documentation](https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute)
CoordinatorStorageQuotaInMb pulumi.IntPtrOutput `pulumi:"coordinatorStorageQuotaInMb"`
// The coordinator vCore count for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64` and `96`.
CoordinatorVcoreCount pulumi.IntPtrOutput `pulumi:"coordinatorVcoreCount"`
// The earliest restore point time (ISO8601 format) for the Azure Cosmos DB for PostgreSQL Cluster.
EarliestRestoreTime pulumi.StringOutput `pulumi:"earliestRestoreTime"`
// Is high availability enabled for the Azure Cosmos DB for PostgreSQL cluster? Defaults to `false`.
HaEnabled pulumi.BoolPtrOutput `pulumi:"haEnabled"`
// The Azure Region where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// A `maintenanceWindow` block as defined below.
MaintenanceWindow PostgresqlClusterMaintenanceWindowPtrOutput `pulumi:"maintenanceWindow"`
// The name which should be used for this Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The worker node count of the Azure Cosmos DB for PostgreSQL Cluster. Possible value is between `0` and `20` except `1`.
NodeCount pulumi.IntOutput `pulumi:"nodeCount"`
// Is public access enabled on worker nodes. Defaults to `false`.
NodePublicIpAccessEnabled pulumi.BoolPtrOutput `pulumi:"nodePublicIpAccessEnabled"`
// The edition of the node server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `MemoryOptimized`.
NodeServerEdition pulumi.StringPtrOutput `pulumi:"nodeServerEdition"`
// The storage quota in MB on each worker node. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608` and `16777216`.
NodeStorageQuotaInMb pulumi.IntOutput `pulumi:"nodeStorageQuotaInMb"`
// The vCores count on each worker node. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `96` and `104`.
NodeVcores pulumi.IntOutput `pulumi:"nodeVcores"`
// The date and time in UTC (ISO8601 format) for the Azure Cosmos DB for PostgreSQL cluster restore. Changing this forces a new resource to be created.
PointInTimeInUtc pulumi.StringPtrOutput `pulumi:"pointInTimeInUtc"`
// The preferred primary availability zone for the Azure Cosmos DB for PostgreSQL cluster.
PreferredPrimaryZone pulumi.StringPtrOutput `pulumi:"preferredPrimaryZone"`
// The name of the Resource Group where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `servers` block as defined below.
Servers PostgresqlClusterServerArrayOutput `pulumi:"servers"`
// Is shards on coordinator enabled for the Azure Cosmos DB for PostgreSQL cluster.
ShardsOnCoordinatorEnabled pulumi.BoolOutput `pulumi:"shardsOnCoordinatorEnabled"`
// The Azure region of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceLocation pulumi.StringPtrOutput `pulumi:"sourceLocation"`
// The resource ID of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrOutput `pulumi:"sourceResourceId"`
// The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14`, `15` and `16`.
SqlVersion pulumi.StringOutput `pulumi:"sqlVersion"`
// A mapping of tags which should be assigned to the Azure Cosmos DB for PostgreSQL Cluster.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewPostgresqlCluster registers a new resource with the given unique name, arguments, and options.
func NewPostgresqlCluster(ctx *pulumi.Context,
name string, args *PostgresqlClusterArgs, opts ...pulumi.ResourceOption) (*PostgresqlCluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.NodeCount == nil {
return nil, errors.New("invalid value for required argument 'NodeCount'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.AdministratorLoginPassword != nil {
args.AdministratorLoginPassword = pulumi.ToSecret(args.AdministratorLoginPassword).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"administratorLoginPassword",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource PostgresqlCluster
err := ctx.RegisterResource("azure:cosmosdb/postgresqlCluster:PostgresqlCluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPostgresqlCluster gets an existing PostgresqlCluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPostgresqlCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PostgresqlClusterState, opts ...pulumi.ResourceOption) (*PostgresqlCluster, error) {
var resource PostgresqlCluster
err := ctx.ReadResource("azure:cosmosdb/postgresqlCluster:PostgresqlCluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PostgresqlCluster resources.
type postgresqlClusterState struct {
// The password of the administrator login. This is required when `sourceResourceId` is not set.
AdministratorLoginPassword *string `pulumi:"administratorLoginPassword"`
// The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`.
CitusVersion *string `pulumi:"citusVersion"`
// Is public access enabled on coordinator? Defaults to `true`.
CoordinatorPublicIpAccessEnabled *bool `pulumi:"coordinatorPublicIpAccessEnabled"`
// The edition of the coordinator server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `GeneralPurpose`.
CoordinatorServerEdition *string `pulumi:"coordinatorServerEdition"`
// The coordinator storage allowed for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608`, `16777216`, and `33554432`.
//
// > **Note:** More information on [the types of compute resources available for CosmosDB can be found in the product documentation](https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute)
CoordinatorStorageQuotaInMb *int `pulumi:"coordinatorStorageQuotaInMb"`
// The coordinator vCore count for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64` and `96`.
CoordinatorVcoreCount *int `pulumi:"coordinatorVcoreCount"`
// The earliest restore point time (ISO8601 format) for the Azure Cosmos DB for PostgreSQL Cluster.
EarliestRestoreTime *string `pulumi:"earliestRestoreTime"`
// Is high availability enabled for the Azure Cosmos DB for PostgreSQL cluster? Defaults to `false`.
HaEnabled *bool `pulumi:"haEnabled"`
// The Azure Region where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A `maintenanceWindow` block as defined below.
MaintenanceWindow *PostgresqlClusterMaintenanceWindow `pulumi:"maintenanceWindow"`
// The name which should be used for this Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The worker node count of the Azure Cosmos DB for PostgreSQL Cluster. Possible value is between `0` and `20` except `1`.
NodeCount *int `pulumi:"nodeCount"`
// Is public access enabled on worker nodes. Defaults to `false`.
NodePublicIpAccessEnabled *bool `pulumi:"nodePublicIpAccessEnabled"`
// The edition of the node server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `MemoryOptimized`.
NodeServerEdition *string `pulumi:"nodeServerEdition"`
// The storage quota in MB on each worker node. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608` and `16777216`.
NodeStorageQuotaInMb *int `pulumi:"nodeStorageQuotaInMb"`
// The vCores count on each worker node. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `96` and `104`.
NodeVcores *int `pulumi:"nodeVcores"`
// The date and time in UTC (ISO8601 format) for the Azure Cosmos DB for PostgreSQL cluster restore. Changing this forces a new resource to be created.
PointInTimeInUtc *string `pulumi:"pointInTimeInUtc"`
// The preferred primary availability zone for the Azure Cosmos DB for PostgreSQL cluster.
PreferredPrimaryZone *string `pulumi:"preferredPrimaryZone"`
// The name of the Resource Group where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A `servers` block as defined below.
Servers []PostgresqlClusterServer `pulumi:"servers"`
// Is shards on coordinator enabled for the Azure Cosmos DB for PostgreSQL cluster.
ShardsOnCoordinatorEnabled *bool `pulumi:"shardsOnCoordinatorEnabled"`
// The Azure region of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceLocation *string `pulumi:"sourceLocation"`
// The resource ID of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceResourceId *string `pulumi:"sourceResourceId"`
// The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14`, `15` and `16`.
SqlVersion *string `pulumi:"sqlVersion"`
// A mapping of tags which should be assigned to the Azure Cosmos DB for PostgreSQL Cluster.
Tags map[string]string `pulumi:"tags"`
}
type PostgresqlClusterState struct {
// The password of the administrator login. This is required when `sourceResourceId` is not set.
AdministratorLoginPassword pulumi.StringPtrInput
// The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`.
CitusVersion pulumi.StringPtrInput
// Is public access enabled on coordinator? Defaults to `true`.
CoordinatorPublicIpAccessEnabled pulumi.BoolPtrInput
// The edition of the coordinator server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `GeneralPurpose`.
CoordinatorServerEdition pulumi.StringPtrInput
// The coordinator storage allowed for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608`, `16777216`, and `33554432`.
//
// > **Note:** More information on [the types of compute resources available for CosmosDB can be found in the product documentation](https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute)
CoordinatorStorageQuotaInMb pulumi.IntPtrInput
// The coordinator vCore count for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64` and `96`.
CoordinatorVcoreCount pulumi.IntPtrInput
// The earliest restore point time (ISO8601 format) for the Azure Cosmos DB for PostgreSQL Cluster.
EarliestRestoreTime pulumi.StringPtrInput
// Is high availability enabled for the Azure Cosmos DB for PostgreSQL cluster? Defaults to `false`.
HaEnabled pulumi.BoolPtrInput
// The Azure Region where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A `maintenanceWindow` block as defined below.
MaintenanceWindow PostgresqlClusterMaintenanceWindowPtrInput
// The name which should be used for this Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The worker node count of the Azure Cosmos DB for PostgreSQL Cluster. Possible value is between `0` and `20` except `1`.
NodeCount pulumi.IntPtrInput
// Is public access enabled on worker nodes. Defaults to `false`.
NodePublicIpAccessEnabled pulumi.BoolPtrInput
// The edition of the node server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `MemoryOptimized`.
NodeServerEdition pulumi.StringPtrInput
// The storage quota in MB on each worker node. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608` and `16777216`.
NodeStorageQuotaInMb pulumi.IntPtrInput
// The vCores count on each worker node. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `96` and `104`.
NodeVcores pulumi.IntPtrInput
// The date and time in UTC (ISO8601 format) for the Azure Cosmos DB for PostgreSQL cluster restore. Changing this forces a new resource to be created.
PointInTimeInUtc pulumi.StringPtrInput
// The preferred primary availability zone for the Azure Cosmos DB for PostgreSQL cluster.
PreferredPrimaryZone pulumi.StringPtrInput
// The name of the Resource Group where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A `servers` block as defined below.
Servers PostgresqlClusterServerArrayInput
// Is shards on coordinator enabled for the Azure Cosmos DB for PostgreSQL cluster.
ShardsOnCoordinatorEnabled pulumi.BoolPtrInput
// The Azure region of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceLocation pulumi.StringPtrInput
// The resource ID of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrInput
// The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14`, `15` and `16`.
SqlVersion pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Azure Cosmos DB for PostgreSQL Cluster.
Tags pulumi.StringMapInput
}
func (PostgresqlClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlClusterState)(nil)).Elem()
}
type postgresqlClusterArgs struct {
// The password of the administrator login. This is required when `sourceResourceId` is not set.
AdministratorLoginPassword *string `pulumi:"administratorLoginPassword"`
// The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`.
CitusVersion *string `pulumi:"citusVersion"`
// Is public access enabled on coordinator? Defaults to `true`.
CoordinatorPublicIpAccessEnabled *bool `pulumi:"coordinatorPublicIpAccessEnabled"`
// The edition of the coordinator server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `GeneralPurpose`.
CoordinatorServerEdition *string `pulumi:"coordinatorServerEdition"`
// The coordinator storage allowed for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608`, `16777216`, and `33554432`.
//
// > **Note:** More information on [the types of compute resources available for CosmosDB can be found in the product documentation](https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute)
CoordinatorStorageQuotaInMb *int `pulumi:"coordinatorStorageQuotaInMb"`
// The coordinator vCore count for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64` and `96`.
CoordinatorVcoreCount *int `pulumi:"coordinatorVcoreCount"`
// Is high availability enabled for the Azure Cosmos DB for PostgreSQL cluster? Defaults to `false`.
HaEnabled *bool `pulumi:"haEnabled"`
// The Azure Region where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A `maintenanceWindow` block as defined below.
MaintenanceWindow *PostgresqlClusterMaintenanceWindow `pulumi:"maintenanceWindow"`
// The name which should be used for this Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The worker node count of the Azure Cosmos DB for PostgreSQL Cluster. Possible value is between `0` and `20` except `1`.
NodeCount int `pulumi:"nodeCount"`
// Is public access enabled on worker nodes. Defaults to `false`.
NodePublicIpAccessEnabled *bool `pulumi:"nodePublicIpAccessEnabled"`
// The edition of the node server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `MemoryOptimized`.
NodeServerEdition *string `pulumi:"nodeServerEdition"`
// The storage quota in MB on each worker node. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608` and `16777216`.
NodeStorageQuotaInMb *int `pulumi:"nodeStorageQuotaInMb"`
// The vCores count on each worker node. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `96` and `104`.
NodeVcores *int `pulumi:"nodeVcores"`
// The date and time in UTC (ISO8601 format) for the Azure Cosmos DB for PostgreSQL cluster restore. Changing this forces a new resource to be created.
PointInTimeInUtc *string `pulumi:"pointInTimeInUtc"`
// The preferred primary availability zone for the Azure Cosmos DB for PostgreSQL cluster.
PreferredPrimaryZone *string `pulumi:"preferredPrimaryZone"`
// The name of the Resource Group where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Is shards on coordinator enabled for the Azure Cosmos DB for PostgreSQL cluster.
ShardsOnCoordinatorEnabled *bool `pulumi:"shardsOnCoordinatorEnabled"`
// The Azure region of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceLocation *string `pulumi:"sourceLocation"`
// The resource ID of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceResourceId *string `pulumi:"sourceResourceId"`
// The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14`, `15` and `16`.
SqlVersion *string `pulumi:"sqlVersion"`
// A mapping of tags which should be assigned to the Azure Cosmos DB for PostgreSQL Cluster.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a PostgresqlCluster resource.
type PostgresqlClusterArgs struct {
// The password of the administrator login. This is required when `sourceResourceId` is not set.
AdministratorLoginPassword pulumi.StringPtrInput
// The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`.
CitusVersion pulumi.StringPtrInput
// Is public access enabled on coordinator? Defaults to `true`.
CoordinatorPublicIpAccessEnabled pulumi.BoolPtrInput
// The edition of the coordinator server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `GeneralPurpose`.
CoordinatorServerEdition pulumi.StringPtrInput
// The coordinator storage allowed for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608`, `16777216`, and `33554432`.
//
// > **Note:** More information on [the types of compute resources available for CosmosDB can be found in the product documentation](https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute)
CoordinatorStorageQuotaInMb pulumi.IntPtrInput
// The coordinator vCore count for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64` and `96`.
CoordinatorVcoreCount pulumi.IntPtrInput
// Is high availability enabled for the Azure Cosmos DB for PostgreSQL cluster? Defaults to `false`.
HaEnabled pulumi.BoolPtrInput
// The Azure Region where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A `maintenanceWindow` block as defined below.
MaintenanceWindow PostgresqlClusterMaintenanceWindowPtrInput
// The name which should be used for this Azure Cosmos DB for PostgreSQL Cluster. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The worker node count of the Azure Cosmos DB for PostgreSQL Cluster. Possible value is between `0` and `20` except `1`.
NodeCount pulumi.IntInput
// Is public access enabled on worker nodes. Defaults to `false`.
NodePublicIpAccessEnabled pulumi.BoolPtrInput
// The edition of the node server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `MemoryOptimized`.
NodeServerEdition pulumi.StringPtrInput
// The storage quota in MB on each worker node. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608` and `16777216`.
NodeStorageQuotaInMb pulumi.IntPtrInput
// The vCores count on each worker node. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `96` and `104`.
NodeVcores pulumi.IntPtrInput
// The date and time in UTC (ISO8601 format) for the Azure Cosmos DB for PostgreSQL cluster restore. Changing this forces a new resource to be created.
PointInTimeInUtc pulumi.StringPtrInput
// The preferred primary availability zone for the Azure Cosmos DB for PostgreSQL cluster.
PreferredPrimaryZone pulumi.StringPtrInput
// The name of the Resource Group where the Azure Cosmos DB for PostgreSQL Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// Is shards on coordinator enabled for the Azure Cosmos DB for PostgreSQL cluster.
ShardsOnCoordinatorEnabled pulumi.BoolPtrInput
// The Azure region of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceLocation pulumi.StringPtrInput
// The resource ID of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrInput
// The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14`, `15` and `16`.
SqlVersion pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Azure Cosmos DB for PostgreSQL Cluster.
Tags pulumi.StringMapInput
}
func (PostgresqlClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*postgresqlClusterArgs)(nil)).Elem()
}
type PostgresqlClusterInput interface {
pulumi.Input
ToPostgresqlClusterOutput() PostgresqlClusterOutput
ToPostgresqlClusterOutputWithContext(ctx context.Context) PostgresqlClusterOutput
}
func (*PostgresqlCluster) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlCluster)(nil)).Elem()
}
func (i *PostgresqlCluster) ToPostgresqlClusterOutput() PostgresqlClusterOutput {
return i.ToPostgresqlClusterOutputWithContext(context.Background())
}
func (i *PostgresqlCluster) ToPostgresqlClusterOutputWithContext(ctx context.Context) PostgresqlClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlClusterOutput)
}
// PostgresqlClusterArrayInput is an input type that accepts PostgresqlClusterArray and PostgresqlClusterArrayOutput values.
// You can construct a concrete instance of `PostgresqlClusterArrayInput` via:
//
// PostgresqlClusterArray{ PostgresqlClusterArgs{...} }
type PostgresqlClusterArrayInput interface {
pulumi.Input
ToPostgresqlClusterArrayOutput() PostgresqlClusterArrayOutput
ToPostgresqlClusterArrayOutputWithContext(context.Context) PostgresqlClusterArrayOutput
}
type PostgresqlClusterArray []PostgresqlClusterInput
func (PostgresqlClusterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PostgresqlCluster)(nil)).Elem()
}
func (i PostgresqlClusterArray) ToPostgresqlClusterArrayOutput() PostgresqlClusterArrayOutput {
return i.ToPostgresqlClusterArrayOutputWithContext(context.Background())
}
func (i PostgresqlClusterArray) ToPostgresqlClusterArrayOutputWithContext(ctx context.Context) PostgresqlClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlClusterArrayOutput)
}
// PostgresqlClusterMapInput is an input type that accepts PostgresqlClusterMap and PostgresqlClusterMapOutput values.
// You can construct a concrete instance of `PostgresqlClusterMapInput` via:
//
// PostgresqlClusterMap{ "key": PostgresqlClusterArgs{...} }
type PostgresqlClusterMapInput interface {
pulumi.Input
ToPostgresqlClusterMapOutput() PostgresqlClusterMapOutput
ToPostgresqlClusterMapOutputWithContext(context.Context) PostgresqlClusterMapOutput
}
type PostgresqlClusterMap map[string]PostgresqlClusterInput
func (PostgresqlClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PostgresqlCluster)(nil)).Elem()
}
func (i PostgresqlClusterMap) ToPostgresqlClusterMapOutput() PostgresqlClusterMapOutput {
return i.ToPostgresqlClusterMapOutputWithContext(context.Background())
}
func (i PostgresqlClusterMap) ToPostgresqlClusterMapOutputWithContext(ctx context.Context) PostgresqlClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PostgresqlClusterMapOutput)
}
type PostgresqlClusterOutput struct{ *pulumi.OutputState }
func (PostgresqlClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PostgresqlCluster)(nil)).Elem()
}
func (o PostgresqlClusterOutput) ToPostgresqlClusterOutput() PostgresqlClusterOutput {
return o
}
func (o PostgresqlClusterOutput) ToPostgresqlClusterOutputWithContext(ctx context.Context) PostgresqlClusterOutput {
return o
}
// The password of the administrator login. This is required when `sourceResourceId` is not set.
func (o PostgresqlClusterOutput) AdministratorLoginPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *PostgresqlCluster) pulumi.StringPtrOutput { return v.AdministratorLoginPassword }).(pulumi.StringPtrOutput)
}
// The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`.
func (o PostgresqlClusterOutput) CitusVersion() pulumi.StringOutput {
return o.ApplyT(func(v *PostgresqlCluster) pulumi.StringOutput { return v.CitusVersion }).(pulumi.StringOutput)
}
// Is public access enabled on coordinator? Defaults to `true`.
func (o PostgresqlClusterOutput) CoordinatorPublicIpAccessEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *PostgresqlCluster) pulumi.BoolPtrOutput { return v.CoordinatorPublicIpAccessEnabled }).(pulumi.BoolPtrOutput)
}
// The edition of the coordinator server. Possible values are `BurstableGeneralPurpose`, `BurstableMemoryOptimized`, `GeneralPurpose` and `MemoryOptimized`. Defaults to `GeneralPurpose`.
func (o PostgresqlClusterOutput) CoordinatorServerEdition() pulumi.StringPtrOutput {
return o.ApplyT(func(v *PostgresqlCluster) pulumi.StringPtrOutput { return v.CoordinatorServerEdition }).(pulumi.StringPtrOutput)
}
// The coordinator storage allowed for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4194304`, `8388608`, `16777216`, and `33554432`.
//
// > **Note:** More information on [the types of compute resources available for CosmosDB can be found in the product documentation](https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute)
func (o PostgresqlClusterOutput) CoordinatorStorageQuotaInMb() pulumi.IntPtrOutput {
return o.ApplyT(func(v *PostgresqlCluster) pulumi.IntPtrOutput { return v.CoordinatorStorageQuotaInMb }).(pulumi.IntPtrOutput)
}
// The coordinator vCore count for the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `1`, `2`, `4`, `8`, `16`, `32`, `64` and `96`.
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/account.go | sdk/go/azure/cosmosdb/account.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a CosmosDB (formally DocumentDB) Account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi-random/sdk/v4/go/random"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
// Name: pulumi.String("sample-rg"),
// Location: pulumi.String("westus"),
// })
// if err != nil {
// return err
// }
// ri, err := random.NewInteger(ctx, "ri", &random.IntegerArgs{
// Min: 10000,
// Max: 99999,
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewAccount(ctx, "db", &cosmosdb.AccountArgs{
// Name: pulumi.Sprintf("tfex-cosmos-db-%v", ri.Result),
// Location: pulumi.Any(example.Location),
// ResourceGroupName: pulumi.Any(example.Name),
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("MongoDB"),
// AutomaticFailoverEnabled: pulumi.Bool(true),
// Capabilities: cosmosdb.AccountCapabilityArray{
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableAggregationPipeline"),
// },
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("mongoEnableDocLevelTTL"),
// },
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("MongoDBv3.4"),
// },
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableMongo"),
// },
// },
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("BoundedStaleness"),
// MaxIntervalInSeconds: pulumi.Int(300),
// MaxStalenessPrefix: pulumi.Int(100000),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: pulumi.String("eastus"),
// FailoverPriority: pulumi.Int(1),
// },
// &cosmosdb.AccountGeoLocationArgs{
// Location: pulumi.String("westus"),
// FailoverPriority: pulumi.Int(0),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## User Assigned Identity Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/authorization"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
// ResourceGroupName: pulumi.Any(exampleAzurermResourceGroup.Name),
// Location: pulumi.Any(exampleAzurermResourceGroup.Location),
// Name: pulumi.String("example-resource"),
// })
// if err != nil {
// return err
// }
// _, err = cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
// Name: pulumi.String("example-resource"),
// Location: pulumi.Any(exampleAzurermResourceGroup.Location),
// ResourceGroupName: pulumi.Any(exampleAzurermResourceGroup.Name),
// DefaultIdentityType: pulumi.String(std.JoinOutput(ctx, std.JoinOutputArgs{
// Separator: pulumi.String("="),
// Input: pulumi.StringArray{
// pulumi.String("UserAssignedIdentity"),
// example.ID(),
// },
// }, nil).ApplyT(func(invoke std.JoinResult) (*string, error) {
// return invoke.Result, nil
// }).(pulumi.StringPtrOutput)),
// OfferType: pulumi.String("Standard"),
// Kind: pulumi.String("MongoDB"),
// Capabilities: cosmosdb.AccountCapabilityArray{
// &cosmosdb.AccountCapabilityArgs{
// Name: pulumi.String("EnableMongo"),
// },
// },
// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
// ConsistencyLevel: pulumi.String("Strong"),
// },
// GeoLocations: cosmosdb.AccountGeoLocationArray{
// &cosmosdb.AccountGeoLocationArgs{
// Location: pulumi.String("westus"),
// FailoverPriority: pulumi.Int(0),
// },
// },
// Identity: &cosmosdb.AccountIdentityArgs{
// Type: pulumi.String("UserAssigned"),
// IdentityIds: pulumi.StringArray{
// example.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.DocumentDB` - 2024-08-15
//
// ## Import
//
// CosmosDB Accounts can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:cosmosdb/account:Account account1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1
// ```
type Account struct {
pulumi.CustomResourceState
AccessKeyMetadataWritesEnabled pulumi.BoolPtrOutput `pulumi:"accessKeyMetadataWritesEnabled"`
// An `analyticalStorage` block as defined below.
AnalyticalStorage AccountAnalyticalStorageOutput `pulumi:"analyticalStorage"`
AnalyticalStorageEnabled pulumi.BoolPtrOutput `pulumi:"analyticalStorageEnabled"`
AutomaticFailoverEnabled pulumi.BoolPtrOutput `pulumi:"automaticFailoverEnabled"`
Backup AccountBackupOutput `pulumi:"backup"`
BurstCapacityEnabled pulumi.BoolPtrOutput `pulumi:"burstCapacityEnabled"`
Capabilities AccountCapabilityArrayOutput `pulumi:"capabilities"`
// A `capacity` block as defined below.
Capacity AccountCapacityOutput `pulumi:"capacity"`
ConsistencyPolicy AccountConsistencyPolicyOutput `pulumi:"consistencyPolicy"`
CorsRule AccountCorsRulePtrOutput `pulumi:"corsRule"`
// The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created.
//
// > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`.
CreateMode pulumi.StringOutput `pulumi:"createMode"`
// The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`.
DefaultIdentityType pulumi.StringPtrOutput `pulumi:"defaultIdentityType"`
// The endpoint used to connect to the CosmosDB account.
Endpoint pulumi.StringOutput `pulumi:"endpoint"`
FreeTierEnabled pulumi.BoolPtrOutput `pulumi:"freeTierEnabled"`
GeoLocations AccountGeoLocationArrayOutput `pulumi:"geoLocations"`
Identity AccountIdentityPtrOutput `pulumi:"identity"`
IpRangeFilters pulumi.StringArrayOutput `pulumi:"ipRangeFilters"`
IsVirtualNetworkFilterEnabled pulumi.BoolPtrOutput `pulumi:"isVirtualNetworkFilterEnabled"`
KeyVaultKeyId pulumi.StringPtrOutput `pulumi:"keyVaultKeyId"`
Kind pulumi.StringPtrOutput `pulumi:"kind"`
LocalAuthenticationDisabled pulumi.BoolPtrOutput `pulumi:"localAuthenticationDisabled"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
ManagedHsmKeyId pulumi.StringPtrOutput `pulumi:"managedHsmKeyId"`
// Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`.
//
// > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details.
MinimalTlsVersion pulumi.StringPtrOutput `pulumi:"minimalTlsVersion"`
MongoServerVersion pulumi.StringOutput `pulumi:"mongoServerVersion"`
MultipleWriteLocationsEnabled pulumi.BoolPtrOutput `pulumi:"multipleWriteLocationsEnabled"`
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
NetworkAclBypassForAzureServices pulumi.BoolPtrOutput `pulumi:"networkAclBypassForAzureServices"`
NetworkAclBypassIds pulumi.StringArrayOutput `pulumi:"networkAclBypassIds"`
// Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`.
OfferType pulumi.StringOutput `pulumi:"offerType"`
PartitionMergeEnabled pulumi.BoolPtrOutput `pulumi:"partitionMergeEnabled"`
// The Primary key for the CosmosDB Account.
PrimaryKey pulumi.StringOutput `pulumi:"primaryKey"`
// Primary Mongodb connection string for the CosmosDB Account.
PrimaryMongodbConnectionString pulumi.StringOutput `pulumi:"primaryMongodbConnectionString"`
// The Primary read-only Key for the CosmosDB Account.
PrimaryReadonlyKey pulumi.StringOutput `pulumi:"primaryReadonlyKey"`
// Primary readonly Mongodb connection string for the CosmosDB Account.
PrimaryReadonlyMongodbConnectionString pulumi.StringOutput `pulumi:"primaryReadonlyMongodbConnectionString"`
// Primary readonly SQL connection string for the CosmosDB Account.
PrimaryReadonlySqlConnectionString pulumi.StringOutput `pulumi:"primaryReadonlySqlConnectionString"`
// Primary SQL connection string for the CosmosDB Account.
PrimarySqlConnectionString pulumi.StringOutput `pulumi:"primarySqlConnectionString"`
PublicNetworkAccessEnabled pulumi.BoolPtrOutput `pulumi:"publicNetworkAccessEnabled"`
// A list of read endpoints available for this CosmosDB account.
ReadEndpoints pulumi.StringArrayOutput `pulumi:"readEndpoints"`
// The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
Restore AccountRestorePtrOutput `pulumi:"restore"`
// The Secondary key for the CosmosDB Account.
SecondaryKey pulumi.StringOutput `pulumi:"secondaryKey"`
// Secondary Mongodb connection string for the CosmosDB Account.
SecondaryMongodbConnectionString pulumi.StringOutput `pulumi:"secondaryMongodbConnectionString"`
// The Secondary read-only key for the CosmosDB Account.
SecondaryReadonlyKey pulumi.StringOutput `pulumi:"secondaryReadonlyKey"`
// Secondary readonly Mongodb connection string for the CosmosDB Account.
SecondaryReadonlyMongodbConnectionString pulumi.StringOutput `pulumi:"secondaryReadonlyMongodbConnectionString"`
// Secondary readonly SQL connection string for the CosmosDB Account.
SecondaryReadonlySqlConnectionString pulumi.StringOutput `pulumi:"secondaryReadonlySqlConnectionString"`
// Secondary SQL connection string for the CosmosDB Account.
SecondarySqlConnectionString pulumi.StringOutput `pulumi:"secondarySqlConnectionString"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
VirtualNetworkRules AccountVirtualNetworkRuleArrayOutput `pulumi:"virtualNetworkRules"`
// A list of write endpoints available for this CosmosDB account.
WriteEndpoints pulumi.StringArrayOutput `pulumi:"writeEndpoints"`
}
// NewAccount registers a new resource with the given unique name, arguments, and options.
func NewAccount(ctx *pulumi.Context,
name string, args *AccountArgs, opts ...pulumi.ResourceOption) (*Account, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ConsistencyPolicy == nil {
return nil, errors.New("invalid value for required argument 'ConsistencyPolicy'")
}
if args.GeoLocations == nil {
return nil, errors.New("invalid value for required argument 'GeoLocations'")
}
if args.OfferType == nil {
return nil, errors.New("invalid value for required argument 'OfferType'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"primaryKey",
"primaryMongodbConnectionString",
"primaryReadonlyKey",
"primaryReadonlyMongodbConnectionString",
"primaryReadonlySqlConnectionString",
"primarySqlConnectionString",
"secondaryKey",
"secondaryMongodbConnectionString",
"secondaryReadonlyKey",
"secondaryReadonlyMongodbConnectionString",
"secondaryReadonlySqlConnectionString",
"secondarySqlConnectionString",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Account
err := ctx.RegisterResource("azure:cosmosdb/account:Account", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAccount gets an existing Account resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetAccount(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AccountState, opts ...pulumi.ResourceOption) (*Account, error) {
var resource Account
err := ctx.ReadResource("azure:cosmosdb/account:Account", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Account resources.
type accountState struct {
AccessKeyMetadataWritesEnabled *bool `pulumi:"accessKeyMetadataWritesEnabled"`
// An `analyticalStorage` block as defined below.
AnalyticalStorage *AccountAnalyticalStorage `pulumi:"analyticalStorage"`
AnalyticalStorageEnabled *bool `pulumi:"analyticalStorageEnabled"`
AutomaticFailoverEnabled *bool `pulumi:"automaticFailoverEnabled"`
Backup *AccountBackup `pulumi:"backup"`
BurstCapacityEnabled *bool `pulumi:"burstCapacityEnabled"`
Capabilities []AccountCapability `pulumi:"capabilities"`
// A `capacity` block as defined below.
Capacity *AccountCapacity `pulumi:"capacity"`
ConsistencyPolicy *AccountConsistencyPolicy `pulumi:"consistencyPolicy"`
CorsRule *AccountCorsRule `pulumi:"corsRule"`
// The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created.
//
// > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`.
CreateMode *string `pulumi:"createMode"`
// The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`.
DefaultIdentityType *string `pulumi:"defaultIdentityType"`
// The endpoint used to connect to the CosmosDB account.
Endpoint *string `pulumi:"endpoint"`
FreeTierEnabled *bool `pulumi:"freeTierEnabled"`
GeoLocations []AccountGeoLocation `pulumi:"geoLocations"`
Identity *AccountIdentity `pulumi:"identity"`
IpRangeFilters []string `pulumi:"ipRangeFilters"`
IsVirtualNetworkFilterEnabled *bool `pulumi:"isVirtualNetworkFilterEnabled"`
KeyVaultKeyId *string `pulumi:"keyVaultKeyId"`
Kind *string `pulumi:"kind"`
LocalAuthenticationDisabled *bool `pulumi:"localAuthenticationDisabled"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
ManagedHsmKeyId *string `pulumi:"managedHsmKeyId"`
// Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`.
//
// > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details.
MinimalTlsVersion *string `pulumi:"minimalTlsVersion"`
MongoServerVersion *string `pulumi:"mongoServerVersion"`
MultipleWriteLocationsEnabled *bool `pulumi:"multipleWriteLocationsEnabled"`
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
NetworkAclBypassForAzureServices *bool `pulumi:"networkAclBypassForAzureServices"`
NetworkAclBypassIds []string `pulumi:"networkAclBypassIds"`
// Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`.
OfferType *string `pulumi:"offerType"`
PartitionMergeEnabled *bool `pulumi:"partitionMergeEnabled"`
// The Primary key for the CosmosDB Account.
PrimaryKey *string `pulumi:"primaryKey"`
// Primary Mongodb connection string for the CosmosDB Account.
PrimaryMongodbConnectionString *string `pulumi:"primaryMongodbConnectionString"`
// The Primary read-only Key for the CosmosDB Account.
PrimaryReadonlyKey *string `pulumi:"primaryReadonlyKey"`
// Primary readonly Mongodb connection string for the CosmosDB Account.
PrimaryReadonlyMongodbConnectionString *string `pulumi:"primaryReadonlyMongodbConnectionString"`
// Primary readonly SQL connection string for the CosmosDB Account.
PrimaryReadonlySqlConnectionString *string `pulumi:"primaryReadonlySqlConnectionString"`
// Primary SQL connection string for the CosmosDB Account.
PrimarySqlConnectionString *string `pulumi:"primarySqlConnectionString"`
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// A list of read endpoints available for this CosmosDB account.
ReadEndpoints []string `pulumi:"readEndpoints"`
// The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
Restore *AccountRestore `pulumi:"restore"`
// The Secondary key for the CosmosDB Account.
SecondaryKey *string `pulumi:"secondaryKey"`
// Secondary Mongodb connection string for the CosmosDB Account.
SecondaryMongodbConnectionString *string `pulumi:"secondaryMongodbConnectionString"`
// The Secondary read-only key for the CosmosDB Account.
SecondaryReadonlyKey *string `pulumi:"secondaryReadonlyKey"`
// Secondary readonly Mongodb connection string for the CosmosDB Account.
SecondaryReadonlyMongodbConnectionString *string `pulumi:"secondaryReadonlyMongodbConnectionString"`
// Secondary readonly SQL connection string for the CosmosDB Account.
SecondaryReadonlySqlConnectionString *string `pulumi:"secondaryReadonlySqlConnectionString"`
// Secondary SQL connection string for the CosmosDB Account.
SecondarySqlConnectionString *string `pulumi:"secondarySqlConnectionString"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
VirtualNetworkRules []AccountVirtualNetworkRule `pulumi:"virtualNetworkRules"`
// A list of write endpoints available for this CosmosDB account.
WriteEndpoints []string `pulumi:"writeEndpoints"`
}
type AccountState struct {
AccessKeyMetadataWritesEnabled pulumi.BoolPtrInput
// An `analyticalStorage` block as defined below.
AnalyticalStorage AccountAnalyticalStoragePtrInput
AnalyticalStorageEnabled pulumi.BoolPtrInput
AutomaticFailoverEnabled pulumi.BoolPtrInput
Backup AccountBackupPtrInput
BurstCapacityEnabled pulumi.BoolPtrInput
Capabilities AccountCapabilityArrayInput
// A `capacity` block as defined below.
Capacity AccountCapacityPtrInput
ConsistencyPolicy AccountConsistencyPolicyPtrInput
CorsRule AccountCorsRulePtrInput
// The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created.
//
// > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`.
CreateMode pulumi.StringPtrInput
// The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`.
DefaultIdentityType pulumi.StringPtrInput
// The endpoint used to connect to the CosmosDB account.
Endpoint pulumi.StringPtrInput
FreeTierEnabled pulumi.BoolPtrInput
GeoLocations AccountGeoLocationArrayInput
Identity AccountIdentityPtrInput
IpRangeFilters pulumi.StringArrayInput
IsVirtualNetworkFilterEnabled pulumi.BoolPtrInput
KeyVaultKeyId pulumi.StringPtrInput
Kind pulumi.StringPtrInput
LocalAuthenticationDisabled pulumi.BoolPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
ManagedHsmKeyId pulumi.StringPtrInput
// Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`.
//
// > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details.
MinimalTlsVersion pulumi.StringPtrInput
MongoServerVersion pulumi.StringPtrInput
MultipleWriteLocationsEnabled pulumi.BoolPtrInput
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
NetworkAclBypassForAzureServices pulumi.BoolPtrInput
NetworkAclBypassIds pulumi.StringArrayInput
// Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`.
OfferType pulumi.StringPtrInput
PartitionMergeEnabled pulumi.BoolPtrInput
// The Primary key for the CosmosDB Account.
PrimaryKey pulumi.StringPtrInput
// Primary Mongodb connection string for the CosmosDB Account.
PrimaryMongodbConnectionString pulumi.StringPtrInput
// The Primary read-only Key for the CosmosDB Account.
PrimaryReadonlyKey pulumi.StringPtrInput
// Primary readonly Mongodb connection string for the CosmosDB Account.
PrimaryReadonlyMongodbConnectionString pulumi.StringPtrInput
// Primary readonly SQL connection string for the CosmosDB Account.
PrimaryReadonlySqlConnectionString pulumi.StringPtrInput
// Primary SQL connection string for the CosmosDB Account.
PrimarySqlConnectionString pulumi.StringPtrInput
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// A list of read endpoints available for this CosmosDB account.
ReadEndpoints pulumi.StringArrayInput
// The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
Restore AccountRestorePtrInput
// The Secondary key for the CosmosDB Account.
SecondaryKey pulumi.StringPtrInput
// Secondary Mongodb connection string for the CosmosDB Account.
SecondaryMongodbConnectionString pulumi.StringPtrInput
// The Secondary read-only key for the CosmosDB Account.
SecondaryReadonlyKey pulumi.StringPtrInput
// Secondary readonly Mongodb connection string for the CosmosDB Account.
SecondaryReadonlyMongodbConnectionString pulumi.StringPtrInput
// Secondary readonly SQL connection string for the CosmosDB Account.
SecondaryReadonlySqlConnectionString pulumi.StringPtrInput
// Secondary SQL connection string for the CosmosDB Account.
SecondarySqlConnectionString pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
VirtualNetworkRules AccountVirtualNetworkRuleArrayInput
// A list of write endpoints available for this CosmosDB account.
WriteEndpoints pulumi.StringArrayInput
}
func (AccountState) ElementType() reflect.Type {
return reflect.TypeOf((*accountState)(nil)).Elem()
}
type accountArgs struct {
AccessKeyMetadataWritesEnabled *bool `pulumi:"accessKeyMetadataWritesEnabled"`
// An `analyticalStorage` block as defined below.
AnalyticalStorage *AccountAnalyticalStorage `pulumi:"analyticalStorage"`
AnalyticalStorageEnabled *bool `pulumi:"analyticalStorageEnabled"`
AutomaticFailoverEnabled *bool `pulumi:"automaticFailoverEnabled"`
Backup *AccountBackup `pulumi:"backup"`
BurstCapacityEnabled *bool `pulumi:"burstCapacityEnabled"`
Capabilities []AccountCapability `pulumi:"capabilities"`
// A `capacity` block as defined below.
Capacity *AccountCapacity `pulumi:"capacity"`
ConsistencyPolicy AccountConsistencyPolicy `pulumi:"consistencyPolicy"`
CorsRule *AccountCorsRule `pulumi:"corsRule"`
// The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created.
//
// > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`.
CreateMode *string `pulumi:"createMode"`
// The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`.
DefaultIdentityType *string `pulumi:"defaultIdentityType"`
FreeTierEnabled *bool `pulumi:"freeTierEnabled"`
GeoLocations []AccountGeoLocation `pulumi:"geoLocations"`
Identity *AccountIdentity `pulumi:"identity"`
IpRangeFilters []string `pulumi:"ipRangeFilters"`
IsVirtualNetworkFilterEnabled *bool `pulumi:"isVirtualNetworkFilterEnabled"`
KeyVaultKeyId *string `pulumi:"keyVaultKeyId"`
Kind *string `pulumi:"kind"`
LocalAuthenticationDisabled *bool `pulumi:"localAuthenticationDisabled"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
ManagedHsmKeyId *string `pulumi:"managedHsmKeyId"`
// Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`.
//
// > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details.
MinimalTlsVersion *string `pulumi:"minimalTlsVersion"`
MongoServerVersion *string `pulumi:"mongoServerVersion"`
MultipleWriteLocationsEnabled *bool `pulumi:"multipleWriteLocationsEnabled"`
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
NetworkAclBypassForAzureServices *bool `pulumi:"networkAclBypassForAzureServices"`
NetworkAclBypassIds []string `pulumi:"networkAclBypassIds"`
// Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`.
OfferType string `pulumi:"offerType"`
PartitionMergeEnabled *bool `pulumi:"partitionMergeEnabled"`
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
Restore *AccountRestore `pulumi:"restore"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
VirtualNetworkRules []AccountVirtualNetworkRule `pulumi:"virtualNetworkRules"`
}
// The set of arguments for constructing a Account resource.
type AccountArgs struct {
AccessKeyMetadataWritesEnabled pulumi.BoolPtrInput
// An `analyticalStorage` block as defined below.
AnalyticalStorage AccountAnalyticalStoragePtrInput
AnalyticalStorageEnabled pulumi.BoolPtrInput
AutomaticFailoverEnabled pulumi.BoolPtrInput
Backup AccountBackupPtrInput
BurstCapacityEnabled pulumi.BoolPtrInput
Capabilities AccountCapabilityArrayInput
// A `capacity` block as defined below.
Capacity AccountCapacityPtrInput
ConsistencyPolicy AccountConsistencyPolicyInput
CorsRule AccountCorsRulePtrInput
// The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created.
//
// > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`.
CreateMode pulumi.StringPtrInput
// The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`.
DefaultIdentityType pulumi.StringPtrInput
FreeTierEnabled pulumi.BoolPtrInput
GeoLocations AccountGeoLocationArrayInput
Identity AccountIdentityPtrInput
IpRangeFilters pulumi.StringArrayInput
IsVirtualNetworkFilterEnabled pulumi.BoolPtrInput
KeyVaultKeyId pulumi.StringPtrInput
Kind pulumi.StringPtrInput
LocalAuthenticationDisabled pulumi.BoolPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
ManagedHsmKeyId pulumi.StringPtrInput
// Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`.
//
// > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details.
MinimalTlsVersion pulumi.StringPtrInput
MongoServerVersion pulumi.StringPtrInput
MultipleWriteLocationsEnabled pulumi.BoolPtrInput
// Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
NetworkAclBypassForAzureServices pulumi.BoolPtrInput
NetworkAclBypassIds pulumi.StringArrayInput
// Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`.
OfferType pulumi.StringInput
PartitionMergeEnabled pulumi.BoolPtrInput
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
Restore AccountRestorePtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
VirtualNetworkRules AccountVirtualNetworkRuleArrayInput
}
func (AccountArgs) ElementType() reflect.Type {
return reflect.TypeOf((*accountArgs)(nil)).Elem()
}
type AccountInput interface {
pulumi.Input
ToAccountOutput() AccountOutput
ToAccountOutputWithContext(ctx context.Context) AccountOutput
}
func (*Account) ElementType() reflect.Type {
return reflect.TypeOf((**Account)(nil)).Elem()
}
func (i *Account) ToAccountOutput() AccountOutput {
return i.ToAccountOutputWithContext(context.Background())
}
func (i *Account) ToAccountOutputWithContext(ctx context.Context) AccountOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccountOutput)
}
// AccountArrayInput is an input type that accepts AccountArray and AccountArrayOutput values.
// You can construct a concrete instance of `AccountArrayInput` via:
//
// AccountArray{ AccountArgs{...} }
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/cosmosdb/getRestorableDatabaseAccounts.go | sdk/go/azure/cosmosdb/getRestorableDatabaseAccounts.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cosmosdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about Cosmos DB Restorable Database Accounts.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cosmosdb.GetRestorableDatabaseAccounts(ctx, &cosmosdb.GetRestorableDatabaseAccountsArgs{
// Name: "example-ca",
// Location: "West Europe",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
func GetRestorableDatabaseAccounts(ctx *pulumi.Context, args *GetRestorableDatabaseAccountsArgs, opts ...pulumi.InvokeOption) (*GetRestorableDatabaseAccountsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetRestorableDatabaseAccountsResult
err := ctx.Invoke("azure:cosmosdb/getRestorableDatabaseAccounts:getRestorableDatabaseAccounts", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getRestorableDatabaseAccounts.
type GetRestorableDatabaseAccountsArgs struct {
// The location where the Cosmos DB Database Account.
Location string `pulumi:"location"`
// The name of this Cosmos DB Database Account.
Name string `pulumi:"name"`
}
// A collection of values returned by getRestorableDatabaseAccounts.
type GetRestorableDatabaseAccountsResult struct {
// One or more `accounts` blocks as defined below.
Accounts []GetRestorableDatabaseAccountsAccount `pulumi:"accounts"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The location of the regional Cosmos DB Restorable Database Account.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
}
func GetRestorableDatabaseAccountsOutput(ctx *pulumi.Context, args GetRestorableDatabaseAccountsOutputArgs, opts ...pulumi.InvokeOption) GetRestorableDatabaseAccountsResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (GetRestorableDatabaseAccountsResultOutput, error) {
args := v.(GetRestorableDatabaseAccountsArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:cosmosdb/getRestorableDatabaseAccounts:getRestorableDatabaseAccounts", args, GetRestorableDatabaseAccountsResultOutput{}, options).(GetRestorableDatabaseAccountsResultOutput), nil
}).(GetRestorableDatabaseAccountsResultOutput)
}
// A collection of arguments for invoking getRestorableDatabaseAccounts.
type GetRestorableDatabaseAccountsOutputArgs struct {
// The location where the Cosmos DB Database Account.
Location pulumi.StringInput `pulumi:"location"`
// The name of this Cosmos DB Database Account.
Name pulumi.StringInput `pulumi:"name"`
}
func (GetRestorableDatabaseAccountsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetRestorableDatabaseAccountsArgs)(nil)).Elem()
}
// A collection of values returned by getRestorableDatabaseAccounts.
type GetRestorableDatabaseAccountsResultOutput struct{ *pulumi.OutputState }
func (GetRestorableDatabaseAccountsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetRestorableDatabaseAccountsResult)(nil)).Elem()
}
func (o GetRestorableDatabaseAccountsResultOutput) ToGetRestorableDatabaseAccountsResultOutput() GetRestorableDatabaseAccountsResultOutput {
return o
}
func (o GetRestorableDatabaseAccountsResultOutput) ToGetRestorableDatabaseAccountsResultOutputWithContext(ctx context.Context) GetRestorableDatabaseAccountsResultOutput {
return o
}
// One or more `accounts` blocks as defined below.
func (o GetRestorableDatabaseAccountsResultOutput) Accounts() GetRestorableDatabaseAccountsAccountArrayOutput {
return o.ApplyT(func(v GetRestorableDatabaseAccountsResult) []GetRestorableDatabaseAccountsAccount { return v.Accounts }).(GetRestorableDatabaseAccountsAccountArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetRestorableDatabaseAccountsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetRestorableDatabaseAccountsResult) string { return v.Id }).(pulumi.StringOutput)
}
// The location of the regional Cosmos DB Restorable Database Account.
func (o GetRestorableDatabaseAccountsResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v GetRestorableDatabaseAccountsResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o GetRestorableDatabaseAccountsResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetRestorableDatabaseAccountsResult) string { return v.Name }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetRestorableDatabaseAccountsResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/waf/policy.go | sdk/go/azure/waf/policy.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package waf
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Azure Web Application Firewall Policy instance.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/waf"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-rg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = waf.NewPolicy(ctx, "example", &waf.PolicyArgs{
// Name: pulumi.String("example-wafpolicy"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// CustomRules: waf.PolicyCustomRuleArray{
// &waf.PolicyCustomRuleArgs{
// Name: pulumi.String("Rule1"),
// Priority: pulumi.Int(1),
// RuleType: pulumi.String("MatchRule"),
// MatchConditions: waf.PolicyCustomRuleMatchConditionArray{
// &waf.PolicyCustomRuleMatchConditionArgs{
// MatchVariables: waf.PolicyCustomRuleMatchConditionMatchVariableArray{
// &waf.PolicyCustomRuleMatchConditionMatchVariableArgs{
// VariableName: pulumi.String("RemoteAddr"),
// },
// },
// Operator: pulumi.String("IPMatch"),
// NegationCondition: pulumi.Bool(false),
// MatchValues: pulumi.StringArray{
// pulumi.String("192.168.1.0/24"),
// pulumi.String("10.0.0.0/24"),
// },
// },
// },
// Action: pulumi.String("Block"),
// },
// &waf.PolicyCustomRuleArgs{
// Name: pulumi.String("Rule2"),
// Priority: pulumi.Int(2),
// RuleType: pulumi.String("MatchRule"),
// MatchConditions: waf.PolicyCustomRuleMatchConditionArray{
// &waf.PolicyCustomRuleMatchConditionArgs{
// MatchVariables: waf.PolicyCustomRuleMatchConditionMatchVariableArray{
// &waf.PolicyCustomRuleMatchConditionMatchVariableArgs{
// VariableName: pulumi.String("RemoteAddr"),
// },
// },
// Operator: pulumi.String("IPMatch"),
// NegationCondition: pulumi.Bool(false),
// MatchValues: pulumi.StringArray{
// pulumi.String("192.168.1.0/24"),
// },
// },
// &waf.PolicyCustomRuleMatchConditionArgs{
// MatchVariables: waf.PolicyCustomRuleMatchConditionMatchVariableArray{
// &waf.PolicyCustomRuleMatchConditionMatchVariableArgs{
// VariableName: pulumi.String("RequestHeaders"),
// Selector: pulumi.String("UserAgent"),
// },
// },
// Operator: pulumi.String("Contains"),
// NegationCondition: pulumi.Bool(false),
// MatchValues: pulumi.StringArray{
// pulumi.String("Windows"),
// },
// },
// },
// Action: pulumi.String("Block"),
// },
// },
// PolicySettings: &waf.PolicyPolicySettingsArgs{
// Enabled: pulumi.Bool(true),
// Mode: pulumi.String("Prevention"),
// RequestBodyCheck: pulumi.Bool(true),
// FileUploadLimitInMb: pulumi.Int(100),
// MaxRequestBodySizeInKb: pulumi.Int(128),
// },
// ManagedRules: &waf.PolicyManagedRulesArgs{
// Exclusions: waf.PolicyManagedRulesExclusionArray{
// &waf.PolicyManagedRulesExclusionArgs{
// MatchVariable: pulumi.String("RequestHeaderNames"),
// Selector: pulumi.String("x-company-secret-header"),
// SelectorMatchOperator: pulumi.String("Equals"),
// },
// &waf.PolicyManagedRulesExclusionArgs{
// MatchVariable: pulumi.String("RequestCookieNames"),
// Selector: pulumi.String("too-tasty"),
// SelectorMatchOperator: pulumi.String("EndsWith"),
// },
// },
// ManagedRuleSets: waf.PolicyManagedRulesManagedRuleSetArray{
// &waf.PolicyManagedRulesManagedRuleSetArgs{
// Type: pulumi.String("OWASP"),
// Version: pulumi.String("3.2"),
// RuleGroupOverrides: waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArray{
// &waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs{
// RuleGroupName: pulumi.String("REQUEST-920-PROTOCOL-ENFORCEMENT"),
// Rules: waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArray{
// &waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs{
// Id: pulumi.String("920300"),
// Enabled: pulumi.Bool(true),
// Action: pulumi.String("Log"),
// },
// &waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs{
// Id: pulumi.String("920440"),
// Enabled: pulumi.Bool(true),
// Action: pulumi.String("Block"),
// },
// },
// },
// },
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Network` - 2025-01-01
//
// ## Import
//
// Web Application Firewall Policy can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:waf/policy:Policy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/example-wafpolicy
// ```
type Policy struct {
pulumi.CustomResourceState
// One or more `customRules` blocks as defined below.
CustomRules PolicyCustomRuleArrayOutput `pulumi:"customRules"`
// A list of HTTP Listener IDs from an `network.ApplicationGateway`.
HttpListenerIds pulumi.StringArrayOutput `pulumi:"httpListenerIds"`
// Resource location. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// A `managedRules` blocks as defined below.
ManagedRules PolicyManagedRulesOutput `pulumi:"managedRules"`
// The name of the policy. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A list of URL Path Map Path Rule IDs from an `network.ApplicationGateway`.
PathBasedRuleIds pulumi.StringArrayOutput `pulumi:"pathBasedRuleIds"`
// A `policySettings` block as defined below.
PolicySettings PolicyPolicySettingsPtrOutput `pulumi:"policySettings"`
// The name of the resource group. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the Web Application Firewall Policy.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewPolicy registers a new resource with the given unique name, arguments, and options.
func NewPolicy(ctx *pulumi.Context,
name string, args *PolicyArgs, opts ...pulumi.ResourceOption) (*Policy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ManagedRules == nil {
return nil, errors.New("invalid value for required argument 'ManagedRules'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Policy
err := ctx.RegisterResource("azure:waf/policy:Policy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPolicy gets an existing Policy resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PolicyState, opts ...pulumi.ResourceOption) (*Policy, error) {
var resource Policy
err := ctx.ReadResource("azure:waf/policy:Policy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Policy resources.
type policyState struct {
// One or more `customRules` blocks as defined below.
CustomRules []PolicyCustomRule `pulumi:"customRules"`
// A list of HTTP Listener IDs from an `network.ApplicationGateway`.
HttpListenerIds []string `pulumi:"httpListenerIds"`
// Resource location. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A `managedRules` blocks as defined below.
ManagedRules *PolicyManagedRules `pulumi:"managedRules"`
// The name of the policy. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A list of URL Path Map Path Rule IDs from an `network.ApplicationGateway`.
PathBasedRuleIds []string `pulumi:"pathBasedRuleIds"`
// A `policySettings` block as defined below.
PolicySettings *PolicyPolicySettings `pulumi:"policySettings"`
// The name of the resource group. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the Web Application Firewall Policy.
Tags map[string]string `pulumi:"tags"`
}
type PolicyState struct {
// One or more `customRules` blocks as defined below.
CustomRules PolicyCustomRuleArrayInput
// A list of HTTP Listener IDs from an `network.ApplicationGateway`.
HttpListenerIds pulumi.StringArrayInput
// Resource location. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A `managedRules` blocks as defined below.
ManagedRules PolicyManagedRulesPtrInput
// The name of the policy. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A list of URL Path Map Path Rule IDs from an `network.ApplicationGateway`.
PathBasedRuleIds pulumi.StringArrayInput
// A `policySettings` block as defined below.
PolicySettings PolicyPolicySettingsPtrInput
// The name of the resource group. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags to assign to the Web Application Firewall Policy.
Tags pulumi.StringMapInput
}
func (PolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*policyState)(nil)).Elem()
}
type policyArgs struct {
// One or more `customRules` blocks as defined below.
CustomRules []PolicyCustomRule `pulumi:"customRules"`
// Resource location. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// A `managedRules` blocks as defined below.
ManagedRules PolicyManagedRules `pulumi:"managedRules"`
// The name of the policy. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `policySettings` block as defined below.
PolicySettings *PolicyPolicySettings `pulumi:"policySettings"`
// The name of the resource group. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the Web Application Firewall Policy.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Policy resource.
type PolicyArgs struct {
// One or more `customRules` blocks as defined below.
CustomRules PolicyCustomRuleArrayInput
// Resource location. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// A `managedRules` blocks as defined below.
ManagedRules PolicyManagedRulesInput
// The name of the policy. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `policySettings` block as defined below.
PolicySettings PolicyPolicySettingsPtrInput
// The name of the resource group. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags to assign to the Web Application Firewall Policy.
Tags pulumi.StringMapInput
}
func (PolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*policyArgs)(nil)).Elem()
}
type PolicyInput interface {
pulumi.Input
ToPolicyOutput() PolicyOutput
ToPolicyOutputWithContext(ctx context.Context) PolicyOutput
}
func (*Policy) ElementType() reflect.Type {
return reflect.TypeOf((**Policy)(nil)).Elem()
}
func (i *Policy) ToPolicyOutput() PolicyOutput {
return i.ToPolicyOutputWithContext(context.Background())
}
func (i *Policy) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyOutput)
}
// PolicyArrayInput is an input type that accepts PolicyArray and PolicyArrayOutput values.
// You can construct a concrete instance of `PolicyArrayInput` via:
//
// PolicyArray{ PolicyArgs{...} }
type PolicyArrayInput interface {
pulumi.Input
ToPolicyArrayOutput() PolicyArrayOutput
ToPolicyArrayOutputWithContext(context.Context) PolicyArrayOutput
}
type PolicyArray []PolicyInput
func (PolicyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Policy)(nil)).Elem()
}
func (i PolicyArray) ToPolicyArrayOutput() PolicyArrayOutput {
return i.ToPolicyArrayOutputWithContext(context.Background())
}
func (i PolicyArray) ToPolicyArrayOutputWithContext(ctx context.Context) PolicyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyArrayOutput)
}
// PolicyMapInput is an input type that accepts PolicyMap and PolicyMapOutput values.
// You can construct a concrete instance of `PolicyMapInput` via:
//
// PolicyMap{ "key": PolicyArgs{...} }
type PolicyMapInput interface {
pulumi.Input
ToPolicyMapOutput() PolicyMapOutput
ToPolicyMapOutputWithContext(context.Context) PolicyMapOutput
}
type PolicyMap map[string]PolicyInput
func (PolicyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Policy)(nil)).Elem()
}
func (i PolicyMap) ToPolicyMapOutput() PolicyMapOutput {
return i.ToPolicyMapOutputWithContext(context.Background())
}
func (i PolicyMap) ToPolicyMapOutputWithContext(ctx context.Context) PolicyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyMapOutput)
}
type PolicyOutput struct{ *pulumi.OutputState }
func (PolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Policy)(nil)).Elem()
}
func (o PolicyOutput) ToPolicyOutput() PolicyOutput {
return o
}
func (o PolicyOutput) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput {
return o
}
// One or more `customRules` blocks as defined below.
func (o PolicyOutput) CustomRules() PolicyCustomRuleArrayOutput {
return o.ApplyT(func(v *Policy) PolicyCustomRuleArrayOutput { return v.CustomRules }).(PolicyCustomRuleArrayOutput)
}
// A list of HTTP Listener IDs from an `network.ApplicationGateway`.
func (o PolicyOutput) HttpListenerIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Policy) pulumi.StringArrayOutput { return v.HttpListenerIds }).(pulumi.StringArrayOutput)
}
// Resource location. Changing this forces a new resource to be created.
func (o PolicyOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// A `managedRules` blocks as defined below.
func (o PolicyOutput) ManagedRules() PolicyManagedRulesOutput {
return o.ApplyT(func(v *Policy) PolicyManagedRulesOutput { return v.ManagedRules }).(PolicyManagedRulesOutput)
}
// The name of the policy. Changing this forces a new resource to be created.
func (o PolicyOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A list of URL Path Map Path Rule IDs from an `network.ApplicationGateway`.
func (o PolicyOutput) PathBasedRuleIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Policy) pulumi.StringArrayOutput { return v.PathBasedRuleIds }).(pulumi.StringArrayOutput)
}
// A `policySettings` block as defined below.
func (o PolicyOutput) PolicySettings() PolicyPolicySettingsPtrOutput {
return o.ApplyT(func(v *Policy) PolicyPolicySettingsPtrOutput { return v.PolicySettings }).(PolicyPolicySettingsPtrOutput)
}
// The name of the resource group. Changing this forces a new resource to be created.
func (o PolicyOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags to assign to the Web Application Firewall Policy.
func (o PolicyOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Policy) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type PolicyArrayOutput struct{ *pulumi.OutputState }
func (PolicyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Policy)(nil)).Elem()
}
func (o PolicyArrayOutput) ToPolicyArrayOutput() PolicyArrayOutput {
return o
}
func (o PolicyArrayOutput) ToPolicyArrayOutputWithContext(ctx context.Context) PolicyArrayOutput {
return o
}
func (o PolicyArrayOutput) Index(i pulumi.IntInput) PolicyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Policy {
return vs[0].([]*Policy)[vs[1].(int)]
}).(PolicyOutput)
}
type PolicyMapOutput struct{ *pulumi.OutputState }
func (PolicyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Policy)(nil)).Elem()
}
func (o PolicyMapOutput) ToPolicyMapOutput() PolicyMapOutput {
return o
}
func (o PolicyMapOutput) ToPolicyMapOutputWithContext(ctx context.Context) PolicyMapOutput {
return o
}
func (o PolicyMapOutput) MapIndex(k pulumi.StringInput) PolicyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Policy {
return vs[0].(map[string]*Policy)[vs[1].(string)]
}).(PolicyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PolicyInput)(nil)).Elem(), &Policy{})
pulumi.RegisterInputType(reflect.TypeOf((*PolicyArrayInput)(nil)).Elem(), PolicyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PolicyMapInput)(nil)).Elem(), PolicyMap{})
pulumi.RegisterOutputType(PolicyOutput{})
pulumi.RegisterOutputType(PolicyArrayOutput{})
pulumi.RegisterOutputType(PolicyMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/waf/init.go | sdk/go/azure/waf/init.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package waf
import (
"fmt"
"github.com/blang/semver"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type module struct {
version semver.Version
}
func (m *module) Version() semver.Version {
return m.version
}
func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) {
switch typ {
case "azure:waf/policy:Policy":
r = &Policy{}
default:
return nil, fmt.Errorf("unknown resource type: %s", typ)
}
err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn))
return
}
func init() {
version, err := internal.PkgVersion()
if err != nil {
version = semver.Version{Major: 1}
}
pulumi.RegisterResourceModule(
"azure",
"waf/policy",
&module{version},
)
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/waf/pulumiTypes.go | sdk/go/azure/waf/pulumiTypes.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package waf
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
var _ = internal.GetEnvOrDefault
type PolicyCustomRule struct {
// Type of action. Possible values are `Allow`, `Block`, `JSChallenge` and `Log`.
//
// > **Note:** If the `ruleType` is specified as `RateLimitRule`, the `Allow` is not supported.
Action string `pulumi:"action"`
// Describes if the policy is in enabled state or disabled state. Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// Specifies what grouping the rate limit will count requests by. Possible values are `ClientAddr`, `ClientAddrXFFHeader`, `GeoLocation`, `GeoLocationXFFHeader` and `None`.
GroupRateLimitBy *string `pulumi:"groupRateLimitBy"`
// One or more `matchConditions` blocks as defined below.
MatchConditions []PolicyCustomRuleMatchCondition `pulumi:"matchConditions"`
// Gets name of the resource that is unique within a policy. This name can be used to access the resource.
Name *string `pulumi:"name"`
// Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
Priority int `pulumi:"priority"`
// Specifies the duration at which the rate limit policy will be applied. Should be used with `RateLimitRule` rule type. Possible values are `FiveMins` and `OneMin`.
RateLimitDuration *string `pulumi:"rateLimitDuration"`
// Specifies the threshold value for the rate limit policy. Must be greater than or equal to 1 if provided.
RateLimitThreshold *int `pulumi:"rateLimitThreshold"`
// Describes the type of rule. Possible values are `MatchRule`, `RateLimitRule` and `Invalid`.
RuleType string `pulumi:"ruleType"`
}
// PolicyCustomRuleInput is an input type that accepts PolicyCustomRuleArgs and PolicyCustomRuleOutput values.
// You can construct a concrete instance of `PolicyCustomRuleInput` via:
//
// PolicyCustomRuleArgs{...}
type PolicyCustomRuleInput interface {
pulumi.Input
ToPolicyCustomRuleOutput() PolicyCustomRuleOutput
ToPolicyCustomRuleOutputWithContext(context.Context) PolicyCustomRuleOutput
}
type PolicyCustomRuleArgs struct {
// Type of action. Possible values are `Allow`, `Block`, `JSChallenge` and `Log`.
//
// > **Note:** If the `ruleType` is specified as `RateLimitRule`, the `Allow` is not supported.
Action pulumi.StringInput `pulumi:"action"`
// Describes if the policy is in enabled state or disabled state. Defaults to `true`.
Enabled pulumi.BoolPtrInput `pulumi:"enabled"`
// Specifies what grouping the rate limit will count requests by. Possible values are `ClientAddr`, `ClientAddrXFFHeader`, `GeoLocation`, `GeoLocationXFFHeader` and `None`.
GroupRateLimitBy pulumi.StringPtrInput `pulumi:"groupRateLimitBy"`
// One or more `matchConditions` blocks as defined below.
MatchConditions PolicyCustomRuleMatchConditionArrayInput `pulumi:"matchConditions"`
// Gets name of the resource that is unique within a policy. This name can be used to access the resource.
Name pulumi.StringPtrInput `pulumi:"name"`
// Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
Priority pulumi.IntInput `pulumi:"priority"`
// Specifies the duration at which the rate limit policy will be applied. Should be used with `RateLimitRule` rule type. Possible values are `FiveMins` and `OneMin`.
RateLimitDuration pulumi.StringPtrInput `pulumi:"rateLimitDuration"`
// Specifies the threshold value for the rate limit policy. Must be greater than or equal to 1 if provided.
RateLimitThreshold pulumi.IntPtrInput `pulumi:"rateLimitThreshold"`
// Describes the type of rule. Possible values are `MatchRule`, `RateLimitRule` and `Invalid`.
RuleType pulumi.StringInput `pulumi:"ruleType"`
}
func (PolicyCustomRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyCustomRule)(nil)).Elem()
}
func (i PolicyCustomRuleArgs) ToPolicyCustomRuleOutput() PolicyCustomRuleOutput {
return i.ToPolicyCustomRuleOutputWithContext(context.Background())
}
func (i PolicyCustomRuleArgs) ToPolicyCustomRuleOutputWithContext(ctx context.Context) PolicyCustomRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyCustomRuleOutput)
}
// PolicyCustomRuleArrayInput is an input type that accepts PolicyCustomRuleArray and PolicyCustomRuleArrayOutput values.
// You can construct a concrete instance of `PolicyCustomRuleArrayInput` via:
//
// PolicyCustomRuleArray{ PolicyCustomRuleArgs{...} }
type PolicyCustomRuleArrayInput interface {
pulumi.Input
ToPolicyCustomRuleArrayOutput() PolicyCustomRuleArrayOutput
ToPolicyCustomRuleArrayOutputWithContext(context.Context) PolicyCustomRuleArrayOutput
}
type PolicyCustomRuleArray []PolicyCustomRuleInput
func (PolicyCustomRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyCustomRule)(nil)).Elem()
}
func (i PolicyCustomRuleArray) ToPolicyCustomRuleArrayOutput() PolicyCustomRuleArrayOutput {
return i.ToPolicyCustomRuleArrayOutputWithContext(context.Background())
}
func (i PolicyCustomRuleArray) ToPolicyCustomRuleArrayOutputWithContext(ctx context.Context) PolicyCustomRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyCustomRuleArrayOutput)
}
type PolicyCustomRuleOutput struct{ *pulumi.OutputState }
func (PolicyCustomRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyCustomRule)(nil)).Elem()
}
func (o PolicyCustomRuleOutput) ToPolicyCustomRuleOutput() PolicyCustomRuleOutput {
return o
}
func (o PolicyCustomRuleOutput) ToPolicyCustomRuleOutputWithContext(ctx context.Context) PolicyCustomRuleOutput {
return o
}
// Type of action. Possible values are `Allow`, `Block`, `JSChallenge` and `Log`.
//
// > **Note:** If the `ruleType` is specified as `RateLimitRule`, the `Allow` is not supported.
func (o PolicyCustomRuleOutput) Action() pulumi.StringOutput {
return o.ApplyT(func(v PolicyCustomRule) string { return v.Action }).(pulumi.StringOutput)
}
// Describes if the policy is in enabled state or disabled state. Defaults to `true`.
func (o PolicyCustomRuleOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v PolicyCustomRule) *bool { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// Specifies what grouping the rate limit will count requests by. Possible values are `ClientAddr`, `ClientAddrXFFHeader`, `GeoLocation`, `GeoLocationXFFHeader` and `None`.
func (o PolicyCustomRuleOutput) GroupRateLimitBy() pulumi.StringPtrOutput {
return o.ApplyT(func(v PolicyCustomRule) *string { return v.GroupRateLimitBy }).(pulumi.StringPtrOutput)
}
// One or more `matchConditions` blocks as defined below.
func (o PolicyCustomRuleOutput) MatchConditions() PolicyCustomRuleMatchConditionArrayOutput {
return o.ApplyT(func(v PolicyCustomRule) []PolicyCustomRuleMatchCondition { return v.MatchConditions }).(PolicyCustomRuleMatchConditionArrayOutput)
}
// Gets name of the resource that is unique within a policy. This name can be used to access the resource.
func (o PolicyCustomRuleOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v PolicyCustomRule) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
func (o PolicyCustomRuleOutput) Priority() pulumi.IntOutput {
return o.ApplyT(func(v PolicyCustomRule) int { return v.Priority }).(pulumi.IntOutput)
}
// Specifies the duration at which the rate limit policy will be applied. Should be used with `RateLimitRule` rule type. Possible values are `FiveMins` and `OneMin`.
func (o PolicyCustomRuleOutput) RateLimitDuration() pulumi.StringPtrOutput {
return o.ApplyT(func(v PolicyCustomRule) *string { return v.RateLimitDuration }).(pulumi.StringPtrOutput)
}
// Specifies the threshold value for the rate limit policy. Must be greater than or equal to 1 if provided.
func (o PolicyCustomRuleOutput) RateLimitThreshold() pulumi.IntPtrOutput {
return o.ApplyT(func(v PolicyCustomRule) *int { return v.RateLimitThreshold }).(pulumi.IntPtrOutput)
}
// Describes the type of rule. Possible values are `MatchRule`, `RateLimitRule` and `Invalid`.
func (o PolicyCustomRuleOutput) RuleType() pulumi.StringOutput {
return o.ApplyT(func(v PolicyCustomRule) string { return v.RuleType }).(pulumi.StringOutput)
}
type PolicyCustomRuleArrayOutput struct{ *pulumi.OutputState }
func (PolicyCustomRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyCustomRule)(nil)).Elem()
}
func (o PolicyCustomRuleArrayOutput) ToPolicyCustomRuleArrayOutput() PolicyCustomRuleArrayOutput {
return o
}
func (o PolicyCustomRuleArrayOutput) ToPolicyCustomRuleArrayOutputWithContext(ctx context.Context) PolicyCustomRuleArrayOutput {
return o
}
func (o PolicyCustomRuleArrayOutput) Index(i pulumi.IntInput) PolicyCustomRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) PolicyCustomRule {
return vs[0].([]PolicyCustomRule)[vs[1].(int)]
}).(PolicyCustomRuleOutput)
}
type PolicyCustomRuleMatchCondition struct {
// A list of match values. This is **Required** when the `operator` is not `Any`.
MatchValues []string `pulumi:"matchValues"`
// One or more `matchVariables` blocks as defined below.
MatchVariables []PolicyCustomRuleMatchConditionMatchVariable `pulumi:"matchVariables"`
// Describes if this is negate condition or not
NegationCondition *bool `pulumi:"negationCondition"`
// Describes operator to be matched. Possible values are `Any`, `IPMatch`, `GeoMatch`, `Equal`, `Contains`, `LessThan`, `GreaterThan`, `LessThanOrEqual`, `GreaterThanOrEqual`, `BeginsWith`, `EndsWith` and `Regex`.
Operator string `pulumi:"operator"`
// A list of transformations to do before the match is attempted. Possible values are `HtmlEntityDecode`, `Lowercase`, `RemoveNulls`, `Trim`, `Uppercase`, `UrlDecode` and `UrlEncode`.
Transforms []string `pulumi:"transforms"`
}
// PolicyCustomRuleMatchConditionInput is an input type that accepts PolicyCustomRuleMatchConditionArgs and PolicyCustomRuleMatchConditionOutput values.
// You can construct a concrete instance of `PolicyCustomRuleMatchConditionInput` via:
//
// PolicyCustomRuleMatchConditionArgs{...}
type PolicyCustomRuleMatchConditionInput interface {
pulumi.Input
ToPolicyCustomRuleMatchConditionOutput() PolicyCustomRuleMatchConditionOutput
ToPolicyCustomRuleMatchConditionOutputWithContext(context.Context) PolicyCustomRuleMatchConditionOutput
}
type PolicyCustomRuleMatchConditionArgs struct {
// A list of match values. This is **Required** when the `operator` is not `Any`.
MatchValues pulumi.StringArrayInput `pulumi:"matchValues"`
// One or more `matchVariables` blocks as defined below.
MatchVariables PolicyCustomRuleMatchConditionMatchVariableArrayInput `pulumi:"matchVariables"`
// Describes if this is negate condition or not
NegationCondition pulumi.BoolPtrInput `pulumi:"negationCondition"`
// Describes operator to be matched. Possible values are `Any`, `IPMatch`, `GeoMatch`, `Equal`, `Contains`, `LessThan`, `GreaterThan`, `LessThanOrEqual`, `GreaterThanOrEqual`, `BeginsWith`, `EndsWith` and `Regex`.
Operator pulumi.StringInput `pulumi:"operator"`
// A list of transformations to do before the match is attempted. Possible values are `HtmlEntityDecode`, `Lowercase`, `RemoveNulls`, `Trim`, `Uppercase`, `UrlDecode` and `UrlEncode`.
Transforms pulumi.StringArrayInput `pulumi:"transforms"`
}
func (PolicyCustomRuleMatchConditionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyCustomRuleMatchCondition)(nil)).Elem()
}
func (i PolicyCustomRuleMatchConditionArgs) ToPolicyCustomRuleMatchConditionOutput() PolicyCustomRuleMatchConditionOutput {
return i.ToPolicyCustomRuleMatchConditionOutputWithContext(context.Background())
}
func (i PolicyCustomRuleMatchConditionArgs) ToPolicyCustomRuleMatchConditionOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyCustomRuleMatchConditionOutput)
}
// PolicyCustomRuleMatchConditionArrayInput is an input type that accepts PolicyCustomRuleMatchConditionArray and PolicyCustomRuleMatchConditionArrayOutput values.
// You can construct a concrete instance of `PolicyCustomRuleMatchConditionArrayInput` via:
//
// PolicyCustomRuleMatchConditionArray{ PolicyCustomRuleMatchConditionArgs{...} }
type PolicyCustomRuleMatchConditionArrayInput interface {
pulumi.Input
ToPolicyCustomRuleMatchConditionArrayOutput() PolicyCustomRuleMatchConditionArrayOutput
ToPolicyCustomRuleMatchConditionArrayOutputWithContext(context.Context) PolicyCustomRuleMatchConditionArrayOutput
}
type PolicyCustomRuleMatchConditionArray []PolicyCustomRuleMatchConditionInput
func (PolicyCustomRuleMatchConditionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyCustomRuleMatchCondition)(nil)).Elem()
}
func (i PolicyCustomRuleMatchConditionArray) ToPolicyCustomRuleMatchConditionArrayOutput() PolicyCustomRuleMatchConditionArrayOutput {
return i.ToPolicyCustomRuleMatchConditionArrayOutputWithContext(context.Background())
}
func (i PolicyCustomRuleMatchConditionArray) ToPolicyCustomRuleMatchConditionArrayOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyCustomRuleMatchConditionArrayOutput)
}
type PolicyCustomRuleMatchConditionOutput struct{ *pulumi.OutputState }
func (PolicyCustomRuleMatchConditionOutput) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyCustomRuleMatchCondition)(nil)).Elem()
}
func (o PolicyCustomRuleMatchConditionOutput) ToPolicyCustomRuleMatchConditionOutput() PolicyCustomRuleMatchConditionOutput {
return o
}
func (o PolicyCustomRuleMatchConditionOutput) ToPolicyCustomRuleMatchConditionOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionOutput {
return o
}
// A list of match values. This is **Required** when the `operator` is not `Any`.
func (o PolicyCustomRuleMatchConditionOutput) MatchValues() pulumi.StringArrayOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchCondition) []string { return v.MatchValues }).(pulumi.StringArrayOutput)
}
// One or more `matchVariables` blocks as defined below.
func (o PolicyCustomRuleMatchConditionOutput) MatchVariables() PolicyCustomRuleMatchConditionMatchVariableArrayOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchCondition) []PolicyCustomRuleMatchConditionMatchVariable {
return v.MatchVariables
}).(PolicyCustomRuleMatchConditionMatchVariableArrayOutput)
}
// Describes if this is negate condition or not
func (o PolicyCustomRuleMatchConditionOutput) NegationCondition() pulumi.BoolPtrOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchCondition) *bool { return v.NegationCondition }).(pulumi.BoolPtrOutput)
}
// Describes operator to be matched. Possible values are `Any`, `IPMatch`, `GeoMatch`, `Equal`, `Contains`, `LessThan`, `GreaterThan`, `LessThanOrEqual`, `GreaterThanOrEqual`, `BeginsWith`, `EndsWith` and `Regex`.
func (o PolicyCustomRuleMatchConditionOutput) Operator() pulumi.StringOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchCondition) string { return v.Operator }).(pulumi.StringOutput)
}
// A list of transformations to do before the match is attempted. Possible values are `HtmlEntityDecode`, `Lowercase`, `RemoveNulls`, `Trim`, `Uppercase`, `UrlDecode` and `UrlEncode`.
func (o PolicyCustomRuleMatchConditionOutput) Transforms() pulumi.StringArrayOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchCondition) []string { return v.Transforms }).(pulumi.StringArrayOutput)
}
type PolicyCustomRuleMatchConditionArrayOutput struct{ *pulumi.OutputState }
func (PolicyCustomRuleMatchConditionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyCustomRuleMatchCondition)(nil)).Elem()
}
func (o PolicyCustomRuleMatchConditionArrayOutput) ToPolicyCustomRuleMatchConditionArrayOutput() PolicyCustomRuleMatchConditionArrayOutput {
return o
}
func (o PolicyCustomRuleMatchConditionArrayOutput) ToPolicyCustomRuleMatchConditionArrayOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionArrayOutput {
return o
}
func (o PolicyCustomRuleMatchConditionArrayOutput) Index(i pulumi.IntInput) PolicyCustomRuleMatchConditionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) PolicyCustomRuleMatchCondition {
return vs[0].([]PolicyCustomRuleMatchCondition)[vs[1].(int)]
}).(PolicyCustomRuleMatchConditionOutput)
}
type PolicyCustomRuleMatchConditionMatchVariable struct {
// Describes field of the matchVariable collection
Selector *string `pulumi:"selector"`
// The name of the Match Variable. Possible values are `RemoteAddr`, `RequestMethod`, `QueryString`, `PostArgs`, `RequestUri`, `RequestHeaders`, `RequestBody` and `RequestCookies`.
VariableName string `pulumi:"variableName"`
}
// PolicyCustomRuleMatchConditionMatchVariableInput is an input type that accepts PolicyCustomRuleMatchConditionMatchVariableArgs and PolicyCustomRuleMatchConditionMatchVariableOutput values.
// You can construct a concrete instance of `PolicyCustomRuleMatchConditionMatchVariableInput` via:
//
// PolicyCustomRuleMatchConditionMatchVariableArgs{...}
type PolicyCustomRuleMatchConditionMatchVariableInput interface {
pulumi.Input
ToPolicyCustomRuleMatchConditionMatchVariableOutput() PolicyCustomRuleMatchConditionMatchVariableOutput
ToPolicyCustomRuleMatchConditionMatchVariableOutputWithContext(context.Context) PolicyCustomRuleMatchConditionMatchVariableOutput
}
type PolicyCustomRuleMatchConditionMatchVariableArgs struct {
// Describes field of the matchVariable collection
Selector pulumi.StringPtrInput `pulumi:"selector"`
// The name of the Match Variable. Possible values are `RemoteAddr`, `RequestMethod`, `QueryString`, `PostArgs`, `RequestUri`, `RequestHeaders`, `RequestBody` and `RequestCookies`.
VariableName pulumi.StringInput `pulumi:"variableName"`
}
func (PolicyCustomRuleMatchConditionMatchVariableArgs) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyCustomRuleMatchConditionMatchVariable)(nil)).Elem()
}
func (i PolicyCustomRuleMatchConditionMatchVariableArgs) ToPolicyCustomRuleMatchConditionMatchVariableOutput() PolicyCustomRuleMatchConditionMatchVariableOutput {
return i.ToPolicyCustomRuleMatchConditionMatchVariableOutputWithContext(context.Background())
}
func (i PolicyCustomRuleMatchConditionMatchVariableArgs) ToPolicyCustomRuleMatchConditionMatchVariableOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionMatchVariableOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyCustomRuleMatchConditionMatchVariableOutput)
}
// PolicyCustomRuleMatchConditionMatchVariableArrayInput is an input type that accepts PolicyCustomRuleMatchConditionMatchVariableArray and PolicyCustomRuleMatchConditionMatchVariableArrayOutput values.
// You can construct a concrete instance of `PolicyCustomRuleMatchConditionMatchVariableArrayInput` via:
//
// PolicyCustomRuleMatchConditionMatchVariableArray{ PolicyCustomRuleMatchConditionMatchVariableArgs{...} }
type PolicyCustomRuleMatchConditionMatchVariableArrayInput interface {
pulumi.Input
ToPolicyCustomRuleMatchConditionMatchVariableArrayOutput() PolicyCustomRuleMatchConditionMatchVariableArrayOutput
ToPolicyCustomRuleMatchConditionMatchVariableArrayOutputWithContext(context.Context) PolicyCustomRuleMatchConditionMatchVariableArrayOutput
}
type PolicyCustomRuleMatchConditionMatchVariableArray []PolicyCustomRuleMatchConditionMatchVariableInput
func (PolicyCustomRuleMatchConditionMatchVariableArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyCustomRuleMatchConditionMatchVariable)(nil)).Elem()
}
func (i PolicyCustomRuleMatchConditionMatchVariableArray) ToPolicyCustomRuleMatchConditionMatchVariableArrayOutput() PolicyCustomRuleMatchConditionMatchVariableArrayOutput {
return i.ToPolicyCustomRuleMatchConditionMatchVariableArrayOutputWithContext(context.Background())
}
func (i PolicyCustomRuleMatchConditionMatchVariableArray) ToPolicyCustomRuleMatchConditionMatchVariableArrayOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionMatchVariableArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyCustomRuleMatchConditionMatchVariableArrayOutput)
}
type PolicyCustomRuleMatchConditionMatchVariableOutput struct{ *pulumi.OutputState }
func (PolicyCustomRuleMatchConditionMatchVariableOutput) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyCustomRuleMatchConditionMatchVariable)(nil)).Elem()
}
func (o PolicyCustomRuleMatchConditionMatchVariableOutput) ToPolicyCustomRuleMatchConditionMatchVariableOutput() PolicyCustomRuleMatchConditionMatchVariableOutput {
return o
}
func (o PolicyCustomRuleMatchConditionMatchVariableOutput) ToPolicyCustomRuleMatchConditionMatchVariableOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionMatchVariableOutput {
return o
}
// Describes field of the matchVariable collection
func (o PolicyCustomRuleMatchConditionMatchVariableOutput) Selector() pulumi.StringPtrOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchConditionMatchVariable) *string { return v.Selector }).(pulumi.StringPtrOutput)
}
// The name of the Match Variable. Possible values are `RemoteAddr`, `RequestMethod`, `QueryString`, `PostArgs`, `RequestUri`, `RequestHeaders`, `RequestBody` and `RequestCookies`.
func (o PolicyCustomRuleMatchConditionMatchVariableOutput) VariableName() pulumi.StringOutput {
return o.ApplyT(func(v PolicyCustomRuleMatchConditionMatchVariable) string { return v.VariableName }).(pulumi.StringOutput)
}
type PolicyCustomRuleMatchConditionMatchVariableArrayOutput struct{ *pulumi.OutputState }
func (PolicyCustomRuleMatchConditionMatchVariableArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyCustomRuleMatchConditionMatchVariable)(nil)).Elem()
}
func (o PolicyCustomRuleMatchConditionMatchVariableArrayOutput) ToPolicyCustomRuleMatchConditionMatchVariableArrayOutput() PolicyCustomRuleMatchConditionMatchVariableArrayOutput {
return o
}
func (o PolicyCustomRuleMatchConditionMatchVariableArrayOutput) ToPolicyCustomRuleMatchConditionMatchVariableArrayOutputWithContext(ctx context.Context) PolicyCustomRuleMatchConditionMatchVariableArrayOutput {
return o
}
func (o PolicyCustomRuleMatchConditionMatchVariableArrayOutput) Index(i pulumi.IntInput) PolicyCustomRuleMatchConditionMatchVariableOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) PolicyCustomRuleMatchConditionMatchVariable {
return vs[0].([]PolicyCustomRuleMatchConditionMatchVariable)[vs[1].(int)]
}).(PolicyCustomRuleMatchConditionMatchVariableOutput)
}
type PolicyManagedRules struct {
// One or more `exclusion` block defined below.
Exclusions []PolicyManagedRulesExclusion `pulumi:"exclusions"`
// One or more `managedRuleSet` block defined below.
ManagedRuleSets []PolicyManagedRulesManagedRuleSet `pulumi:"managedRuleSets"`
}
// PolicyManagedRulesInput is an input type that accepts PolicyManagedRulesArgs and PolicyManagedRulesOutput values.
// You can construct a concrete instance of `PolicyManagedRulesInput` via:
//
// PolicyManagedRulesArgs{...}
type PolicyManagedRulesInput interface {
pulumi.Input
ToPolicyManagedRulesOutput() PolicyManagedRulesOutput
ToPolicyManagedRulesOutputWithContext(context.Context) PolicyManagedRulesOutput
}
type PolicyManagedRulesArgs struct {
// One or more `exclusion` block defined below.
Exclusions PolicyManagedRulesExclusionArrayInput `pulumi:"exclusions"`
// One or more `managedRuleSet` block defined below.
ManagedRuleSets PolicyManagedRulesManagedRuleSetArrayInput `pulumi:"managedRuleSets"`
}
func (PolicyManagedRulesArgs) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyManagedRules)(nil)).Elem()
}
func (i PolicyManagedRulesArgs) ToPolicyManagedRulesOutput() PolicyManagedRulesOutput {
return i.ToPolicyManagedRulesOutputWithContext(context.Background())
}
func (i PolicyManagedRulesArgs) ToPolicyManagedRulesOutputWithContext(ctx context.Context) PolicyManagedRulesOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyManagedRulesOutput)
}
func (i PolicyManagedRulesArgs) ToPolicyManagedRulesPtrOutput() PolicyManagedRulesPtrOutput {
return i.ToPolicyManagedRulesPtrOutputWithContext(context.Background())
}
func (i PolicyManagedRulesArgs) ToPolicyManagedRulesPtrOutputWithContext(ctx context.Context) PolicyManagedRulesPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyManagedRulesOutput).ToPolicyManagedRulesPtrOutputWithContext(ctx)
}
// PolicyManagedRulesPtrInput is an input type that accepts PolicyManagedRulesArgs, PolicyManagedRulesPtr and PolicyManagedRulesPtrOutput values.
// You can construct a concrete instance of `PolicyManagedRulesPtrInput` via:
//
// PolicyManagedRulesArgs{...}
//
// or:
//
// nil
type PolicyManagedRulesPtrInput interface {
pulumi.Input
ToPolicyManagedRulesPtrOutput() PolicyManagedRulesPtrOutput
ToPolicyManagedRulesPtrOutputWithContext(context.Context) PolicyManagedRulesPtrOutput
}
type policyManagedRulesPtrType PolicyManagedRulesArgs
func PolicyManagedRulesPtr(v *PolicyManagedRulesArgs) PolicyManagedRulesPtrInput {
return (*policyManagedRulesPtrType)(v)
}
func (*policyManagedRulesPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**PolicyManagedRules)(nil)).Elem()
}
func (i *policyManagedRulesPtrType) ToPolicyManagedRulesPtrOutput() PolicyManagedRulesPtrOutput {
return i.ToPolicyManagedRulesPtrOutputWithContext(context.Background())
}
func (i *policyManagedRulesPtrType) ToPolicyManagedRulesPtrOutputWithContext(ctx context.Context) PolicyManagedRulesPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyManagedRulesPtrOutput)
}
type PolicyManagedRulesOutput struct{ *pulumi.OutputState }
func (PolicyManagedRulesOutput) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyManagedRules)(nil)).Elem()
}
func (o PolicyManagedRulesOutput) ToPolicyManagedRulesOutput() PolicyManagedRulesOutput {
return o
}
func (o PolicyManagedRulesOutput) ToPolicyManagedRulesOutputWithContext(ctx context.Context) PolicyManagedRulesOutput {
return o
}
func (o PolicyManagedRulesOutput) ToPolicyManagedRulesPtrOutput() PolicyManagedRulesPtrOutput {
return o.ToPolicyManagedRulesPtrOutputWithContext(context.Background())
}
func (o PolicyManagedRulesOutput) ToPolicyManagedRulesPtrOutputWithContext(ctx context.Context) PolicyManagedRulesPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v PolicyManagedRules) *PolicyManagedRules {
return &v
}).(PolicyManagedRulesPtrOutput)
}
// One or more `exclusion` block defined below.
func (o PolicyManagedRulesOutput) Exclusions() PolicyManagedRulesExclusionArrayOutput {
return o.ApplyT(func(v PolicyManagedRules) []PolicyManagedRulesExclusion { return v.Exclusions }).(PolicyManagedRulesExclusionArrayOutput)
}
// One or more `managedRuleSet` block defined below.
func (o PolicyManagedRulesOutput) ManagedRuleSets() PolicyManagedRulesManagedRuleSetArrayOutput {
return o.ApplyT(func(v PolicyManagedRules) []PolicyManagedRulesManagedRuleSet { return v.ManagedRuleSets }).(PolicyManagedRulesManagedRuleSetArrayOutput)
}
type PolicyManagedRulesPtrOutput struct{ *pulumi.OutputState }
func (PolicyManagedRulesPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PolicyManagedRules)(nil)).Elem()
}
func (o PolicyManagedRulesPtrOutput) ToPolicyManagedRulesPtrOutput() PolicyManagedRulesPtrOutput {
return o
}
func (o PolicyManagedRulesPtrOutput) ToPolicyManagedRulesPtrOutputWithContext(ctx context.Context) PolicyManagedRulesPtrOutput {
return o
}
func (o PolicyManagedRulesPtrOutput) Elem() PolicyManagedRulesOutput {
return o.ApplyT(func(v *PolicyManagedRules) PolicyManagedRules {
if v != nil {
return *v
}
var ret PolicyManagedRules
return ret
}).(PolicyManagedRulesOutput)
}
// One or more `exclusion` block defined below.
func (o PolicyManagedRulesPtrOutput) Exclusions() PolicyManagedRulesExclusionArrayOutput {
return o.ApplyT(func(v *PolicyManagedRules) []PolicyManagedRulesExclusion {
if v == nil {
return nil
}
return v.Exclusions
}).(PolicyManagedRulesExclusionArrayOutput)
}
// One or more `managedRuleSet` block defined below.
func (o PolicyManagedRulesPtrOutput) ManagedRuleSets() PolicyManagedRulesManagedRuleSetArrayOutput {
return o.ApplyT(func(v *PolicyManagedRules) []PolicyManagedRulesManagedRuleSet {
if v == nil {
return nil
}
return v.ManagedRuleSets
}).(PolicyManagedRulesManagedRuleSetArrayOutput)
}
type PolicyManagedRulesExclusion struct {
// One or more `excludedRuleSet` block defined below.
ExcludedRuleSet *PolicyManagedRulesExclusionExcludedRuleSet `pulumi:"excludedRuleSet"`
// The name of the Match Variable. Possible values: `RequestArgKeys`, `RequestArgNames`, `RequestArgValues`, `RequestCookieKeys`, `RequestCookieNames`, `RequestCookieValues`, `RequestHeaderKeys`, `RequestHeaderNames`, `RequestHeaderValues`.
MatchVariable string `pulumi:"matchVariable"`
// Describes field of the matchVariable collection.
Selector string `pulumi:"selector"`
// Describes operator to be matched. Possible values: `Contains`, `EndsWith`, `Equals`, `EqualsAny`, `StartsWith`.
SelectorMatchOperator string `pulumi:"selectorMatchOperator"`
}
// PolicyManagedRulesExclusionInput is an input type that accepts PolicyManagedRulesExclusionArgs and PolicyManagedRulesExclusionOutput values.
// You can construct a concrete instance of `PolicyManagedRulesExclusionInput` via:
//
// PolicyManagedRulesExclusionArgs{...}
type PolicyManagedRulesExclusionInput interface {
pulumi.Input
ToPolicyManagedRulesExclusionOutput() PolicyManagedRulesExclusionOutput
ToPolicyManagedRulesExclusionOutputWithContext(context.Context) PolicyManagedRulesExclusionOutput
}
type PolicyManagedRulesExclusionArgs struct {
// One or more `excludedRuleSet` block defined below.
ExcludedRuleSet PolicyManagedRulesExclusionExcludedRuleSetPtrInput `pulumi:"excludedRuleSet"`
// The name of the Match Variable. Possible values: `RequestArgKeys`, `RequestArgNames`, `RequestArgValues`, `RequestCookieKeys`, `RequestCookieNames`, `RequestCookieValues`, `RequestHeaderKeys`, `RequestHeaderNames`, `RequestHeaderValues`.
MatchVariable pulumi.StringInput `pulumi:"matchVariable"`
// Describes field of the matchVariable collection.
Selector pulumi.StringInput `pulumi:"selector"`
// Describes operator to be matched. Possible values: `Contains`, `EndsWith`, `Equals`, `EqualsAny`, `StartsWith`.
SelectorMatchOperator pulumi.StringInput `pulumi:"selectorMatchOperator"`
}
func (PolicyManagedRulesExclusionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*PolicyManagedRulesExclusion)(nil)).Elem()
}
func (i PolicyManagedRulesExclusionArgs) ToPolicyManagedRulesExclusionOutput() PolicyManagedRulesExclusionOutput {
return i.ToPolicyManagedRulesExclusionOutputWithContext(context.Background())
}
func (i PolicyManagedRulesExclusionArgs) ToPolicyManagedRulesExclusionOutputWithContext(ctx context.Context) PolicyManagedRulesExclusionOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyManagedRulesExclusionOutput)
}
// PolicyManagedRulesExclusionArrayInput is an input type that accepts PolicyManagedRulesExclusionArray and PolicyManagedRulesExclusionArrayOutput values.
// You can construct a concrete instance of `PolicyManagedRulesExclusionArrayInput` via:
//
// PolicyManagedRulesExclusionArray{ PolicyManagedRulesExclusionArgs{...} }
type PolicyManagedRulesExclusionArrayInput interface {
pulumi.Input
ToPolicyManagedRulesExclusionArrayOutput() PolicyManagedRulesExclusionArrayOutput
ToPolicyManagedRulesExclusionArrayOutputWithContext(context.Context) PolicyManagedRulesExclusionArrayOutput
}
type PolicyManagedRulesExclusionArray []PolicyManagedRulesExclusionInput
func (PolicyManagedRulesExclusionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]PolicyManagedRulesExclusion)(nil)).Elem()
}
func (i PolicyManagedRulesExclusionArray) ToPolicyManagedRulesExclusionArrayOutput() PolicyManagedRulesExclusionArrayOutput {
return i.ToPolicyManagedRulesExclusionArrayOutputWithContext(context.Background())
}
func (i PolicyManagedRulesExclusionArray) ToPolicyManagedRulesExclusionArrayOutputWithContext(ctx context.Context) PolicyManagedRulesExclusionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyManagedRulesExclusionArrayOutput)
}
type PolicyManagedRulesExclusionOutput struct{ *pulumi.OutputState }
func (PolicyManagedRulesExclusionOutput) ElementType() reflect.Type {
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/waf/getFirewallPolicy.go | sdk/go/azure/waf/getFirewallPolicy.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package waf
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Web Application Firewall Policy.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/waf"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := waf.GetFirewallPolicy(ctx, &waf.GetFirewallPolicyArgs{
// ResourceGroupName: "existing",
// Name: "existing",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Network` - 2025-01-01
func GetFirewallPolicy(ctx *pulumi.Context, args *GetFirewallPolicyArgs, opts ...pulumi.InvokeOption) (*GetFirewallPolicyResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetFirewallPolicyResult
err := ctx.Invoke("azure:waf/getFirewallPolicy:getFirewallPolicy", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getFirewallPolicy.
type GetFirewallPolicyArgs struct {
// The name of the Web Application Firewall Policy
Name string `pulumi:"name"`
// The name of the Resource Group where the Web Application Firewall Policy exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getFirewallPolicy.
type GetFirewallPolicyResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Location string `pulumi:"location"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
Tags map[string]string `pulumi:"tags"`
}
func GetFirewallPolicyOutput(ctx *pulumi.Context, args GetFirewallPolicyOutputArgs, opts ...pulumi.InvokeOption) GetFirewallPolicyResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (GetFirewallPolicyResultOutput, error) {
args := v.(GetFirewallPolicyArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:waf/getFirewallPolicy:getFirewallPolicy", args, GetFirewallPolicyResultOutput{}, options).(GetFirewallPolicyResultOutput), nil
}).(GetFirewallPolicyResultOutput)
}
// A collection of arguments for invoking getFirewallPolicy.
type GetFirewallPolicyOutputArgs struct {
// The name of the Web Application Firewall Policy
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Web Application Firewall Policy exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (GetFirewallPolicyOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetFirewallPolicyArgs)(nil)).Elem()
}
// A collection of values returned by getFirewallPolicy.
type GetFirewallPolicyResultOutput struct{ *pulumi.OutputState }
func (GetFirewallPolicyResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetFirewallPolicyResult)(nil)).Elem()
}
func (o GetFirewallPolicyResultOutput) ToGetFirewallPolicyResultOutput() GetFirewallPolicyResultOutput {
return o
}
func (o GetFirewallPolicyResultOutput) ToGetFirewallPolicyResultOutputWithContext(ctx context.Context) GetFirewallPolicyResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetFirewallPolicyResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetFirewallPolicyResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetFirewallPolicyResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v GetFirewallPolicyResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o GetFirewallPolicyResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetFirewallPolicyResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o GetFirewallPolicyResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v GetFirewallPolicyResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o GetFirewallPolicyResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v GetFirewallPolicyResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(GetFirewallPolicyResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/packetCapture.go | sdk/go/azure/compute/packetCapture.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Configures Network Packet Capturing against a Virtual Machine using a Network Watcher.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleNetworkWatcher, err := network.NewNetworkWatcher(ctx, "example", &network.NetworkWatcherArgs{
// Name: pulumi.String("example-nw"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-network"),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "example", &network.NetworkInterfaceArgs{
// Name: pulumi.String("example-nic"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
// &network.NetworkInterfaceIpConfigurationArgs{
// Name: pulumi.String("testconfiguration1"),
// SubnetId: exampleSubnet.ID(),
// PrivateIpAddressAllocation: pulumi.String("Dynamic"),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "example", &compute.VirtualMachineArgs{
// Name: pulumi.String("example-vm"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// NetworkInterfaceIds: pulumi.StringArray{
// exampleNetworkInterface.ID(),
// },
// VmSize: pulumi.String("Standard_F2"),
// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{
// Publisher: pulumi.String("Canonical"),
// Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
// Sku: pulumi.String("22_04-lts"),
// Version: pulumi.String("latest"),
// },
// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{
// Name: pulumi.String("osdisk"),
// Caching: pulumi.String("ReadWrite"),
// CreateOption: pulumi.String("FromImage"),
// ManagedDiskType: pulumi.String("Standard_LRS"),
// },
// OsProfile: &compute.VirtualMachineOsProfileArgs{
// ComputerName: pulumi.String("pctest-vm"),
// AdminUsername: pulumi.String("testadmin"),
// AdminPassword: pulumi.String("Password1234!"),
// },
// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{
// DisablePasswordAuthentication: pulumi.Bool(false),
// },
// })
// if err != nil {
// return err
// }
// exampleExtension, err := compute.NewExtension(ctx, "example", &compute.ExtensionArgs{
// Name: pulumi.String("network-watcher"),
// VirtualMachineId: exampleVirtualMachine.ID(),
// Publisher: pulumi.String("Microsoft.Azure.NetworkWatcher"),
// Type: pulumi.String("NetworkWatcherAgentLinux"),
// TypeHandlerVersion: pulumi.String("1.4"),
// AutoUpgradeMinorVersion: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
// Name: pulumi.String("examplesa"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AccountTier: pulumi.String("Standard"),
// AccountReplicationType: pulumi.String("LRS"),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewPacketCapture(ctx, "example", &compute.PacketCaptureArgs{
// Name: pulumi.String("example-pc"),
// NetworkWatcherId: exampleNetworkWatcher.ID(),
// VirtualMachineId: exampleVirtualMachine.ID(),
// StorageLocation: &compute.PacketCaptureStorageLocationArgs{
// StorageAccountId: exampleAccount.ID(),
// },
// }, pulumi.DependsOn([]pulumi.Resource{
// exampleExtension,
// }))
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// > **Note:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource.
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Network` - 2025-01-01
//
// ## Import
//
// Virtual Machine Packet Captures can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/packetCapture:PacketCapture capture1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkWatchers/watcher1/packetCaptures/capture1
// ```
type PacketCapture struct {
pulumi.CustomResourceState
// One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
Filters PacketCaptureFilterArrayOutput `pulumi:"filters"`
// The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created.
MaximumBytesPerPacket pulumi.IntPtrOutput `pulumi:"maximumBytesPerPacket"`
// Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
MaximumBytesPerSession pulumi.IntPtrOutput `pulumi:"maximumBytesPerSession"`
// The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
MaximumCaptureDurationInSeconds pulumi.IntPtrOutput `pulumi:"maximumCaptureDurationInSeconds"`
// The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The resource ID of the Network Watcher. Changing this forces a new resource to be created.
NetworkWatcherId pulumi.StringOutput `pulumi:"networkWatcherId"`
// A `storageLocation` block as defined below. Changing this forces a new resource to be created.
StorageLocation PacketCaptureStorageLocationOutput `pulumi:"storageLocation"`
// The resource ID of the target Virtual Machine to capture packets from. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringOutput `pulumi:"virtualMachineId"`
}
// NewPacketCapture registers a new resource with the given unique name, arguments, and options.
func NewPacketCapture(ctx *pulumi.Context,
name string, args *PacketCaptureArgs, opts ...pulumi.ResourceOption) (*PacketCapture, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.NetworkWatcherId == nil {
return nil, errors.New("invalid value for required argument 'NetworkWatcherId'")
}
if args.StorageLocation == nil {
return nil, errors.New("invalid value for required argument 'StorageLocation'")
}
if args.VirtualMachineId == nil {
return nil, errors.New("invalid value for required argument 'VirtualMachineId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PacketCapture
err := ctx.RegisterResource("azure:compute/packetCapture:PacketCapture", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPacketCapture gets an existing PacketCapture resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetPacketCapture(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PacketCaptureState, opts ...pulumi.ResourceOption) (*PacketCapture, error) {
var resource PacketCapture
err := ctx.ReadResource("azure:compute/packetCapture:PacketCapture", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PacketCapture resources.
type packetCaptureState struct {
// One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
Filters []PacketCaptureFilter `pulumi:"filters"`
// The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created.
MaximumBytesPerPacket *int `pulumi:"maximumBytesPerPacket"`
// Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
MaximumBytesPerSession *int `pulumi:"maximumBytesPerSession"`
// The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
MaximumCaptureDurationInSeconds *int `pulumi:"maximumCaptureDurationInSeconds"`
// The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The resource ID of the Network Watcher. Changing this forces a new resource to be created.
NetworkWatcherId *string `pulumi:"networkWatcherId"`
// A `storageLocation` block as defined below. Changing this forces a new resource to be created.
StorageLocation *PacketCaptureStorageLocation `pulumi:"storageLocation"`
// The resource ID of the target Virtual Machine to capture packets from. Changing this forces a new resource to be created.
VirtualMachineId *string `pulumi:"virtualMachineId"`
}
type PacketCaptureState struct {
// One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
Filters PacketCaptureFilterArrayInput
// The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created.
MaximumBytesPerPacket pulumi.IntPtrInput
// Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
MaximumBytesPerSession pulumi.IntPtrInput
// The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
MaximumCaptureDurationInSeconds pulumi.IntPtrInput
// The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The resource ID of the Network Watcher. Changing this forces a new resource to be created.
NetworkWatcherId pulumi.StringPtrInput
// A `storageLocation` block as defined below. Changing this forces a new resource to be created.
StorageLocation PacketCaptureStorageLocationPtrInput
// The resource ID of the target Virtual Machine to capture packets from. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringPtrInput
}
func (PacketCaptureState) ElementType() reflect.Type {
return reflect.TypeOf((*packetCaptureState)(nil)).Elem()
}
type packetCaptureArgs struct {
// One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
Filters []PacketCaptureFilter `pulumi:"filters"`
// The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created.
MaximumBytesPerPacket *int `pulumi:"maximumBytesPerPacket"`
// Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
MaximumBytesPerSession *int `pulumi:"maximumBytesPerSession"`
// The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
MaximumCaptureDurationInSeconds *int `pulumi:"maximumCaptureDurationInSeconds"`
// The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The resource ID of the Network Watcher. Changing this forces a new resource to be created.
NetworkWatcherId string `pulumi:"networkWatcherId"`
// A `storageLocation` block as defined below. Changing this forces a new resource to be created.
StorageLocation PacketCaptureStorageLocation `pulumi:"storageLocation"`
// The resource ID of the target Virtual Machine to capture packets from. Changing this forces a new resource to be created.
VirtualMachineId string `pulumi:"virtualMachineId"`
}
// The set of arguments for constructing a PacketCapture resource.
type PacketCaptureArgs struct {
// One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
Filters PacketCaptureFilterArrayInput
// The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created.
MaximumBytesPerPacket pulumi.IntPtrInput
// Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
MaximumBytesPerSession pulumi.IntPtrInput
// The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
MaximumCaptureDurationInSeconds pulumi.IntPtrInput
// The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The resource ID of the Network Watcher. Changing this forces a new resource to be created.
NetworkWatcherId pulumi.StringInput
// A `storageLocation` block as defined below. Changing this forces a new resource to be created.
StorageLocation PacketCaptureStorageLocationInput
// The resource ID of the target Virtual Machine to capture packets from. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringInput
}
func (PacketCaptureArgs) ElementType() reflect.Type {
return reflect.TypeOf((*packetCaptureArgs)(nil)).Elem()
}
type PacketCaptureInput interface {
pulumi.Input
ToPacketCaptureOutput() PacketCaptureOutput
ToPacketCaptureOutputWithContext(ctx context.Context) PacketCaptureOutput
}
func (*PacketCapture) ElementType() reflect.Type {
return reflect.TypeOf((**PacketCapture)(nil)).Elem()
}
func (i *PacketCapture) ToPacketCaptureOutput() PacketCaptureOutput {
return i.ToPacketCaptureOutputWithContext(context.Background())
}
func (i *PacketCapture) ToPacketCaptureOutputWithContext(ctx context.Context) PacketCaptureOutput {
return pulumi.ToOutputWithContext(ctx, i).(PacketCaptureOutput)
}
// PacketCaptureArrayInput is an input type that accepts PacketCaptureArray and PacketCaptureArrayOutput values.
// You can construct a concrete instance of `PacketCaptureArrayInput` via:
//
// PacketCaptureArray{ PacketCaptureArgs{...} }
type PacketCaptureArrayInput interface {
pulumi.Input
ToPacketCaptureArrayOutput() PacketCaptureArrayOutput
ToPacketCaptureArrayOutputWithContext(context.Context) PacketCaptureArrayOutput
}
type PacketCaptureArray []PacketCaptureInput
func (PacketCaptureArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PacketCapture)(nil)).Elem()
}
func (i PacketCaptureArray) ToPacketCaptureArrayOutput() PacketCaptureArrayOutput {
return i.ToPacketCaptureArrayOutputWithContext(context.Background())
}
func (i PacketCaptureArray) ToPacketCaptureArrayOutputWithContext(ctx context.Context) PacketCaptureArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PacketCaptureArrayOutput)
}
// PacketCaptureMapInput is an input type that accepts PacketCaptureMap and PacketCaptureMapOutput values.
// You can construct a concrete instance of `PacketCaptureMapInput` via:
//
// PacketCaptureMap{ "key": PacketCaptureArgs{...} }
type PacketCaptureMapInput interface {
pulumi.Input
ToPacketCaptureMapOutput() PacketCaptureMapOutput
ToPacketCaptureMapOutputWithContext(context.Context) PacketCaptureMapOutput
}
type PacketCaptureMap map[string]PacketCaptureInput
func (PacketCaptureMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PacketCapture)(nil)).Elem()
}
func (i PacketCaptureMap) ToPacketCaptureMapOutput() PacketCaptureMapOutput {
return i.ToPacketCaptureMapOutputWithContext(context.Background())
}
func (i PacketCaptureMap) ToPacketCaptureMapOutputWithContext(ctx context.Context) PacketCaptureMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PacketCaptureMapOutput)
}
type PacketCaptureOutput struct{ *pulumi.OutputState }
func (PacketCaptureOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PacketCapture)(nil)).Elem()
}
func (o PacketCaptureOutput) ToPacketCaptureOutput() PacketCaptureOutput {
return o
}
func (o PacketCaptureOutput) ToPacketCaptureOutputWithContext(ctx context.Context) PacketCaptureOutput {
return o
}
// One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
func (o PacketCaptureOutput) Filters() PacketCaptureFilterArrayOutput {
return o.ApplyT(func(v *PacketCapture) PacketCaptureFilterArrayOutput { return v.Filters }).(PacketCaptureFilterArrayOutput)
}
// The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created.
func (o PacketCaptureOutput) MaximumBytesPerPacket() pulumi.IntPtrOutput {
return o.ApplyT(func(v *PacketCapture) pulumi.IntPtrOutput { return v.MaximumBytesPerPacket }).(pulumi.IntPtrOutput)
}
// Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
func (o PacketCaptureOutput) MaximumBytesPerSession() pulumi.IntPtrOutput {
return o.ApplyT(func(v *PacketCapture) pulumi.IntPtrOutput { return v.MaximumBytesPerSession }).(pulumi.IntPtrOutput)
}
// The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
func (o PacketCaptureOutput) MaximumCaptureDurationInSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *PacketCapture) pulumi.IntPtrOutput { return v.MaximumCaptureDurationInSeconds }).(pulumi.IntPtrOutput)
}
// The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
func (o PacketCaptureOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PacketCapture) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The resource ID of the Network Watcher. Changing this forces a new resource to be created.
func (o PacketCaptureOutput) NetworkWatcherId() pulumi.StringOutput {
return o.ApplyT(func(v *PacketCapture) pulumi.StringOutput { return v.NetworkWatcherId }).(pulumi.StringOutput)
}
// A `storageLocation` block as defined below. Changing this forces a new resource to be created.
func (o PacketCaptureOutput) StorageLocation() PacketCaptureStorageLocationOutput {
return o.ApplyT(func(v *PacketCapture) PacketCaptureStorageLocationOutput { return v.StorageLocation }).(PacketCaptureStorageLocationOutput)
}
// The resource ID of the target Virtual Machine to capture packets from. Changing this forces a new resource to be created.
func (o PacketCaptureOutput) VirtualMachineId() pulumi.StringOutput {
return o.ApplyT(func(v *PacketCapture) pulumi.StringOutput { return v.VirtualMachineId }).(pulumi.StringOutput)
}
type PacketCaptureArrayOutput struct{ *pulumi.OutputState }
func (PacketCaptureArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PacketCapture)(nil)).Elem()
}
func (o PacketCaptureArrayOutput) ToPacketCaptureArrayOutput() PacketCaptureArrayOutput {
return o
}
func (o PacketCaptureArrayOutput) ToPacketCaptureArrayOutputWithContext(ctx context.Context) PacketCaptureArrayOutput {
return o
}
func (o PacketCaptureArrayOutput) Index(i pulumi.IntInput) PacketCaptureOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PacketCapture {
return vs[0].([]*PacketCapture)[vs[1].(int)]
}).(PacketCaptureOutput)
}
type PacketCaptureMapOutput struct{ *pulumi.OutputState }
func (PacketCaptureMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PacketCapture)(nil)).Elem()
}
func (o PacketCaptureMapOutput) ToPacketCaptureMapOutput() PacketCaptureMapOutput {
return o
}
func (o PacketCaptureMapOutput) ToPacketCaptureMapOutputWithContext(ctx context.Context) PacketCaptureMapOutput {
return o
}
func (o PacketCaptureMapOutput) MapIndex(k pulumi.StringInput) PacketCaptureOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PacketCapture {
return vs[0].(map[string]*PacketCapture)[vs[1].(string)]
}).(PacketCaptureOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PacketCaptureInput)(nil)).Elem(), &PacketCapture{})
pulumi.RegisterInputType(reflect.TypeOf((*PacketCaptureArrayInput)(nil)).Elem(), PacketCaptureArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PacketCaptureMapInput)(nil)).Elem(), PacketCaptureMap{})
pulumi.RegisterOutputType(PacketCaptureOutput{})
pulumi.RegisterOutputType(PacketCaptureArrayOutput{})
pulumi.RegisterOutputType(PacketCaptureMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getDiskAccess.go | sdk/go/azure/compute/getDiskAccess.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Disk Access.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.LookupDiskAccess(ctx, &compute.LookupDiskAccessArgs{
// Name: "existing",
// ResourceGroupName: "existing",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-02
func LookupDiskAccess(ctx *pulumi.Context, args *LookupDiskAccessArgs, opts ...pulumi.InvokeOption) (*LookupDiskAccessResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupDiskAccessResult
err := ctx.Invoke("azure:compute/getDiskAccess:getDiskAccess", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDiskAccess.
type LookupDiskAccessArgs struct {
// The name of this Disk Access.
Name string `pulumi:"name"`
// The name of the Resource Group where the Disk Access exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getDiskAccess.
type LookupDiskAccessResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
Tags map[string]string `pulumi:"tags"`
}
func LookupDiskAccessOutput(ctx *pulumi.Context, args LookupDiskAccessOutputArgs, opts ...pulumi.InvokeOption) LookupDiskAccessResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupDiskAccessResultOutput, error) {
args := v.(LookupDiskAccessArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getDiskAccess:getDiskAccess", args, LookupDiskAccessResultOutput{}, options).(LookupDiskAccessResultOutput), nil
}).(LookupDiskAccessResultOutput)
}
// A collection of arguments for invoking getDiskAccess.
type LookupDiskAccessOutputArgs struct {
// The name of this Disk Access.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Disk Access exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupDiskAccessOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDiskAccessArgs)(nil)).Elem()
}
// A collection of values returned by getDiskAccess.
type LookupDiskAccessResultOutput struct{ *pulumi.OutputState }
func (LookupDiskAccessResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDiskAccessResult)(nil)).Elem()
}
func (o LookupDiskAccessResultOutput) ToLookupDiskAccessResultOutput() LookupDiskAccessResultOutput {
return o
}
func (o LookupDiskAccessResultOutput) ToLookupDiskAccessResultOutputWithContext(ctx context.Context) LookupDiskAccessResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o LookupDiskAccessResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskAccessResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupDiskAccessResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskAccessResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupDiskAccessResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskAccessResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o LookupDiskAccessResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDiskAccessResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDiskAccessResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getSharedImage.go | sdk/go/azure/compute/getSharedImage.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Shared Image within a Shared Image Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := compute.LookupSharedImage(ctx, &compute.LookupSharedImageArgs{
// Name: "my-image",
// GalleryName: "my-image-gallery",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-03
func LookupSharedImage(ctx *pulumi.Context, args *LookupSharedImageArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSharedImageResult
err := ctx.Invoke("azure:compute/getSharedImage:getSharedImage", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSharedImage.
type LookupSharedImageArgs struct {
// The name of the Shared Image Gallery in which the Shared Image exists.
GalleryName string `pulumi:"galleryName"`
// The name of the Shared Image.
Name string `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getSharedImage.
type LookupSharedImageResult struct {
// Specifies if the Shared Image supports Accelerated Network.
AcceleratedNetworkSupportEnabled bool `pulumi:"acceleratedNetworkSupportEnabled"`
Architecture string `pulumi:"architecture"`
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines.
ConfidentialVmEnabled bool `pulumi:"confidentialVmEnabled"`
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image.
ConfidentialVmSupported bool `pulumi:"confidentialVmSupported"`
// The description of this Shared Image.
Description string `pulumi:"description"`
// The End User Licence Agreement for the Shared Image.
Eula string `pulumi:"eula"`
GalleryName string `pulumi:"galleryName"`
// Specifies if the Shared Image supports hibernation.
HibernationEnabled bool `pulumi:"hibernationEnabled"`
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on.
HyperVGeneration string `pulumi:"hyperVGeneration"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// An `identifier` block as defined below.
Identifiers []GetSharedImageIdentifier `pulumi:"identifiers"`
// The supported Azure location where the Shared Image Gallery exists.
Location string `pulumi:"location"`
// (Required) The Purchase Plan Name for this Shared Image.
Name string `pulumi:"name"`
// The type of Operating System present in this Shared Image.
OsType string `pulumi:"osType"`
// The URI containing the Privacy Statement for this Shared Image.
PrivacyStatementUri string `pulumi:"privacyStatementUri"`
// (Optional) A `purchasePlan` block as defined below.
PurchasePlans []GetSharedImagePurchasePlan `pulumi:"purchasePlans"`
// The URI containing the Release Notes for this Shared Image.
ReleaseNoteUri string `pulumi:"releaseNoteUri"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run).
Specialized bool `pulumi:"specialized"`
// A mapping of tags assigned to the Shared Image.
Tags map[string]string `pulumi:"tags"`
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image.
TrustedLaunchEnabled bool `pulumi:"trustedLaunchEnabled"`
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image.
TrustedLaunchSupported bool `pulumi:"trustedLaunchSupported"`
}
func LookupSharedImageOutput(ctx *pulumi.Context, args LookupSharedImageOutputArgs, opts ...pulumi.InvokeOption) LookupSharedImageResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupSharedImageResultOutput, error) {
args := v.(LookupSharedImageArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getSharedImage:getSharedImage", args, LookupSharedImageResultOutput{}, options).(LookupSharedImageResultOutput), nil
}).(LookupSharedImageResultOutput)
}
// A collection of arguments for invoking getSharedImage.
type LookupSharedImageOutputArgs struct {
// The name of the Shared Image Gallery in which the Shared Image exists.
GalleryName pulumi.StringInput `pulumi:"galleryName"`
// The name of the Shared Image.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupSharedImageOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageArgs)(nil)).Elem()
}
// A collection of values returned by getSharedImage.
type LookupSharedImageResultOutput struct{ *pulumi.OutputState }
func (LookupSharedImageResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageResult)(nil)).Elem()
}
func (o LookupSharedImageResultOutput) ToLookupSharedImageResultOutput() LookupSharedImageResultOutput {
return o
}
func (o LookupSharedImageResultOutput) ToLookupSharedImageResultOutputWithContext(ctx context.Context) LookupSharedImageResultOutput {
return o
}
// Specifies if the Shared Image supports Accelerated Network.
func (o LookupSharedImageResultOutput) AcceleratedNetworkSupportEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.AcceleratedNetworkSupportEnabled }).(pulumi.BoolOutput)
}
func (o LookupSharedImageResultOutput) Architecture() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Architecture }).(pulumi.StringOutput)
}
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines.
func (o LookupSharedImageResultOutput) ConfidentialVmEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.ConfidentialVmEnabled }).(pulumi.BoolOutput)
}
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image.
func (o LookupSharedImageResultOutput) ConfidentialVmSupported() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.ConfidentialVmSupported }).(pulumi.BoolOutput)
}
// The description of this Shared Image.
func (o LookupSharedImageResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Description }).(pulumi.StringOutput)
}
// The End User Licence Agreement for the Shared Image.
func (o LookupSharedImageResultOutput) Eula() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Eula }).(pulumi.StringOutput)
}
func (o LookupSharedImageResultOutput) GalleryName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.GalleryName }).(pulumi.StringOutput)
}
// Specifies if the Shared Image supports hibernation.
func (o LookupSharedImageResultOutput) HibernationEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.HibernationEnabled }).(pulumi.BoolOutput)
}
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on.
func (o LookupSharedImageResultOutput) HyperVGeneration() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.HyperVGeneration }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSharedImageResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Id }).(pulumi.StringOutput)
}
// An `identifier` block as defined below.
func (o LookupSharedImageResultOutput) Identifiers() GetSharedImageIdentifierArrayOutput {
return o.ApplyT(func(v LookupSharedImageResult) []GetSharedImageIdentifier { return v.Identifiers }).(GetSharedImageIdentifierArrayOutput)
}
// The supported Azure location where the Shared Image Gallery exists.
func (o LookupSharedImageResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Location }).(pulumi.StringOutput)
}
// (Required) The Purchase Plan Name for this Shared Image.
func (o LookupSharedImageResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.Name }).(pulumi.StringOutput)
}
// The type of Operating System present in this Shared Image.
func (o LookupSharedImageResultOutput) OsType() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.OsType }).(pulumi.StringOutput)
}
// The URI containing the Privacy Statement for this Shared Image.
func (o LookupSharedImageResultOutput) PrivacyStatementUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.PrivacyStatementUri }).(pulumi.StringOutput)
}
// (Optional) A `purchasePlan` block as defined below.
func (o LookupSharedImageResultOutput) PurchasePlans() GetSharedImagePurchasePlanArrayOutput {
return o.ApplyT(func(v LookupSharedImageResult) []GetSharedImagePurchasePlan { return v.PurchasePlans }).(GetSharedImagePurchasePlanArrayOutput)
}
// The URI containing the Release Notes for this Shared Image.
func (o LookupSharedImageResultOutput) ReleaseNoteUri() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.ReleaseNoteUri }).(pulumi.StringOutput)
}
func (o LookupSharedImageResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run).
func (o LookupSharedImageResultOutput) Specialized() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.Specialized }).(pulumi.BoolOutput)
}
// A mapping of tags assigned to the Shared Image.
func (o LookupSharedImageResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupSharedImageResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image.
func (o LookupSharedImageResultOutput) TrustedLaunchEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.TrustedLaunchEnabled }).(pulumi.BoolOutput)
}
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image.
func (o LookupSharedImageResultOutput) TrustedLaunchSupported() pulumi.BoolOutput {
return o.ApplyT(func(v LookupSharedImageResult) bool { return v.TrustedLaunchSupported }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSharedImageResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/dedicatedHostGroup.go | sdk/go/azure/compute/dedicatedHostGroup.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manage a Dedicated Host Group.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-rg-compute"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewDedicatedHostGroup(ctx, "example", &compute.DedicatedHostGroupArgs{
// Name: pulumi.String("example-dedicated-host-group"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// PlatformFaultDomainCount: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01
//
// ## Import
//
// Dedicated Host Group can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/dedicatedHostGroup:DedicatedHostGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Compute/hostGroups/group1
// ```
type DedicatedHostGroup struct {
pulumi.CustomResourceState
// Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
AutomaticPlacementEnabled pulumi.BoolPtrOutput `pulumi:"automaticPlacementEnabled"`
// The Azure location where the Dedicated Host Group exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
PlatformFaultDomainCount pulumi.IntOutput `pulumi:"platformFaultDomainCount"`
// Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
Zone pulumi.StringPtrOutput `pulumi:"zone"`
}
// NewDedicatedHostGroup registers a new resource with the given unique name, arguments, and options.
func NewDedicatedHostGroup(ctx *pulumi.Context,
name string, args *DedicatedHostGroupArgs, opts ...pulumi.ResourceOption) (*DedicatedHostGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PlatformFaultDomainCount == nil {
return nil, errors.New("invalid value for required argument 'PlatformFaultDomainCount'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DedicatedHostGroup
err := ctx.RegisterResource("azure:compute/dedicatedHostGroup:DedicatedHostGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDedicatedHostGroup gets an existing DedicatedHostGroup resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDedicatedHostGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DedicatedHostGroupState, opts ...pulumi.ResourceOption) (*DedicatedHostGroup, error) {
var resource DedicatedHostGroup
err := ctx.ReadResource("azure:compute/dedicatedHostGroup:DedicatedHostGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DedicatedHostGroup resources.
type dedicatedHostGroupState struct {
// Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
AutomaticPlacementEnabled *bool `pulumi:"automaticPlacementEnabled"`
// The Azure location where the Dedicated Host Group exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
PlatformFaultDomainCount *int `pulumi:"platformFaultDomainCount"`
// Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
Zone *string `pulumi:"zone"`
}
type DedicatedHostGroupState struct {
// Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
AutomaticPlacementEnabled pulumi.BoolPtrInput
// The Azure location where the Dedicated Host Group exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
PlatformFaultDomainCount pulumi.IntPtrInput
// Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
Zone pulumi.StringPtrInput
}
func (DedicatedHostGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*dedicatedHostGroupState)(nil)).Elem()
}
type dedicatedHostGroupArgs struct {
// Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
AutomaticPlacementEnabled *bool `pulumi:"automaticPlacementEnabled"`
// The Azure location where the Dedicated Host Group exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
PlatformFaultDomainCount int `pulumi:"platformFaultDomainCount"`
// Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
Zone *string `pulumi:"zone"`
}
// The set of arguments for constructing a DedicatedHostGroup resource.
type DedicatedHostGroupArgs struct {
// Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
AutomaticPlacementEnabled pulumi.BoolPtrInput
// The Azure location where the Dedicated Host Group exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
PlatformFaultDomainCount pulumi.IntInput
// Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
Zone pulumi.StringPtrInput
}
func (DedicatedHostGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dedicatedHostGroupArgs)(nil)).Elem()
}
type DedicatedHostGroupInput interface {
pulumi.Input
ToDedicatedHostGroupOutput() DedicatedHostGroupOutput
ToDedicatedHostGroupOutputWithContext(ctx context.Context) DedicatedHostGroupOutput
}
func (*DedicatedHostGroup) ElementType() reflect.Type {
return reflect.TypeOf((**DedicatedHostGroup)(nil)).Elem()
}
func (i *DedicatedHostGroup) ToDedicatedHostGroupOutput() DedicatedHostGroupOutput {
return i.ToDedicatedHostGroupOutputWithContext(context.Background())
}
func (i *DedicatedHostGroup) ToDedicatedHostGroupOutputWithContext(ctx context.Context) DedicatedHostGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostGroupOutput)
}
// DedicatedHostGroupArrayInput is an input type that accepts DedicatedHostGroupArray and DedicatedHostGroupArrayOutput values.
// You can construct a concrete instance of `DedicatedHostGroupArrayInput` via:
//
// DedicatedHostGroupArray{ DedicatedHostGroupArgs{...} }
type DedicatedHostGroupArrayInput interface {
pulumi.Input
ToDedicatedHostGroupArrayOutput() DedicatedHostGroupArrayOutput
ToDedicatedHostGroupArrayOutputWithContext(context.Context) DedicatedHostGroupArrayOutput
}
type DedicatedHostGroupArray []DedicatedHostGroupInput
func (DedicatedHostGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DedicatedHostGroup)(nil)).Elem()
}
func (i DedicatedHostGroupArray) ToDedicatedHostGroupArrayOutput() DedicatedHostGroupArrayOutput {
return i.ToDedicatedHostGroupArrayOutputWithContext(context.Background())
}
func (i DedicatedHostGroupArray) ToDedicatedHostGroupArrayOutputWithContext(ctx context.Context) DedicatedHostGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostGroupArrayOutput)
}
// DedicatedHostGroupMapInput is an input type that accepts DedicatedHostGroupMap and DedicatedHostGroupMapOutput values.
// You can construct a concrete instance of `DedicatedHostGroupMapInput` via:
//
// DedicatedHostGroupMap{ "key": DedicatedHostGroupArgs{...} }
type DedicatedHostGroupMapInput interface {
pulumi.Input
ToDedicatedHostGroupMapOutput() DedicatedHostGroupMapOutput
ToDedicatedHostGroupMapOutputWithContext(context.Context) DedicatedHostGroupMapOutput
}
type DedicatedHostGroupMap map[string]DedicatedHostGroupInput
func (DedicatedHostGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DedicatedHostGroup)(nil)).Elem()
}
func (i DedicatedHostGroupMap) ToDedicatedHostGroupMapOutput() DedicatedHostGroupMapOutput {
return i.ToDedicatedHostGroupMapOutputWithContext(context.Background())
}
func (i DedicatedHostGroupMap) ToDedicatedHostGroupMapOutputWithContext(ctx context.Context) DedicatedHostGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostGroupMapOutput)
}
type DedicatedHostGroupOutput struct{ *pulumi.OutputState }
func (DedicatedHostGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DedicatedHostGroup)(nil)).Elem()
}
func (o DedicatedHostGroupOutput) ToDedicatedHostGroupOutput() DedicatedHostGroupOutput {
return o
}
func (o DedicatedHostGroupOutput) ToDedicatedHostGroupOutputWithContext(ctx context.Context) DedicatedHostGroupOutput {
return o
}
// Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
func (o DedicatedHostGroupOutput) AutomaticPlacementEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.BoolPtrOutput { return v.AutomaticPlacementEnabled }).(pulumi.BoolPtrOutput)
}
// The Azure location where the Dedicated Host Group exists. Changing this forces a new resource to be created.
func (o DedicatedHostGroupOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
func (o DedicatedHostGroupOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
func (o DedicatedHostGroupOutput) PlatformFaultDomainCount() pulumi.IntOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.IntOutput { return v.PlatformFaultDomainCount }).(pulumi.IntOutput)
}
// Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
func (o DedicatedHostGroupOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags to assign to the resource.
func (o DedicatedHostGroupOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
func (o DedicatedHostGroupOutput) Zone() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DedicatedHostGroup) pulumi.StringPtrOutput { return v.Zone }).(pulumi.StringPtrOutput)
}
type DedicatedHostGroupArrayOutput struct{ *pulumi.OutputState }
func (DedicatedHostGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DedicatedHostGroup)(nil)).Elem()
}
func (o DedicatedHostGroupArrayOutput) ToDedicatedHostGroupArrayOutput() DedicatedHostGroupArrayOutput {
return o
}
func (o DedicatedHostGroupArrayOutput) ToDedicatedHostGroupArrayOutputWithContext(ctx context.Context) DedicatedHostGroupArrayOutput {
return o
}
func (o DedicatedHostGroupArrayOutput) Index(i pulumi.IntInput) DedicatedHostGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DedicatedHostGroup {
return vs[0].([]*DedicatedHostGroup)[vs[1].(int)]
}).(DedicatedHostGroupOutput)
}
type DedicatedHostGroupMapOutput struct{ *pulumi.OutputState }
func (DedicatedHostGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DedicatedHostGroup)(nil)).Elem()
}
func (o DedicatedHostGroupMapOutput) ToDedicatedHostGroupMapOutput() DedicatedHostGroupMapOutput {
return o
}
func (o DedicatedHostGroupMapOutput) ToDedicatedHostGroupMapOutputWithContext(ctx context.Context) DedicatedHostGroupMapOutput {
return o
}
func (o DedicatedHostGroupMapOutput) MapIndex(k pulumi.StringInput) DedicatedHostGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DedicatedHostGroup {
return vs[0].(map[string]*DedicatedHostGroup)[vs[1].(string)]
}).(DedicatedHostGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DedicatedHostGroupInput)(nil)).Elem(), &DedicatedHostGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*DedicatedHostGroupArrayInput)(nil)).Elem(), DedicatedHostGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DedicatedHostGroupMapInput)(nil)).Elem(), DedicatedHostGroupMap{})
pulumi.RegisterOutputType(DedicatedHostGroupOutput{})
pulumi.RegisterOutputType(DedicatedHostGroupArrayOutput{})
pulumi.RegisterOutputType(DedicatedHostGroupMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getVirtualMachine.go | sdk/go/azure/compute/getVirtualMachine.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Virtual Machine.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{
// Name: "production",
// ResourceGroupName: "networking",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("virtualMachineId", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01
func LookupVirtualMachine(ctx *pulumi.Context, args *LookupVirtualMachineArgs, opts ...pulumi.InvokeOption) (*LookupVirtualMachineResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupVirtualMachineResult
err := ctx.Invoke("azure:compute/getVirtualMachine:getVirtualMachine", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVirtualMachine.
type LookupVirtualMachineArgs struct {
// Specifies the name of the Virtual Machine.
Name string `pulumi:"name"`
// Specifies the name of the resource group the Virtual Machine is located in.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getVirtualMachine.
type LookupVirtualMachineResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A `identity` block as defined below.
Identities []GetVirtualMachineIdentity `pulumi:"identities"`
Location string `pulumi:"location"`
Name string `pulumi:"name"`
// The power state of the virtual machine.
PowerState string `pulumi:"powerState"`
// The Primary Private IP Address assigned to this Virtual Machine.
PrivateIpAddress string `pulumi:"privateIpAddress"`
// A list of Private IP Addresses assigned to this Virtual Machine.
PrivateIpAddresses []string `pulumi:"privateIpAddresses"`
// The Primary Public IP Address assigned to this Virtual Machine.
PublicIpAddress string `pulumi:"publicIpAddress"`
// A list of the Public IP Addresses assigned to this Virtual Machine.
PublicIpAddresses []string `pulumi:"publicIpAddresses"`
ResourceGroupName string `pulumi:"resourceGroupName"`
}
func LookupVirtualMachineOutput(ctx *pulumi.Context, args LookupVirtualMachineOutputArgs, opts ...pulumi.InvokeOption) LookupVirtualMachineResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupVirtualMachineResultOutput, error) {
args := v.(LookupVirtualMachineArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getVirtualMachine:getVirtualMachine", args, LookupVirtualMachineResultOutput{}, options).(LookupVirtualMachineResultOutput), nil
}).(LookupVirtualMachineResultOutput)
}
// A collection of arguments for invoking getVirtualMachine.
type LookupVirtualMachineOutputArgs struct {
// Specifies the name of the Virtual Machine.
Name pulumi.StringInput `pulumi:"name"`
// Specifies the name of the resource group the Virtual Machine is located in.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupVirtualMachineOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVirtualMachineArgs)(nil)).Elem()
}
// A collection of values returned by getVirtualMachine.
type LookupVirtualMachineResultOutput struct{ *pulumi.OutputState }
func (LookupVirtualMachineResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVirtualMachineResult)(nil)).Elem()
}
func (o LookupVirtualMachineResultOutput) ToLookupVirtualMachineResultOutput() LookupVirtualMachineResultOutput {
return o
}
func (o LookupVirtualMachineResultOutput) ToLookupVirtualMachineResultOutputWithContext(ctx context.Context) LookupVirtualMachineResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o LookupVirtualMachineResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Id }).(pulumi.StringOutput)
}
// A `identity` block as defined below.
func (o LookupVirtualMachineResultOutput) Identities() GetVirtualMachineIdentityArrayOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) []GetVirtualMachineIdentity { return v.Identities }).(GetVirtualMachineIdentityArrayOutput)
}
func (o LookupVirtualMachineResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupVirtualMachineResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Name }).(pulumi.StringOutput)
}
// The power state of the virtual machine.
func (o LookupVirtualMachineResultOutput) PowerState() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.PowerState }).(pulumi.StringOutput)
}
// The Primary Private IP Address assigned to this Virtual Machine.
func (o LookupVirtualMachineResultOutput) PrivateIpAddress() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.PrivateIpAddress }).(pulumi.StringOutput)
}
// A list of Private IP Addresses assigned to this Virtual Machine.
func (o LookupVirtualMachineResultOutput) PrivateIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) []string { return v.PrivateIpAddresses }).(pulumi.StringArrayOutput)
}
// The Primary Public IP Address assigned to this Virtual Machine.
func (o LookupVirtualMachineResultOutput) PublicIpAddress() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.PublicIpAddress }).(pulumi.StringOutput)
}
// A list of the Public IP Addresses assigned to this Virtual Machine.
func (o LookupVirtualMachineResultOutput) PublicIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) []string { return v.PublicIpAddresses }).(pulumi.StringArrayOutput)
}
func (o LookupVirtualMachineResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVirtualMachineResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/init.go | sdk/go/azure/compute/init.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"fmt"
"github.com/blang/semver"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type module struct {
version semver.Version
}
func (m *module) Version() semver.Version {
return m.version
}
func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) {
switch typ {
case "azure:compute/automanageConfigurationAssignment:AutomanageConfigurationAssignment":
r = &AutomanageConfigurationAssignment{}
case "azure:compute/availabilitySet:AvailabilitySet":
r = &AvailabilitySet{}
case "azure:compute/bastionHost:BastionHost":
r = &BastionHost{}
case "azure:compute/capacityReservation:CapacityReservation":
r = &CapacityReservation{}
case "azure:compute/capacityReservationGroup:CapacityReservationGroup":
r = &CapacityReservationGroup{}
case "azure:compute/dataDiskAttachment:DataDiskAttachment":
r = &DataDiskAttachment{}
case "azure:compute/dedicatedHost:DedicatedHost":
r = &DedicatedHost{}
case "azure:compute/dedicatedHostGroup:DedicatedHostGroup":
r = &DedicatedHostGroup{}
case "azure:compute/diskAccess:DiskAccess":
r = &DiskAccess{}
case "azure:compute/diskEncryptionSet:DiskEncryptionSet":
r = &DiskEncryptionSet{}
case "azure:compute/extension:Extension":
r = &Extension{}
case "azure:compute/galleryApplication:GalleryApplication":
r = &GalleryApplication{}
case "azure:compute/galleryApplicationAssignment:GalleryApplicationAssignment":
r = &GalleryApplicationAssignment{}
case "azure:compute/galleryApplicationVersion:GalleryApplicationVersion":
r = &GalleryApplicationVersion{}
case "azure:compute/image:Image":
r = &Image{}
case "azure:compute/implicitDataDiskFromSource:ImplicitDataDiskFromSource":
r = &ImplicitDataDiskFromSource{}
case "azure:compute/linuxVirtualMachine:LinuxVirtualMachine":
r = &LinuxVirtualMachine{}
case "azure:compute/linuxVirtualMachineScaleSet:LinuxVirtualMachineScaleSet":
r = &LinuxVirtualMachineScaleSet{}
case "azure:compute/managedDisk:ManagedDisk":
r = &ManagedDisk{}
case "azure:compute/managedDiskSasToken:ManagedDiskSasToken":
r = &ManagedDiskSasToken{}
case "azure:compute/orchestratedVirtualMachineScaleSet:OrchestratedVirtualMachineScaleSet":
r = &OrchestratedVirtualMachineScaleSet{}
case "azure:compute/packetCapture:PacketCapture":
r = &PacketCapture{}
case "azure:compute/restorePoint:RestorePoint":
r = &RestorePoint{}
case "azure:compute/restorePointCollection:RestorePointCollection":
r = &RestorePointCollection{}
case "azure:compute/runCommand:RunCommand":
r = &RunCommand{}
case "azure:compute/scaleSet:ScaleSet":
r = &ScaleSet{}
case "azure:compute/scaleSetPacketCapture:ScaleSetPacketCapture":
r = &ScaleSetPacketCapture{}
case "azure:compute/scaleSetStandbyPool:ScaleSetStandbyPool":
r = &ScaleSetStandbyPool{}
case "azure:compute/sharedImage:SharedImage":
r = &SharedImage{}
case "azure:compute/sharedImageGallery:SharedImageGallery":
r = &SharedImageGallery{}
case "azure:compute/sharedImageVersion:SharedImageVersion":
r = &SharedImageVersion{}
case "azure:compute/snapshot:Snapshot":
r = &Snapshot{}
case "azure:compute/sshPublicKey:SshPublicKey":
r = &SshPublicKey{}
case "azure:compute/virtualMachine:VirtualMachine":
r = &VirtualMachine{}
case "azure:compute/virtualMachineScaleSetExtension:VirtualMachineScaleSetExtension":
r = &VirtualMachineScaleSetExtension{}
case "azure:compute/windowsVirtualMachine:WindowsVirtualMachine":
r = &WindowsVirtualMachine{}
case "azure:compute/windowsVirtualMachineScaleSet:WindowsVirtualMachineScaleSet":
r = &WindowsVirtualMachineScaleSet{}
default:
return nil, fmt.Errorf("unknown resource type: %s", typ)
}
err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn))
return
}
func init() {
version, err := internal.PkgVersion()
if err != nil {
version = semver.Version{Major: 1}
}
pulumi.RegisterResourceModule(
"azure",
"compute/automanageConfigurationAssignment",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/availabilitySet",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/bastionHost",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/capacityReservation",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/capacityReservationGroup",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/dataDiskAttachment",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/dedicatedHost",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/dedicatedHostGroup",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/diskAccess",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/diskEncryptionSet",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/extension",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/galleryApplication",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/galleryApplicationAssignment",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/galleryApplicationVersion",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/image",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/implicitDataDiskFromSource",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/linuxVirtualMachine",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/linuxVirtualMachineScaleSet",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/managedDisk",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/managedDiskSasToken",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/orchestratedVirtualMachineScaleSet",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/packetCapture",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/restorePoint",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/restorePointCollection",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/runCommand",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/scaleSet",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/scaleSetPacketCapture",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/scaleSetStandbyPool",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/sharedImage",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/sharedImageGallery",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/sharedImageVersion",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/snapshot",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/sshPublicKey",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/virtualMachine",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/virtualMachineScaleSetExtension",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/windowsVirtualMachine",
&module{version},
)
pulumi.RegisterResourceModule(
"azure",
"compute/windowsVirtualMachineScaleSet",
&module{version},
)
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/pulumiTypes.go | sdk/go/azure/compute/pulumiTypes.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
var _ = internal.GetEnvOrDefault
type BastionHostIpConfiguration struct {
// The name of the IP configuration. Changing this forces a new resource to be created.
Name string `pulumi:"name"`
// Reference to a Public IP Address to associate with this Bastion Host. Changing this forces a new resource to be created.
PublicIpAddressId string `pulumi:"publicIpAddressId"`
// Reference to a subnet in which this Bastion Host has been created. Changing this forces a new resource to be created.
//
// > **Note:** The Subnet used for the Bastion Host must have the name `AzureBastionSubnet` and the subnet mask must be at least a `/26`.
SubnetId string `pulumi:"subnetId"`
}
// BastionHostIpConfigurationInput is an input type that accepts BastionHostIpConfigurationArgs and BastionHostIpConfigurationOutput values.
// You can construct a concrete instance of `BastionHostIpConfigurationInput` via:
//
// BastionHostIpConfigurationArgs{...}
type BastionHostIpConfigurationInput interface {
pulumi.Input
ToBastionHostIpConfigurationOutput() BastionHostIpConfigurationOutput
ToBastionHostIpConfigurationOutputWithContext(context.Context) BastionHostIpConfigurationOutput
}
type BastionHostIpConfigurationArgs struct {
// The name of the IP configuration. Changing this forces a new resource to be created.
Name pulumi.StringInput `pulumi:"name"`
// Reference to a Public IP Address to associate with this Bastion Host. Changing this forces a new resource to be created.
PublicIpAddressId pulumi.StringInput `pulumi:"publicIpAddressId"`
// Reference to a subnet in which this Bastion Host has been created. Changing this forces a new resource to be created.
//
// > **Note:** The Subnet used for the Bastion Host must have the name `AzureBastionSubnet` and the subnet mask must be at least a `/26`.
SubnetId pulumi.StringInput `pulumi:"subnetId"`
}
func (BastionHostIpConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*BastionHostIpConfiguration)(nil)).Elem()
}
func (i BastionHostIpConfigurationArgs) ToBastionHostIpConfigurationOutput() BastionHostIpConfigurationOutput {
return i.ToBastionHostIpConfigurationOutputWithContext(context.Background())
}
func (i BastionHostIpConfigurationArgs) ToBastionHostIpConfigurationOutputWithContext(ctx context.Context) BastionHostIpConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(BastionHostIpConfigurationOutput)
}
func (i BastionHostIpConfigurationArgs) ToBastionHostIpConfigurationPtrOutput() BastionHostIpConfigurationPtrOutput {
return i.ToBastionHostIpConfigurationPtrOutputWithContext(context.Background())
}
func (i BastionHostIpConfigurationArgs) ToBastionHostIpConfigurationPtrOutputWithContext(ctx context.Context) BastionHostIpConfigurationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(BastionHostIpConfigurationOutput).ToBastionHostIpConfigurationPtrOutputWithContext(ctx)
}
// BastionHostIpConfigurationPtrInput is an input type that accepts BastionHostIpConfigurationArgs, BastionHostIpConfigurationPtr and BastionHostIpConfigurationPtrOutput values.
// You can construct a concrete instance of `BastionHostIpConfigurationPtrInput` via:
//
// BastionHostIpConfigurationArgs{...}
//
// or:
//
// nil
type BastionHostIpConfigurationPtrInput interface {
pulumi.Input
ToBastionHostIpConfigurationPtrOutput() BastionHostIpConfigurationPtrOutput
ToBastionHostIpConfigurationPtrOutputWithContext(context.Context) BastionHostIpConfigurationPtrOutput
}
type bastionHostIpConfigurationPtrType BastionHostIpConfigurationArgs
func BastionHostIpConfigurationPtr(v *BastionHostIpConfigurationArgs) BastionHostIpConfigurationPtrInput {
return (*bastionHostIpConfigurationPtrType)(v)
}
func (*bastionHostIpConfigurationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**BastionHostIpConfiguration)(nil)).Elem()
}
func (i *bastionHostIpConfigurationPtrType) ToBastionHostIpConfigurationPtrOutput() BastionHostIpConfigurationPtrOutput {
return i.ToBastionHostIpConfigurationPtrOutputWithContext(context.Background())
}
func (i *bastionHostIpConfigurationPtrType) ToBastionHostIpConfigurationPtrOutputWithContext(ctx context.Context) BastionHostIpConfigurationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(BastionHostIpConfigurationPtrOutput)
}
type BastionHostIpConfigurationOutput struct{ *pulumi.OutputState }
func (BastionHostIpConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*BastionHostIpConfiguration)(nil)).Elem()
}
func (o BastionHostIpConfigurationOutput) ToBastionHostIpConfigurationOutput() BastionHostIpConfigurationOutput {
return o
}
func (o BastionHostIpConfigurationOutput) ToBastionHostIpConfigurationOutputWithContext(ctx context.Context) BastionHostIpConfigurationOutput {
return o
}
func (o BastionHostIpConfigurationOutput) ToBastionHostIpConfigurationPtrOutput() BastionHostIpConfigurationPtrOutput {
return o.ToBastionHostIpConfigurationPtrOutputWithContext(context.Background())
}
func (o BastionHostIpConfigurationOutput) ToBastionHostIpConfigurationPtrOutputWithContext(ctx context.Context) BastionHostIpConfigurationPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v BastionHostIpConfiguration) *BastionHostIpConfiguration {
return &v
}).(BastionHostIpConfigurationPtrOutput)
}
// The name of the IP configuration. Changing this forces a new resource to be created.
func (o BastionHostIpConfigurationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v BastionHostIpConfiguration) string { return v.Name }).(pulumi.StringOutput)
}
// Reference to a Public IP Address to associate with this Bastion Host. Changing this forces a new resource to be created.
func (o BastionHostIpConfigurationOutput) PublicIpAddressId() pulumi.StringOutput {
return o.ApplyT(func(v BastionHostIpConfiguration) string { return v.PublicIpAddressId }).(pulumi.StringOutput)
}
// Reference to a subnet in which this Bastion Host has been created. Changing this forces a new resource to be created.
//
// > **Note:** The Subnet used for the Bastion Host must have the name `AzureBastionSubnet` and the subnet mask must be at least a `/26`.
func (o BastionHostIpConfigurationOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v BastionHostIpConfiguration) string { return v.SubnetId }).(pulumi.StringOutput)
}
type BastionHostIpConfigurationPtrOutput struct{ *pulumi.OutputState }
func (BastionHostIpConfigurationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BastionHostIpConfiguration)(nil)).Elem()
}
func (o BastionHostIpConfigurationPtrOutput) ToBastionHostIpConfigurationPtrOutput() BastionHostIpConfigurationPtrOutput {
return o
}
func (o BastionHostIpConfigurationPtrOutput) ToBastionHostIpConfigurationPtrOutputWithContext(ctx context.Context) BastionHostIpConfigurationPtrOutput {
return o
}
func (o BastionHostIpConfigurationPtrOutput) Elem() BastionHostIpConfigurationOutput {
return o.ApplyT(func(v *BastionHostIpConfiguration) BastionHostIpConfiguration {
if v != nil {
return *v
}
var ret BastionHostIpConfiguration
return ret
}).(BastionHostIpConfigurationOutput)
}
// The name of the IP configuration. Changing this forces a new resource to be created.
func (o BastionHostIpConfigurationPtrOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BastionHostIpConfiguration) *string {
if v == nil {
return nil
}
return &v.Name
}).(pulumi.StringPtrOutput)
}
// Reference to a Public IP Address to associate with this Bastion Host. Changing this forces a new resource to be created.
func (o BastionHostIpConfigurationPtrOutput) PublicIpAddressId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BastionHostIpConfiguration) *string {
if v == nil {
return nil
}
return &v.PublicIpAddressId
}).(pulumi.StringPtrOutput)
}
// Reference to a subnet in which this Bastion Host has been created. Changing this forces a new resource to be created.
//
// > **Note:** The Subnet used for the Bastion Host must have the name `AzureBastionSubnet` and the subnet mask must be at least a `/26`.
func (o BastionHostIpConfigurationPtrOutput) SubnetId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BastionHostIpConfiguration) *string {
if v == nil {
return nil
}
return &v.SubnetId
}).(pulumi.StringPtrOutput)
}
type CapacityReservationSku struct {
// Specifies the number of instances to be reserved. It must be greater than or equal to `0` and not exceed the quota in the subscription.
Capacity int `pulumi:"capacity"`
// Name of the sku, such as `Standard_F2`. Changing this forces a new resource to be created.
Name string `pulumi:"name"`
}
// CapacityReservationSkuInput is an input type that accepts CapacityReservationSkuArgs and CapacityReservationSkuOutput values.
// You can construct a concrete instance of `CapacityReservationSkuInput` via:
//
// CapacityReservationSkuArgs{...}
type CapacityReservationSkuInput interface {
pulumi.Input
ToCapacityReservationSkuOutput() CapacityReservationSkuOutput
ToCapacityReservationSkuOutputWithContext(context.Context) CapacityReservationSkuOutput
}
type CapacityReservationSkuArgs struct {
// Specifies the number of instances to be reserved. It must be greater than or equal to `0` and not exceed the quota in the subscription.
Capacity pulumi.IntInput `pulumi:"capacity"`
// Name of the sku, such as `Standard_F2`. Changing this forces a new resource to be created.
Name pulumi.StringInput `pulumi:"name"`
}
func (CapacityReservationSkuArgs) ElementType() reflect.Type {
return reflect.TypeOf((*CapacityReservationSku)(nil)).Elem()
}
func (i CapacityReservationSkuArgs) ToCapacityReservationSkuOutput() CapacityReservationSkuOutput {
return i.ToCapacityReservationSkuOutputWithContext(context.Background())
}
func (i CapacityReservationSkuArgs) ToCapacityReservationSkuOutputWithContext(ctx context.Context) CapacityReservationSkuOutput {
return pulumi.ToOutputWithContext(ctx, i).(CapacityReservationSkuOutput)
}
func (i CapacityReservationSkuArgs) ToCapacityReservationSkuPtrOutput() CapacityReservationSkuPtrOutput {
return i.ToCapacityReservationSkuPtrOutputWithContext(context.Background())
}
func (i CapacityReservationSkuArgs) ToCapacityReservationSkuPtrOutputWithContext(ctx context.Context) CapacityReservationSkuPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CapacityReservationSkuOutput).ToCapacityReservationSkuPtrOutputWithContext(ctx)
}
// CapacityReservationSkuPtrInput is an input type that accepts CapacityReservationSkuArgs, CapacityReservationSkuPtr and CapacityReservationSkuPtrOutput values.
// You can construct a concrete instance of `CapacityReservationSkuPtrInput` via:
//
// CapacityReservationSkuArgs{...}
//
// or:
//
// nil
type CapacityReservationSkuPtrInput interface {
pulumi.Input
ToCapacityReservationSkuPtrOutput() CapacityReservationSkuPtrOutput
ToCapacityReservationSkuPtrOutputWithContext(context.Context) CapacityReservationSkuPtrOutput
}
type capacityReservationSkuPtrType CapacityReservationSkuArgs
func CapacityReservationSkuPtr(v *CapacityReservationSkuArgs) CapacityReservationSkuPtrInput {
return (*capacityReservationSkuPtrType)(v)
}
func (*capacityReservationSkuPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**CapacityReservationSku)(nil)).Elem()
}
func (i *capacityReservationSkuPtrType) ToCapacityReservationSkuPtrOutput() CapacityReservationSkuPtrOutput {
return i.ToCapacityReservationSkuPtrOutputWithContext(context.Background())
}
func (i *capacityReservationSkuPtrType) ToCapacityReservationSkuPtrOutputWithContext(ctx context.Context) CapacityReservationSkuPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CapacityReservationSkuPtrOutput)
}
type CapacityReservationSkuOutput struct{ *pulumi.OutputState }
func (CapacityReservationSkuOutput) ElementType() reflect.Type {
return reflect.TypeOf((*CapacityReservationSku)(nil)).Elem()
}
func (o CapacityReservationSkuOutput) ToCapacityReservationSkuOutput() CapacityReservationSkuOutput {
return o
}
func (o CapacityReservationSkuOutput) ToCapacityReservationSkuOutputWithContext(ctx context.Context) CapacityReservationSkuOutput {
return o
}
func (o CapacityReservationSkuOutput) ToCapacityReservationSkuPtrOutput() CapacityReservationSkuPtrOutput {
return o.ToCapacityReservationSkuPtrOutputWithContext(context.Background())
}
func (o CapacityReservationSkuOutput) ToCapacityReservationSkuPtrOutputWithContext(ctx context.Context) CapacityReservationSkuPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v CapacityReservationSku) *CapacityReservationSku {
return &v
}).(CapacityReservationSkuPtrOutput)
}
// Specifies the number of instances to be reserved. It must be greater than or equal to `0` and not exceed the quota in the subscription.
func (o CapacityReservationSkuOutput) Capacity() pulumi.IntOutput {
return o.ApplyT(func(v CapacityReservationSku) int { return v.Capacity }).(pulumi.IntOutput)
}
// Name of the sku, such as `Standard_F2`. Changing this forces a new resource to be created.
func (o CapacityReservationSkuOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v CapacityReservationSku) string { return v.Name }).(pulumi.StringOutput)
}
type CapacityReservationSkuPtrOutput struct{ *pulumi.OutputState }
func (CapacityReservationSkuPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CapacityReservationSku)(nil)).Elem()
}
func (o CapacityReservationSkuPtrOutput) ToCapacityReservationSkuPtrOutput() CapacityReservationSkuPtrOutput {
return o
}
func (o CapacityReservationSkuPtrOutput) ToCapacityReservationSkuPtrOutputWithContext(ctx context.Context) CapacityReservationSkuPtrOutput {
return o
}
func (o CapacityReservationSkuPtrOutput) Elem() CapacityReservationSkuOutput {
return o.ApplyT(func(v *CapacityReservationSku) CapacityReservationSku {
if v != nil {
return *v
}
var ret CapacityReservationSku
return ret
}).(CapacityReservationSkuOutput)
}
// Specifies the number of instances to be reserved. It must be greater than or equal to `0` and not exceed the quota in the subscription.
func (o CapacityReservationSkuPtrOutput) Capacity() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CapacityReservationSku) *int {
if v == nil {
return nil
}
return &v.Capacity
}).(pulumi.IntPtrOutput)
}
// Name of the sku, such as `Standard_F2`. Changing this forces a new resource to be created.
func (o CapacityReservationSkuPtrOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CapacityReservationSku) *string {
if v == nil {
return nil
}
return &v.Name
}).(pulumi.StringPtrOutput)
}
type DiskEncryptionSetIdentity struct {
// A list of User Assigned Managed Identity IDs to be assigned to this Disk Encryption Set.
//
// > **Note:** This is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
IdentityIds []string `pulumi:"identityIds"`
// The (Client) ID of the Service Principal.
PrincipalId *string `pulumi:"principalId"`
// The ID of the Tenant the Service Principal is assigned in.
TenantId *string `pulumi:"tenantId"`
// The type of Managed Service Identity that is configured on this Disk Encryption Set. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both).
Type string `pulumi:"type"`
}
// DiskEncryptionSetIdentityInput is an input type that accepts DiskEncryptionSetIdentityArgs and DiskEncryptionSetIdentityOutput values.
// You can construct a concrete instance of `DiskEncryptionSetIdentityInput` via:
//
// DiskEncryptionSetIdentityArgs{...}
type DiskEncryptionSetIdentityInput interface {
pulumi.Input
ToDiskEncryptionSetIdentityOutput() DiskEncryptionSetIdentityOutput
ToDiskEncryptionSetIdentityOutputWithContext(context.Context) DiskEncryptionSetIdentityOutput
}
type DiskEncryptionSetIdentityArgs struct {
// A list of User Assigned Managed Identity IDs to be assigned to this Disk Encryption Set.
//
// > **Note:** This is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
IdentityIds pulumi.StringArrayInput `pulumi:"identityIds"`
// The (Client) ID of the Service Principal.
PrincipalId pulumi.StringPtrInput `pulumi:"principalId"`
// The ID of the Tenant the Service Principal is assigned in.
TenantId pulumi.StringPtrInput `pulumi:"tenantId"`
// The type of Managed Service Identity that is configured on this Disk Encryption Set. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both).
Type pulumi.StringInput `pulumi:"type"`
}
func (DiskEncryptionSetIdentityArgs) ElementType() reflect.Type {
return reflect.TypeOf((*DiskEncryptionSetIdentity)(nil)).Elem()
}
func (i DiskEncryptionSetIdentityArgs) ToDiskEncryptionSetIdentityOutput() DiskEncryptionSetIdentityOutput {
return i.ToDiskEncryptionSetIdentityOutputWithContext(context.Background())
}
func (i DiskEncryptionSetIdentityArgs) ToDiskEncryptionSetIdentityOutputWithContext(ctx context.Context) DiskEncryptionSetIdentityOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskEncryptionSetIdentityOutput)
}
func (i DiskEncryptionSetIdentityArgs) ToDiskEncryptionSetIdentityPtrOutput() DiskEncryptionSetIdentityPtrOutput {
return i.ToDiskEncryptionSetIdentityPtrOutputWithContext(context.Background())
}
func (i DiskEncryptionSetIdentityArgs) ToDiskEncryptionSetIdentityPtrOutputWithContext(ctx context.Context) DiskEncryptionSetIdentityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskEncryptionSetIdentityOutput).ToDiskEncryptionSetIdentityPtrOutputWithContext(ctx)
}
// DiskEncryptionSetIdentityPtrInput is an input type that accepts DiskEncryptionSetIdentityArgs, DiskEncryptionSetIdentityPtr and DiskEncryptionSetIdentityPtrOutput values.
// You can construct a concrete instance of `DiskEncryptionSetIdentityPtrInput` via:
//
// DiskEncryptionSetIdentityArgs{...}
//
// or:
//
// nil
type DiskEncryptionSetIdentityPtrInput interface {
pulumi.Input
ToDiskEncryptionSetIdentityPtrOutput() DiskEncryptionSetIdentityPtrOutput
ToDiskEncryptionSetIdentityPtrOutputWithContext(context.Context) DiskEncryptionSetIdentityPtrOutput
}
type diskEncryptionSetIdentityPtrType DiskEncryptionSetIdentityArgs
func DiskEncryptionSetIdentityPtr(v *DiskEncryptionSetIdentityArgs) DiskEncryptionSetIdentityPtrInput {
return (*diskEncryptionSetIdentityPtrType)(v)
}
func (*diskEncryptionSetIdentityPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**DiskEncryptionSetIdentity)(nil)).Elem()
}
func (i *diskEncryptionSetIdentityPtrType) ToDiskEncryptionSetIdentityPtrOutput() DiskEncryptionSetIdentityPtrOutput {
return i.ToDiskEncryptionSetIdentityPtrOutputWithContext(context.Background())
}
func (i *diskEncryptionSetIdentityPtrType) ToDiskEncryptionSetIdentityPtrOutputWithContext(ctx context.Context) DiskEncryptionSetIdentityPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskEncryptionSetIdentityPtrOutput)
}
type DiskEncryptionSetIdentityOutput struct{ *pulumi.OutputState }
func (DiskEncryptionSetIdentityOutput) ElementType() reflect.Type {
return reflect.TypeOf((*DiskEncryptionSetIdentity)(nil)).Elem()
}
func (o DiskEncryptionSetIdentityOutput) ToDiskEncryptionSetIdentityOutput() DiskEncryptionSetIdentityOutput {
return o
}
func (o DiskEncryptionSetIdentityOutput) ToDiskEncryptionSetIdentityOutputWithContext(ctx context.Context) DiskEncryptionSetIdentityOutput {
return o
}
func (o DiskEncryptionSetIdentityOutput) ToDiskEncryptionSetIdentityPtrOutput() DiskEncryptionSetIdentityPtrOutput {
return o.ToDiskEncryptionSetIdentityPtrOutputWithContext(context.Background())
}
func (o DiskEncryptionSetIdentityOutput) ToDiskEncryptionSetIdentityPtrOutputWithContext(ctx context.Context) DiskEncryptionSetIdentityPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v DiskEncryptionSetIdentity) *DiskEncryptionSetIdentity {
return &v
}).(DiskEncryptionSetIdentityPtrOutput)
}
// A list of User Assigned Managed Identity IDs to be assigned to this Disk Encryption Set.
//
// > **Note:** This is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
func (o DiskEncryptionSetIdentityOutput) IdentityIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v DiskEncryptionSetIdentity) []string { return v.IdentityIds }).(pulumi.StringArrayOutput)
}
// The (Client) ID of the Service Principal.
func (o DiskEncryptionSetIdentityOutput) PrincipalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v DiskEncryptionSetIdentity) *string { return v.PrincipalId }).(pulumi.StringPtrOutput)
}
// The ID of the Tenant the Service Principal is assigned in.
func (o DiskEncryptionSetIdentityOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v DiskEncryptionSetIdentity) *string { return v.TenantId }).(pulumi.StringPtrOutput)
}
// The type of Managed Service Identity that is configured on this Disk Encryption Set. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both).
func (o DiskEncryptionSetIdentityOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v DiskEncryptionSetIdentity) string { return v.Type }).(pulumi.StringOutput)
}
type DiskEncryptionSetIdentityPtrOutput struct{ *pulumi.OutputState }
func (DiskEncryptionSetIdentityPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DiskEncryptionSetIdentity)(nil)).Elem()
}
func (o DiskEncryptionSetIdentityPtrOutput) ToDiskEncryptionSetIdentityPtrOutput() DiskEncryptionSetIdentityPtrOutput {
return o
}
func (o DiskEncryptionSetIdentityPtrOutput) ToDiskEncryptionSetIdentityPtrOutputWithContext(ctx context.Context) DiskEncryptionSetIdentityPtrOutput {
return o
}
func (o DiskEncryptionSetIdentityPtrOutput) Elem() DiskEncryptionSetIdentityOutput {
return o.ApplyT(func(v *DiskEncryptionSetIdentity) DiskEncryptionSetIdentity {
if v != nil {
return *v
}
var ret DiskEncryptionSetIdentity
return ret
}).(DiskEncryptionSetIdentityOutput)
}
// A list of User Assigned Managed Identity IDs to be assigned to this Disk Encryption Set.
//
// > **Note:** This is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`.
func (o DiskEncryptionSetIdentityPtrOutput) IdentityIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *DiskEncryptionSetIdentity) []string {
if v == nil {
return nil
}
return v.IdentityIds
}).(pulumi.StringArrayOutput)
}
// The (Client) ID of the Service Principal.
func (o DiskEncryptionSetIdentityPtrOutput) PrincipalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiskEncryptionSetIdentity) *string {
if v == nil {
return nil
}
return v.PrincipalId
}).(pulumi.StringPtrOutput)
}
// The ID of the Tenant the Service Principal is assigned in.
func (o DiskEncryptionSetIdentityPtrOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiskEncryptionSetIdentity) *string {
if v == nil {
return nil
}
return v.TenantId
}).(pulumi.StringPtrOutput)
}
// The type of Managed Service Identity that is configured on this Disk Encryption Set. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both).
func (o DiskEncryptionSetIdentityPtrOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiskEncryptionSetIdentity) *string {
if v == nil {
return nil
}
return &v.Type
}).(pulumi.StringPtrOutput)
}
type ExtensionProtectedSettingsFromKeyVault struct {
// The URL to the Key Vault Secret which stores the protected settings.
SecretUrl string `pulumi:"secretUrl"`
// The ID of the source Key Vault.
SourceVaultId string `pulumi:"sourceVaultId"`
}
// ExtensionProtectedSettingsFromKeyVaultInput is an input type that accepts ExtensionProtectedSettingsFromKeyVaultArgs and ExtensionProtectedSettingsFromKeyVaultOutput values.
// You can construct a concrete instance of `ExtensionProtectedSettingsFromKeyVaultInput` via:
//
// ExtensionProtectedSettingsFromKeyVaultArgs{...}
type ExtensionProtectedSettingsFromKeyVaultInput interface {
pulumi.Input
ToExtensionProtectedSettingsFromKeyVaultOutput() ExtensionProtectedSettingsFromKeyVaultOutput
ToExtensionProtectedSettingsFromKeyVaultOutputWithContext(context.Context) ExtensionProtectedSettingsFromKeyVaultOutput
}
type ExtensionProtectedSettingsFromKeyVaultArgs struct {
// The URL to the Key Vault Secret which stores the protected settings.
SecretUrl pulumi.StringInput `pulumi:"secretUrl"`
// The ID of the source Key Vault.
SourceVaultId pulumi.StringInput `pulumi:"sourceVaultId"`
}
func (ExtensionProtectedSettingsFromKeyVaultArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ExtensionProtectedSettingsFromKeyVault)(nil)).Elem()
}
func (i ExtensionProtectedSettingsFromKeyVaultArgs) ToExtensionProtectedSettingsFromKeyVaultOutput() ExtensionProtectedSettingsFromKeyVaultOutput {
return i.ToExtensionProtectedSettingsFromKeyVaultOutputWithContext(context.Background())
}
func (i ExtensionProtectedSettingsFromKeyVaultArgs) ToExtensionProtectedSettingsFromKeyVaultOutputWithContext(ctx context.Context) ExtensionProtectedSettingsFromKeyVaultOutput {
return pulumi.ToOutputWithContext(ctx, i).(ExtensionProtectedSettingsFromKeyVaultOutput)
}
func (i ExtensionProtectedSettingsFromKeyVaultArgs) ToExtensionProtectedSettingsFromKeyVaultPtrOutput() ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return i.ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(context.Background())
}
func (i ExtensionProtectedSettingsFromKeyVaultArgs) ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(ctx context.Context) ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ExtensionProtectedSettingsFromKeyVaultOutput).ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(ctx)
}
// ExtensionProtectedSettingsFromKeyVaultPtrInput is an input type that accepts ExtensionProtectedSettingsFromKeyVaultArgs, ExtensionProtectedSettingsFromKeyVaultPtr and ExtensionProtectedSettingsFromKeyVaultPtrOutput values.
// You can construct a concrete instance of `ExtensionProtectedSettingsFromKeyVaultPtrInput` via:
//
// ExtensionProtectedSettingsFromKeyVaultArgs{...}
//
// or:
//
// nil
type ExtensionProtectedSettingsFromKeyVaultPtrInput interface {
pulumi.Input
ToExtensionProtectedSettingsFromKeyVaultPtrOutput() ExtensionProtectedSettingsFromKeyVaultPtrOutput
ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(context.Context) ExtensionProtectedSettingsFromKeyVaultPtrOutput
}
type extensionProtectedSettingsFromKeyVaultPtrType ExtensionProtectedSettingsFromKeyVaultArgs
func ExtensionProtectedSettingsFromKeyVaultPtr(v *ExtensionProtectedSettingsFromKeyVaultArgs) ExtensionProtectedSettingsFromKeyVaultPtrInput {
return (*extensionProtectedSettingsFromKeyVaultPtrType)(v)
}
func (*extensionProtectedSettingsFromKeyVaultPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**ExtensionProtectedSettingsFromKeyVault)(nil)).Elem()
}
func (i *extensionProtectedSettingsFromKeyVaultPtrType) ToExtensionProtectedSettingsFromKeyVaultPtrOutput() ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return i.ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(context.Background())
}
func (i *extensionProtectedSettingsFromKeyVaultPtrType) ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(ctx context.Context) ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ExtensionProtectedSettingsFromKeyVaultPtrOutput)
}
type ExtensionProtectedSettingsFromKeyVaultOutput struct{ *pulumi.OutputState }
func (ExtensionProtectedSettingsFromKeyVaultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ExtensionProtectedSettingsFromKeyVault)(nil)).Elem()
}
func (o ExtensionProtectedSettingsFromKeyVaultOutput) ToExtensionProtectedSettingsFromKeyVaultOutput() ExtensionProtectedSettingsFromKeyVaultOutput {
return o
}
func (o ExtensionProtectedSettingsFromKeyVaultOutput) ToExtensionProtectedSettingsFromKeyVaultOutputWithContext(ctx context.Context) ExtensionProtectedSettingsFromKeyVaultOutput {
return o
}
func (o ExtensionProtectedSettingsFromKeyVaultOutput) ToExtensionProtectedSettingsFromKeyVaultPtrOutput() ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return o.ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(context.Background())
}
func (o ExtensionProtectedSettingsFromKeyVaultOutput) ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(ctx context.Context) ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v ExtensionProtectedSettingsFromKeyVault) *ExtensionProtectedSettingsFromKeyVault {
return &v
}).(ExtensionProtectedSettingsFromKeyVaultPtrOutput)
}
// The URL to the Key Vault Secret which stores the protected settings.
func (o ExtensionProtectedSettingsFromKeyVaultOutput) SecretUrl() pulumi.StringOutput {
return o.ApplyT(func(v ExtensionProtectedSettingsFromKeyVault) string { return v.SecretUrl }).(pulumi.StringOutput)
}
// The ID of the source Key Vault.
func (o ExtensionProtectedSettingsFromKeyVaultOutput) SourceVaultId() pulumi.StringOutput {
return o.ApplyT(func(v ExtensionProtectedSettingsFromKeyVault) string { return v.SourceVaultId }).(pulumi.StringOutput)
}
type ExtensionProtectedSettingsFromKeyVaultPtrOutput struct{ *pulumi.OutputState }
func (ExtensionProtectedSettingsFromKeyVaultPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ExtensionProtectedSettingsFromKeyVault)(nil)).Elem()
}
func (o ExtensionProtectedSettingsFromKeyVaultPtrOutput) ToExtensionProtectedSettingsFromKeyVaultPtrOutput() ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return o
}
func (o ExtensionProtectedSettingsFromKeyVaultPtrOutput) ToExtensionProtectedSettingsFromKeyVaultPtrOutputWithContext(ctx context.Context) ExtensionProtectedSettingsFromKeyVaultPtrOutput {
return o
}
func (o ExtensionProtectedSettingsFromKeyVaultPtrOutput) Elem() ExtensionProtectedSettingsFromKeyVaultOutput {
return o.ApplyT(func(v *ExtensionProtectedSettingsFromKeyVault) ExtensionProtectedSettingsFromKeyVault {
if v != nil {
return *v
}
var ret ExtensionProtectedSettingsFromKeyVault
return ret
}).(ExtensionProtectedSettingsFromKeyVaultOutput)
}
// The URL to the Key Vault Secret which stores the protected settings.
func (o ExtensionProtectedSettingsFromKeyVaultPtrOutput) SecretUrl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ExtensionProtectedSettingsFromKeyVault) *string {
if v == nil {
return nil
}
return &v.SecretUrl
}).(pulumi.StringPtrOutput)
}
// The ID of the source Key Vault.
func (o ExtensionProtectedSettingsFromKeyVaultPtrOutput) SourceVaultId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ExtensionProtectedSettingsFromKeyVault) *string {
if v == nil {
return nil
}
return &v.SourceVaultId
}).(pulumi.StringPtrOutput)
}
type GalleryApplicationVersionManageAction struct {
// The command to install the Gallery Application. Changing this forces a new resource to be created.
Install string `pulumi:"install"`
// The command to remove the Gallery Application. Changing this forces a new resource to be created.
Remove string `pulumi:"remove"`
// The command to update the Gallery Application. Changing this forces a new resource to be created.
Update *string `pulumi:"update"`
}
// GalleryApplicationVersionManageActionInput is an input type that accepts GalleryApplicationVersionManageActionArgs and GalleryApplicationVersionManageActionOutput values.
// You can construct a concrete instance of `GalleryApplicationVersionManageActionInput` via:
//
// GalleryApplicationVersionManageActionArgs{...}
type GalleryApplicationVersionManageActionInput interface {
pulumi.Input
ToGalleryApplicationVersionManageActionOutput() GalleryApplicationVersionManageActionOutput
ToGalleryApplicationVersionManageActionOutputWithContext(context.Context) GalleryApplicationVersionManageActionOutput
}
type GalleryApplicationVersionManageActionArgs struct {
// The command to install the Gallery Application. Changing this forces a new resource to be created.
Install pulumi.StringInput `pulumi:"install"`
// The command to remove the Gallery Application. Changing this forces a new resource to be created.
Remove pulumi.StringInput `pulumi:"remove"`
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/linuxVirtualMachineScaleSet.go | sdk/go/azure/compute/linuxVirtualMachineScaleSet.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Linux Virtual Machine Scale Set.
//
// ## Disclaimers
//
// > **Note:** As of the **v2.86.0** (November 19, 2021) release of the provider this resource will only create Virtual Machine Scale Sets with the **Uniform** Orchestration Mode. For Virtual Machine Scale Sets with **Flexible** orchestration mode, use `compute.OrchestratedVirtualMachineScaleSet`. Flexible orchestration mode is recommended for workloads on Azure.
//
// ## Example Usage
//
// This example provisions a basic Linux Virtual Machine Scale Set on an internal network.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// firstPublicKey := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com"
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-network"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// })
// if err != nil {
// return err
// }
// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// _, err = compute.NewLinuxVirtualMachineScaleSet(ctx, "example", &compute.LinuxVirtualMachineScaleSetArgs{
// Name: pulumi.String("example-vmss"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Sku: pulumi.String("Standard_F2"),
// Instances: pulumi.Int(1),
// AdminUsername: pulumi.String("adminuser"),
// AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{
// &compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{
// Username: pulumi.String("adminuser"),
// PublicKey: pulumi.String(firstPublicKey),
// },
// },
// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{
// Publisher: pulumi.String("Canonical"),
// Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
// Sku: pulumi.String("22_04-lts"),
// Version: pulumi.String("latest"),
// },
// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{
// StorageAccountType: pulumi.String("Standard_LRS"),
// Caching: pulumi.String("ReadWrite"),
// },
// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{
// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{
// Name: pulumi.String("example"),
// Primary: pulumi.Bool(true),
// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{
// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{
// Name: pulumi.String("internal"),
// Primary: pulumi.Bool(true),
// SubnetId: internal.ID(),
// },
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-11-01
//
// ## Import
//
// Linux Virtual Machine Scale Sets can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/linuxVirtualMachineScaleSet:LinuxVirtualMachineScaleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachineScaleSets/scaleset1
// ```
type LinuxVirtualMachineScaleSet struct {
pulumi.CustomResourceState
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities LinuxVirtualMachineScaleSetAdditionalCapabilitiesPtrOutput `pulumi:"additionalCapabilities"`
// The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.
//
// > **Note:** When an `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
//
// > **Note:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminPassword pulumi.StringPtrOutput `pulumi:"adminPassword"`
// One or more `adminSshKey` blocks as defined below.
//
// > **Note:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminSshKeys LinuxVirtualMachineScaleSetAdminSshKeyArrayOutput `pulumi:"adminSshKeys"`
// The username of the local administrator on each Virtual Machine Scale Set instance. Changing this forces a new resource to be created.
AdminUsername pulumi.StringOutput `pulumi:"adminUsername"`
// An `automaticInstanceRepair` block as defined below. To enable the automatic instance repair, this Virtual Machine Scale Set must have a valid `healthProbeId` or an [Application Health Extension](https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-health-extension).
//
// > **Note:** For more information about Automatic Instance Repair, please refer to the [product documentation](https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-instance-repairs).
AutomaticInstanceRepair LinuxVirtualMachineScaleSetAutomaticInstanceRepairOutput `pulumi:"automaticInstanceRepair"`
// An `automaticOsUpgradePolicy` block as defined below. This can only be specified when `upgradeMode` is set to either `Automatic` or `Rolling`.
AutomaticOsUpgradePolicy LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyPtrOutput `pulumi:"automaticOsUpgradePolicy"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics LinuxVirtualMachineScaleSetBootDiagnosticsPtrOutput `pulumi:"bootDiagnostics"`
// Specifies the ID of the Capacity Reservation Group which the Virtual Machine Scale Set should be allocated to. Changing this forces a new resource to be created.
//
// > **Note:** `capacityReservationGroupId` cannot be used with `proximityPlacementGroupId`
//
// > **Note:** `singlePlacementGroup` must be set to `false` when `capacityReservationGroupId` is specified.
CapacityReservationGroupId pulumi.StringPtrOutput `pulumi:"capacityReservationGroupId"`
// The prefix which should be used for the name of the Virtual Machines in this Scale Set. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerNamePrefix`, then you must specify `computerNamePrefix`. Changing this forces a new resource to be created.
ComputerNamePrefix pulumi.StringOutput `pulumi:"computerNamePrefix"`
// The Base64-Encoded Custom Data which should be used for this Virtual Machine Scale Set.
//
// > **Note:** When Custom Data has been configured, it's not possible to remove it without tainting the Virtual Machine Scale Set, due to a limitation of the Azure API.
CustomData pulumi.StringPtrOutput `pulumi:"customData"`
// One or more `dataDisk` blocks as defined below.
DataDisks LinuxVirtualMachineScaleSetDataDiskArrayOutput `pulumi:"dataDisks"`
// Should Password Authentication be disabled on this Virtual Machine Scale Set? Defaults to `true`.
//
// > **Note:** In general we'd recommend using SSH Keys for authentication rather than Passwords - but there's tradeoff's to each - please [see this thread for more information](https://security.stackexchange.com/questions/69407/why-is-using-an-ssh-key-more-secure-than-using-passwords).
//
// > **Note:** When a `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
DisablePasswordAuthentication pulumi.BoolPtrOutput `pulumi:"disablePasswordAuthentication"`
// Should Virtual Machine Extensions be run on Overprovisioned Virtual Machines in the Scale Set? Defaults to `false`.
DoNotRunExtensionsOnOverprovisionedMachines pulumi.BoolPtrOutput `pulumi:"doNotRunExtensionsOnOverprovisionedMachines"`
// Specifies the Edge Zone within the Azure Region where this Linux Virtual Machine Scale Set should exist. Changing this forces a new Linux Virtual Machine Scale Set to be created.
EdgeZone pulumi.StringPtrOutput `pulumi:"edgeZone"`
// Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host?
EncryptionAtHostEnabled pulumi.BoolPtrOutput `pulumi:"encryptionAtHostEnabled"`
// Specifies the eviction policy for Virtual Machines in this Scale Set. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created.
//
// > **Note:** This can only be configured when `priority` is set to `Spot`.
EvictionPolicy pulumi.StringPtrOutput `pulumi:"evictionPolicy"`
// Should extension operations be allowed on the Virtual Machine Scale Set? Possible values are `true` or `false`. Defaults to `true`. Changing this forces a new Linux Virtual Machine Scale Set to be created.
//
// > **Note:** `extensionOperationsEnabled` may only be set to `false` if there are no extensions defined in the `extension` field.
ExtensionOperationsEnabled pulumi.BoolPtrOutput `pulumi:"extensionOperationsEnabled"`
// One or more `extension` blocks as defined below
Extensions LinuxVirtualMachineScaleSetExtensionArrayOutput `pulumi:"extensions"`
// Specifies the duration allocated for all extensions to start. The time duration should be between `15` minutes and `120` minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `PT1H30M`.
ExtensionsTimeBudget pulumi.StringPtrOutput `pulumi:"extensionsTimeBudget"`
// One or more `galleryApplication` blocks as defined below.
GalleryApplications LinuxVirtualMachineScaleSetGalleryApplicationArrayOutput `pulumi:"galleryApplications"`
// The ID of a Load Balancer Probe which should be used to determine the health of an instance. This is Required and can only be specified when `upgradeMode` is set to `Automatic` or `Rolling`.
HealthProbeId pulumi.StringPtrOutput `pulumi:"healthProbeId"`
// Specifies the ID of the dedicated host group that the virtual machine scale set resides in. Changing this forces a new resource to be created.
HostGroupId pulumi.StringPtrOutput `pulumi:"hostGroupId"`
// An `identity` block as defined below.
Identity LinuxVirtualMachineScaleSetIdentityPtrOutput `pulumi:"identity"`
// The number of Virtual Machines in the Scale Set. Defaults to `0`.
//
// > **NOTE:** If you're using AutoScaling, you may wish to use [`Ignore Changes` functionality](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to ignore changes to this field.
Instances pulumi.IntPtrOutput `pulumi:"instances"`
// The Azure location where the Linux Virtual Machine Scale Set should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The maximum price you're willing to pay for each Virtual Machine in this Scale Set, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machines in the Scale Set will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that each Virtual Machine in this Scale Set should not be evicted for price reasons.
//
// > **Note:** This can only be configured when `priority` is set to `Spot`.
MaxBidPrice pulumi.Float64PtrOutput `pulumi:"maxBidPrice"`
// The name of the Linux Virtual Machine Scale Set. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// One or more `networkInterface` blocks as defined below.
NetworkInterfaces LinuxVirtualMachineScaleSetNetworkInterfaceArrayOutput `pulumi:"networkInterfaces"`
// An `osDisk` block as defined below.
OsDisk LinuxVirtualMachineScaleSetOsDiskOutput `pulumi:"osDisk"`
// Should Azure over-provision Virtual Machines in this Scale Set? This means that multiple Virtual Machines will be provisioned and Azure will keep the instances which become available first - which improves provisioning success rates and improves deployment time. You're not billed for these over-provisioned VM's and they don't count towards the Subscription Quota. Defaults to `true`.
Overprovision pulumi.BoolPtrOutput `pulumi:"overprovision"`
// A `plan` block as defined below. Changing this forces a new resource to be created.
//
// > **Note:** When using an image from Azure Marketplace a `plan` must be specified.
Plan LinuxVirtualMachineScaleSetPlanPtrOutput `pulumi:"plan"`
// Specifies the number of fault domains that are used by this Linux Virtual Machine Scale Set. Changing this forces a new resource to be created.
PlatformFaultDomainCount pulumi.IntOutput `pulumi:"platformFaultDomainCount"`
// The Priority of this Virtual Machine Scale Set. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this value forces a new resource.
//
// > **Note:** When `priority` is set to `Spot` an `evictionPolicy` must be specified.
Priority pulumi.StringPtrOutput `pulumi:"priority"`
// Should the Azure VM Agent be provisioned on each Virtual Machine in the Scale Set? Defaults to `true`. Changing this value forces a new resource to be created.
ProvisionVmAgent pulumi.BoolPtrOutput `pulumi:"provisionVmAgent"`
// The ID of the Proximity Placement Group in which the Virtual Machine Scale Set should be assigned to. Changing this forces a new resource to be created.
ProximityPlacementGroupId pulumi.StringPtrOutput `pulumi:"proximityPlacementGroupId"`
// Should resilient VM creation be enabled? When enabled, the service will attempt to create VMs in alternative fault domains or zones if the primary location fails during creation. Defaults to `false`.
//
// > **Note:** `resilientVmCreationEnabled` is currently not supported in the `austriaeast`, `belgiumcentral`, `centraluseuap`, `chilecentral`, `indonesiacentral`, `israelnorthwest`, `malaysiawest`, `mexicocentral`, `newzealandnorth`, `southcentralus2`, `southindia`, `southeastus3`, `southwestus`, `eastasia`, `eastus`, `southcentralus`, `southeastasia`, and `westeurope` regions.
ResilientVmCreationEnabled pulumi.BoolPtrOutput `pulumi:"resilientVmCreationEnabled"`
// Should resilient VM deletion be enabled? When enabled, the service will use a more resilient deletion process that attempts to gracefully handle failures during VM termination. Defaults to `false`.
//
// > **Note:** `resilientVmDeletionEnabled` is currently not supported in the `austriaeast`, `belgiumcentral`, `centraluseuap`, `chilecentral`, `indonesiacentral`, `israelnorthwest`, `malaysiawest`, `mexicocentral`, `newzealandnorth`, `southcentralus2`, `southindia`, `southeastus3`, `southwestus`, `eastasia`, `eastus`, `southcentralus`, `southeastasia`, and `westeurope` regions.
ResilientVmDeletionEnabled pulumi.BoolPtrOutput `pulumi:"resilientVmDeletionEnabled"`
// The name of the Resource Group in which the Linux Virtual Machine Scale Set should be exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `rollingUpgradePolicy` block as defined below. This is Required and can only be specified when `upgradeMode` is set to `Automatic` or `Rolling`. Changing this forces a new resource to be created.
RollingUpgradePolicy LinuxVirtualMachineScaleSetRollingUpgradePolicyPtrOutput `pulumi:"rollingUpgradePolicy"`
// A `scaleIn` block as defined below.
ScaleIn LinuxVirtualMachineScaleSetScaleInPtrOutput `pulumi:"scaleIn"`
// One or more `secret` blocks as defined below.
Secrets LinuxVirtualMachineScaleSetSecretArrayOutput `pulumi:"secrets"`
// Specifies whether secure boot should be enabled on the virtual machine. Changing this forces a new resource to be created.
SecureBootEnabled pulumi.BoolPtrOutput `pulumi:"secureBootEnabled"`
// Should this Virtual Machine Scale Set be limited to a Single Placement Group, which means the number of instances will be capped at 100 Virtual Machines. Defaults to `true`.
SinglePlacementGroup pulumi.BoolPtrOutput `pulumi:"singlePlacementGroup"`
// The Virtual Machine SKU for the Scale Set, such as `Standard_F2`.
Sku pulumi.StringOutput `pulumi:"sku"`
// The ID of an Image which each Virtual Machine in this Scale Set should be based on. Possible Image ID types include `Image ID`, `Shared Image ID`, `Shared Image Version ID`, `Community Gallery Image ID`, `Community Gallery Image Version ID`, `Shared Gallery Image ID` and `Shared Gallery Image Version ID`.
//
// > **Note:** One of either `sourceImageId` or `sourceImageReference` must be set.
SourceImageId pulumi.StringPtrOutput `pulumi:"sourceImageId"`
// A `sourceImageReference` block as defined below.
//
// > **Note:** One of either `sourceImageId` or `sourceImageReference` must be set.
SourceImageReference LinuxVirtualMachineScaleSetSourceImageReferencePtrOutput `pulumi:"sourceImageReference"`
// A `spotRestore` block as defined below.
SpotRestore LinuxVirtualMachineScaleSetSpotRestoreOutput `pulumi:"spotRestore"`
// A mapping of tags which should be assigned to this Virtual Machine Scale Set.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A `terminationNotification` block as defined below.
TerminationNotification LinuxVirtualMachineScaleSetTerminationNotificationOutput `pulumi:"terminationNotification"`
// The Unique ID for this Linux Virtual Machine Scale Set.
UniqueId pulumi.StringOutput `pulumi:"uniqueId"`
UpgradeMode pulumi.StringPtrOutput `pulumi:"upgradeMode"`
// The Base64-Encoded User Data which should be used for this Virtual Machine Scale Set.
UserData pulumi.StringPtrOutput `pulumi:"userData"`
// Specifies whether vTPM should be enabled on the virtual machine. Changing this forces a new resource to be created.
VtpmEnabled pulumi.BoolPtrOutput `pulumi:"vtpmEnabled"`
// Should the Virtual Machines in this Scale Set be strictly evenly distributed across Availability Zones? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** This can only be set to `true` when one or more `zones` are configured.
ZoneBalance pulumi.BoolPtrOutput `pulumi:"zoneBalance"`
// Specifies a list of Availability Zones in which this Linux Virtual Machine Scale Set should be located.
//
// > **Note:** Updating `zones` to remove an existing zone forces a new Virtual Machine Scale Set to be created.
Zones pulumi.StringArrayOutput `pulumi:"zones"`
}
// NewLinuxVirtualMachineScaleSet registers a new resource with the given unique name, arguments, and options.
func NewLinuxVirtualMachineScaleSet(ctx *pulumi.Context,
name string, args *LinuxVirtualMachineScaleSetArgs, opts ...pulumi.ResourceOption) (*LinuxVirtualMachineScaleSet, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AdminUsername == nil {
return nil, errors.New("invalid value for required argument 'AdminUsername'")
}
if args.NetworkInterfaces == nil {
return nil, errors.New("invalid value for required argument 'NetworkInterfaces'")
}
if args.OsDisk == nil {
return nil, errors.New("invalid value for required argument 'OsDisk'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Sku == nil {
return nil, errors.New("invalid value for required argument 'Sku'")
}
if args.AdminPassword != nil {
args.AdminPassword = pulumi.ToSecret(args.AdminPassword).(pulumi.StringPtrInput)
}
if args.CustomData != nil {
args.CustomData = pulumi.ToSecret(args.CustomData).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"adminPassword",
"customData",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource LinuxVirtualMachineScaleSet
err := ctx.RegisterResource("azure:compute/linuxVirtualMachineScaleSet:LinuxVirtualMachineScaleSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLinuxVirtualMachineScaleSet gets an existing LinuxVirtualMachineScaleSet resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetLinuxVirtualMachineScaleSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LinuxVirtualMachineScaleSetState, opts ...pulumi.ResourceOption) (*LinuxVirtualMachineScaleSet, error) {
var resource LinuxVirtualMachineScaleSet
err := ctx.ReadResource("azure:compute/linuxVirtualMachineScaleSet:LinuxVirtualMachineScaleSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LinuxVirtualMachineScaleSet resources.
type linuxVirtualMachineScaleSetState struct {
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities *LinuxVirtualMachineScaleSetAdditionalCapabilities `pulumi:"additionalCapabilities"`
// The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.
//
// > **Note:** When an `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
//
// > **Note:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminPassword *string `pulumi:"adminPassword"`
// One or more `adminSshKey` blocks as defined below.
//
// > **Note:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminSshKeys []LinuxVirtualMachineScaleSetAdminSshKey `pulumi:"adminSshKeys"`
// The username of the local administrator on each Virtual Machine Scale Set instance. Changing this forces a new resource to be created.
AdminUsername *string `pulumi:"adminUsername"`
// An `automaticInstanceRepair` block as defined below. To enable the automatic instance repair, this Virtual Machine Scale Set must have a valid `healthProbeId` or an [Application Health Extension](https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-health-extension).
//
// > **Note:** For more information about Automatic Instance Repair, please refer to the [product documentation](https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-instance-repairs).
AutomaticInstanceRepair *LinuxVirtualMachineScaleSetAutomaticInstanceRepair `pulumi:"automaticInstanceRepair"`
// An `automaticOsUpgradePolicy` block as defined below. This can only be specified when `upgradeMode` is set to either `Automatic` or `Rolling`.
AutomaticOsUpgradePolicy *LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicy `pulumi:"automaticOsUpgradePolicy"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics *LinuxVirtualMachineScaleSetBootDiagnostics `pulumi:"bootDiagnostics"`
// Specifies the ID of the Capacity Reservation Group which the Virtual Machine Scale Set should be allocated to. Changing this forces a new resource to be created.
//
// > **Note:** `capacityReservationGroupId` cannot be used with `proximityPlacementGroupId`
//
// > **Note:** `singlePlacementGroup` must be set to `false` when `capacityReservationGroupId` is specified.
CapacityReservationGroupId *string `pulumi:"capacityReservationGroupId"`
// The prefix which should be used for the name of the Virtual Machines in this Scale Set. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerNamePrefix`, then you must specify `computerNamePrefix`. Changing this forces a new resource to be created.
ComputerNamePrefix *string `pulumi:"computerNamePrefix"`
// The Base64-Encoded Custom Data which should be used for this Virtual Machine Scale Set.
//
// > **Note:** When Custom Data has been configured, it's not possible to remove it without tainting the Virtual Machine Scale Set, due to a limitation of the Azure API.
CustomData *string `pulumi:"customData"`
// One or more `dataDisk` blocks as defined below.
DataDisks []LinuxVirtualMachineScaleSetDataDisk `pulumi:"dataDisks"`
// Should Password Authentication be disabled on this Virtual Machine Scale Set? Defaults to `true`.
//
// > **Note:** In general we'd recommend using SSH Keys for authentication rather than Passwords - but there's tradeoff's to each - please [see this thread for more information](https://security.stackexchange.com/questions/69407/why-is-using-an-ssh-key-more-secure-than-using-passwords).
//
// > **Note:** When a `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
DisablePasswordAuthentication *bool `pulumi:"disablePasswordAuthentication"`
// Should Virtual Machine Extensions be run on Overprovisioned Virtual Machines in the Scale Set? Defaults to `false`.
DoNotRunExtensionsOnOverprovisionedMachines *bool `pulumi:"doNotRunExtensionsOnOverprovisionedMachines"`
// Specifies the Edge Zone within the Azure Region where this Linux Virtual Machine Scale Set should exist. Changing this forces a new Linux Virtual Machine Scale Set to be created.
EdgeZone *string `pulumi:"edgeZone"`
// Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host?
EncryptionAtHostEnabled *bool `pulumi:"encryptionAtHostEnabled"`
// Specifies the eviction policy for Virtual Machines in this Scale Set. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created.
//
// > **Note:** This can only be configured when `priority` is set to `Spot`.
EvictionPolicy *string `pulumi:"evictionPolicy"`
// Should extension operations be allowed on the Virtual Machine Scale Set? Possible values are `true` or `false`. Defaults to `true`. Changing this forces a new Linux Virtual Machine Scale Set to be created.
//
// > **Note:** `extensionOperationsEnabled` may only be set to `false` if there are no extensions defined in the `extension` field.
ExtensionOperationsEnabled *bool `pulumi:"extensionOperationsEnabled"`
// One or more `extension` blocks as defined below
Extensions []LinuxVirtualMachineScaleSetExtension `pulumi:"extensions"`
// Specifies the duration allocated for all extensions to start. The time duration should be between `15` minutes and `120` minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `PT1H30M`.
ExtensionsTimeBudget *string `pulumi:"extensionsTimeBudget"`
// One or more `galleryApplication` blocks as defined below.
GalleryApplications []LinuxVirtualMachineScaleSetGalleryApplication `pulumi:"galleryApplications"`
// The ID of a Load Balancer Probe which should be used to determine the health of an instance. This is Required and can only be specified when `upgradeMode` is set to `Automatic` or `Rolling`.
HealthProbeId *string `pulumi:"healthProbeId"`
// Specifies the ID of the dedicated host group that the virtual machine scale set resides in. Changing this forces a new resource to be created.
HostGroupId *string `pulumi:"hostGroupId"`
// An `identity` block as defined below.
Identity *LinuxVirtualMachineScaleSetIdentity `pulumi:"identity"`
// The number of Virtual Machines in the Scale Set. Defaults to `0`.
//
// > **NOTE:** If you're using AutoScaling, you may wish to use [`Ignore Changes` functionality](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to ignore changes to this field.
Instances *int `pulumi:"instances"`
// The Azure location where the Linux Virtual Machine Scale Set should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The maximum price you're willing to pay for each Virtual Machine in this Scale Set, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machines in the Scale Set will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that each Virtual Machine in this Scale Set should not be evicted for price reasons.
//
// > **Note:** This can only be configured when `priority` is set to `Spot`.
MaxBidPrice *float64 `pulumi:"maxBidPrice"`
// The name of the Linux Virtual Machine Scale Set. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// One or more `networkInterface` blocks as defined below.
NetworkInterfaces []LinuxVirtualMachineScaleSetNetworkInterface `pulumi:"networkInterfaces"`
// An `osDisk` block as defined below.
OsDisk *LinuxVirtualMachineScaleSetOsDisk `pulumi:"osDisk"`
// Should Azure over-provision Virtual Machines in this Scale Set? This means that multiple Virtual Machines will be provisioned and Azure will keep the instances which become available first - which improves provisioning success rates and improves deployment time. You're not billed for these over-provisioned VM's and they don't count towards the Subscription Quota. Defaults to `true`.
Overprovision *bool `pulumi:"overprovision"`
// A `plan` block as defined below. Changing this forces a new resource to be created.
//
// > **Note:** When using an image from Azure Marketplace a `plan` must be specified.
Plan *LinuxVirtualMachineScaleSetPlan `pulumi:"plan"`
// Specifies the number of fault domains that are used by this Linux Virtual Machine Scale Set. Changing this forces a new resource to be created.
PlatformFaultDomainCount *int `pulumi:"platformFaultDomainCount"`
// The Priority of this Virtual Machine Scale Set. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this value forces a new resource.
//
// > **Note:** When `priority` is set to `Spot` an `evictionPolicy` must be specified.
Priority *string `pulumi:"priority"`
// Should the Azure VM Agent be provisioned on each Virtual Machine in the Scale Set? Defaults to `true`. Changing this value forces a new resource to be created.
ProvisionVmAgent *bool `pulumi:"provisionVmAgent"`
// The ID of the Proximity Placement Group in which the Virtual Machine Scale Set should be assigned to. Changing this forces a new resource to be created.
ProximityPlacementGroupId *string `pulumi:"proximityPlacementGroupId"`
// Should resilient VM creation be enabled? When enabled, the service will attempt to create VMs in alternative fault domains or zones if the primary location fails during creation. Defaults to `false`.
//
// > **Note:** `resilientVmCreationEnabled` is currently not supported in the `austriaeast`, `belgiumcentral`, `centraluseuap`, `chilecentral`, `indonesiacentral`, `israelnorthwest`, `malaysiawest`, `mexicocentral`, `newzealandnorth`, `southcentralus2`, `southindia`, `southeastus3`, `southwestus`, `eastasia`, `eastus`, `southcentralus`, `southeastasia`, and `westeurope` regions.
ResilientVmCreationEnabled *bool `pulumi:"resilientVmCreationEnabled"`
// Should resilient VM deletion be enabled? When enabled, the service will use a more resilient deletion process that attempts to gracefully handle failures during VM termination. Defaults to `false`.
//
// > **Note:** `resilientVmDeletionEnabled` is currently not supported in the `austriaeast`, `belgiumcentral`, `centraluseuap`, `chilecentral`, `indonesiacentral`, `israelnorthwest`, `malaysiawest`, `mexicocentral`, `newzealandnorth`, `southcentralus2`, `southindia`, `southeastus3`, `southwestus`, `eastasia`, `eastus`, `southcentralus`, `southeastasia`, and `westeurope` regions.
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getImage.go | sdk/go/azure/compute/getImage.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Image.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// search, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
// Name: pulumi.StringRef("search-api"),
// ResourceGroupName: "packerimages",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("imageId", search.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-01
func LookupImage(ctx *pulumi.Context, args *LookupImageArgs, opts ...pulumi.InvokeOption) (*LookupImageResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupImageResult
err := ctx.Invoke("azure:compute/getImage:getImage", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getImage.
type LookupImageArgs struct {
// The name of the Image.
Name *string `pulumi:"name"`
// Regex pattern of the image to match.
NameRegex *string `pulumi:"nameRegex"`
// The Name of the Resource Group where this Image exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
// By default when matching by regex, images are sorted by name in ascending order and the first match is chosen, to sort descending, set this flag.
SortDescending *bool `pulumi:"sortDescending"`
}
// A collection of values returned by getImage.
type LookupImageResult struct {
// a collection of `dataDisk` blocks as defined below.
DataDisks []GetImageDataDisk `pulumi:"dataDisks"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// the Azure Location where this Image exists.
Location string `pulumi:"location"`
// the name of the Image.
Name *string `pulumi:"name"`
NameRegex *string `pulumi:"nameRegex"`
// a `osDisk` block as defined below.
OsDisks []GetImageOsDisk `pulumi:"osDisks"`
ResourceGroupName string `pulumi:"resourceGroupName"`
SortDescending *bool `pulumi:"sortDescending"`
// a mapping of tags to assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// is zone resiliency enabled?
ZoneResilient bool `pulumi:"zoneResilient"`
}
func LookupImageOutput(ctx *pulumi.Context, args LookupImageOutputArgs, opts ...pulumi.InvokeOption) LookupImageResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupImageResultOutput, error) {
args := v.(LookupImageArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getImage:getImage", args, LookupImageResultOutput{}, options).(LookupImageResultOutput), nil
}).(LookupImageResultOutput)
}
// A collection of arguments for invoking getImage.
type LookupImageOutputArgs struct {
// The name of the Image.
Name pulumi.StringPtrInput `pulumi:"name"`
// Regex pattern of the image to match.
NameRegex pulumi.StringPtrInput `pulumi:"nameRegex"`
// The Name of the Resource Group where this Image exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// By default when matching by regex, images are sorted by name in ascending order and the first match is chosen, to sort descending, set this flag.
SortDescending pulumi.BoolPtrInput `pulumi:"sortDescending"`
}
func (LookupImageOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupImageArgs)(nil)).Elem()
}
// A collection of values returned by getImage.
type LookupImageResultOutput struct{ *pulumi.OutputState }
func (LookupImageResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupImageResult)(nil)).Elem()
}
func (o LookupImageResultOutput) ToLookupImageResultOutput() LookupImageResultOutput {
return o
}
func (o LookupImageResultOutput) ToLookupImageResultOutputWithContext(ctx context.Context) LookupImageResultOutput {
return o
}
// a collection of `dataDisk` blocks as defined below.
func (o LookupImageResultOutput) DataDisks() GetImageDataDiskArrayOutput {
return o.ApplyT(func(v LookupImageResult) []GetImageDataDisk { return v.DataDisks }).(GetImageDataDiskArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupImageResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupImageResult) string { return v.Id }).(pulumi.StringOutput)
}
// the Azure Location where this Image exists.
func (o LookupImageResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupImageResult) string { return v.Location }).(pulumi.StringOutput)
}
// the name of the Image.
func (o LookupImageResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupImageResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
func (o LookupImageResultOutput) NameRegex() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupImageResult) *string { return v.NameRegex }).(pulumi.StringPtrOutput)
}
// a `osDisk` block as defined below.
func (o LookupImageResultOutput) OsDisks() GetImageOsDiskArrayOutput {
return o.ApplyT(func(v LookupImageResult) []GetImageOsDisk { return v.OsDisks }).(GetImageOsDiskArrayOutput)
}
func (o LookupImageResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupImageResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func (o LookupImageResultOutput) SortDescending() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupImageResult) *bool { return v.SortDescending }).(pulumi.BoolPtrOutput)
}
// a mapping of tags to assigned to the resource.
func (o LookupImageResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupImageResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// is zone resiliency enabled?
func (o LookupImageResultOutput) ZoneResilient() pulumi.BoolOutput {
return o.ApplyT(func(v LookupImageResult) bool { return v.ZoneResilient }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupImageResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/linuxVirtualMachine.go | sdk/go/azure/compute/linuxVirtualMachine.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Linux Virtual Machine.
//
// ## Disclaimers
//
// > **Note** This provider will automatically remove the OS Disk by default - this behaviour can be configured using the `features` configuration within the Provider configuration block.
//
// > **Note** All arguments including the administrator login and password will be stored in the raw state as plain-text.
//
// > **Note** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `compute.VirtualMachine` resource instead.
//
// > **Note** This resource does not support attaching existing OS Disks. You can instead capture an image of the OS Disk or continue to use the `compute.VirtualMachine` resource instead.
//
// > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's.
//
// ## Example Usage
//
// This example provisions a basic Linux Virtual Machine on an internal network.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
// Name: pulumi.String("example-network"),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: exampleVirtualNetwork.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "example", &network.NetworkInterfaceArgs{
// Name: pulumi.String("example-nic"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
// &network.NetworkInterfaceIpConfigurationArgs{
// Name: pulumi.String("internal"),
// SubnetId: exampleSubnet.ID(),
// PrivateIpAddressAllocation: pulumi.String("Dynamic"),
// },
// },
// })
// if err != nil {
// return err
// }
// invokeFile, err := std.File(ctx, &std.FileArgs{
// Input: "~/.ssh/id_rsa.pub",
// }, nil)
// if err != nil {
// return err
// }
// _, err = compute.NewLinuxVirtualMachine(ctx, "example", &compute.LinuxVirtualMachineArgs{
// Name: pulumi.String("example-machine"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Size: pulumi.String("Standard_F2"),
// AdminUsername: pulumi.String("adminuser"),
// NetworkInterfaceIds: pulumi.StringArray{
// exampleNetworkInterface.ID(),
// },
// AdminSshKeys: compute.LinuxVirtualMachineAdminSshKeyArray{
// &compute.LinuxVirtualMachineAdminSshKeyArgs{
// Username: pulumi.String("adminuser"),
// PublicKey: pulumi.String(invokeFile.Result),
// },
// },
// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{
// Caching: pulumi.String("ReadWrite"),
// StorageAccountType: pulumi.String("Standard_LRS"),
// },
// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{
// Publisher: pulumi.String("Canonical"),
// Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
// Sku: pulumi.String("22_04-lts"),
// Version: pulumi.String("latest"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01, 2023-04-02
//
// ## Import
//
// Linux Virtual Machines can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/linuxVirtualMachine:LinuxVirtualMachine example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1
// ```
type LinuxVirtualMachine struct {
pulumi.CustomResourceState
// A `additionalCapabilities` block as defined below.
AdditionalCapabilities LinuxVirtualMachineAdditionalCapabilitiesPtrOutput `pulumi:"additionalCapabilities"`
// The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.
//
// > **NOTE:** When an `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
// **NOTE:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminPassword pulumi.StringPtrOutput `pulumi:"adminPassword"`
// One or more `adminSshKey` blocks as defined below. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminSshKeys LinuxVirtualMachineAdminSshKeyArrayOutput `pulumi:"adminSshKeys"`
// The username of the local administrator used for the Virtual Machine. Changing this forces a new resource to be created.
//
// > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`.
AdminUsername pulumi.StringPtrOutput `pulumi:"adminUsername"`
// Should Extension Operations be allowed on this Virtual Machine? Defaults to `true`.
AllowExtensionOperations pulumi.BoolOutput `pulumi:"allowExtensionOperations"`
// Specifies the ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId pulumi.StringPtrOutput `pulumi:"availabilitySetId"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics LinuxVirtualMachineBootDiagnosticsPtrOutput `pulumi:"bootDiagnostics"`
// Specifies whether to skip platform scheduled patching when a user schedule is associated with the VM. Defaults to `false`.
//
// > **NOTE:** `bypassPlatformSafetyChecksOnUserScheduleEnabled` can only be set to `true` when `patchMode` is set to `AutomaticByPlatform`.
BypassPlatformSafetyChecksOnUserScheduleEnabled pulumi.BoolPtrOutput `pulumi:"bypassPlatformSafetyChecksOnUserScheduleEnabled"`
// Specifies the ID of the Capacity Reservation Group which the Virtual Machine should be allocated to.
//
// > **NOTE:** `capacityReservationGroupId` cannot be used with `availabilitySetId` or `proximityPlacementGroupId`
CapacityReservationGroupId pulumi.StringPtrOutput `pulumi:"capacityReservationGroupId"`
// Specifies the Hostname which should be used for this Virtual Machine. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerName`, then you must specify `computerName`. Changing this forces a new resource to be created.
ComputerName pulumi.StringOutput `pulumi:"computerName"`
// The Base64-Encoded Custom Data which should be used for this Virtual Machine. Changing this forces a new resource to be created.
CustomData pulumi.StringPtrOutput `pulumi:"customData"`
// The ID of a Dedicated Host Group that this Linux Virtual Machine should be run within. Conflicts with `dedicatedHostId`.
DedicatedHostGroupId pulumi.StringPtrOutput `pulumi:"dedicatedHostGroupId"`
// The ID of a Dedicated Host where this machine should be run on. Conflicts with `dedicatedHostGroupId`.
DedicatedHostId pulumi.StringPtrOutput `pulumi:"dedicatedHostId"`
// Should Password Authentication be disabled on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created.
//
// > In general we'd recommend using SSH Keys for authentication rather than Passwords - but there's tradeoff's to each - please [see this thread for more information](https://security.stackexchange.com/questions/69407/why-is-using-an-ssh-key-more-secure-than-using-passwords).
//
// > **NOTE:** When an `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
DisablePasswordAuthentication pulumi.BoolOutput `pulumi:"disablePasswordAuthentication"`
// Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`.
DiskControllerType pulumi.StringOutput `pulumi:"diskControllerType"`
// Specifies the Edge Zone within the Azure Region where this Linux Virtual Machine should exist. Changing this forces a new Linux Virtual Machine to be created.
EdgeZone pulumi.StringPtrOutput `pulumi:"edgeZone"`
// Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host?
EncryptionAtHostEnabled pulumi.BoolPtrOutput `pulumi:"encryptionAtHostEnabled"`
// Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created.
//
// > **NOTE:** This can only be configured when `priority` is set to `Spot`.
EvictionPolicy pulumi.StringPtrOutput `pulumi:"evictionPolicy"`
// Specifies the duration allocated for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `PT1H30M`.
ExtensionsTimeBudget pulumi.StringPtrOutput `pulumi:"extensionsTimeBudget"`
// One or more `galleryApplication` blocks as defined below.
//
// > **Note** Gallery Application Assignments can be defined either directly on `compute.LinuxVirtualMachine` resource, or using the `compute.GalleryApplicationAssignment` resource - but the two approaches cannot be used together. If both are used with the same Virtual Machine, spurious changes will occur. If `compute.GalleryApplicationAssignment` is used, it's recommended to use `ignoreChanges` for the `galleryApplication` block on the corresponding `compute.LinuxVirtualMachine` resource, to avoid a persistent diff when using this resource.
GalleryApplications LinuxVirtualMachineGalleryApplicationArrayOutput `pulumi:"galleryApplications"`
// An `identity` block as defined below.
Identity LinuxVirtualMachineIdentityPtrOutput `pulumi:"identity"`
// Specifies the License Type for this Virtual Machine. Possible values are `RHEL_BYOS`, `RHEL_BASE`, `RHEL_EUS`, `RHEL_SAPAPPS`, `RHEL_SAPHA`, `RHEL_BASESAPAPPS`, `RHEL_BASESAPHA`, `SLES_BYOS`, `SLES_SAP`, `SLES_HPC`, `UBUNTU_PRO`.
LicenseType pulumi.StringPtrOutput `pulumi:"licenseType"`
// The Azure location where the Linux Virtual Machine should exist. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The maximum price you're willing to pay for this Virtual Machine, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machine will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that the Virtual Machine should not be evicted for price reasons.
//
// > **NOTE:** This can only be configured when `priority` is set to `Spot`.
MaxBidPrice pulumi.Float64PtrOutput `pulumi:"maxBidPrice"`
// The name of the Linux Virtual Machine. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// . A list of Network Interface IDs which should be attached to this Virtual Machine. The first Network Interface ID in this list will be the Primary Network Interface on the Virtual Machine.
NetworkInterfaceIds pulumi.StringArrayOutput `pulumi:"networkInterfaceIds"`
// A `osDisk` block as defined below.
OsDisk LinuxVirtualMachineOsDiskOutput `pulumi:"osDisk"`
// A `osImageNotification` block as defined below.
OsImageNotification LinuxVirtualMachineOsImageNotificationPtrOutput `pulumi:"osImageNotification"`
// The ID of an existing Managed Disk to use as the OS Disk for this Linux Virtual Machine. Changing this forces a new resource to be created.
//
// > **Note:** When specifying an existing Managed Disk it is not currently possible to subsequently manage the Operating System Profile properties: `adminUsername`, `adminPassword`, `bypassPlatformSafetyChecksOnUserScheduleEnabled`, `computerName`, `customData`, `provisionVmAgent`, `patchMode`, `patchAssessmentMode`, or `rebootSetting`.
OsManagedDiskId pulumi.StringOutput `pulumi:"osManagedDiskId"`
// Specifies the mode of VM Guest Patching for the Virtual Machine. Possible values are `AutomaticByPlatform` or `ImageDefault`. Defaults to `ImageDefault`.
//
// > **NOTE:** If the `patchAssessmentMode` is set to `AutomaticByPlatform` then the `provisionVmAgent` field must be set to `true`.
PatchAssessmentMode pulumi.StringOutput `pulumi:"patchAssessmentMode"`
// Specifies the mode of in-guest patching to this Linux Virtual Machine. Possible values are `AutomaticByPlatform` and `ImageDefault`. Defaults to `ImageDefault`. For more information on patch modes please see the [product documentation](https://docs.microsoft.com/azure/virtual-machines/automatic-vm-guest-patching#patch-orchestration-modes).
//
// > **NOTE:** If `patchMode` is set to `AutomaticByPlatform` then `provisionVmAgent` must also be set to `true`.
PatchMode pulumi.StringOutput `pulumi:"patchMode"`
// A `plan` block as defined below. Changing this forces a new resource to be created.
Plan LinuxVirtualMachinePlanPtrOutput `pulumi:"plan"`
// Specifies the Platform Fault Domain in which this Linux Virtual Machine should be created. Defaults to `-1`, which means this will be automatically assigned to a fault domain that best maintains balance across the available fault domains. Changing this forces a new Linux Virtual Machine to be created.
PlatformFaultDomain pulumi.IntPtrOutput `pulumi:"platformFaultDomain"`
// Specifies the priority of this Virtual Machine. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this forces a new resource to be created.
Priority pulumi.StringPtrOutput `pulumi:"priority"`
// The Primary Private IP Address assigned to this Virtual Machine.
PrivateIpAddress pulumi.StringOutput `pulumi:"privateIpAddress"`
// A list of Private IP Addresses assigned to this Virtual Machine.
PrivateIpAddresses pulumi.StringArrayOutput `pulumi:"privateIpAddresses"`
// Should the Azure VM Agent be provisioned on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created.
//
// > **NOTE:** If `provisionVmAgent` is set to `false` then `allowExtensionOperations` must also be set to `false`.
ProvisionVmAgent pulumi.BoolOutput `pulumi:"provisionVmAgent"`
// The ID of the Proximity Placement Group which the Virtual Machine should be assigned to.
ProximityPlacementGroupId pulumi.StringPtrOutput `pulumi:"proximityPlacementGroupId"`
// The Primary Public IP Address assigned to this Virtual Machine.
PublicIpAddress pulumi.StringOutput `pulumi:"publicIpAddress"`
// A list of the Public IP Addresses assigned to this Virtual Machine.
PublicIpAddresses pulumi.StringArrayOutput `pulumi:"publicIpAddresses"`
// Specifies the reboot setting for platform scheduled patching. Possible values are `Always`, `IfRequired` and `Never`.
//
// > **NOTE:** `rebootSetting` can only be set when `patchMode` is set to `AutomaticByPlatform`.
RebootSetting pulumi.StringPtrOutput `pulumi:"rebootSetting"`
// The name of the Resource Group in which the Linux Virtual Machine should be exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// One or more `secret` blocks as defined below.
Secrets LinuxVirtualMachineSecretArrayOutput `pulumi:"secrets"`
// Specifies whether secure boot should be enabled on the virtual machine. Changing this forces a new resource to be created.
SecureBootEnabled pulumi.BoolPtrOutput `pulumi:"secureBootEnabled"`
// The SKU which should be used for this Virtual Machine, such as `Standard_F2`.
Size pulumi.StringOutput `pulumi:"size"`
// The ID of the Image which this Virtual Machine should be created from. Changing this forces a new resource to be created. Possible Image ID types include `Image ID`s, `Shared Image ID`s, `Shared Image Version ID`s, `Community Gallery Image ID`s, `Community Gallery Image Version ID`s, `Shared Gallery Image ID`s and `Shared Gallery Image Version ID`s.
//
// > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set.
SourceImageId pulumi.StringPtrOutput `pulumi:"sourceImageId"`
// A `sourceImageReference` block as defined below. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set.
SourceImageReference LinuxVirtualMachineSourceImageReferencePtrOutput `pulumi:"sourceImageReference"`
// A mapping of tags which should be assigned to this Virtual Machine.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A `terminationNotification` block as defined below.
TerminationNotification LinuxVirtualMachineTerminationNotificationOutput `pulumi:"terminationNotification"`
// The Base64-Encoded User Data which should be used for this Virtual Machine.
UserData pulumi.StringPtrOutput `pulumi:"userData"`
// A 128-bit identifier which uniquely identifies this Virtual Machine.
VirtualMachineId pulumi.StringOutput `pulumi:"virtualMachineId"`
// Specifies the Orchestrated Virtual Machine Scale Set that this Virtual Machine should be created within.
//
// > **NOTE:** To update `virtualMachineScaleSetId` the Preview Feature `Microsoft.Compute/SingleFDAttachDetachVMToVmss` needs to be enabled, see [the documentation](https://review.learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm#enroll-in-the-preview) for more information.
//
// > **NOTE:** Orchestrated Virtual Machine Scale Sets can be provisioned using [the `compute.OrchestratedVirtualMachineScaleSet` resource](https://www.terraform.io/docs/providers/azurerm/r/orchestrated_virtual_machine_scale_set.html).
//
// > **NOTE:** To attach an existing VM to a Virtual Machine Scale Set, the scale set must have `singlePlacementGroup` set to `false`, see [the documentation](https://learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3#limitations-for-attaching-an-existing-vm-to-a-scale-set) for more information.
VirtualMachineScaleSetId pulumi.StringPtrOutput `pulumi:"virtualMachineScaleSetId"`
// Specifies whether VMAgent Platform Updates is enabled. Defaults to `false`.
//
// Deprecated: this property has been deprecated due to a breaking change introduced by the Service team, which redefined it as a read-only field within the API
VmAgentPlatformUpdatesEnabled pulumi.BoolOutput `pulumi:"vmAgentPlatformUpdatesEnabled"`
// Specifies whether vTPM should be enabled on the virtual machine. Changing this forces a new resource to be created.
VtpmEnabled pulumi.BoolPtrOutput `pulumi:"vtpmEnabled"`
// Specifies the Availability Zones in which this Linux Virtual Machine should be located. Changing this forces a new Linux Virtual Machine to be created.
Zone pulumi.StringPtrOutput `pulumi:"zone"`
}
// NewLinuxVirtualMachine registers a new resource with the given unique name, arguments, and options.
func NewLinuxVirtualMachine(ctx *pulumi.Context,
name string, args *LinuxVirtualMachineArgs, opts ...pulumi.ResourceOption) (*LinuxVirtualMachine, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.NetworkInterfaceIds == nil {
return nil, errors.New("invalid value for required argument 'NetworkInterfaceIds'")
}
if args.OsDisk == nil {
return nil, errors.New("invalid value for required argument 'OsDisk'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Size == nil {
return nil, errors.New("invalid value for required argument 'Size'")
}
if args.AdminPassword != nil {
args.AdminPassword = pulumi.ToSecret(args.AdminPassword).(pulumi.StringPtrInput)
}
if args.CustomData != nil {
args.CustomData = pulumi.ToSecret(args.CustomData).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"adminPassword",
"customData",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource LinuxVirtualMachine
err := ctx.RegisterResource("azure:compute/linuxVirtualMachine:LinuxVirtualMachine", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLinuxVirtualMachine gets an existing LinuxVirtualMachine resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetLinuxVirtualMachine(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LinuxVirtualMachineState, opts ...pulumi.ResourceOption) (*LinuxVirtualMachine, error) {
var resource LinuxVirtualMachine
err := ctx.ReadResource("azure:compute/linuxVirtualMachine:LinuxVirtualMachine", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LinuxVirtualMachine resources.
type linuxVirtualMachineState struct {
// A `additionalCapabilities` block as defined below.
AdditionalCapabilities *LinuxVirtualMachineAdditionalCapabilities `pulumi:"additionalCapabilities"`
// The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.
//
// > **NOTE:** When an `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
// **NOTE:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminPassword *string `pulumi:"adminPassword"`
// One or more `adminSshKey` blocks as defined below. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `adminPassword` or `adminSshKey` must be specified.
AdminSshKeys []LinuxVirtualMachineAdminSshKey `pulumi:"adminSshKeys"`
// The username of the local administrator used for the Virtual Machine. Changing this forces a new resource to be created.
//
// > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`.
AdminUsername *string `pulumi:"adminUsername"`
// Should Extension Operations be allowed on this Virtual Machine? Defaults to `true`.
AllowExtensionOperations *bool `pulumi:"allowExtensionOperations"`
// Specifies the ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId *string `pulumi:"availabilitySetId"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics *LinuxVirtualMachineBootDiagnostics `pulumi:"bootDiagnostics"`
// Specifies whether to skip platform scheduled patching when a user schedule is associated with the VM. Defaults to `false`.
//
// > **NOTE:** `bypassPlatformSafetyChecksOnUserScheduleEnabled` can only be set to `true` when `patchMode` is set to `AutomaticByPlatform`.
BypassPlatformSafetyChecksOnUserScheduleEnabled *bool `pulumi:"bypassPlatformSafetyChecksOnUserScheduleEnabled"`
// Specifies the ID of the Capacity Reservation Group which the Virtual Machine should be allocated to.
//
// > **NOTE:** `capacityReservationGroupId` cannot be used with `availabilitySetId` or `proximityPlacementGroupId`
CapacityReservationGroupId *string `pulumi:"capacityReservationGroupId"`
// Specifies the Hostname which should be used for this Virtual Machine. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerName`, then you must specify `computerName`. Changing this forces a new resource to be created.
ComputerName *string `pulumi:"computerName"`
// The Base64-Encoded Custom Data which should be used for this Virtual Machine. Changing this forces a new resource to be created.
CustomData *string `pulumi:"customData"`
// The ID of a Dedicated Host Group that this Linux Virtual Machine should be run within. Conflicts with `dedicatedHostId`.
DedicatedHostGroupId *string `pulumi:"dedicatedHostGroupId"`
// The ID of a Dedicated Host where this machine should be run on. Conflicts with `dedicatedHostGroupId`.
DedicatedHostId *string `pulumi:"dedicatedHostId"`
// Should Password Authentication be disabled on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created.
//
// > In general we'd recommend using SSH Keys for authentication rather than Passwords - but there's tradeoff's to each - please [see this thread for more information](https://security.stackexchange.com/questions/69407/why-is-using-an-ssh-key-more-secure-than-using-passwords).
//
// > **NOTE:** When an `adminPassword` is specified `disablePasswordAuthentication` must be set to `false`.
DisablePasswordAuthentication *bool `pulumi:"disablePasswordAuthentication"`
// Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`.
DiskControllerType *string `pulumi:"diskControllerType"`
// Specifies the Edge Zone within the Azure Region where this Linux Virtual Machine should exist. Changing this forces a new Linux Virtual Machine to be created.
EdgeZone *string `pulumi:"edgeZone"`
// Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host?
EncryptionAtHostEnabled *bool `pulumi:"encryptionAtHostEnabled"`
// Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created.
//
// > **NOTE:** This can only be configured when `priority` is set to `Spot`.
EvictionPolicy *string `pulumi:"evictionPolicy"`
// Specifies the duration allocated for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `PT1H30M`.
ExtensionsTimeBudget *string `pulumi:"extensionsTimeBudget"`
// One or more `galleryApplication` blocks as defined below.
//
// > **Note** Gallery Application Assignments can be defined either directly on `compute.LinuxVirtualMachine` resource, or using the `compute.GalleryApplicationAssignment` resource - but the two approaches cannot be used together. If both are used with the same Virtual Machine, spurious changes will occur. If `compute.GalleryApplicationAssignment` is used, it's recommended to use `ignoreChanges` for the `galleryApplication` block on the corresponding `compute.LinuxVirtualMachine` resource, to avoid a persistent diff when using this resource.
GalleryApplications []LinuxVirtualMachineGalleryApplication `pulumi:"galleryApplications"`
// An `identity` block as defined below.
Identity *LinuxVirtualMachineIdentity `pulumi:"identity"`
// Specifies the License Type for this Virtual Machine. Possible values are `RHEL_BYOS`, `RHEL_BASE`, `RHEL_EUS`, `RHEL_SAPAPPS`, `RHEL_SAPHA`, `RHEL_BASESAPAPPS`, `RHEL_BASESAPHA`, `SLES_BYOS`, `SLES_SAP`, `SLES_HPC`, `UBUNTU_PRO`.
LicenseType *string `pulumi:"licenseType"`
// The Azure location where the Linux Virtual Machine should exist. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The maximum price you're willing to pay for this Virtual Machine, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machine will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that the Virtual Machine should not be evicted for price reasons.
//
// > **NOTE:** This can only be configured when `priority` is set to `Spot`.
MaxBidPrice *float64 `pulumi:"maxBidPrice"`
// The name of the Linux Virtual Machine. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// . A list of Network Interface IDs which should be attached to this Virtual Machine. The first Network Interface ID in this list will be the Primary Network Interface on the Virtual Machine.
NetworkInterfaceIds []string `pulumi:"networkInterfaceIds"`
// A `osDisk` block as defined below.
OsDisk *LinuxVirtualMachineOsDisk `pulumi:"osDisk"`
// A `osImageNotification` block as defined below.
OsImageNotification *LinuxVirtualMachineOsImageNotification `pulumi:"osImageNotification"`
// The ID of an existing Managed Disk to use as the OS Disk for this Linux Virtual Machine. Changing this forces a new resource to be created.
//
// > **Note:** When specifying an existing Managed Disk it is not currently possible to subsequently manage the Operating System Profile properties: `adminUsername`, `adminPassword`, `bypassPlatformSafetyChecksOnUserScheduleEnabled`, `computerName`, `customData`, `provisionVmAgent`, `patchMode`, `patchAssessmentMode`, or `rebootSetting`.
OsManagedDiskId *string `pulumi:"osManagedDiskId"`
// Specifies the mode of VM Guest Patching for the Virtual Machine. Possible values are `AutomaticByPlatform` or `ImageDefault`. Defaults to `ImageDefault`.
//
// > **NOTE:** If the `patchAssessmentMode` is set to `AutomaticByPlatform` then the `provisionVmAgent` field must be set to `true`.
PatchAssessmentMode *string `pulumi:"patchAssessmentMode"`
// Specifies the mode of in-guest patching to this Linux Virtual Machine. Possible values are `AutomaticByPlatform` and `ImageDefault`. Defaults to `ImageDefault`. For more information on patch modes please see the [product documentation](https://docs.microsoft.com/azure/virtual-machines/automatic-vm-guest-patching#patch-orchestration-modes).
//
// > **NOTE:** If `patchMode` is set to `AutomaticByPlatform` then `provisionVmAgent` must also be set to `true`.
PatchMode *string `pulumi:"patchMode"`
// A `plan` block as defined below. Changing this forces a new resource to be created.
Plan *LinuxVirtualMachinePlan `pulumi:"plan"`
// Specifies the Platform Fault Domain in which this Linux Virtual Machine should be created. Defaults to `-1`, which means this will be automatically assigned to a fault domain that best maintains balance across the available fault domains. Changing this forces a new Linux Virtual Machine to be created.
PlatformFaultDomain *int `pulumi:"platformFaultDomain"`
// Specifies the priority of this Virtual Machine. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this forces a new resource to be created.
Priority *string `pulumi:"priority"`
// The Primary Private IP Address assigned to this Virtual Machine.
PrivateIpAddress *string `pulumi:"privateIpAddress"`
// A list of Private IP Addresses assigned to this Virtual Machine.
PrivateIpAddresses []string `pulumi:"privateIpAddresses"`
// Should the Azure VM Agent be provisioned on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created.
//
// > **NOTE:** If `provisionVmAgent` is set to `false` then `allowExtensionOperations` must also be set to `false`.
ProvisionVmAgent *bool `pulumi:"provisionVmAgent"`
// The ID of the Proximity Placement Group which the Virtual Machine should be assigned to.
ProximityPlacementGroupId *string `pulumi:"proximityPlacementGroupId"`
// The Primary Public IP Address assigned to this Virtual Machine.
PublicIpAddress *string `pulumi:"publicIpAddress"`
// A list of the Public IP Addresses assigned to this Virtual Machine.
PublicIpAddresses []string `pulumi:"publicIpAddresses"`
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/galleryApplicationAssignment.go | sdk/go/azure/compute/galleryApplicationAssignment.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Virtual Machine Gallery Application Assignment.
//
// > **Note:** Gallery Application Assignments can be defined either directly on `compute.LinuxVirtualMachine` and `compute.WindowsVirtualMachine` resources, or using the `compute.GalleryApplicationAssignment` resource - but the two approaches cannot be used together. If both are used with the same Virtual Machine, spurious changes will occur. It's recommended to use `ignoreChanges` for the `galleryApplication` block on the associated virtual machine resources, to avoid a persistent diff when using this resource.
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{
// Name: "example-vm",
// ResourceGroupName: "example-resources-vm",
// }, nil)
// if err != nil {
// return err
// }
// exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "example", &compute.SharedImageGalleryArgs{
// Name: pulumi.String("examplegallery"),
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// })
// if err != nil {
// return err
// }
// exampleGalleryApplication, err := compute.NewGalleryApplication(ctx, "example", &compute.GalleryApplicationArgs{
// Name: pulumi.String("example-app"),
// GalleryId: exampleSharedImageGallery.ID(),
// Location: exampleResourceGroup.Location,
// SupportedOsType: pulumi.String("Linux"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
// Name: pulumi.String("examplestorage"),
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// AccountTier: pulumi.String("Standard"),
// AccountReplicationType: pulumi.String("LRS"),
// })
// if err != nil {
// return err
// }
// exampleContainer, err := storage.NewContainer(ctx, "example", &storage.ContainerArgs{
// Name: pulumi.String("example-container"),
// StorageAccountName: exampleAccount.Name,
// ContainerAccessType: pulumi.String("blob"),
// })
// if err != nil {
// return err
// }
// exampleBlob, err := storage.NewBlob(ctx, "example", &storage.BlobArgs{
// Name: pulumi.String("scripts"),
// StorageAccountName: exampleAccount.Name,
// StorageContainerName: exampleContainer.Name,
// Type: pulumi.String("Block"),
// SourceContent: pulumi.String("[scripts file content]"),
// })
// if err != nil {
// return err
// }
// exampleGalleryApplicationVersion, err := compute.NewGalleryApplicationVersion(ctx, "example", &compute.GalleryApplicationVersionArgs{
// Name: pulumi.String("0.0.1"),
// GalleryApplicationId: exampleGalleryApplication.ID(),
// Location: exampleGalleryApplication.Location,
// ManageAction: &compute.GalleryApplicationVersionManageActionArgs{
// Install: pulumi.String("[install command]"),
// Remove: pulumi.String("[remove command]"),
// },
// Source: &compute.GalleryApplicationVersionSourceArgs{
// MediaLink: exampleBlob.ID(),
// },
// TargetRegions: compute.GalleryApplicationVersionTargetRegionArray{
// &compute.GalleryApplicationVersionTargetRegionArgs{
// Name: exampleGalleryApplication.Location,
// RegionalReplicaCount: pulumi.Int(1),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = compute.NewGalleryApplicationAssignment(ctx, "example", &compute.GalleryApplicationAssignmentArgs{
// GalleryApplicationVersionId: exampleGalleryApplicationVersion.ID(),
// VirtualMachineId: pulumi.String(example.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01
//
// ## Import
//
// Virtual Machine Gallery Application Assignments can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/galleryApplicationAssignment:GalleryApplicationAssignment example subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1/versions/galleryApplicationVersion1
// ```
type GalleryApplicationAssignment struct {
pulumi.CustomResourceState
// Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. Changing this forces a new resource to be created.
ConfigurationBlobUri pulumi.StringPtrOutput `pulumi:"configurationBlobUri"`
// The ID of the Gallery Application Version. Changing this forces a new resource to be created.
GalleryApplicationVersionId pulumi.StringOutput `pulumi:"galleryApplicationVersionId"`
// Specifies the order in which the packages have to be installed. Possible values are between `0` and `2147483647`. Defaults to `0`.
Order pulumi.IntPtrOutput `pulumi:"order"`
// Specifies a passthrough value for more generic context. This field can be any valid `string` value. Changing this forces a new resource to be created.
Tag pulumi.StringPtrOutput `pulumi:"tag"`
// The ID of the Virtual Machine. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringOutput `pulumi:"virtualMachineId"`
}
// NewGalleryApplicationAssignment registers a new resource with the given unique name, arguments, and options.
func NewGalleryApplicationAssignment(ctx *pulumi.Context,
name string, args *GalleryApplicationAssignmentArgs, opts ...pulumi.ResourceOption) (*GalleryApplicationAssignment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GalleryApplicationVersionId == nil {
return nil, errors.New("invalid value for required argument 'GalleryApplicationVersionId'")
}
if args.VirtualMachineId == nil {
return nil, errors.New("invalid value for required argument 'VirtualMachineId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GalleryApplicationAssignment
err := ctx.RegisterResource("azure:compute/galleryApplicationAssignment:GalleryApplicationAssignment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGalleryApplicationAssignment gets an existing GalleryApplicationAssignment resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGalleryApplicationAssignment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GalleryApplicationAssignmentState, opts ...pulumi.ResourceOption) (*GalleryApplicationAssignment, error) {
var resource GalleryApplicationAssignment
err := ctx.ReadResource("azure:compute/galleryApplicationAssignment:GalleryApplicationAssignment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GalleryApplicationAssignment resources.
type galleryApplicationAssignmentState struct {
// Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. Changing this forces a new resource to be created.
ConfigurationBlobUri *string `pulumi:"configurationBlobUri"`
// The ID of the Gallery Application Version. Changing this forces a new resource to be created.
GalleryApplicationVersionId *string `pulumi:"galleryApplicationVersionId"`
// Specifies the order in which the packages have to be installed. Possible values are between `0` and `2147483647`. Defaults to `0`.
Order *int `pulumi:"order"`
// Specifies a passthrough value for more generic context. This field can be any valid `string` value. Changing this forces a new resource to be created.
Tag *string `pulumi:"tag"`
// The ID of the Virtual Machine. Changing this forces a new resource to be created.
VirtualMachineId *string `pulumi:"virtualMachineId"`
}
type GalleryApplicationAssignmentState struct {
// Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. Changing this forces a new resource to be created.
ConfigurationBlobUri pulumi.StringPtrInput
// The ID of the Gallery Application Version. Changing this forces a new resource to be created.
GalleryApplicationVersionId pulumi.StringPtrInput
// Specifies the order in which the packages have to be installed. Possible values are between `0` and `2147483647`. Defaults to `0`.
Order pulumi.IntPtrInput
// Specifies a passthrough value for more generic context. This field can be any valid `string` value. Changing this forces a new resource to be created.
Tag pulumi.StringPtrInput
// The ID of the Virtual Machine. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringPtrInput
}
func (GalleryApplicationAssignmentState) ElementType() reflect.Type {
return reflect.TypeOf((*galleryApplicationAssignmentState)(nil)).Elem()
}
type galleryApplicationAssignmentArgs struct {
// Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. Changing this forces a new resource to be created.
ConfigurationBlobUri *string `pulumi:"configurationBlobUri"`
// The ID of the Gallery Application Version. Changing this forces a new resource to be created.
GalleryApplicationVersionId string `pulumi:"galleryApplicationVersionId"`
// Specifies the order in which the packages have to be installed. Possible values are between `0` and `2147483647`. Defaults to `0`.
Order *int `pulumi:"order"`
// Specifies a passthrough value for more generic context. This field can be any valid `string` value. Changing this forces a new resource to be created.
Tag *string `pulumi:"tag"`
// The ID of the Virtual Machine. Changing this forces a new resource to be created.
VirtualMachineId string `pulumi:"virtualMachineId"`
}
// The set of arguments for constructing a GalleryApplicationAssignment resource.
type GalleryApplicationAssignmentArgs struct {
// Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. Changing this forces a new resource to be created.
ConfigurationBlobUri pulumi.StringPtrInput
// The ID of the Gallery Application Version. Changing this forces a new resource to be created.
GalleryApplicationVersionId pulumi.StringInput
// Specifies the order in which the packages have to be installed. Possible values are between `0` and `2147483647`. Defaults to `0`.
Order pulumi.IntPtrInput
// Specifies a passthrough value for more generic context. This field can be any valid `string` value. Changing this forces a new resource to be created.
Tag pulumi.StringPtrInput
// The ID of the Virtual Machine. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringInput
}
func (GalleryApplicationAssignmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*galleryApplicationAssignmentArgs)(nil)).Elem()
}
type GalleryApplicationAssignmentInput interface {
pulumi.Input
ToGalleryApplicationAssignmentOutput() GalleryApplicationAssignmentOutput
ToGalleryApplicationAssignmentOutputWithContext(ctx context.Context) GalleryApplicationAssignmentOutput
}
func (*GalleryApplicationAssignment) ElementType() reflect.Type {
return reflect.TypeOf((**GalleryApplicationAssignment)(nil)).Elem()
}
func (i *GalleryApplicationAssignment) ToGalleryApplicationAssignmentOutput() GalleryApplicationAssignmentOutput {
return i.ToGalleryApplicationAssignmentOutputWithContext(context.Background())
}
func (i *GalleryApplicationAssignment) ToGalleryApplicationAssignmentOutputWithContext(ctx context.Context) GalleryApplicationAssignmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(GalleryApplicationAssignmentOutput)
}
// GalleryApplicationAssignmentArrayInput is an input type that accepts GalleryApplicationAssignmentArray and GalleryApplicationAssignmentArrayOutput values.
// You can construct a concrete instance of `GalleryApplicationAssignmentArrayInput` via:
//
// GalleryApplicationAssignmentArray{ GalleryApplicationAssignmentArgs{...} }
type GalleryApplicationAssignmentArrayInput interface {
pulumi.Input
ToGalleryApplicationAssignmentArrayOutput() GalleryApplicationAssignmentArrayOutput
ToGalleryApplicationAssignmentArrayOutputWithContext(context.Context) GalleryApplicationAssignmentArrayOutput
}
type GalleryApplicationAssignmentArray []GalleryApplicationAssignmentInput
func (GalleryApplicationAssignmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GalleryApplicationAssignment)(nil)).Elem()
}
func (i GalleryApplicationAssignmentArray) ToGalleryApplicationAssignmentArrayOutput() GalleryApplicationAssignmentArrayOutput {
return i.ToGalleryApplicationAssignmentArrayOutputWithContext(context.Background())
}
func (i GalleryApplicationAssignmentArray) ToGalleryApplicationAssignmentArrayOutputWithContext(ctx context.Context) GalleryApplicationAssignmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GalleryApplicationAssignmentArrayOutput)
}
// GalleryApplicationAssignmentMapInput is an input type that accepts GalleryApplicationAssignmentMap and GalleryApplicationAssignmentMapOutput values.
// You can construct a concrete instance of `GalleryApplicationAssignmentMapInput` via:
//
// GalleryApplicationAssignmentMap{ "key": GalleryApplicationAssignmentArgs{...} }
type GalleryApplicationAssignmentMapInput interface {
pulumi.Input
ToGalleryApplicationAssignmentMapOutput() GalleryApplicationAssignmentMapOutput
ToGalleryApplicationAssignmentMapOutputWithContext(context.Context) GalleryApplicationAssignmentMapOutput
}
type GalleryApplicationAssignmentMap map[string]GalleryApplicationAssignmentInput
func (GalleryApplicationAssignmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GalleryApplicationAssignment)(nil)).Elem()
}
func (i GalleryApplicationAssignmentMap) ToGalleryApplicationAssignmentMapOutput() GalleryApplicationAssignmentMapOutput {
return i.ToGalleryApplicationAssignmentMapOutputWithContext(context.Background())
}
func (i GalleryApplicationAssignmentMap) ToGalleryApplicationAssignmentMapOutputWithContext(ctx context.Context) GalleryApplicationAssignmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GalleryApplicationAssignmentMapOutput)
}
type GalleryApplicationAssignmentOutput struct{ *pulumi.OutputState }
func (GalleryApplicationAssignmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GalleryApplicationAssignment)(nil)).Elem()
}
func (o GalleryApplicationAssignmentOutput) ToGalleryApplicationAssignmentOutput() GalleryApplicationAssignmentOutput {
return o
}
func (o GalleryApplicationAssignmentOutput) ToGalleryApplicationAssignmentOutputWithContext(ctx context.Context) GalleryApplicationAssignmentOutput {
return o
}
// Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. Changing this forces a new resource to be created.
func (o GalleryApplicationAssignmentOutput) ConfigurationBlobUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GalleryApplicationAssignment) pulumi.StringPtrOutput { return v.ConfigurationBlobUri }).(pulumi.StringPtrOutput)
}
// The ID of the Gallery Application Version. Changing this forces a new resource to be created.
func (o GalleryApplicationAssignmentOutput) GalleryApplicationVersionId() pulumi.StringOutput {
return o.ApplyT(func(v *GalleryApplicationAssignment) pulumi.StringOutput { return v.GalleryApplicationVersionId }).(pulumi.StringOutput)
}
// Specifies the order in which the packages have to be installed. Possible values are between `0` and `2147483647`. Defaults to `0`.
func (o GalleryApplicationAssignmentOutput) Order() pulumi.IntPtrOutput {
return o.ApplyT(func(v *GalleryApplicationAssignment) pulumi.IntPtrOutput { return v.Order }).(pulumi.IntPtrOutput)
}
// Specifies a passthrough value for more generic context. This field can be any valid `string` value. Changing this forces a new resource to be created.
func (o GalleryApplicationAssignmentOutput) Tag() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GalleryApplicationAssignment) pulumi.StringPtrOutput { return v.Tag }).(pulumi.StringPtrOutput)
}
// The ID of the Virtual Machine. Changing this forces a new resource to be created.
func (o GalleryApplicationAssignmentOutput) VirtualMachineId() pulumi.StringOutput {
return o.ApplyT(func(v *GalleryApplicationAssignment) pulumi.StringOutput { return v.VirtualMachineId }).(pulumi.StringOutput)
}
type GalleryApplicationAssignmentArrayOutput struct{ *pulumi.OutputState }
func (GalleryApplicationAssignmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GalleryApplicationAssignment)(nil)).Elem()
}
func (o GalleryApplicationAssignmentArrayOutput) ToGalleryApplicationAssignmentArrayOutput() GalleryApplicationAssignmentArrayOutput {
return o
}
func (o GalleryApplicationAssignmentArrayOutput) ToGalleryApplicationAssignmentArrayOutputWithContext(ctx context.Context) GalleryApplicationAssignmentArrayOutput {
return o
}
func (o GalleryApplicationAssignmentArrayOutput) Index(i pulumi.IntInput) GalleryApplicationAssignmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GalleryApplicationAssignment {
return vs[0].([]*GalleryApplicationAssignment)[vs[1].(int)]
}).(GalleryApplicationAssignmentOutput)
}
type GalleryApplicationAssignmentMapOutput struct{ *pulumi.OutputState }
func (GalleryApplicationAssignmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GalleryApplicationAssignment)(nil)).Elem()
}
func (o GalleryApplicationAssignmentMapOutput) ToGalleryApplicationAssignmentMapOutput() GalleryApplicationAssignmentMapOutput {
return o
}
func (o GalleryApplicationAssignmentMapOutput) ToGalleryApplicationAssignmentMapOutputWithContext(ctx context.Context) GalleryApplicationAssignmentMapOutput {
return o
}
func (o GalleryApplicationAssignmentMapOutput) MapIndex(k pulumi.StringInput) GalleryApplicationAssignmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GalleryApplicationAssignment {
return vs[0].(map[string]*GalleryApplicationAssignment)[vs[1].(string)]
}).(GalleryApplicationAssignmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GalleryApplicationAssignmentInput)(nil)).Elem(), &GalleryApplicationAssignment{})
pulumi.RegisterInputType(reflect.TypeOf((*GalleryApplicationAssignmentArrayInput)(nil)).Elem(), GalleryApplicationAssignmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GalleryApplicationAssignmentMapInput)(nil)).Elem(), GalleryApplicationAssignmentMap{})
pulumi.RegisterOutputType(GalleryApplicationAssignmentOutput{})
pulumi.RegisterOutputType(GalleryApplicationAssignmentArrayOutput{})
pulumi.RegisterOutputType(GalleryApplicationAssignmentMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getSharedImageGallery.go | sdk/go/azure/compute/getSharedImageGallery.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Shared Image Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := compute.LookupSharedImageGallery(ctx, &compute.LookupSharedImageGalleryArgs{
// Name: "my-image-gallery",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-03
func LookupSharedImageGallery(ctx *pulumi.Context, args *LookupSharedImageGalleryArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageGalleryResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSharedImageGalleryResult
err := ctx.Invoke("azure:compute/getSharedImageGallery:getSharedImageGallery", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSharedImageGallery.
type LookupSharedImageGalleryArgs struct {
// The name of the Shared Image Gallery.
Name string `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getSharedImageGallery.
type LookupSharedImageGalleryResult struct {
// A description for the Shared Image Gallery.
Description string `pulumi:"description"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of Shared Image names within this Shared Image Gallery.
ImageNames []string `pulumi:"imageNames"`
Location string `pulumi:"location"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags which are assigned to the Shared Image Gallery.
Tags map[string]string `pulumi:"tags"`
// The unique name assigned to the Shared Image Gallery.
UniqueName string `pulumi:"uniqueName"`
}
func LookupSharedImageGalleryOutput(ctx *pulumi.Context, args LookupSharedImageGalleryOutputArgs, opts ...pulumi.InvokeOption) LookupSharedImageGalleryResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupSharedImageGalleryResultOutput, error) {
args := v.(LookupSharedImageGalleryArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getSharedImageGallery:getSharedImageGallery", args, LookupSharedImageGalleryResultOutput{}, options).(LookupSharedImageGalleryResultOutput), nil
}).(LookupSharedImageGalleryResultOutput)
}
// A collection of arguments for invoking getSharedImageGallery.
type LookupSharedImageGalleryOutputArgs struct {
// The name of the Shared Image Gallery.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group in which the Shared Image Gallery exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupSharedImageGalleryOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageGalleryArgs)(nil)).Elem()
}
// A collection of values returned by getSharedImageGallery.
type LookupSharedImageGalleryResultOutput struct{ *pulumi.OutputState }
func (LookupSharedImageGalleryResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSharedImageGalleryResult)(nil)).Elem()
}
func (o LookupSharedImageGalleryResultOutput) ToLookupSharedImageGalleryResultOutput() LookupSharedImageGalleryResultOutput {
return o
}
func (o LookupSharedImageGalleryResultOutput) ToLookupSharedImageGalleryResultOutputWithContext(ctx context.Context) LookupSharedImageGalleryResultOutput {
return o
}
// A description for the Shared Image Gallery.
func (o LookupSharedImageGalleryResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) string { return v.Description }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSharedImageGalleryResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) string { return v.Id }).(pulumi.StringOutput)
}
// A list of Shared Image names within this Shared Image Gallery.
func (o LookupSharedImageGalleryResultOutput) ImageNames() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) []string { return v.ImageNames }).(pulumi.StringArrayOutput)
}
func (o LookupSharedImageGalleryResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupSharedImageGalleryResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupSharedImageGalleryResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags which are assigned to the Shared Image Gallery.
func (o LookupSharedImageGalleryResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The unique name assigned to the Shared Image Gallery.
func (o LookupSharedImageGalleryResultOutput) UniqueName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSharedImageGalleryResult) string { return v.UniqueName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSharedImageGalleryResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getPlatformImage.go | sdk/go/azure/compute/getPlatformImage.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about a Platform Image.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.GetPlatformImage(ctx, &compute.GetPlatformImageArgs{
// Location: "West Europe",
// Publisher: "Canonical",
// Offer: "0001-com-ubuntu-server-focal",
// Sku: "20_04-lts",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01
func GetPlatformImage(ctx *pulumi.Context, args *GetPlatformImageArgs, opts ...pulumi.InvokeOption) (*GetPlatformImageResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetPlatformImageResult
err := ctx.Invoke("azure:compute/getPlatformImage:getPlatformImage", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getPlatformImage.
type GetPlatformImageArgs struct {
// Specifies the Location to pull information about this Platform Image from.
Location string `pulumi:"location"`
// Specifies the Offer associated with the Platform Image.
Offer string `pulumi:"offer"`
// Specifies the Publisher associated with the Platform Image.
Publisher string `pulumi:"publisher"`
// Specifies the SKU of the Platform Image.
Sku string `pulumi:"sku"`
// The version of the Platform Image.
Version *string `pulumi:"version"`
}
// A collection of values returned by getPlatformImage.
type GetPlatformImageResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Location string `pulumi:"location"`
Offer string `pulumi:"offer"`
Publisher string `pulumi:"publisher"`
Sku string `pulumi:"sku"`
Version string `pulumi:"version"`
}
func GetPlatformImageOutput(ctx *pulumi.Context, args GetPlatformImageOutputArgs, opts ...pulumi.InvokeOption) GetPlatformImageResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (GetPlatformImageResultOutput, error) {
args := v.(GetPlatformImageArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getPlatformImage:getPlatformImage", args, GetPlatformImageResultOutput{}, options).(GetPlatformImageResultOutput), nil
}).(GetPlatformImageResultOutput)
}
// A collection of arguments for invoking getPlatformImage.
type GetPlatformImageOutputArgs struct {
// Specifies the Location to pull information about this Platform Image from.
Location pulumi.StringInput `pulumi:"location"`
// Specifies the Offer associated with the Platform Image.
Offer pulumi.StringInput `pulumi:"offer"`
// Specifies the Publisher associated with the Platform Image.
Publisher pulumi.StringInput `pulumi:"publisher"`
// Specifies the SKU of the Platform Image.
Sku pulumi.StringInput `pulumi:"sku"`
// The version of the Platform Image.
Version pulumi.StringPtrInput `pulumi:"version"`
}
func (GetPlatformImageOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetPlatformImageArgs)(nil)).Elem()
}
// A collection of values returned by getPlatformImage.
type GetPlatformImageResultOutput struct{ *pulumi.OutputState }
func (GetPlatformImageResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetPlatformImageResult)(nil)).Elem()
}
func (o GetPlatformImageResultOutput) ToGetPlatformImageResultOutput() GetPlatformImageResultOutput {
return o
}
func (o GetPlatformImageResultOutput) ToGetPlatformImageResultOutputWithContext(ctx context.Context) GetPlatformImageResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetPlatformImageResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetPlatformImageResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetPlatformImageResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v GetPlatformImageResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o GetPlatformImageResultOutput) Offer() pulumi.StringOutput {
return o.ApplyT(func(v GetPlatformImageResult) string { return v.Offer }).(pulumi.StringOutput)
}
func (o GetPlatformImageResultOutput) Publisher() pulumi.StringOutput {
return o.ApplyT(func(v GetPlatformImageResult) string { return v.Publisher }).(pulumi.StringOutput)
}
func (o GetPlatformImageResultOutput) Sku() pulumi.StringOutput {
return o.ApplyT(func(v GetPlatformImageResult) string { return v.Sku }).(pulumi.StringOutput)
}
func (o GetPlatformImageResultOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v GetPlatformImageResult) string { return v.Version }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetPlatformImageResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/sshPublicKey.go | sdk/go/azure/compute/sshPublicKey.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a SSH Public Key.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// invokeFile, err := std.File(ctx, &std.FileArgs{
// Input: "~/.ssh/id_rsa.pub",
// }, nil)
// if err != nil {
// return err
// }
// _, err = compute.NewSshPublicKey(ctx, "example", &compute.SshPublicKeyArgs{
// Name: pulumi.String("example"),
// ResourceGroupName: pulumi.String("example"),
// Location: pulumi.String("West Europe"),
// PublicKey: pulumi.String(invokeFile.Result),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01
//
// ## Import
//
// SSH Public Keys can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/sshPublicKey:SshPublicKey example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName1
// ```
type SshPublicKey struct {
pulumi.CustomResourceState
// The Azure Region where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The name which should be used for this SSH Public Key. Changing this forces a new SSH Public Key to be created.
Name pulumi.StringOutput `pulumi:"name"`
// SSH public key used to authenticate to a virtual machine through ssh. the provided public key needs to be at least 2048-bit and in ssh-rsa format.
PublicKey pulumi.StringOutput `pulumi:"publicKey"`
// The name of the Resource Group where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the SSH Public Key.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewSshPublicKey registers a new resource with the given unique name, arguments, and options.
func NewSshPublicKey(ctx *pulumi.Context,
name string, args *SshPublicKeyArgs, opts ...pulumi.ResourceOption) (*SshPublicKey, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PublicKey == nil {
return nil, errors.New("invalid value for required argument 'PublicKey'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SshPublicKey
err := ctx.RegisterResource("azure:compute/sshPublicKey:SshPublicKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSshPublicKey gets an existing SshPublicKey resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSshPublicKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SshPublicKeyState, opts ...pulumi.ResourceOption) (*SshPublicKey, error) {
var resource SshPublicKey
err := ctx.ReadResource("azure:compute/sshPublicKey:SshPublicKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SshPublicKey resources.
type sshPublicKeyState struct {
// The Azure Region where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
Location *string `pulumi:"location"`
// The name which should be used for this SSH Public Key. Changing this forces a new SSH Public Key to be created.
Name *string `pulumi:"name"`
// SSH public key used to authenticate to a virtual machine through ssh. the provided public key needs to be at least 2048-bit and in ssh-rsa format.
PublicKey *string `pulumi:"publicKey"`
// The name of the Resource Group where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the SSH Public Key.
Tags map[string]string `pulumi:"tags"`
}
type SshPublicKeyState struct {
// The Azure Region where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
Location pulumi.StringPtrInput
// The name which should be used for this SSH Public Key. Changing this forces a new SSH Public Key to be created.
Name pulumi.StringPtrInput
// SSH public key used to authenticate to a virtual machine through ssh. the provided public key needs to be at least 2048-bit and in ssh-rsa format.
PublicKey pulumi.StringPtrInput
// The name of the Resource Group where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags which should be assigned to the SSH Public Key.
Tags pulumi.StringMapInput
}
func (SshPublicKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*sshPublicKeyState)(nil)).Elem()
}
type sshPublicKeyArgs struct {
// The Azure Region where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
Location *string `pulumi:"location"`
// The name which should be used for this SSH Public Key. Changing this forces a new SSH Public Key to be created.
Name *string `pulumi:"name"`
// SSH public key used to authenticate to a virtual machine through ssh. the provided public key needs to be at least 2048-bit and in ssh-rsa format.
PublicKey string `pulumi:"publicKey"`
// The name of the Resource Group where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the SSH Public Key.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a SshPublicKey resource.
type SshPublicKeyArgs struct {
// The Azure Region where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
Location pulumi.StringPtrInput
// The name which should be used for this SSH Public Key. Changing this forces a new SSH Public Key to be created.
Name pulumi.StringPtrInput
// SSH public key used to authenticate to a virtual machine through ssh. the provided public key needs to be at least 2048-bit and in ssh-rsa format.
PublicKey pulumi.StringInput
// The name of the Resource Group where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags which should be assigned to the SSH Public Key.
Tags pulumi.StringMapInput
}
func (SshPublicKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sshPublicKeyArgs)(nil)).Elem()
}
type SshPublicKeyInput interface {
pulumi.Input
ToSshPublicKeyOutput() SshPublicKeyOutput
ToSshPublicKeyOutputWithContext(ctx context.Context) SshPublicKeyOutput
}
func (*SshPublicKey) ElementType() reflect.Type {
return reflect.TypeOf((**SshPublicKey)(nil)).Elem()
}
func (i *SshPublicKey) ToSshPublicKeyOutput() SshPublicKeyOutput {
return i.ToSshPublicKeyOutputWithContext(context.Background())
}
func (i *SshPublicKey) ToSshPublicKeyOutputWithContext(ctx context.Context) SshPublicKeyOutput {
return pulumi.ToOutputWithContext(ctx, i).(SshPublicKeyOutput)
}
// SshPublicKeyArrayInput is an input type that accepts SshPublicKeyArray and SshPublicKeyArrayOutput values.
// You can construct a concrete instance of `SshPublicKeyArrayInput` via:
//
// SshPublicKeyArray{ SshPublicKeyArgs{...} }
type SshPublicKeyArrayInput interface {
pulumi.Input
ToSshPublicKeyArrayOutput() SshPublicKeyArrayOutput
ToSshPublicKeyArrayOutputWithContext(context.Context) SshPublicKeyArrayOutput
}
type SshPublicKeyArray []SshPublicKeyInput
func (SshPublicKeyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SshPublicKey)(nil)).Elem()
}
func (i SshPublicKeyArray) ToSshPublicKeyArrayOutput() SshPublicKeyArrayOutput {
return i.ToSshPublicKeyArrayOutputWithContext(context.Background())
}
func (i SshPublicKeyArray) ToSshPublicKeyArrayOutputWithContext(ctx context.Context) SshPublicKeyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SshPublicKeyArrayOutput)
}
// SshPublicKeyMapInput is an input type that accepts SshPublicKeyMap and SshPublicKeyMapOutput values.
// You can construct a concrete instance of `SshPublicKeyMapInput` via:
//
// SshPublicKeyMap{ "key": SshPublicKeyArgs{...} }
type SshPublicKeyMapInput interface {
pulumi.Input
ToSshPublicKeyMapOutput() SshPublicKeyMapOutput
ToSshPublicKeyMapOutputWithContext(context.Context) SshPublicKeyMapOutput
}
type SshPublicKeyMap map[string]SshPublicKeyInput
func (SshPublicKeyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SshPublicKey)(nil)).Elem()
}
func (i SshPublicKeyMap) ToSshPublicKeyMapOutput() SshPublicKeyMapOutput {
return i.ToSshPublicKeyMapOutputWithContext(context.Background())
}
func (i SshPublicKeyMap) ToSshPublicKeyMapOutputWithContext(ctx context.Context) SshPublicKeyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SshPublicKeyMapOutput)
}
type SshPublicKeyOutput struct{ *pulumi.OutputState }
func (SshPublicKeyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SshPublicKey)(nil)).Elem()
}
func (o SshPublicKeyOutput) ToSshPublicKeyOutput() SshPublicKeyOutput {
return o
}
func (o SshPublicKeyOutput) ToSshPublicKeyOutputWithContext(ctx context.Context) SshPublicKeyOutput {
return o
}
// The Azure Region where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
func (o SshPublicKeyOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *SshPublicKey) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The name which should be used for this SSH Public Key. Changing this forces a new SSH Public Key to be created.
func (o SshPublicKeyOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SshPublicKey) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// SSH public key used to authenticate to a virtual machine through ssh. the provided public key needs to be at least 2048-bit and in ssh-rsa format.
func (o SshPublicKeyOutput) PublicKey() pulumi.StringOutput {
return o.ApplyT(func(v *SshPublicKey) pulumi.StringOutput { return v.PublicKey }).(pulumi.StringOutput)
}
// The name of the Resource Group where the SSH Public Key should exist. Changing this forces a new SSH Public Key to be created.
func (o SshPublicKeyOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SshPublicKey) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the SSH Public Key.
func (o SshPublicKeyOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *SshPublicKey) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type SshPublicKeyArrayOutput struct{ *pulumi.OutputState }
func (SshPublicKeyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SshPublicKey)(nil)).Elem()
}
func (o SshPublicKeyArrayOutput) ToSshPublicKeyArrayOutput() SshPublicKeyArrayOutput {
return o
}
func (o SshPublicKeyArrayOutput) ToSshPublicKeyArrayOutputWithContext(ctx context.Context) SshPublicKeyArrayOutput {
return o
}
func (o SshPublicKeyArrayOutput) Index(i pulumi.IntInput) SshPublicKeyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SshPublicKey {
return vs[0].([]*SshPublicKey)[vs[1].(int)]
}).(SshPublicKeyOutput)
}
type SshPublicKeyMapOutput struct{ *pulumi.OutputState }
func (SshPublicKeyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SshPublicKey)(nil)).Elem()
}
func (o SshPublicKeyMapOutput) ToSshPublicKeyMapOutput() SshPublicKeyMapOutput {
return o
}
func (o SshPublicKeyMapOutput) ToSshPublicKeyMapOutputWithContext(ctx context.Context) SshPublicKeyMapOutput {
return o
}
func (o SshPublicKeyMapOutput) MapIndex(k pulumi.StringInput) SshPublicKeyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SshPublicKey {
return vs[0].(map[string]*SshPublicKey)[vs[1].(string)]
}).(SshPublicKeyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SshPublicKeyInput)(nil)).Elem(), &SshPublicKey{})
pulumi.RegisterInputType(reflect.TypeOf((*SshPublicKeyArrayInput)(nil)).Elem(), SshPublicKeyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SshPublicKeyMapInput)(nil)).Elem(), SshPublicKeyMap{})
pulumi.RegisterOutputType(SshPublicKeyOutput{})
pulumi.RegisterOutputType(SshPublicKeyArrayOutput{})
pulumi.RegisterOutputType(SshPublicKeyMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/snapshot.go | sdk/go/azure/compute/snapshot.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Disk Snapshot.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("snapshot-rg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
// Name: pulumi.String("managed-disk"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// StorageAccountType: pulumi.String("Standard_LRS"),
// CreateOption: pulumi.String("Empty"),
// DiskSizeGb: pulumi.Int(10),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewSnapshot(ctx, "example", &compute.SnapshotArgs{
// Name: pulumi.String("snapshot"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// CreateOption: pulumi.String("Copy"),
// SourceUri: exampleManagedDisk.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-02
//
// ## Import
//
// Snapshots can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/snapshot:Snapshot example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/snapshots/snapshot1
// ```
type Snapshot struct {
pulumi.CustomResourceState
// Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
//
// > **Note:** One of `sourceUri`, `sourceResourceId` or `storageAccountId` must be specified.
CreateOption pulumi.StringOutput `pulumi:"createOption"`
// Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `networkAccessPolicy` to `AllowPrivate`.
DiskAccessId pulumi.StringPtrOutput `pulumi:"diskAccessId"`
// The size of the Snapshotted Disk in GB.
DiskSizeGb pulumi.IntOutput `pulumi:"diskSizeGb"`
// A `encryptionSettings` block as defined below.
//
// > **Note:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings SnapshotEncryptionSettingsPtrOutput `pulumi:"encryptionSettings"`
// Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
IncrementalEnabled pulumi.BoolPtrOutput `pulumi:"incrementalEnabled"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy pulumi.StringPtrOutput `pulumi:"networkAccessPolicy"`
// Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
PublicNetworkAccessEnabled pulumi.BoolPtrOutput `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// Specifies a reference to an existing snapshot, when `createOption` is `Copy`. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrOutput `pulumi:"sourceResourceId"`
// Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
SourceUri pulumi.StringPtrOutput `pulumi:"sourceUri"`
// Specifies the ID of an storage account. Used with `sourceUri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringPtrOutput `pulumi:"storageAccountId"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Whether Trusted Launch is enabled for the Snapshot.
TrustedLaunchEnabled pulumi.BoolOutput `pulumi:"trustedLaunchEnabled"`
}
// NewSnapshot registers a new resource with the given unique name, arguments, and options.
func NewSnapshot(ctx *pulumi.Context,
name string, args *SnapshotArgs, opts ...pulumi.ResourceOption) (*Snapshot, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CreateOption == nil {
return nil, errors.New("invalid value for required argument 'CreateOption'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Snapshot
err := ctx.RegisterResource("azure:compute/snapshot:Snapshot", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSnapshot gets an existing Snapshot resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSnapshot(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SnapshotState, opts ...pulumi.ResourceOption) (*Snapshot, error) {
var resource Snapshot
err := ctx.ReadResource("azure:compute/snapshot:Snapshot", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Snapshot resources.
type snapshotState struct {
// Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
//
// > **Note:** One of `sourceUri`, `sourceResourceId` or `storageAccountId` must be specified.
CreateOption *string `pulumi:"createOption"`
// Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `networkAccessPolicy` to `AllowPrivate`.
DiskAccessId *string `pulumi:"diskAccessId"`
// The size of the Snapshotted Disk in GB.
DiskSizeGb *int `pulumi:"diskSizeGb"`
// A `encryptionSettings` block as defined below.
//
// > **Note:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings *SnapshotEncryptionSettings `pulumi:"encryptionSettings"`
// Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
IncrementalEnabled *bool `pulumi:"incrementalEnabled"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy *string `pulumi:"networkAccessPolicy"`
// Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// Specifies a reference to an existing snapshot, when `createOption` is `Copy`. Changing this forces a new resource to be created.
SourceResourceId *string `pulumi:"sourceResourceId"`
// Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
SourceUri *string `pulumi:"sourceUri"`
// Specifies the ID of an storage account. Used with `sourceUri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
StorageAccountId *string `pulumi:"storageAccountId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Whether Trusted Launch is enabled for the Snapshot.
TrustedLaunchEnabled *bool `pulumi:"trustedLaunchEnabled"`
}
type SnapshotState struct {
// Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
//
// > **Note:** One of `sourceUri`, `sourceResourceId` or `storageAccountId` must be specified.
CreateOption pulumi.StringPtrInput
// Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `networkAccessPolicy` to `AllowPrivate`.
DiskAccessId pulumi.StringPtrInput
// The size of the Snapshotted Disk in GB.
DiskSizeGb pulumi.IntPtrInput
// A `encryptionSettings` block as defined below.
//
// > **Note:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings SnapshotEncryptionSettingsPtrInput
// Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
IncrementalEnabled pulumi.BoolPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy pulumi.StringPtrInput
// Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// Specifies a reference to an existing snapshot, when `createOption` is `Copy`. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrInput
// Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
SourceUri pulumi.StringPtrInput
// Specifies the ID of an storage account. Used with `sourceUri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Whether Trusted Launch is enabled for the Snapshot.
TrustedLaunchEnabled pulumi.BoolPtrInput
}
func (SnapshotState) ElementType() reflect.Type {
return reflect.TypeOf((*snapshotState)(nil)).Elem()
}
type snapshotArgs struct {
// Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
//
// > **Note:** One of `sourceUri`, `sourceResourceId` or `storageAccountId` must be specified.
CreateOption string `pulumi:"createOption"`
// Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `networkAccessPolicy` to `AllowPrivate`.
DiskAccessId *string `pulumi:"diskAccessId"`
// The size of the Snapshotted Disk in GB.
DiskSizeGb *int `pulumi:"diskSizeGb"`
// A `encryptionSettings` block as defined below.
//
// > **Note:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings *SnapshotEncryptionSettings `pulumi:"encryptionSettings"`
// Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
IncrementalEnabled *bool `pulumi:"incrementalEnabled"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy *string `pulumi:"networkAccessPolicy"`
// Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Specifies a reference to an existing snapshot, when `createOption` is `Copy`. Changing this forces a new resource to be created.
SourceResourceId *string `pulumi:"sourceResourceId"`
// Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
SourceUri *string `pulumi:"sourceUri"`
// Specifies the ID of an storage account. Used with `sourceUri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
StorageAccountId *string `pulumi:"storageAccountId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Snapshot resource.
type SnapshotArgs struct {
// Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
//
// > **Note:** One of `sourceUri`, `sourceResourceId` or `storageAccountId` must be specified.
CreateOption pulumi.StringInput
// Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `networkAccessPolicy` to `AllowPrivate`.
DiskAccessId pulumi.StringPtrInput
// The size of the Snapshotted Disk in GB.
DiskSizeGb pulumi.IntPtrInput
// A `encryptionSettings` block as defined below.
//
// > **Note:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings SnapshotEncryptionSettingsPtrInput
// Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
IncrementalEnabled pulumi.BoolPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy pulumi.StringPtrInput
// Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// Specifies a reference to an existing snapshot, when `createOption` is `Copy`. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrInput
// Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
SourceUri pulumi.StringPtrInput
// Specifies the ID of an storage account. Used with `sourceUri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (SnapshotArgs) ElementType() reflect.Type {
return reflect.TypeOf((*snapshotArgs)(nil)).Elem()
}
type SnapshotInput interface {
pulumi.Input
ToSnapshotOutput() SnapshotOutput
ToSnapshotOutputWithContext(ctx context.Context) SnapshotOutput
}
func (*Snapshot) ElementType() reflect.Type {
return reflect.TypeOf((**Snapshot)(nil)).Elem()
}
func (i *Snapshot) ToSnapshotOutput() SnapshotOutput {
return i.ToSnapshotOutputWithContext(context.Background())
}
func (i *Snapshot) ToSnapshotOutputWithContext(ctx context.Context) SnapshotOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnapshotOutput)
}
// SnapshotArrayInput is an input type that accepts SnapshotArray and SnapshotArrayOutput values.
// You can construct a concrete instance of `SnapshotArrayInput` via:
//
// SnapshotArray{ SnapshotArgs{...} }
type SnapshotArrayInput interface {
pulumi.Input
ToSnapshotArrayOutput() SnapshotArrayOutput
ToSnapshotArrayOutputWithContext(context.Context) SnapshotArrayOutput
}
type SnapshotArray []SnapshotInput
func (SnapshotArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Snapshot)(nil)).Elem()
}
func (i SnapshotArray) ToSnapshotArrayOutput() SnapshotArrayOutput {
return i.ToSnapshotArrayOutputWithContext(context.Background())
}
func (i SnapshotArray) ToSnapshotArrayOutputWithContext(ctx context.Context) SnapshotArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnapshotArrayOutput)
}
// SnapshotMapInput is an input type that accepts SnapshotMap and SnapshotMapOutput values.
// You can construct a concrete instance of `SnapshotMapInput` via:
//
// SnapshotMap{ "key": SnapshotArgs{...} }
type SnapshotMapInput interface {
pulumi.Input
ToSnapshotMapOutput() SnapshotMapOutput
ToSnapshotMapOutputWithContext(context.Context) SnapshotMapOutput
}
type SnapshotMap map[string]SnapshotInput
func (SnapshotMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Snapshot)(nil)).Elem()
}
func (i SnapshotMap) ToSnapshotMapOutput() SnapshotMapOutput {
return i.ToSnapshotMapOutputWithContext(context.Background())
}
func (i SnapshotMap) ToSnapshotMapOutputWithContext(ctx context.Context) SnapshotMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnapshotMapOutput)
}
type SnapshotOutput struct{ *pulumi.OutputState }
func (SnapshotOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Snapshot)(nil)).Elem()
}
func (o SnapshotOutput) ToSnapshotOutput() SnapshotOutput {
return o
}
func (o SnapshotOutput) ToSnapshotOutputWithContext(ctx context.Context) SnapshotOutput {
return o
}
// Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
//
// > **Note:** One of `sourceUri`, `sourceResourceId` or `storageAccountId` must be specified.
func (o SnapshotOutput) CreateOption() pulumi.StringOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringOutput { return v.CreateOption }).(pulumi.StringOutput)
}
// Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `networkAccessPolicy` to `AllowPrivate`.
func (o SnapshotOutput) DiskAccessId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringPtrOutput { return v.DiskAccessId }).(pulumi.StringPtrOutput)
}
// The size of the Snapshotted Disk in GB.
func (o SnapshotOutput) DiskSizeGb() pulumi.IntOutput {
return o.ApplyT(func(v *Snapshot) pulumi.IntOutput { return v.DiskSizeGb }).(pulumi.IntOutput)
}
// A `encryptionSettings` block as defined below.
//
// > **Note:** Removing `encryptionSettings` forces a new resource to be created.
func (o SnapshotOutput) EncryptionSettings() SnapshotEncryptionSettingsPtrOutput {
return o.ApplyT(func(v *Snapshot) SnapshotEncryptionSettingsPtrOutput { return v.EncryptionSettings }).(SnapshotEncryptionSettingsPtrOutput)
}
// Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
func (o SnapshotOutput) IncrementalEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.BoolPtrOutput { return v.IncrementalEnabled }).(pulumi.BoolPtrOutput)
}
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
func (o SnapshotOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
func (o SnapshotOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
func (o SnapshotOutput) NetworkAccessPolicy() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringPtrOutput { return v.NetworkAccessPolicy }).(pulumi.StringPtrOutput)
}
// Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
func (o SnapshotOutput) PublicNetworkAccessEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.BoolPtrOutput { return v.PublicNetworkAccessEnabled }).(pulumi.BoolPtrOutput)
}
// The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
func (o SnapshotOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// Specifies a reference to an existing snapshot, when `createOption` is `Copy`. Changing this forces a new resource to be created.
func (o SnapshotOutput) SourceResourceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringPtrOutput { return v.SourceResourceId }).(pulumi.StringPtrOutput)
}
// Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
func (o SnapshotOutput) SourceUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringPtrOutput { return v.SourceUri }).(pulumi.StringPtrOutput)
}
// Specifies the ID of an storage account. Used with `sourceUri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
func (o SnapshotOutput) StorageAccountId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringPtrOutput { return v.StorageAccountId }).(pulumi.StringPtrOutput)
}
// A mapping of tags to assign to the resource.
func (o SnapshotOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Snapshot) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Whether Trusted Launch is enabled for the Snapshot.
func (o SnapshotOutput) TrustedLaunchEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v *Snapshot) pulumi.BoolOutput { return v.TrustedLaunchEnabled }).(pulumi.BoolOutput)
}
type SnapshotArrayOutput struct{ *pulumi.OutputState }
func (SnapshotArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Snapshot)(nil)).Elem()
}
func (o SnapshotArrayOutput) ToSnapshotArrayOutput() SnapshotArrayOutput {
return o
}
func (o SnapshotArrayOutput) ToSnapshotArrayOutputWithContext(ctx context.Context) SnapshotArrayOutput {
return o
}
func (o SnapshotArrayOutput) Index(i pulumi.IntInput) SnapshotOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Snapshot {
return vs[0].([]*Snapshot)[vs[1].(int)]
}).(SnapshotOutput)
}
type SnapshotMapOutput struct{ *pulumi.OutputState }
func (SnapshotMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Snapshot)(nil)).Elem()
}
func (o SnapshotMapOutput) ToSnapshotMapOutput() SnapshotMapOutput {
return o
}
func (o SnapshotMapOutput) ToSnapshotMapOutputWithContext(ctx context.Context) SnapshotMapOutput {
return o
}
func (o SnapshotMapOutput) MapIndex(k pulumi.StringInput) SnapshotOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Snapshot {
return vs[0].(map[string]*Snapshot)[vs[1].(string)]
}).(SnapshotOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SnapshotInput)(nil)).Elem(), &Snapshot{})
pulumi.RegisterInputType(reflect.TypeOf((*SnapshotArrayInput)(nil)).Elem(), SnapshotArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SnapshotMapInput)(nil)).Elem(), SnapshotMap{})
pulumi.RegisterOutputType(SnapshotOutput{})
pulumi.RegisterOutputType(SnapshotArrayOutput{})
pulumi.RegisterOutputType(SnapshotMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/dataDiskAttachment.go | sdk/go/azure/compute/dataDiskAttachment.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages attaching a Disk to a Virtual Machine.
//
// > **NOTE:** Data Disks can be attached either directly on the `compute.VirtualMachine` resource, or using the `compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur.
//
// > **Please Note:** only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the `storageDataDisk` block in the `compute.VirtualMachine` resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cfg := config.New(ctx, "")
// prefix := "example"
// if param := cfg.Get("prefix"); param != "" {
// prefix = param
// }
// vmName := fmt.Sprintf("%v-vm", prefix)
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.Sprintf("%v-resources", prefix),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// main, err := network.NewVirtualNetwork(ctx, "main", &network.VirtualNetworkArgs{
// Name: pulumi.Sprintf("%v-network", prefix),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: main.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// mainNetworkInterface, err := network.NewNetworkInterface(ctx, "main", &network.NetworkInterfaceArgs{
// Name: pulumi.Sprintf("%v-nic", prefix),
// Location: example.Location,
// ResourceGroupName: example.Name,
// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
// &network.NetworkInterfaceIpConfigurationArgs{
// Name: pulumi.String("internal"),
// SubnetId: internal.ID(),
// PrivateIpAddressAllocation: pulumi.String("Dynamic"),
// },
// },
// })
// if err != nil {
// return err
// }
// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "example", &compute.VirtualMachineArgs{
// Name: pulumi.String(vmName),
// Location: example.Location,
// ResourceGroupName: example.Name,
// NetworkInterfaceIds: pulumi.StringArray{
// mainNetworkInterface.ID(),
// },
// VmSize: pulumi.String("Standard_F2"),
// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{
// Publisher: pulumi.String("Canonical"),
// Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
// Sku: pulumi.String("22_04-lts"),
// Version: pulumi.String("latest"),
// },
// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{
// Name: pulumi.String("myosdisk1"),
// Caching: pulumi.String("ReadWrite"),
// CreateOption: pulumi.String("FromImage"),
// ManagedDiskType: pulumi.String("Standard_LRS"),
// },
// OsProfile: &compute.VirtualMachineOsProfileArgs{
// ComputerName: pulumi.String(vmName),
// AdminUsername: pulumi.String("testadmin"),
// AdminPassword: pulumi.String("Password1234!"),
// },
// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{
// DisablePasswordAuthentication: pulumi.Bool(false),
// },
// })
// if err != nil {
// return err
// }
// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
// Name: pulumi.Sprintf("%v-disk1", vmName),
// Location: example.Location,
// ResourceGroupName: example.Name,
// StorageAccountType: pulumi.String("Standard_LRS"),
// CreateOption: pulumi.String("Empty"),
// DiskSizeGb: pulumi.Int(10),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewDataDiskAttachment(ctx, "example", &compute.DataDiskAttachmentArgs{
// ManagedDiskId: exampleManagedDisk.ID(),
// VirtualMachineId: exampleVirtualMachine.ID(),
// Lun: pulumi.Int(10),
// Caching: pulumi.String("ReadWrite"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01, 2023-04-02
//
// ## Import
//
// Virtual Machines Data Disk Attachments can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/dataDiskAttachment:DataDiskAttachment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1/dataDisks/disk1
// ```
type DataDiskAttachment struct {
pulumi.CustomResourceState
// Specifies the caching requirements for this Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
Caching pulumi.StringOutput `pulumi:"caching"`
// The Create Option of the Data Disk, such as `Empty` or `Attach`. Defaults to `Attach`. Changing this forces a new resource to be created.
CreateOption pulumi.StringPtrOutput `pulumi:"createOption"`
// The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Lun pulumi.IntOutput `pulumi:"lun"`
// The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
ManagedDiskId pulumi.StringOutput `pulumi:"managedDiskId"`
// The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringOutput `pulumi:"virtualMachineId"`
// Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
WriteAcceleratorEnabled pulumi.BoolPtrOutput `pulumi:"writeAcceleratorEnabled"`
}
// NewDataDiskAttachment registers a new resource with the given unique name, arguments, and options.
func NewDataDiskAttachment(ctx *pulumi.Context,
name string, args *DataDiskAttachmentArgs, opts ...pulumi.ResourceOption) (*DataDiskAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Caching == nil {
return nil, errors.New("invalid value for required argument 'Caching'")
}
if args.Lun == nil {
return nil, errors.New("invalid value for required argument 'Lun'")
}
if args.ManagedDiskId == nil {
return nil, errors.New("invalid value for required argument 'ManagedDiskId'")
}
if args.VirtualMachineId == nil {
return nil, errors.New("invalid value for required argument 'VirtualMachineId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DataDiskAttachment
err := ctx.RegisterResource("azure:compute/dataDiskAttachment:DataDiskAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDataDiskAttachment gets an existing DataDiskAttachment resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDataDiskAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DataDiskAttachmentState, opts ...pulumi.ResourceOption) (*DataDiskAttachment, error) {
var resource DataDiskAttachment
err := ctx.ReadResource("azure:compute/dataDiskAttachment:DataDiskAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DataDiskAttachment resources.
type dataDiskAttachmentState struct {
// Specifies the caching requirements for this Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
Caching *string `pulumi:"caching"`
// The Create Option of the Data Disk, such as `Empty` or `Attach`. Defaults to `Attach`. Changing this forces a new resource to be created.
CreateOption *string `pulumi:"createOption"`
// The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Lun *int `pulumi:"lun"`
// The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
ManagedDiskId *string `pulumi:"managedDiskId"`
// The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
VirtualMachineId *string `pulumi:"virtualMachineId"`
// Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
WriteAcceleratorEnabled *bool `pulumi:"writeAcceleratorEnabled"`
}
type DataDiskAttachmentState struct {
// Specifies the caching requirements for this Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
Caching pulumi.StringPtrInput
// The Create Option of the Data Disk, such as `Empty` or `Attach`. Defaults to `Attach`. Changing this forces a new resource to be created.
CreateOption pulumi.StringPtrInput
// The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Lun pulumi.IntPtrInput
// The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
ManagedDiskId pulumi.StringPtrInput
// The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringPtrInput
// Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
WriteAcceleratorEnabled pulumi.BoolPtrInput
}
func (DataDiskAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*dataDiskAttachmentState)(nil)).Elem()
}
type dataDiskAttachmentArgs struct {
// Specifies the caching requirements for this Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
Caching string `pulumi:"caching"`
// The Create Option of the Data Disk, such as `Empty` or `Attach`. Defaults to `Attach`. Changing this forces a new resource to be created.
CreateOption *string `pulumi:"createOption"`
// The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Lun int `pulumi:"lun"`
// The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
ManagedDiskId string `pulumi:"managedDiskId"`
// The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
VirtualMachineId string `pulumi:"virtualMachineId"`
// Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
WriteAcceleratorEnabled *bool `pulumi:"writeAcceleratorEnabled"`
}
// The set of arguments for constructing a DataDiskAttachment resource.
type DataDiskAttachmentArgs struct {
// Specifies the caching requirements for this Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
Caching pulumi.StringInput
// The Create Option of the Data Disk, such as `Empty` or `Attach`. Defaults to `Attach`. Changing this forces a new resource to be created.
CreateOption pulumi.StringPtrInput
// The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Lun pulumi.IntInput
// The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
ManagedDiskId pulumi.StringInput
// The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
VirtualMachineId pulumi.StringInput
// Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
WriteAcceleratorEnabled pulumi.BoolPtrInput
}
func (DataDiskAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dataDiskAttachmentArgs)(nil)).Elem()
}
type DataDiskAttachmentInput interface {
pulumi.Input
ToDataDiskAttachmentOutput() DataDiskAttachmentOutput
ToDataDiskAttachmentOutputWithContext(ctx context.Context) DataDiskAttachmentOutput
}
func (*DataDiskAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**DataDiskAttachment)(nil)).Elem()
}
func (i *DataDiskAttachment) ToDataDiskAttachmentOutput() DataDiskAttachmentOutput {
return i.ToDataDiskAttachmentOutputWithContext(context.Background())
}
func (i *DataDiskAttachment) ToDataDiskAttachmentOutputWithContext(ctx context.Context) DataDiskAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataDiskAttachmentOutput)
}
// DataDiskAttachmentArrayInput is an input type that accepts DataDiskAttachmentArray and DataDiskAttachmentArrayOutput values.
// You can construct a concrete instance of `DataDiskAttachmentArrayInput` via:
//
// DataDiskAttachmentArray{ DataDiskAttachmentArgs{...} }
type DataDiskAttachmentArrayInput interface {
pulumi.Input
ToDataDiskAttachmentArrayOutput() DataDiskAttachmentArrayOutput
ToDataDiskAttachmentArrayOutputWithContext(context.Context) DataDiskAttachmentArrayOutput
}
type DataDiskAttachmentArray []DataDiskAttachmentInput
func (DataDiskAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DataDiskAttachment)(nil)).Elem()
}
func (i DataDiskAttachmentArray) ToDataDiskAttachmentArrayOutput() DataDiskAttachmentArrayOutput {
return i.ToDataDiskAttachmentArrayOutputWithContext(context.Background())
}
func (i DataDiskAttachmentArray) ToDataDiskAttachmentArrayOutputWithContext(ctx context.Context) DataDiskAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataDiskAttachmentArrayOutput)
}
// DataDiskAttachmentMapInput is an input type that accepts DataDiskAttachmentMap and DataDiskAttachmentMapOutput values.
// You can construct a concrete instance of `DataDiskAttachmentMapInput` via:
//
// DataDiskAttachmentMap{ "key": DataDiskAttachmentArgs{...} }
type DataDiskAttachmentMapInput interface {
pulumi.Input
ToDataDiskAttachmentMapOutput() DataDiskAttachmentMapOutput
ToDataDiskAttachmentMapOutputWithContext(context.Context) DataDiskAttachmentMapOutput
}
type DataDiskAttachmentMap map[string]DataDiskAttachmentInput
func (DataDiskAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DataDiskAttachment)(nil)).Elem()
}
func (i DataDiskAttachmentMap) ToDataDiskAttachmentMapOutput() DataDiskAttachmentMapOutput {
return i.ToDataDiskAttachmentMapOutputWithContext(context.Background())
}
func (i DataDiskAttachmentMap) ToDataDiskAttachmentMapOutputWithContext(ctx context.Context) DataDiskAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataDiskAttachmentMapOutput)
}
type DataDiskAttachmentOutput struct{ *pulumi.OutputState }
func (DataDiskAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DataDiskAttachment)(nil)).Elem()
}
func (o DataDiskAttachmentOutput) ToDataDiskAttachmentOutput() DataDiskAttachmentOutput {
return o
}
func (o DataDiskAttachmentOutput) ToDataDiskAttachmentOutputWithContext(ctx context.Context) DataDiskAttachmentOutput {
return o
}
// Specifies the caching requirements for this Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
func (o DataDiskAttachmentOutput) Caching() pulumi.StringOutput {
return o.ApplyT(func(v *DataDiskAttachment) pulumi.StringOutput { return v.Caching }).(pulumi.StringOutput)
}
// The Create Option of the Data Disk, such as `Empty` or `Attach`. Defaults to `Attach`. Changing this forces a new resource to be created.
func (o DataDiskAttachmentOutput) CreateOption() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DataDiskAttachment) pulumi.StringPtrOutput { return v.CreateOption }).(pulumi.StringPtrOutput)
}
// The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
func (o DataDiskAttachmentOutput) Lun() pulumi.IntOutput {
return o.ApplyT(func(v *DataDiskAttachment) pulumi.IntOutput { return v.Lun }).(pulumi.IntOutput)
}
// The ID of an existing Managed Disk which should be attached. Changing this forces a new resource to be created.
func (o DataDiskAttachmentOutput) ManagedDiskId() pulumi.StringOutput {
return o.ApplyT(func(v *DataDiskAttachment) pulumi.StringOutput { return v.ManagedDiskId }).(pulumi.StringOutput)
}
// The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
func (o DataDiskAttachmentOutput) VirtualMachineId() pulumi.StringOutput {
return o.ApplyT(func(v *DataDiskAttachment) pulumi.StringOutput { return v.VirtualMachineId }).(pulumi.StringOutput)
}
// Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
func (o DataDiskAttachmentOutput) WriteAcceleratorEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *DataDiskAttachment) pulumi.BoolPtrOutput { return v.WriteAcceleratorEnabled }).(pulumi.BoolPtrOutput)
}
type DataDiskAttachmentArrayOutput struct{ *pulumi.OutputState }
func (DataDiskAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DataDiskAttachment)(nil)).Elem()
}
func (o DataDiskAttachmentArrayOutput) ToDataDiskAttachmentArrayOutput() DataDiskAttachmentArrayOutput {
return o
}
func (o DataDiskAttachmentArrayOutput) ToDataDiskAttachmentArrayOutputWithContext(ctx context.Context) DataDiskAttachmentArrayOutput {
return o
}
func (o DataDiskAttachmentArrayOutput) Index(i pulumi.IntInput) DataDiskAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DataDiskAttachment {
return vs[0].([]*DataDiskAttachment)[vs[1].(int)]
}).(DataDiskAttachmentOutput)
}
type DataDiskAttachmentMapOutput struct{ *pulumi.OutputState }
func (DataDiskAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DataDiskAttachment)(nil)).Elem()
}
func (o DataDiskAttachmentMapOutput) ToDataDiskAttachmentMapOutput() DataDiskAttachmentMapOutput {
return o
}
func (o DataDiskAttachmentMapOutput) ToDataDiskAttachmentMapOutputWithContext(ctx context.Context) DataDiskAttachmentMapOutput {
return o
}
func (o DataDiskAttachmentMapOutput) MapIndex(k pulumi.StringInput) DataDiskAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DataDiskAttachment {
return vs[0].(map[string]*DataDiskAttachment)[vs[1].(string)]
}).(DataDiskAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DataDiskAttachmentInput)(nil)).Elem(), &DataDiskAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*DataDiskAttachmentArrayInput)(nil)).Elem(), DataDiskAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DataDiskAttachmentMapInput)(nil)).Elem(), DataDiskAttachmentMap{})
pulumi.RegisterOutputType(DataDiskAttachmentOutput{})
pulumi.RegisterOutputType(DataDiskAttachmentArrayOutput{})
pulumi.RegisterOutputType(DataDiskAttachmentMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getDedicatedHostGroup.go | sdk/go/azure/compute/getDedicatedHostGroup.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Dedicated Host Group.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.LookupDedicatedHostGroup(ctx, &compute.LookupDedicatedHostGroupArgs{
// Name: "example-dedicated-host-group",
// ResourceGroupName: "example-rg",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01
func LookupDedicatedHostGroup(ctx *pulumi.Context, args *LookupDedicatedHostGroupArgs, opts ...pulumi.InvokeOption) (*LookupDedicatedHostGroupResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupDedicatedHostGroupResult
err := ctx.Invoke("azure:compute/getDedicatedHostGroup:getDedicatedHostGroup", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDedicatedHostGroup.
type LookupDedicatedHostGroupArgs struct {
// Specifies the name of the Dedicated Host Group.
Name string `pulumi:"name"`
// Specifies the name of the resource group the Dedicated Host Group is located in.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getDedicatedHostGroup.
type LookupDedicatedHostGroupResult struct {
// Whether virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group.
AutomaticPlacementEnabled bool `pulumi:"automaticPlacementEnabled"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The Azure location where the Dedicated Host Group exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
// The number of fault domains that the Dedicated Host Group spans.
PlatformFaultDomainCount int `pulumi:"platformFaultDomainCount"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
// A list of Availability Zones in which this Dedicated Host Group is located.
Zones []string `pulumi:"zones"`
}
func LookupDedicatedHostGroupOutput(ctx *pulumi.Context, args LookupDedicatedHostGroupOutputArgs, opts ...pulumi.InvokeOption) LookupDedicatedHostGroupResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (LookupDedicatedHostGroupResultOutput, error) {
args := v.(LookupDedicatedHostGroupArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getDedicatedHostGroup:getDedicatedHostGroup", args, LookupDedicatedHostGroupResultOutput{}, options).(LookupDedicatedHostGroupResultOutput), nil
}).(LookupDedicatedHostGroupResultOutput)
}
// A collection of arguments for invoking getDedicatedHostGroup.
type LookupDedicatedHostGroupOutputArgs struct {
// Specifies the name of the Dedicated Host Group.
Name pulumi.StringInput `pulumi:"name"`
// Specifies the name of the resource group the Dedicated Host Group is located in.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupDedicatedHostGroupOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDedicatedHostGroupArgs)(nil)).Elem()
}
// A collection of values returned by getDedicatedHostGroup.
type LookupDedicatedHostGroupResultOutput struct{ *pulumi.OutputState }
func (LookupDedicatedHostGroupResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDedicatedHostGroupResult)(nil)).Elem()
}
func (o LookupDedicatedHostGroupResultOutput) ToLookupDedicatedHostGroupResultOutput() LookupDedicatedHostGroupResultOutput {
return o
}
func (o LookupDedicatedHostGroupResultOutput) ToLookupDedicatedHostGroupResultOutputWithContext(ctx context.Context) LookupDedicatedHostGroupResultOutput {
return o
}
// Whether virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group.
func (o LookupDedicatedHostGroupResultOutput) AutomaticPlacementEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) bool { return v.AutomaticPlacementEnabled }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupDedicatedHostGroupResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) string { return v.Id }).(pulumi.StringOutput)
}
// The Azure location where the Dedicated Host Group exists.
func (o LookupDedicatedHostGroupResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupDedicatedHostGroupResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) string { return v.Name }).(pulumi.StringOutput)
}
// The number of fault domains that the Dedicated Host Group spans.
func (o LookupDedicatedHostGroupResultOutput) PlatformFaultDomainCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) int { return v.PlatformFaultDomainCount }).(pulumi.IntOutput)
}
func (o LookupDedicatedHostGroupResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the resource.
func (o LookupDedicatedHostGroupResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// A list of Availability Zones in which this Dedicated Host Group is located.
func (o LookupDedicatedHostGroupResultOutput) Zones() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupDedicatedHostGroupResult) []string { return v.Zones }).(pulumi.StringArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDedicatedHostGroupResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/managedDisk.go | sdk/go/azure/compute/managedDisk.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a managed disk.
//
// ## Example Usage
//
// ### With Create Empty
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
// Name: pulumi.String("acctestmd"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// StorageAccountType: pulumi.String("Standard_LRS"),
// CreateOption: pulumi.String("Empty"),
// DiskSizeGb: pulumi.Int(1),
// Tags: pulumi.StringMap{
// "environment": pulumi.String("staging"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ### With Create Copy
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// source, err := compute.NewManagedDisk(ctx, "source", &compute.ManagedDiskArgs{
// Name: pulumi.String("acctestmd1"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// StorageAccountType: pulumi.String("Standard_LRS"),
// CreateOption: pulumi.String("Empty"),
// DiskSizeGb: pulumi.Int(1),
// Tags: pulumi.StringMap{
// "environment": pulumi.String("staging"),
// },
// })
// if err != nil {
// return err
// }
// _, err = compute.NewManagedDisk(ctx, "copy", &compute.ManagedDiskArgs{
// Name: pulumi.String("acctestmd2"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// StorageAccountType: pulumi.String("Standard_LRS"),
// CreateOption: pulumi.String("Copy"),
// SourceResourceId: source.ID(),
// DiskSizeGb: pulumi.Int(1),
// Tags: pulumi.StringMap{
// "environment": pulumi.String("staging"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2023-04-02
//
// ## Import
//
// Managed Disks can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/managedDisk:ManagedDisk example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/disks/manageddisk1
// ```
type ManagedDisk struct {
pulumi.CustomResourceState
// The method to use when creating the managed disk. Changing this forces a new resource to be created. Possible values include:
// * `Import` - Import a VHD file in to the managed disk (VHD specified with `sourceUri`).
// * `ImportSecure` - Securely import a VHD file in to the managed disk (VHD specified with `sourceUri`).
// * `Empty` - Create an empty managed disk.
// * `Copy` - Copy an existing managed disk or snapshot (specified with `sourceResourceId`).
// * `FromImage` - Copy a Platform Image (specified with `imageReferenceId`)
// * `Restore` - Set by Azure Backup or Site Recovery on a restored disk (specified with `sourceResourceId`).
// * `Upload` - Upload a VHD disk with the help of SAS URL (to be used with `uploadSizeBytes`).
CreateOption pulumi.StringOutput `pulumi:"createOption"`
// The ID of the disk access resource for using private endpoints on disks.
//
// > **Note:** `diskAccessId` is only supported when `networkAccessPolicy` is set to `AllowPrivate`.
DiskAccessId pulumi.StringPtrOutput `pulumi:"diskAccessId"`
// The ID of a Disk Encryption Set which should be used to encrypt this Managed Disk. Conflicts with `secureVmDiskEncryptionSetId`.
//
// > **NOTE:** The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
//
// > **NOTE:** Disk Encryption Sets are in Public Preview in a limited set of regions
DiskEncryptionSetId pulumi.StringPtrOutput `pulumi:"diskEncryptionSetId"`
// The number of IOPS allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. One operation can transfer between 4k and 256k bytes.
DiskIopsReadOnly pulumi.IntOutput `pulumi:"diskIopsReadOnly"`
// The number of IOPS allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. One operation can transfer between 4k and 256k bytes.
DiskIopsReadWrite pulumi.IntOutput `pulumi:"diskIopsReadWrite"`
// The bandwidth allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. MBps means millions of bytes per second.
DiskMbpsReadOnly pulumi.IntOutput `pulumi:"diskMbpsReadOnly"`
// The bandwidth allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. MBps means millions of bytes per second.
DiskMbpsReadWrite pulumi.IntOutput `pulumi:"diskMbpsReadWrite"`
DiskSizeGb pulumi.IntOutput `pulumi:"diskSizeGb"`
// Specifies the Edge Zone within the Azure Region where this Managed Disk should exist. Changing this forces a new Managed Disk to be created.
EdgeZone pulumi.StringPtrOutput `pulumi:"edgeZone"`
// A `encryptionSettings` block as defined below.
//
// > **NOTE:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings ManagedDiskEncryptionSettingsPtrOutput `pulumi:"encryptionSettings"`
// ID of a Gallery Image Version to copy when `createOption` is `FromImage`. This field cannot be specified if imageReferenceId is specified. Changing this forces a new resource to be created.
GalleryImageReferenceId pulumi.StringPtrOutput `pulumi:"galleryImageReferenceId"`
// The HyperV Generation of the Disk when the source of an `Import` or `Copy` operation targets a source that contains an operating system. Possible values are `V1` and `V2`. For `ImportSecure` it must be set to `V2`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrOutput `pulumi:"hyperVGeneration"`
// ID of an existing platform/marketplace disk image to copy when `createOption` is `FromImage`. This field cannot be specified if galleryImageReferenceId is specified. Changing this forces a new resource to be created.
ImageReferenceId pulumi.StringPtrOutput `pulumi:"imageReferenceId"`
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Logical Sector Size. Possible values are: `512` and `4096`. Defaults to `4096`. Changing this forces a new resource to be created.
//
// > **NOTE:** Setting logical sector size is supported only with `UltraSSD_LRS` disks and `PremiumV2_LRS` disks.
LogicalSectorSize pulumi.IntOutput `pulumi:"logicalSectorSize"`
// The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.
//
// > **Note:** Premium SSD maxShares limit: `P15` and `P20` disks: 2. `P30`,`P40`,`P50` disks: 5. `P60`,`P70`,`P80` disks: 10. For ultra disks the `maxShares` minimum value is 1 and the maximum is 5.
MaxShares pulumi.IntOutput `pulumi:"maxShares"`
// Specifies the name of the Managed Disk. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Policy for accessing the disk via network. Allowed values are `AllowAll`, `AllowPrivate`, and `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy pulumi.StringPtrOutput `pulumi:"networkAccessPolicy"`
// Specifies if On-Demand Bursting is enabled for the Managed Disk.
//
// > **Note:** Credit-Based Bursting is enabled by default on all eligible disks. More information on [Credit-Based and On-Demand Bursting can be found in the documentation](https://docs.microsoft.com/azure/virtual-machines/disk-bursting#disk-level-bursting).
OnDemandBurstingEnabled pulumi.BoolPtrOutput `pulumi:"onDemandBurstingEnabled"`
// Specifies whether this Managed Disk should be optimized for frequent disk attachments (where a disk is attached/detached more than 5 times in a day). Defaults to `false`.
//
// > **Note:** Setting `optimizedFrequentAttachEnabled` to `true` causes the disks to not align with the fault domain of the Virtual Machine, which can have operational implications.
OptimizedFrequentAttachEnabled pulumi.BoolPtrOutput `pulumi:"optimizedFrequentAttachEnabled"`
// Specify a value when the source of an `Import`, `ImportSecure` or `Copy` operation targets a source that contains an operating system. Valid values are `Linux` or `Windows`.
OsType pulumi.StringPtrOutput `pulumi:"osType"`
// Specifies whether Performance Plus is enabled for this Managed Disk. Defaults to `false`. Changing this forces a new resource to be created.
PerformancePlusEnabled pulumi.BoolPtrOutput `pulumi:"performancePlusEnabled"`
// Whether it is allowed to access the disk via public network. Defaults to `true`.
//
// For more information on managed disks, such as sizing options and pricing, please check out the [Azure Documentation](https://docs.microsoft.com/azure/storage/storage-managed-disks-overview).
PublicNetworkAccessEnabled pulumi.BoolPtrOutput `pulumi:"publicNetworkAccessEnabled"`
// The name of the Resource Group where the Managed Disk should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk when the Virtual Machine is a Confidential VM. Conflicts with `diskEncryptionSetId`. Changing this forces a new resource to be created.
//
// > **NOTE:** `secureVmDiskEncryptionSetId` can only be specified when `securityType` is set to `ConfidentialVM_DiskEncryptedWithCustomerKey`.
SecureVmDiskEncryptionSetId pulumi.StringPtrOutput `pulumi:"secureVmDiskEncryptionSetId"`
// Security Type of the Managed Disk when it is used for a Confidential VM. Possible values are `ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey`, `ConfidentialVM_DiskEncryptedWithPlatformKey` and `ConfidentialVM_DiskEncryptedWithCustomerKey`. Changing this forces a new resource to be created.
//
// > **NOTE:** When `securityType` is set to `ConfidentialVM_DiskEncryptedWithCustomerKey` the value of `createOption` must be one of `FromImage` or `ImportSecure`.
//
// > **NOTE:** `securityType` cannot be specified when `trustedLaunchEnabled` is set to true.
//
// > **NOTE:** `secureVmDiskEncryptionSetId` must be specified when `securityType` is set to `ConfidentialVM_DiskEncryptedWithCustomerKey`.
SecurityType pulumi.StringPtrOutput `pulumi:"securityType"`
// The ID of an existing Managed Disk or Snapshot to copy when `createOption` is `Copy` or the recovery point to restore when `createOption` is `Restore`. Changing this forces a new resource to be created.
SourceResourceId pulumi.StringPtrOutput `pulumi:"sourceResourceId"`
// URI to a valid VHD file to be used when `createOption` is `Import` or `ImportSecure`. Changing this forces a new resource to be created.
SourceUri pulumi.StringOutput `pulumi:"sourceUri"`
// The ID of the Storage Account where the `sourceUri` is located. Required when `createOption` is set to `Import` or `ImportSecure`. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringPtrOutput `pulumi:"storageAccountId"`
// The type of storage to use for the managed disk. Possible values are `Standard_LRS`, `StandardSSD_ZRS`, `Premium_LRS`, `PremiumV2_LRS`, `Premium_ZRS`, `StandardSSD_LRS` or `UltraSSD_LRS`.
//
// > **Note:** Azure Ultra Disk Storage is only available in a region that support availability zones and can only enabled on the following VM series: `ESv3`, `DSv3`, `FSv3`, `LSv2`, `M` and `Mv2`. For more information see the `Azure Ultra Disk Storage` [product documentation](https://docs.microsoft.com/azure/virtual-machines/windows/disks-enable-ultra-ssd).
StorageAccountType pulumi.StringOutput `pulumi:"storageAccountType"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
Tier pulumi.StringOutput `pulumi:"tier"`
// Specifies if Trusted Launch is enabled for the Managed Disk. Changing this forces a new resource to be created.
//
// > **Note:** Trusted Launch can only be enabled when `createOption` is `FromImage` or `Import`.
TrustedLaunchEnabled pulumi.BoolPtrOutput `pulumi:"trustedLaunchEnabled"`
// Specifies the size of the managed disk to create in bytes. Required when `createOption` is `Upload`. The value must be equal to the source disk to be copied in bytes. Source disk size could be calculated with `ls -l` or `wc -c`. More information can be found at [Copy a managed disk](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disks-upload-vhd-to-managed-disk-cli#copy-a-managed-disk). Changing this forces a new resource to be created.
UploadSizeBytes pulumi.IntPtrOutput `pulumi:"uploadSizeBytes"`
// Specifies the Availability Zone in which this Managed Disk should be located. Changing this property forces a new resource to be created.
//
// > **Note:** Availability Zones are [only supported in select regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
Zone pulumi.StringPtrOutput `pulumi:"zone"`
}
// NewManagedDisk registers a new resource with the given unique name, arguments, and options.
func NewManagedDisk(ctx *pulumi.Context,
name string, args *ManagedDiskArgs, opts ...pulumi.ResourceOption) (*ManagedDisk, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CreateOption == nil {
return nil, errors.New("invalid value for required argument 'CreateOption'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.StorageAccountType == nil {
return nil, errors.New("invalid value for required argument 'StorageAccountType'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ManagedDisk
err := ctx.RegisterResource("azure:compute/managedDisk:ManagedDisk", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetManagedDisk gets an existing ManagedDisk resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetManagedDisk(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ManagedDiskState, opts ...pulumi.ResourceOption) (*ManagedDisk, error) {
var resource ManagedDisk
err := ctx.ReadResource("azure:compute/managedDisk:ManagedDisk", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ManagedDisk resources.
type managedDiskState struct {
// The method to use when creating the managed disk. Changing this forces a new resource to be created. Possible values include:
// * `Import` - Import a VHD file in to the managed disk (VHD specified with `sourceUri`).
// * `ImportSecure` - Securely import a VHD file in to the managed disk (VHD specified with `sourceUri`).
// * `Empty` - Create an empty managed disk.
// * `Copy` - Copy an existing managed disk or snapshot (specified with `sourceResourceId`).
// * `FromImage` - Copy a Platform Image (specified with `imageReferenceId`)
// * `Restore` - Set by Azure Backup or Site Recovery on a restored disk (specified with `sourceResourceId`).
// * `Upload` - Upload a VHD disk with the help of SAS URL (to be used with `uploadSizeBytes`).
CreateOption *string `pulumi:"createOption"`
// The ID of the disk access resource for using private endpoints on disks.
//
// > **Note:** `diskAccessId` is only supported when `networkAccessPolicy` is set to `AllowPrivate`.
DiskAccessId *string `pulumi:"diskAccessId"`
// The ID of a Disk Encryption Set which should be used to encrypt this Managed Disk. Conflicts with `secureVmDiskEncryptionSetId`.
//
// > **NOTE:** The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
//
// > **NOTE:** Disk Encryption Sets are in Public Preview in a limited set of regions
DiskEncryptionSetId *string `pulumi:"diskEncryptionSetId"`
// The number of IOPS allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. One operation can transfer between 4k and 256k bytes.
DiskIopsReadOnly *int `pulumi:"diskIopsReadOnly"`
// The number of IOPS allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. One operation can transfer between 4k and 256k bytes.
DiskIopsReadWrite *int `pulumi:"diskIopsReadWrite"`
// The bandwidth allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. MBps means millions of bytes per second.
DiskMbpsReadOnly *int `pulumi:"diskMbpsReadOnly"`
// The bandwidth allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. MBps means millions of bytes per second.
DiskMbpsReadWrite *int `pulumi:"diskMbpsReadWrite"`
DiskSizeGb *int `pulumi:"diskSizeGb"`
// Specifies the Edge Zone within the Azure Region where this Managed Disk should exist. Changing this forces a new Managed Disk to be created.
EdgeZone *string `pulumi:"edgeZone"`
// A `encryptionSettings` block as defined below.
//
// > **NOTE:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings *ManagedDiskEncryptionSettings `pulumi:"encryptionSettings"`
// ID of a Gallery Image Version to copy when `createOption` is `FromImage`. This field cannot be specified if imageReferenceId is specified. Changing this forces a new resource to be created.
GalleryImageReferenceId *string `pulumi:"galleryImageReferenceId"`
// The HyperV Generation of the Disk when the source of an `Import` or `Copy` operation targets a source that contains an operating system. Possible values are `V1` and `V2`. For `ImportSecure` it must be set to `V2`. Changing this forces a new resource to be created.
HyperVGeneration *string `pulumi:"hyperVGeneration"`
// ID of an existing platform/marketplace disk image to copy when `createOption` is `FromImage`. This field cannot be specified if galleryImageReferenceId is specified. Changing this forces a new resource to be created.
ImageReferenceId *string `pulumi:"imageReferenceId"`
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Logical Sector Size. Possible values are: `512` and `4096`. Defaults to `4096`. Changing this forces a new resource to be created.
//
// > **NOTE:** Setting logical sector size is supported only with `UltraSSD_LRS` disks and `PremiumV2_LRS` disks.
LogicalSectorSize *int `pulumi:"logicalSectorSize"`
// The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.
//
// > **Note:** Premium SSD maxShares limit: `P15` and `P20` disks: 2. `P30`,`P40`,`P50` disks: 5. `P60`,`P70`,`P80` disks: 10. For ultra disks the `maxShares` minimum value is 1 and the maximum is 5.
MaxShares *int `pulumi:"maxShares"`
// Specifies the name of the Managed Disk. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Policy for accessing the disk via network. Allowed values are `AllowAll`, `AllowPrivate`, and `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy *string `pulumi:"networkAccessPolicy"`
// Specifies if On-Demand Bursting is enabled for the Managed Disk.
//
// > **Note:** Credit-Based Bursting is enabled by default on all eligible disks. More information on [Credit-Based and On-Demand Bursting can be found in the documentation](https://docs.microsoft.com/azure/virtual-machines/disk-bursting#disk-level-bursting).
OnDemandBurstingEnabled *bool `pulumi:"onDemandBurstingEnabled"`
// Specifies whether this Managed Disk should be optimized for frequent disk attachments (where a disk is attached/detached more than 5 times in a day). Defaults to `false`.
//
// > **Note:** Setting `optimizedFrequentAttachEnabled` to `true` causes the disks to not align with the fault domain of the Virtual Machine, which can have operational implications.
OptimizedFrequentAttachEnabled *bool `pulumi:"optimizedFrequentAttachEnabled"`
// Specify a value when the source of an `Import`, `ImportSecure` or `Copy` operation targets a source that contains an operating system. Valid values are `Linux` or `Windows`.
OsType *string `pulumi:"osType"`
// Specifies whether Performance Plus is enabled for this Managed Disk. Defaults to `false`. Changing this forces a new resource to be created.
PerformancePlusEnabled *bool `pulumi:"performancePlusEnabled"`
// Whether it is allowed to access the disk via public network. Defaults to `true`.
//
// For more information on managed disks, such as sizing options and pricing, please check out the [Azure Documentation](https://docs.microsoft.com/azure/storage/storage-managed-disks-overview).
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// The name of the Resource Group where the Managed Disk should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk when the Virtual Machine is a Confidential VM. Conflicts with `diskEncryptionSetId`. Changing this forces a new resource to be created.
//
// > **NOTE:** `secureVmDiskEncryptionSetId` can only be specified when `securityType` is set to `ConfidentialVM_DiskEncryptedWithCustomerKey`.
SecureVmDiskEncryptionSetId *string `pulumi:"secureVmDiskEncryptionSetId"`
// Security Type of the Managed Disk when it is used for a Confidential VM. Possible values are `ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey`, `ConfidentialVM_DiskEncryptedWithPlatformKey` and `ConfidentialVM_DiskEncryptedWithCustomerKey`. Changing this forces a new resource to be created.
//
// > **NOTE:** When `securityType` is set to `ConfidentialVM_DiskEncryptedWithCustomerKey` the value of `createOption` must be one of `FromImage` or `ImportSecure`.
//
// > **NOTE:** `securityType` cannot be specified when `trustedLaunchEnabled` is set to true.
//
// > **NOTE:** `secureVmDiskEncryptionSetId` must be specified when `securityType` is set to `ConfidentialVM_DiskEncryptedWithCustomerKey`.
SecurityType *string `pulumi:"securityType"`
// The ID of an existing Managed Disk or Snapshot to copy when `createOption` is `Copy` or the recovery point to restore when `createOption` is `Restore`. Changing this forces a new resource to be created.
SourceResourceId *string `pulumi:"sourceResourceId"`
// URI to a valid VHD file to be used when `createOption` is `Import` or `ImportSecure`. Changing this forces a new resource to be created.
SourceUri *string `pulumi:"sourceUri"`
// The ID of the Storage Account where the `sourceUri` is located. Required when `createOption` is set to `Import` or `ImportSecure`. Changing this forces a new resource to be created.
StorageAccountId *string `pulumi:"storageAccountId"`
// The type of storage to use for the managed disk. Possible values are `Standard_LRS`, `StandardSSD_ZRS`, `Premium_LRS`, `PremiumV2_LRS`, `Premium_ZRS`, `StandardSSD_LRS` or `UltraSSD_LRS`.
//
// > **Note:** Azure Ultra Disk Storage is only available in a region that support availability zones and can only enabled on the following VM series: `ESv3`, `DSv3`, `FSv3`, `LSv2`, `M` and `Mv2`. For more information see the `Azure Ultra Disk Storage` [product documentation](https://docs.microsoft.com/azure/virtual-machines/windows/disks-enable-ultra-ssd).
StorageAccountType *string `pulumi:"storageAccountType"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
Tier *string `pulumi:"tier"`
// Specifies if Trusted Launch is enabled for the Managed Disk. Changing this forces a new resource to be created.
//
// > **Note:** Trusted Launch can only be enabled when `createOption` is `FromImage` or `Import`.
TrustedLaunchEnabled *bool `pulumi:"trustedLaunchEnabled"`
// Specifies the size of the managed disk to create in bytes. Required when `createOption` is `Upload`. The value must be equal to the source disk to be copied in bytes. Source disk size could be calculated with `ls -l` or `wc -c`. More information can be found at [Copy a managed disk](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disks-upload-vhd-to-managed-disk-cli#copy-a-managed-disk). Changing this forces a new resource to be created.
UploadSizeBytes *int `pulumi:"uploadSizeBytes"`
// Specifies the Availability Zone in which this Managed Disk should be located. Changing this property forces a new resource to be created.
//
// > **Note:** Availability Zones are [only supported in select regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
Zone *string `pulumi:"zone"`
}
type ManagedDiskState struct {
// The method to use when creating the managed disk. Changing this forces a new resource to be created. Possible values include:
// * `Import` - Import a VHD file in to the managed disk (VHD specified with `sourceUri`).
// * `ImportSecure` - Securely import a VHD file in to the managed disk (VHD specified with `sourceUri`).
// * `Empty` - Create an empty managed disk.
// * `Copy` - Copy an existing managed disk or snapshot (specified with `sourceResourceId`).
// * `FromImage` - Copy a Platform Image (specified with `imageReferenceId`)
// * `Restore` - Set by Azure Backup or Site Recovery on a restored disk (specified with `sourceResourceId`).
// * `Upload` - Upload a VHD disk with the help of SAS URL (to be used with `uploadSizeBytes`).
CreateOption pulumi.StringPtrInput
// The ID of the disk access resource for using private endpoints on disks.
//
// > **Note:** `diskAccessId` is only supported when `networkAccessPolicy` is set to `AllowPrivate`.
DiskAccessId pulumi.StringPtrInput
// The ID of a Disk Encryption Set which should be used to encrypt this Managed Disk. Conflicts with `secureVmDiskEncryptionSetId`.
//
// > **NOTE:** The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
//
// > **NOTE:** Disk Encryption Sets are in Public Preview in a limited set of regions
DiskEncryptionSetId pulumi.StringPtrInput
// The number of IOPS allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. One operation can transfer between 4k and 256k bytes.
DiskIopsReadOnly pulumi.IntPtrInput
// The number of IOPS allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. One operation can transfer between 4k and 256k bytes.
DiskIopsReadWrite pulumi.IntPtrInput
// The bandwidth allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. MBps means millions of bytes per second.
DiskMbpsReadOnly pulumi.IntPtrInput
// The bandwidth allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. MBps means millions of bytes per second.
DiskMbpsReadWrite pulumi.IntPtrInput
DiskSizeGb pulumi.IntPtrInput
// Specifies the Edge Zone within the Azure Region where this Managed Disk should exist. Changing this forces a new Managed Disk to be created.
EdgeZone pulumi.StringPtrInput
// A `encryptionSettings` block as defined below.
//
// > **NOTE:** Removing `encryptionSettings` forces a new resource to be created.
EncryptionSettings ManagedDiskEncryptionSettingsPtrInput
// ID of a Gallery Image Version to copy when `createOption` is `FromImage`. This field cannot be specified if imageReferenceId is specified. Changing this forces a new resource to be created.
GalleryImageReferenceId pulumi.StringPtrInput
// The HyperV Generation of the Disk when the source of an `Import` or `Copy` operation targets a source that contains an operating system. Possible values are `V1` and `V2`. For `ImportSecure` it must be set to `V2`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrInput
// ID of an existing platform/marketplace disk image to copy when `createOption` is `FromImage`. This field cannot be specified if galleryImageReferenceId is specified. Changing this forces a new resource to be created.
ImageReferenceId pulumi.StringPtrInput
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Logical Sector Size. Possible values are: `512` and `4096`. Defaults to `4096`. Changing this forces a new resource to be created.
//
// > **NOTE:** Setting logical sector size is supported only with `UltraSSD_LRS` disks and `PremiumV2_LRS` disks.
LogicalSectorSize pulumi.IntPtrInput
// The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.
//
// > **Note:** Premium SSD maxShares limit: `P15` and `P20` disks: 2. `P30`,`P40`,`P50` disks: 5. `P60`,`P70`,`P80` disks: 10. For ultra disks the `maxShares` minimum value is 1 and the maximum is 5.
MaxShares pulumi.IntPtrInput
// Specifies the name of the Managed Disk. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Policy for accessing the disk via network. Allowed values are `AllowAll`, `AllowPrivate`, and `DenyAll`. Defaults to `AllowAll`.
NetworkAccessPolicy pulumi.StringPtrInput
// Specifies if On-Demand Bursting is enabled for the Managed Disk.
//
// > **Note:** Credit-Based Bursting is enabled by default on all eligible disks. More information on [Credit-Based and On-Demand Bursting can be found in the documentation](https://docs.microsoft.com/azure/virtual-machines/disk-bursting#disk-level-bursting).
OnDemandBurstingEnabled pulumi.BoolPtrInput
// Specifies whether this Managed Disk should be optimized for frequent disk attachments (where a disk is attached/detached more than 5 times in a day). Defaults to `false`.
//
// > **Note:** Setting `optimizedFrequentAttachEnabled` to `true` causes the disks to not align with the fault domain of the Virtual Machine, which can have operational implications.
OptimizedFrequentAttachEnabled pulumi.BoolPtrInput
// Specify a value when the source of an `Import`, `ImportSecure` or `Copy` operation targets a source that contains an operating system. Valid values are `Linux` or `Windows`.
OsType pulumi.StringPtrInput
// Specifies whether Performance Plus is enabled for this Managed Disk. Defaults to `false`. Changing this forces a new resource to be created.
PerformancePlusEnabled pulumi.BoolPtrInput
// Whether it is allowed to access the disk via public network. Defaults to `true`.
//
// For more information on managed disks, such as sizing options and pricing, please check out the [Azure Documentation](https://docs.microsoft.com/azure/storage/storage-managed-disks-overview).
PublicNetworkAccessEnabled pulumi.BoolPtrInput
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/capacityReservation.go | sdk/go/azure/compute/capacityReservation.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Capacity Reservation within a Capacity Reservation Group.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-rg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleCapacityReservationGroup, err := compute.NewCapacityReservationGroup(ctx, "example", &compute.CapacityReservationGroupArgs{
// Name: pulumi.String("example-capacity-reservation-group"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// })
// if err != nil {
// return err
// }
// _, err = compute.NewCapacityReservation(ctx, "example", &compute.CapacityReservationArgs{
// Name: pulumi.String("example-capacity-reservation"),
// CapacityReservationGroupId: exampleCapacityReservationGroup.ID(),
// Sku: &compute.CapacityReservationSkuArgs{
// Name: pulumi.String("Standard_D2s_v3"),
// Capacity: pulumi.Int(1),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-01
//
// ## Import
//
// Capacity Reservations can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/capacityReservation:CapacityReservation example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/capacityReservationGroups/capacityReservationGroup1/capacityReservations/capacityReservation1
// ```
type CapacityReservation struct {
pulumi.CustomResourceState
// The ID of the Capacity Reservation Group where the Capacity Reservation exists. Changing this forces a new resource to be created.
CapacityReservationGroupId pulumi.StringOutput `pulumi:"capacityReservationGroupId"`
// Specifies the name of this Capacity Reservation. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A `sku` block as defined below.
Sku CapacityReservationSkuOutput `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies the Availability Zone for this Capacity Reservation. Changing this forces a new resource to be created.
Zone pulumi.StringPtrOutput `pulumi:"zone"`
}
// NewCapacityReservation registers a new resource with the given unique name, arguments, and options.
func NewCapacityReservation(ctx *pulumi.Context,
name string, args *CapacityReservationArgs, opts ...pulumi.ResourceOption) (*CapacityReservation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CapacityReservationGroupId == nil {
return nil, errors.New("invalid value for required argument 'CapacityReservationGroupId'")
}
if args.Sku == nil {
return nil, errors.New("invalid value for required argument 'Sku'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource CapacityReservation
err := ctx.RegisterResource("azure:compute/capacityReservation:CapacityReservation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCapacityReservation gets an existing CapacityReservation resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCapacityReservation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CapacityReservationState, opts ...pulumi.ResourceOption) (*CapacityReservation, error) {
var resource CapacityReservation
err := ctx.ReadResource("azure:compute/capacityReservation:CapacityReservation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CapacityReservation resources.
type capacityReservationState struct {
// The ID of the Capacity Reservation Group where the Capacity Reservation exists. Changing this forces a new resource to be created.
CapacityReservationGroupId *string `pulumi:"capacityReservationGroupId"`
// Specifies the name of this Capacity Reservation. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `sku` block as defined below.
Sku *CapacityReservationSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Specifies the Availability Zone for this Capacity Reservation. Changing this forces a new resource to be created.
Zone *string `pulumi:"zone"`
}
type CapacityReservationState struct {
// The ID of the Capacity Reservation Group where the Capacity Reservation exists. Changing this forces a new resource to be created.
CapacityReservationGroupId pulumi.StringPtrInput
// Specifies the name of this Capacity Reservation. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `sku` block as defined below.
Sku CapacityReservationSkuPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Specifies the Availability Zone for this Capacity Reservation. Changing this forces a new resource to be created.
Zone pulumi.StringPtrInput
}
func (CapacityReservationState) ElementType() reflect.Type {
return reflect.TypeOf((*capacityReservationState)(nil)).Elem()
}
type capacityReservationArgs struct {
// The ID of the Capacity Reservation Group where the Capacity Reservation exists. Changing this forces a new resource to be created.
CapacityReservationGroupId string `pulumi:"capacityReservationGroupId"`
// Specifies the name of this Capacity Reservation. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `sku` block as defined below.
Sku CapacityReservationSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Specifies the Availability Zone for this Capacity Reservation. Changing this forces a new resource to be created.
Zone *string `pulumi:"zone"`
}
// The set of arguments for constructing a CapacityReservation resource.
type CapacityReservationArgs struct {
// The ID of the Capacity Reservation Group where the Capacity Reservation exists. Changing this forces a new resource to be created.
CapacityReservationGroupId pulumi.StringInput
// Specifies the name of this Capacity Reservation. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `sku` block as defined below.
Sku CapacityReservationSkuInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Specifies the Availability Zone for this Capacity Reservation. Changing this forces a new resource to be created.
Zone pulumi.StringPtrInput
}
func (CapacityReservationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*capacityReservationArgs)(nil)).Elem()
}
type CapacityReservationInput interface {
pulumi.Input
ToCapacityReservationOutput() CapacityReservationOutput
ToCapacityReservationOutputWithContext(ctx context.Context) CapacityReservationOutput
}
func (*CapacityReservation) ElementType() reflect.Type {
return reflect.TypeOf((**CapacityReservation)(nil)).Elem()
}
func (i *CapacityReservation) ToCapacityReservationOutput() CapacityReservationOutput {
return i.ToCapacityReservationOutputWithContext(context.Background())
}
func (i *CapacityReservation) ToCapacityReservationOutputWithContext(ctx context.Context) CapacityReservationOutput {
return pulumi.ToOutputWithContext(ctx, i).(CapacityReservationOutput)
}
// CapacityReservationArrayInput is an input type that accepts CapacityReservationArray and CapacityReservationArrayOutput values.
// You can construct a concrete instance of `CapacityReservationArrayInput` via:
//
// CapacityReservationArray{ CapacityReservationArgs{...} }
type CapacityReservationArrayInput interface {
pulumi.Input
ToCapacityReservationArrayOutput() CapacityReservationArrayOutput
ToCapacityReservationArrayOutputWithContext(context.Context) CapacityReservationArrayOutput
}
type CapacityReservationArray []CapacityReservationInput
func (CapacityReservationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CapacityReservation)(nil)).Elem()
}
func (i CapacityReservationArray) ToCapacityReservationArrayOutput() CapacityReservationArrayOutput {
return i.ToCapacityReservationArrayOutputWithContext(context.Background())
}
func (i CapacityReservationArray) ToCapacityReservationArrayOutputWithContext(ctx context.Context) CapacityReservationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CapacityReservationArrayOutput)
}
// CapacityReservationMapInput is an input type that accepts CapacityReservationMap and CapacityReservationMapOutput values.
// You can construct a concrete instance of `CapacityReservationMapInput` via:
//
// CapacityReservationMap{ "key": CapacityReservationArgs{...} }
type CapacityReservationMapInput interface {
pulumi.Input
ToCapacityReservationMapOutput() CapacityReservationMapOutput
ToCapacityReservationMapOutputWithContext(context.Context) CapacityReservationMapOutput
}
type CapacityReservationMap map[string]CapacityReservationInput
func (CapacityReservationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CapacityReservation)(nil)).Elem()
}
func (i CapacityReservationMap) ToCapacityReservationMapOutput() CapacityReservationMapOutput {
return i.ToCapacityReservationMapOutputWithContext(context.Background())
}
func (i CapacityReservationMap) ToCapacityReservationMapOutputWithContext(ctx context.Context) CapacityReservationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CapacityReservationMapOutput)
}
type CapacityReservationOutput struct{ *pulumi.OutputState }
func (CapacityReservationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CapacityReservation)(nil)).Elem()
}
func (o CapacityReservationOutput) ToCapacityReservationOutput() CapacityReservationOutput {
return o
}
func (o CapacityReservationOutput) ToCapacityReservationOutputWithContext(ctx context.Context) CapacityReservationOutput {
return o
}
// The ID of the Capacity Reservation Group where the Capacity Reservation exists. Changing this forces a new resource to be created.
func (o CapacityReservationOutput) CapacityReservationGroupId() pulumi.StringOutput {
return o.ApplyT(func(v *CapacityReservation) pulumi.StringOutput { return v.CapacityReservationGroupId }).(pulumi.StringOutput)
}
// Specifies the name of this Capacity Reservation. Changing this forces a new resource to be created.
func (o CapacityReservationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CapacityReservation) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A `sku` block as defined below.
func (o CapacityReservationOutput) Sku() CapacityReservationSkuOutput {
return o.ApplyT(func(v *CapacityReservation) CapacityReservationSkuOutput { return v.Sku }).(CapacityReservationSkuOutput)
}
// A mapping of tags to assign to the resource.
func (o CapacityReservationOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *CapacityReservation) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Specifies the Availability Zone for this Capacity Reservation. Changing this forces a new resource to be created.
func (o CapacityReservationOutput) Zone() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CapacityReservation) pulumi.StringPtrOutput { return v.Zone }).(pulumi.StringPtrOutput)
}
type CapacityReservationArrayOutput struct{ *pulumi.OutputState }
func (CapacityReservationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CapacityReservation)(nil)).Elem()
}
func (o CapacityReservationArrayOutput) ToCapacityReservationArrayOutput() CapacityReservationArrayOutput {
return o
}
func (o CapacityReservationArrayOutput) ToCapacityReservationArrayOutputWithContext(ctx context.Context) CapacityReservationArrayOutput {
return o
}
func (o CapacityReservationArrayOutput) Index(i pulumi.IntInput) CapacityReservationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CapacityReservation {
return vs[0].([]*CapacityReservation)[vs[1].(int)]
}).(CapacityReservationOutput)
}
type CapacityReservationMapOutput struct{ *pulumi.OutputState }
func (CapacityReservationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CapacityReservation)(nil)).Elem()
}
func (o CapacityReservationMapOutput) ToCapacityReservationMapOutput() CapacityReservationMapOutput {
return o
}
func (o CapacityReservationMapOutput) ToCapacityReservationMapOutputWithContext(ctx context.Context) CapacityReservationMapOutput {
return o
}
func (o CapacityReservationMapOutput) MapIndex(k pulumi.StringInput) CapacityReservationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CapacityReservation {
return vs[0].(map[string]*CapacityReservation)[vs[1].(string)]
}).(CapacityReservationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CapacityReservationInput)(nil)).Elem(), &CapacityReservation{})
pulumi.RegisterInputType(reflect.TypeOf((*CapacityReservationArrayInput)(nil)).Elem(), CapacityReservationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CapacityReservationMapInput)(nil)).Elem(), CapacityReservationMap{})
pulumi.RegisterOutputType(CapacityReservationOutput{})
pulumi.RegisterOutputType(CapacityReservationArrayOutput{})
pulumi.RegisterOutputType(CapacityReservationMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/managedDiskSasToken.go | sdk/go/azure/compute/managedDiskSasToken.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Disk SAS Token.
//
// Use this resource to obtain a Shared Access Signature (SAS Token) for an existing Managed Disk.
//
// Shared access signatures allow fine-grained, ephemeral access control to various aspects of Managed Disk similar to blob/storage account container.
//
// With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// test, err := core.NewResourceGroup(ctx, "test", &core.ResourceGroupArgs{
// Name: pulumi.String("testrg"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// testManagedDisk, err := compute.NewManagedDisk(ctx, "test", &compute.ManagedDiskArgs{
// Name: pulumi.String("tst-disk-export"),
// Location: test.Location,
// ResourceGroupName: test.Name,
// StorageAccountType: pulumi.String("Standard_LRS"),
// CreateOption: pulumi.String("Empty"),
// DiskSizeGb: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewManagedDiskSasToken(ctx, "test", &compute.ManagedDiskSasTokenArgs{
// ManagedDiskId: testManagedDisk.ID(),
// DurationInSeconds: pulumi.Int(300),
// AccessLevel: pulumi.String("Read"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2023-04-02
//
// ## Import
//
// Disk SAS Token can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/managedDiskSasToken:ManagedDiskSasToken example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/disks/manageddisk1
// ```
type ManagedDiskSasToken struct {
pulumi.CustomResourceState
// The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
//
// Refer to the [SAS creation reference from Azure](https://docs.microsoft.com/rest/api/compute/disks/grant-access)
// for additional details on the fields above.
AccessLevel pulumi.StringOutput `pulumi:"accessLevel"`
// The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
DurationInSeconds pulumi.IntOutput `pulumi:"durationInSeconds"`
// The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
ManagedDiskId pulumi.StringOutput `pulumi:"managedDiskId"`
// The computed Shared Access Signature (SAS) of the Managed Disk.
SasUrl pulumi.StringOutput `pulumi:"sasUrl"`
}
// NewManagedDiskSasToken registers a new resource with the given unique name, arguments, and options.
func NewManagedDiskSasToken(ctx *pulumi.Context,
name string, args *ManagedDiskSasTokenArgs, opts ...pulumi.ResourceOption) (*ManagedDiskSasToken, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccessLevel == nil {
return nil, errors.New("invalid value for required argument 'AccessLevel'")
}
if args.DurationInSeconds == nil {
return nil, errors.New("invalid value for required argument 'DurationInSeconds'")
}
if args.ManagedDiskId == nil {
return nil, errors.New("invalid value for required argument 'ManagedDiskId'")
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"sasUrl",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource ManagedDiskSasToken
err := ctx.RegisterResource("azure:compute/managedDiskSasToken:ManagedDiskSasToken", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetManagedDiskSasToken gets an existing ManagedDiskSasToken resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetManagedDiskSasToken(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ManagedDiskSasTokenState, opts ...pulumi.ResourceOption) (*ManagedDiskSasToken, error) {
var resource ManagedDiskSasToken
err := ctx.ReadResource("azure:compute/managedDiskSasToken:ManagedDiskSasToken", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ManagedDiskSasToken resources.
type managedDiskSasTokenState struct {
// The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
//
// Refer to the [SAS creation reference from Azure](https://docs.microsoft.com/rest/api/compute/disks/grant-access)
// for additional details on the fields above.
AccessLevel *string `pulumi:"accessLevel"`
// The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
DurationInSeconds *int `pulumi:"durationInSeconds"`
// The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
ManagedDiskId *string `pulumi:"managedDiskId"`
// The computed Shared Access Signature (SAS) of the Managed Disk.
SasUrl *string `pulumi:"sasUrl"`
}
type ManagedDiskSasTokenState struct {
// The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
//
// Refer to the [SAS creation reference from Azure](https://docs.microsoft.com/rest/api/compute/disks/grant-access)
// for additional details on the fields above.
AccessLevel pulumi.StringPtrInput
// The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
DurationInSeconds pulumi.IntPtrInput
// The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
ManagedDiskId pulumi.StringPtrInput
// The computed Shared Access Signature (SAS) of the Managed Disk.
SasUrl pulumi.StringPtrInput
}
func (ManagedDiskSasTokenState) ElementType() reflect.Type {
return reflect.TypeOf((*managedDiskSasTokenState)(nil)).Elem()
}
type managedDiskSasTokenArgs struct {
// The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
//
// Refer to the [SAS creation reference from Azure](https://docs.microsoft.com/rest/api/compute/disks/grant-access)
// for additional details on the fields above.
AccessLevel string `pulumi:"accessLevel"`
// The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
DurationInSeconds int `pulumi:"durationInSeconds"`
// The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
ManagedDiskId string `pulumi:"managedDiskId"`
}
// The set of arguments for constructing a ManagedDiskSasToken resource.
type ManagedDiskSasTokenArgs struct {
// The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
//
// Refer to the [SAS creation reference from Azure](https://docs.microsoft.com/rest/api/compute/disks/grant-access)
// for additional details on the fields above.
AccessLevel pulumi.StringInput
// The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
DurationInSeconds pulumi.IntInput
// The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
ManagedDiskId pulumi.StringInput
}
func (ManagedDiskSasTokenArgs) ElementType() reflect.Type {
return reflect.TypeOf((*managedDiskSasTokenArgs)(nil)).Elem()
}
type ManagedDiskSasTokenInput interface {
pulumi.Input
ToManagedDiskSasTokenOutput() ManagedDiskSasTokenOutput
ToManagedDiskSasTokenOutputWithContext(ctx context.Context) ManagedDiskSasTokenOutput
}
func (*ManagedDiskSasToken) ElementType() reflect.Type {
return reflect.TypeOf((**ManagedDiskSasToken)(nil)).Elem()
}
func (i *ManagedDiskSasToken) ToManagedDiskSasTokenOutput() ManagedDiskSasTokenOutput {
return i.ToManagedDiskSasTokenOutputWithContext(context.Background())
}
func (i *ManagedDiskSasToken) ToManagedDiskSasTokenOutputWithContext(ctx context.Context) ManagedDiskSasTokenOutput {
return pulumi.ToOutputWithContext(ctx, i).(ManagedDiskSasTokenOutput)
}
// ManagedDiskSasTokenArrayInput is an input type that accepts ManagedDiskSasTokenArray and ManagedDiskSasTokenArrayOutput values.
// You can construct a concrete instance of `ManagedDiskSasTokenArrayInput` via:
//
// ManagedDiskSasTokenArray{ ManagedDiskSasTokenArgs{...} }
type ManagedDiskSasTokenArrayInput interface {
pulumi.Input
ToManagedDiskSasTokenArrayOutput() ManagedDiskSasTokenArrayOutput
ToManagedDiskSasTokenArrayOutputWithContext(context.Context) ManagedDiskSasTokenArrayOutput
}
type ManagedDiskSasTokenArray []ManagedDiskSasTokenInput
func (ManagedDiskSasTokenArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ManagedDiskSasToken)(nil)).Elem()
}
func (i ManagedDiskSasTokenArray) ToManagedDiskSasTokenArrayOutput() ManagedDiskSasTokenArrayOutput {
return i.ToManagedDiskSasTokenArrayOutputWithContext(context.Background())
}
func (i ManagedDiskSasTokenArray) ToManagedDiskSasTokenArrayOutputWithContext(ctx context.Context) ManagedDiskSasTokenArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ManagedDiskSasTokenArrayOutput)
}
// ManagedDiskSasTokenMapInput is an input type that accepts ManagedDiskSasTokenMap and ManagedDiskSasTokenMapOutput values.
// You can construct a concrete instance of `ManagedDiskSasTokenMapInput` via:
//
// ManagedDiskSasTokenMap{ "key": ManagedDiskSasTokenArgs{...} }
type ManagedDiskSasTokenMapInput interface {
pulumi.Input
ToManagedDiskSasTokenMapOutput() ManagedDiskSasTokenMapOutput
ToManagedDiskSasTokenMapOutputWithContext(context.Context) ManagedDiskSasTokenMapOutput
}
type ManagedDiskSasTokenMap map[string]ManagedDiskSasTokenInput
func (ManagedDiskSasTokenMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ManagedDiskSasToken)(nil)).Elem()
}
func (i ManagedDiskSasTokenMap) ToManagedDiskSasTokenMapOutput() ManagedDiskSasTokenMapOutput {
return i.ToManagedDiskSasTokenMapOutputWithContext(context.Background())
}
func (i ManagedDiskSasTokenMap) ToManagedDiskSasTokenMapOutputWithContext(ctx context.Context) ManagedDiskSasTokenMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ManagedDiskSasTokenMapOutput)
}
type ManagedDiskSasTokenOutput struct{ *pulumi.OutputState }
func (ManagedDiskSasTokenOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ManagedDiskSasToken)(nil)).Elem()
}
func (o ManagedDiskSasTokenOutput) ToManagedDiskSasTokenOutput() ManagedDiskSasTokenOutput {
return o
}
func (o ManagedDiskSasTokenOutput) ToManagedDiskSasTokenOutputWithContext(ctx context.Context) ManagedDiskSasTokenOutput {
return o
}
// The level of access required on the disk. Supported are Read, Write. Changing this forces a new resource to be created.
//
// Refer to the [SAS creation reference from Azure](https://docs.microsoft.com/rest/api/compute/disks/grant-access)
// for additional details on the fields above.
func (o ManagedDiskSasTokenOutput) AccessLevel() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedDiskSasToken) pulumi.StringOutput { return v.AccessLevel }).(pulumi.StringOutput)
}
// The duration for which the export should be allowed. Should be between 30 & 4294967295 seconds. Changing this forces a new resource to be created.
func (o ManagedDiskSasTokenOutput) DurationInSeconds() pulumi.IntOutput {
return o.ApplyT(func(v *ManagedDiskSasToken) pulumi.IntOutput { return v.DurationInSeconds }).(pulumi.IntOutput)
}
// The ID of an existing Managed Disk which should be exported. Changing this forces a new resource to be created.
func (o ManagedDiskSasTokenOutput) ManagedDiskId() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedDiskSasToken) pulumi.StringOutput { return v.ManagedDiskId }).(pulumi.StringOutput)
}
// The computed Shared Access Signature (SAS) of the Managed Disk.
func (o ManagedDiskSasTokenOutput) SasUrl() pulumi.StringOutput {
return o.ApplyT(func(v *ManagedDiskSasToken) pulumi.StringOutput { return v.SasUrl }).(pulumi.StringOutput)
}
type ManagedDiskSasTokenArrayOutput struct{ *pulumi.OutputState }
func (ManagedDiskSasTokenArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ManagedDiskSasToken)(nil)).Elem()
}
func (o ManagedDiskSasTokenArrayOutput) ToManagedDiskSasTokenArrayOutput() ManagedDiskSasTokenArrayOutput {
return o
}
func (o ManagedDiskSasTokenArrayOutput) ToManagedDiskSasTokenArrayOutputWithContext(ctx context.Context) ManagedDiskSasTokenArrayOutput {
return o
}
func (o ManagedDiskSasTokenArrayOutput) Index(i pulumi.IntInput) ManagedDiskSasTokenOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ManagedDiskSasToken {
return vs[0].([]*ManagedDiskSasToken)[vs[1].(int)]
}).(ManagedDiskSasTokenOutput)
}
type ManagedDiskSasTokenMapOutput struct{ *pulumi.OutputState }
func (ManagedDiskSasTokenMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ManagedDiskSasToken)(nil)).Elem()
}
func (o ManagedDiskSasTokenMapOutput) ToManagedDiskSasTokenMapOutput() ManagedDiskSasTokenMapOutput {
return o
}
func (o ManagedDiskSasTokenMapOutput) ToManagedDiskSasTokenMapOutputWithContext(ctx context.Context) ManagedDiskSasTokenMapOutput {
return o
}
func (o ManagedDiskSasTokenMapOutput) MapIndex(k pulumi.StringInput) ManagedDiskSasTokenOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ManagedDiskSasToken {
return vs[0].(map[string]*ManagedDiskSasToken)[vs[1].(string)]
}).(ManagedDiskSasTokenOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ManagedDiskSasTokenInput)(nil)).Elem(), &ManagedDiskSasToken{})
pulumi.RegisterInputType(reflect.TypeOf((*ManagedDiskSasTokenArrayInput)(nil)).Elem(), ManagedDiskSasTokenArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ManagedDiskSasTokenMapInput)(nil)).Elem(), ManagedDiskSasTokenMap{})
pulumi.RegisterOutputType(ManagedDiskSasTokenOutput{})
pulumi.RegisterOutputType(ManagedDiskSasTokenArrayOutput{})
pulumi.RegisterOutputType(ManagedDiskSasTokenMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/getVirtualMachineScaleSet.go | sdk/go/azure/compute/getVirtualMachineScaleSet.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Virtual Machine Scale Set.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.GetVirtualMachineScaleSet(ctx, &compute.GetVirtualMachineScaleSetArgs{
// Name: "existing",
// ResourceGroupName: "existing",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This data source uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-11-01, 2024-03-01, 2023-09-01
func GetVirtualMachineScaleSet(ctx *pulumi.Context, args *GetVirtualMachineScaleSetArgs, opts ...pulumi.InvokeOption) (*GetVirtualMachineScaleSetResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetVirtualMachineScaleSetResult
err := ctx.Invoke("azure:compute/getVirtualMachineScaleSet:getVirtualMachineScaleSet", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVirtualMachineScaleSet.
type GetVirtualMachineScaleSetArgs struct {
// The name of this Virtual Machine Scale Set.
Name string `pulumi:"name"`
// The name of the Resource Group where the Virtual Machine Scale Set exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getVirtualMachineScaleSet.
type GetVirtualMachineScaleSetResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A `identity` block as defined below.
Identities []GetVirtualMachineScaleSetIdentity `pulumi:"identities"`
// A list of `instances` blocks as defined below.
Instances []GetVirtualMachineScaleSetInstance `pulumi:"instances"`
// The Azure Region in which this Virtual Machine Scale Set exists.
Location string `pulumi:"location"`
// The name of the public IP address configuration
Name string `pulumi:"name"`
// A list of `networkInterface` blocks as defined below.
NetworkInterfaces []GetVirtualMachineScaleSetNetworkInterface `pulumi:"networkInterfaces"`
ResourceGroupName string `pulumi:"resourceGroupName"`
}
func GetVirtualMachineScaleSetOutput(ctx *pulumi.Context, args GetVirtualMachineScaleSetOutputArgs, opts ...pulumi.InvokeOption) GetVirtualMachineScaleSetResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (GetVirtualMachineScaleSetResultOutput, error) {
args := v.(GetVirtualMachineScaleSetArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("azure:compute/getVirtualMachineScaleSet:getVirtualMachineScaleSet", args, GetVirtualMachineScaleSetResultOutput{}, options).(GetVirtualMachineScaleSetResultOutput), nil
}).(GetVirtualMachineScaleSetResultOutput)
}
// A collection of arguments for invoking getVirtualMachineScaleSet.
type GetVirtualMachineScaleSetOutputArgs struct {
// The name of this Virtual Machine Scale Set.
Name pulumi.StringInput `pulumi:"name"`
// The name of the Resource Group where the Virtual Machine Scale Set exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (GetVirtualMachineScaleSetOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetVirtualMachineScaleSetArgs)(nil)).Elem()
}
// A collection of values returned by getVirtualMachineScaleSet.
type GetVirtualMachineScaleSetResultOutput struct{ *pulumi.OutputState }
func (GetVirtualMachineScaleSetResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetVirtualMachineScaleSetResult)(nil)).Elem()
}
func (o GetVirtualMachineScaleSetResultOutput) ToGetVirtualMachineScaleSetResultOutput() GetVirtualMachineScaleSetResultOutput {
return o
}
func (o GetVirtualMachineScaleSetResultOutput) ToGetVirtualMachineScaleSetResultOutputWithContext(ctx context.Context) GetVirtualMachineScaleSetResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetVirtualMachineScaleSetResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) string { return v.Id }).(pulumi.StringOutput)
}
// A `identity` block as defined below.
func (o GetVirtualMachineScaleSetResultOutput) Identities() GetVirtualMachineScaleSetIdentityArrayOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) []GetVirtualMachineScaleSetIdentity { return v.Identities }).(GetVirtualMachineScaleSetIdentityArrayOutput)
}
// A list of `instances` blocks as defined below.
func (o GetVirtualMachineScaleSetResultOutput) Instances() GetVirtualMachineScaleSetInstanceArrayOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) []GetVirtualMachineScaleSetInstance { return v.Instances }).(GetVirtualMachineScaleSetInstanceArrayOutput)
}
// The Azure Region in which this Virtual Machine Scale Set exists.
func (o GetVirtualMachineScaleSetResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) string { return v.Location }).(pulumi.StringOutput)
}
// The name of the public IP address configuration
func (o GetVirtualMachineScaleSetResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) string { return v.Name }).(pulumi.StringOutput)
}
// A list of `networkInterface` blocks as defined below.
func (o GetVirtualMachineScaleSetResultOutput) NetworkInterfaces() GetVirtualMachineScaleSetNetworkInterfaceArrayOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) []GetVirtualMachineScaleSetNetworkInterface {
return v.NetworkInterfaces
}).(GetVirtualMachineScaleSetNetworkInterfaceArrayOutput)
}
func (o GetVirtualMachineScaleSetResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v GetVirtualMachineScaleSetResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetVirtualMachineScaleSetResultOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/scaleSetStandbyPool.go | sdk/go/azure/compute/scaleSetStandbyPool.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Standby Pool for Virtual Machine Scale Sets.
// > **Note:** please follow the prerequisites mentioned in this [article](https://learn.microsoft.com/azure/virtual-machine-scale-sets/standby-pools-create?tabs=portal#prerequisites) before using this resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleOrchestratedVirtualMachineScaleSet, err := compute.NewOrchestratedVirtualMachineScaleSet(ctx, "example", &compute.OrchestratedVirtualMachineScaleSetArgs{
// Name: pulumi.String("example-ovmss"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PlatformFaultDomainCount: pulumi.Int(1),
// Zones: pulumi.StringArray{
// pulumi.String("1"),
// },
// })
// if err != nil {
// return err
// }
// _, err = compute.NewScaleSetStandbyPool(ctx, "example", &compute.ScaleSetStandbyPoolArgs{
// Name: pulumi.String("example-spsvmp"),
// ResourceGroupName: example.Name,
// Location: pulumi.String("West Europe"),
// AttachedVirtualMachineScaleSetId: exampleOrchestratedVirtualMachineScaleSet.ID(),
// VirtualMachineState: pulumi.String("Running"),
// ElasticityProfile: &compute.ScaleSetStandbyPoolElasticityProfileArgs{
// MaxReadyCapacity: pulumi.Int(10),
// MinReadyCapacity: pulumi.Int(5),
// },
// Tags: pulumi.StringMap{
// "key": pulumi.String("value"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.StandbyPool` - 2025-03-01
//
// ## Import
//
// Standby Pool can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/scaleSetStandbyPool:ScaleSetStandbyPool example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/standbyVirtualMachinePool1
// ```
type ScaleSetStandbyPool struct {
pulumi.CustomResourceState
// Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.
AttachedVirtualMachineScaleSetId pulumi.StringOutput `pulumi:"attachedVirtualMachineScaleSetId"`
// An `elasticityProfile` block as defined below.
ElasticityProfile ScaleSetStandbyPoolElasticityProfileOutput `pulumi:"elasticityProfile"`
// Specifies the Azure Region where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name which should be used for this Standby Pool. Changing this forces a new Standby Pool to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the name of the Resource Group where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Standby Pool.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies the desired state of virtual machines in the pool. Possible values are `Deallocated`, `Hibernated` and `Running`.
VirtualMachineState pulumi.StringOutput `pulumi:"virtualMachineState"`
}
// NewScaleSetStandbyPool registers a new resource with the given unique name, arguments, and options.
func NewScaleSetStandbyPool(ctx *pulumi.Context,
name string, args *ScaleSetStandbyPoolArgs, opts ...pulumi.ResourceOption) (*ScaleSetStandbyPool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AttachedVirtualMachineScaleSetId == nil {
return nil, errors.New("invalid value for required argument 'AttachedVirtualMachineScaleSetId'")
}
if args.ElasticityProfile == nil {
return nil, errors.New("invalid value for required argument 'ElasticityProfile'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.VirtualMachineState == nil {
return nil, errors.New("invalid value for required argument 'VirtualMachineState'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ScaleSetStandbyPool
err := ctx.RegisterResource("azure:compute/scaleSetStandbyPool:ScaleSetStandbyPool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetScaleSetStandbyPool gets an existing ScaleSetStandbyPool resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetScaleSetStandbyPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ScaleSetStandbyPoolState, opts ...pulumi.ResourceOption) (*ScaleSetStandbyPool, error) {
var resource ScaleSetStandbyPool
err := ctx.ReadResource("azure:compute/scaleSetStandbyPool:ScaleSetStandbyPool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ScaleSetStandbyPool resources.
type scaleSetStandbyPoolState struct {
// Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.
AttachedVirtualMachineScaleSetId *string `pulumi:"attachedVirtualMachineScaleSetId"`
// An `elasticityProfile` block as defined below.
ElasticityProfile *ScaleSetStandbyPoolElasticityProfile `pulumi:"elasticityProfile"`
// Specifies the Azure Region where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
Location *string `pulumi:"location"`
// Specifies the name which should be used for this Standby Pool. Changing this forces a new Standby Pool to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Standby Pool.
Tags map[string]string `pulumi:"tags"`
// Specifies the desired state of virtual machines in the pool. Possible values are `Deallocated`, `Hibernated` and `Running`.
VirtualMachineState *string `pulumi:"virtualMachineState"`
}
type ScaleSetStandbyPoolState struct {
// Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.
AttachedVirtualMachineScaleSetId pulumi.StringPtrInput
// An `elasticityProfile` block as defined below.
ElasticityProfile ScaleSetStandbyPoolElasticityProfilePtrInput
// Specifies the Azure Region where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
Location pulumi.StringPtrInput
// Specifies the name which should be used for this Standby Pool. Changing this forces a new Standby Pool to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Standby Pool.
Tags pulumi.StringMapInput
// Specifies the desired state of virtual machines in the pool. Possible values are `Deallocated`, `Hibernated` and `Running`.
VirtualMachineState pulumi.StringPtrInput
}
func (ScaleSetStandbyPoolState) ElementType() reflect.Type {
return reflect.TypeOf((*scaleSetStandbyPoolState)(nil)).Elem()
}
type scaleSetStandbyPoolArgs struct {
// Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.
AttachedVirtualMachineScaleSetId string `pulumi:"attachedVirtualMachineScaleSetId"`
// An `elasticityProfile` block as defined below.
ElasticityProfile ScaleSetStandbyPoolElasticityProfile `pulumi:"elasticityProfile"`
// Specifies the Azure Region where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
Location *string `pulumi:"location"`
// Specifies the name which should be used for this Standby Pool. Changing this forces a new Standby Pool to be created.
Name *string `pulumi:"name"`
// Specifies the name of the Resource Group where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Standby Pool.
Tags map[string]string `pulumi:"tags"`
// Specifies the desired state of virtual machines in the pool. Possible values are `Deallocated`, `Hibernated` and `Running`.
VirtualMachineState string `pulumi:"virtualMachineState"`
}
// The set of arguments for constructing a ScaleSetStandbyPool resource.
type ScaleSetStandbyPoolArgs struct {
// Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.
AttachedVirtualMachineScaleSetId pulumi.StringInput
// An `elasticityProfile` block as defined below.
ElasticityProfile ScaleSetStandbyPoolElasticityProfileInput
// Specifies the Azure Region where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
Location pulumi.StringPtrInput
// Specifies the name which should be used for this Standby Pool. Changing this forces a new Standby Pool to be created.
Name pulumi.StringPtrInput
// Specifies the name of the Resource Group where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags which should be assigned to the Standby Pool.
Tags pulumi.StringMapInput
// Specifies the desired state of virtual machines in the pool. Possible values are `Deallocated`, `Hibernated` and `Running`.
VirtualMachineState pulumi.StringInput
}
func (ScaleSetStandbyPoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*scaleSetStandbyPoolArgs)(nil)).Elem()
}
type ScaleSetStandbyPoolInput interface {
pulumi.Input
ToScaleSetStandbyPoolOutput() ScaleSetStandbyPoolOutput
ToScaleSetStandbyPoolOutputWithContext(ctx context.Context) ScaleSetStandbyPoolOutput
}
func (*ScaleSetStandbyPool) ElementType() reflect.Type {
return reflect.TypeOf((**ScaleSetStandbyPool)(nil)).Elem()
}
func (i *ScaleSetStandbyPool) ToScaleSetStandbyPoolOutput() ScaleSetStandbyPoolOutput {
return i.ToScaleSetStandbyPoolOutputWithContext(context.Background())
}
func (i *ScaleSetStandbyPool) ToScaleSetStandbyPoolOutputWithContext(ctx context.Context) ScaleSetStandbyPoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(ScaleSetStandbyPoolOutput)
}
// ScaleSetStandbyPoolArrayInput is an input type that accepts ScaleSetStandbyPoolArray and ScaleSetStandbyPoolArrayOutput values.
// You can construct a concrete instance of `ScaleSetStandbyPoolArrayInput` via:
//
// ScaleSetStandbyPoolArray{ ScaleSetStandbyPoolArgs{...} }
type ScaleSetStandbyPoolArrayInput interface {
pulumi.Input
ToScaleSetStandbyPoolArrayOutput() ScaleSetStandbyPoolArrayOutput
ToScaleSetStandbyPoolArrayOutputWithContext(context.Context) ScaleSetStandbyPoolArrayOutput
}
type ScaleSetStandbyPoolArray []ScaleSetStandbyPoolInput
func (ScaleSetStandbyPoolArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ScaleSetStandbyPool)(nil)).Elem()
}
func (i ScaleSetStandbyPoolArray) ToScaleSetStandbyPoolArrayOutput() ScaleSetStandbyPoolArrayOutput {
return i.ToScaleSetStandbyPoolArrayOutputWithContext(context.Background())
}
func (i ScaleSetStandbyPoolArray) ToScaleSetStandbyPoolArrayOutputWithContext(ctx context.Context) ScaleSetStandbyPoolArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ScaleSetStandbyPoolArrayOutput)
}
// ScaleSetStandbyPoolMapInput is an input type that accepts ScaleSetStandbyPoolMap and ScaleSetStandbyPoolMapOutput values.
// You can construct a concrete instance of `ScaleSetStandbyPoolMapInput` via:
//
// ScaleSetStandbyPoolMap{ "key": ScaleSetStandbyPoolArgs{...} }
type ScaleSetStandbyPoolMapInput interface {
pulumi.Input
ToScaleSetStandbyPoolMapOutput() ScaleSetStandbyPoolMapOutput
ToScaleSetStandbyPoolMapOutputWithContext(context.Context) ScaleSetStandbyPoolMapOutput
}
type ScaleSetStandbyPoolMap map[string]ScaleSetStandbyPoolInput
func (ScaleSetStandbyPoolMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ScaleSetStandbyPool)(nil)).Elem()
}
func (i ScaleSetStandbyPoolMap) ToScaleSetStandbyPoolMapOutput() ScaleSetStandbyPoolMapOutput {
return i.ToScaleSetStandbyPoolMapOutputWithContext(context.Background())
}
func (i ScaleSetStandbyPoolMap) ToScaleSetStandbyPoolMapOutputWithContext(ctx context.Context) ScaleSetStandbyPoolMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ScaleSetStandbyPoolMapOutput)
}
type ScaleSetStandbyPoolOutput struct{ *pulumi.OutputState }
func (ScaleSetStandbyPoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ScaleSetStandbyPool)(nil)).Elem()
}
func (o ScaleSetStandbyPoolOutput) ToScaleSetStandbyPoolOutput() ScaleSetStandbyPoolOutput {
return o
}
func (o ScaleSetStandbyPoolOutput) ToScaleSetStandbyPoolOutputWithContext(ctx context.Context) ScaleSetStandbyPoolOutput {
return o
}
// Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.
func (o ScaleSetStandbyPoolOutput) AttachedVirtualMachineScaleSetId() pulumi.StringOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) pulumi.StringOutput { return v.AttachedVirtualMachineScaleSetId }).(pulumi.StringOutput)
}
// An `elasticityProfile` block as defined below.
func (o ScaleSetStandbyPoolOutput) ElasticityProfile() ScaleSetStandbyPoolElasticityProfileOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) ScaleSetStandbyPoolElasticityProfileOutput { return v.ElasticityProfile }).(ScaleSetStandbyPoolElasticityProfileOutput)
}
// Specifies the Azure Region where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
func (o ScaleSetStandbyPoolOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name which should be used for this Standby Pool. Changing this forces a new Standby Pool to be created.
func (o ScaleSetStandbyPoolOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the name of the Resource Group where the Standby Pool should exist. Changing this forces a new Standby Pool to be created.
func (o ScaleSetStandbyPoolOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Standby Pool.
func (o ScaleSetStandbyPoolOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Specifies the desired state of virtual machines in the pool. Possible values are `Deallocated`, `Hibernated` and `Running`.
func (o ScaleSetStandbyPoolOutput) VirtualMachineState() pulumi.StringOutput {
return o.ApplyT(func(v *ScaleSetStandbyPool) pulumi.StringOutput { return v.VirtualMachineState }).(pulumi.StringOutput)
}
type ScaleSetStandbyPoolArrayOutput struct{ *pulumi.OutputState }
func (ScaleSetStandbyPoolArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ScaleSetStandbyPool)(nil)).Elem()
}
func (o ScaleSetStandbyPoolArrayOutput) ToScaleSetStandbyPoolArrayOutput() ScaleSetStandbyPoolArrayOutput {
return o
}
func (o ScaleSetStandbyPoolArrayOutput) ToScaleSetStandbyPoolArrayOutputWithContext(ctx context.Context) ScaleSetStandbyPoolArrayOutput {
return o
}
func (o ScaleSetStandbyPoolArrayOutput) Index(i pulumi.IntInput) ScaleSetStandbyPoolOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ScaleSetStandbyPool {
return vs[0].([]*ScaleSetStandbyPool)[vs[1].(int)]
}).(ScaleSetStandbyPoolOutput)
}
type ScaleSetStandbyPoolMapOutput struct{ *pulumi.OutputState }
func (ScaleSetStandbyPoolMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ScaleSetStandbyPool)(nil)).Elem()
}
func (o ScaleSetStandbyPoolMapOutput) ToScaleSetStandbyPoolMapOutput() ScaleSetStandbyPoolMapOutput {
return o
}
func (o ScaleSetStandbyPoolMapOutput) ToScaleSetStandbyPoolMapOutputWithContext(ctx context.Context) ScaleSetStandbyPoolMapOutput {
return o
}
func (o ScaleSetStandbyPoolMapOutput) MapIndex(k pulumi.StringInput) ScaleSetStandbyPoolOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ScaleSetStandbyPool {
return vs[0].(map[string]*ScaleSetStandbyPool)[vs[1].(string)]
}).(ScaleSetStandbyPoolOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ScaleSetStandbyPoolInput)(nil)).Elem(), &ScaleSetStandbyPool{})
pulumi.RegisterInputType(reflect.TypeOf((*ScaleSetStandbyPoolArrayInput)(nil)).Elem(), ScaleSetStandbyPoolArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ScaleSetStandbyPoolMapInput)(nil)).Elem(), ScaleSetStandbyPoolMap{})
pulumi.RegisterOutputType(ScaleSetStandbyPoolOutput{})
pulumi.RegisterOutputType(ScaleSetStandbyPoolArrayOutput{})
pulumi.RegisterOutputType(ScaleSetStandbyPoolMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/image.go | sdk/go/azure/compute/image.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a custom virtual machine image that can be used to create virtual machines.
//
// ## Example Usage
//
// > **Note:** For a more complete example, see the `examples/image` directory within the GitHub Repository.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{
// Name: "examplevm",
// ResourceGroupName: "example-resources",
// }, nil)
// if err != nil {
// return err
// }
// _, err = compute.NewImage(ctx, "example", &compute.ImageArgs{
// Name: pulumi.String("exampleimage"),
// Location: pulumi.String(example.Location),
// ResourceGroupName: pulumi.String(example.Name),
// SourceVirtualMachineId: pulumi.String(example.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-01
//
// ## Import
//
// Images can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/image:Image example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/images/image1
// ```
type Image struct {
pulumi.CustomResourceState
// One or more `dataDisk` blocks as defined below.
//
// > **Note:** `dataDisk` cannot be set together with `sourceVirtualMachineId`.
DataDisks ImageDataDiskArrayOutput `pulumi:"dataDisks"`
// The Hyper-V Generation Type of the Virtual Machine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrOutput `pulumi:"hyperVGeneration"`
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of the image. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// One or more `osDisk` blocks as defined below. Changing this forces a new resource to be created.
//
// > **Note:** `osDisk` cannot be set together with `sourceVirtualMachineId`.
OsDisk ImageOsDiskPtrOutput `pulumi:"osDisk"`
// The name of the resource group in which to create the image. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// The Virtual Machine ID from which to create the image.
SourceVirtualMachineId pulumi.StringPtrOutput `pulumi:"sourceVirtualMachineId"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** `zoneResilient` can only be set to `true` if the image is stored in a region that supports availability zones.
//
// > **Note:** `zoneResilient` cannot be set together with `sourceVirtualMachineId`.
ZoneResilient pulumi.BoolPtrOutput `pulumi:"zoneResilient"`
}
// NewImage registers a new resource with the given unique name, arguments, and options.
func NewImage(ctx *pulumi.Context,
name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Image
err := ctx.RegisterResource("azure:compute/image:Image", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetImage gets an existing Image resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetImage(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ImageState, opts ...pulumi.ResourceOption) (*Image, error) {
var resource Image
err := ctx.ReadResource("azure:compute/image:Image", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Image resources.
type imageState struct {
// One or more `dataDisk` blocks as defined below.
//
// > **Note:** `dataDisk` cannot be set together with `sourceVirtualMachineId`.
DataDisks []ImageDataDisk `pulumi:"dataDisks"`
// The Hyper-V Generation Type of the Virtual Machine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration *string `pulumi:"hyperVGeneration"`
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the image. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// One or more `osDisk` blocks as defined below. Changing this forces a new resource to be created.
//
// > **Note:** `osDisk` cannot be set together with `sourceVirtualMachineId`.
OsDisk *ImageOsDisk `pulumi:"osDisk"`
// The name of the resource group in which to create the image. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The Virtual Machine ID from which to create the image.
SourceVirtualMachineId *string `pulumi:"sourceVirtualMachineId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** `zoneResilient` can only be set to `true` if the image is stored in a region that supports availability zones.
//
// > **Note:** `zoneResilient` cannot be set together with `sourceVirtualMachineId`.
ZoneResilient *bool `pulumi:"zoneResilient"`
}
type ImageState struct {
// One or more `dataDisk` blocks as defined below.
//
// > **Note:** `dataDisk` cannot be set together with `sourceVirtualMachineId`.
DataDisks ImageDataDiskArrayInput
// The Hyper-V Generation Type of the Virtual Machine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrInput
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the image. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// One or more `osDisk` blocks as defined below. Changing this forces a new resource to be created.
//
// > **Note:** `osDisk` cannot be set together with `sourceVirtualMachineId`.
OsDisk ImageOsDiskPtrInput
// The name of the resource group in which to create the image. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// The Virtual Machine ID from which to create the image.
SourceVirtualMachineId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** `zoneResilient` can only be set to `true` if the image is stored in a region that supports availability zones.
//
// > **Note:** `zoneResilient` cannot be set together with `sourceVirtualMachineId`.
ZoneResilient pulumi.BoolPtrInput
}
func (ImageState) ElementType() reflect.Type {
return reflect.TypeOf((*imageState)(nil)).Elem()
}
type imageArgs struct {
// One or more `dataDisk` blocks as defined below.
//
// > **Note:** `dataDisk` cannot be set together with `sourceVirtualMachineId`.
DataDisks []ImageDataDisk `pulumi:"dataDisks"`
// The Hyper-V Generation Type of the Virtual Machine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration *string `pulumi:"hyperVGeneration"`
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the image. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// One or more `osDisk` blocks as defined below. Changing this forces a new resource to be created.
//
// > **Note:** `osDisk` cannot be set together with `sourceVirtualMachineId`.
OsDisk *ImageOsDisk `pulumi:"osDisk"`
// The name of the resource group in which to create the image. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The Virtual Machine ID from which to create the image.
SourceVirtualMachineId *string `pulumi:"sourceVirtualMachineId"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** `zoneResilient` can only be set to `true` if the image is stored in a region that supports availability zones.
//
// > **Note:** `zoneResilient` cannot be set together with `sourceVirtualMachineId`.
ZoneResilient *bool `pulumi:"zoneResilient"`
}
// The set of arguments for constructing a Image resource.
type ImageArgs struct {
// One or more `dataDisk` blocks as defined below.
//
// > **Note:** `dataDisk` cannot be set together with `sourceVirtualMachineId`.
DataDisks ImageDataDiskArrayInput
// The Hyper-V Generation Type of the Virtual Machine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrInput
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the image. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// One or more `osDisk` blocks as defined below. Changing this forces a new resource to be created.
//
// > **Note:** `osDisk` cannot be set together with `sourceVirtualMachineId`.
OsDisk ImageOsDiskPtrInput
// The name of the resource group in which to create the image. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// The Virtual Machine ID from which to create the image.
SourceVirtualMachineId pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** `zoneResilient` can only be set to `true` if the image is stored in a region that supports availability zones.
//
// > **Note:** `zoneResilient` cannot be set together with `sourceVirtualMachineId`.
ZoneResilient pulumi.BoolPtrInput
}
func (ImageArgs) ElementType() reflect.Type {
return reflect.TypeOf((*imageArgs)(nil)).Elem()
}
type ImageInput interface {
pulumi.Input
ToImageOutput() ImageOutput
ToImageOutputWithContext(ctx context.Context) ImageOutput
}
func (*Image) ElementType() reflect.Type {
return reflect.TypeOf((**Image)(nil)).Elem()
}
func (i *Image) ToImageOutput() ImageOutput {
return i.ToImageOutputWithContext(context.Background())
}
func (i *Image) ToImageOutputWithContext(ctx context.Context) ImageOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImageOutput)
}
// ImageArrayInput is an input type that accepts ImageArray and ImageArrayOutput values.
// You can construct a concrete instance of `ImageArrayInput` via:
//
// ImageArray{ ImageArgs{...} }
type ImageArrayInput interface {
pulumi.Input
ToImageArrayOutput() ImageArrayOutput
ToImageArrayOutputWithContext(context.Context) ImageArrayOutput
}
type ImageArray []ImageInput
func (ImageArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Image)(nil)).Elem()
}
func (i ImageArray) ToImageArrayOutput() ImageArrayOutput {
return i.ToImageArrayOutputWithContext(context.Background())
}
func (i ImageArray) ToImageArrayOutputWithContext(ctx context.Context) ImageArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImageArrayOutput)
}
// ImageMapInput is an input type that accepts ImageMap and ImageMapOutput values.
// You can construct a concrete instance of `ImageMapInput` via:
//
// ImageMap{ "key": ImageArgs{...} }
type ImageMapInput interface {
pulumi.Input
ToImageMapOutput() ImageMapOutput
ToImageMapOutputWithContext(context.Context) ImageMapOutput
}
type ImageMap map[string]ImageInput
func (ImageMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Image)(nil)).Elem()
}
func (i ImageMap) ToImageMapOutput() ImageMapOutput {
return i.ToImageMapOutputWithContext(context.Background())
}
func (i ImageMap) ToImageMapOutputWithContext(ctx context.Context) ImageMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ImageMapOutput)
}
type ImageOutput struct{ *pulumi.OutputState }
func (ImageOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Image)(nil)).Elem()
}
func (o ImageOutput) ToImageOutput() ImageOutput {
return o
}
func (o ImageOutput) ToImageOutputWithContext(ctx context.Context) ImageOutput {
return o
}
// One or more `dataDisk` blocks as defined below.
//
// > **Note:** `dataDisk` cannot be set together with `sourceVirtualMachineId`.
func (o ImageOutput) DataDisks() ImageDataDiskArrayOutput {
return o.ApplyT(func(v *Image) ImageDataDiskArrayOutput { return v.DataDisks }).(ImageDataDiskArrayOutput)
}
// The Hyper-V Generation Type of the Virtual Machine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
func (o ImageOutput) HyperVGeneration() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Image) pulumi.StringPtrOutput { return v.HyperVGeneration }).(pulumi.StringPtrOutput)
}
// Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
func (o ImageOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Image) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of the image. Changing this forces a new resource to be created.
func (o ImageOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Image) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// One or more `osDisk` blocks as defined below. Changing this forces a new resource to be created.
//
// > **Note:** `osDisk` cannot be set together with `sourceVirtualMachineId`.
func (o ImageOutput) OsDisk() ImageOsDiskPtrOutput {
return o.ApplyT(func(v *Image) ImageOsDiskPtrOutput { return v.OsDisk }).(ImageOsDiskPtrOutput)
}
// The name of the resource group in which to create the image. Changing this forces a new resource to be created.
func (o ImageOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Image) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The Virtual Machine ID from which to create the image.
func (o ImageOutput) SourceVirtualMachineId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Image) pulumi.StringPtrOutput { return v.SourceVirtualMachineId }).(pulumi.StringPtrOutput)
}
// A mapping of tags to assign to the resource.
func (o ImageOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Image) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
//
// > **Note:** `zoneResilient` can only be set to `true` if the image is stored in a region that supports availability zones.
//
// > **Note:** `zoneResilient` cannot be set together with `sourceVirtualMachineId`.
func (o ImageOutput) ZoneResilient() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Image) pulumi.BoolPtrOutput { return v.ZoneResilient }).(pulumi.BoolPtrOutput)
}
type ImageArrayOutput struct{ *pulumi.OutputState }
func (ImageArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Image)(nil)).Elem()
}
func (o ImageArrayOutput) ToImageArrayOutput() ImageArrayOutput {
return o
}
func (o ImageArrayOutput) ToImageArrayOutputWithContext(ctx context.Context) ImageArrayOutput {
return o
}
func (o ImageArrayOutput) Index(i pulumi.IntInput) ImageOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Image {
return vs[0].([]*Image)[vs[1].(int)]
}).(ImageOutput)
}
type ImageMapOutput struct{ *pulumi.OutputState }
func (ImageMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Image)(nil)).Elem()
}
func (o ImageMapOutput) ToImageMapOutput() ImageMapOutput {
return o
}
func (o ImageMapOutput) ToImageMapOutputWithContext(ctx context.Context) ImageMapOutput {
return o
}
func (o ImageMapOutput) MapIndex(k pulumi.StringInput) ImageOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Image {
return vs[0].(map[string]*Image)[vs[1].(string)]
}).(ImageOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ImageInput)(nil)).Elem(), &Image{})
pulumi.RegisterInputType(reflect.TypeOf((*ImageArrayInput)(nil)).Elem(), ImageArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ImageMapInput)(nil)).Elem(), ImageMap{})
pulumi.RegisterOutputType(ImageOutput{})
pulumi.RegisterOutputType(ImageArrayOutput{})
pulumi.RegisterOutputType(ImageMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/sharedImage.go | sdk/go/azure/compute/sharedImage.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Shared Image within a Shared Image Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "example", &compute.SharedImageGalleryArgs{
// Name: pulumi.String("example_image_gallery"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Description: pulumi.String("Shared images and things."),
// Tags: pulumi.StringMap{
// "Hello": pulumi.String("There"),
// "World": pulumi.String("Example"),
// },
// })
// if err != nil {
// return err
// }
// _, err = compute.NewSharedImage(ctx, "example", &compute.SharedImageArgs{
// Name: pulumi.String("my-image"),
// GalleryName: exampleSharedImageGallery.Name,
// ResourceGroupName: example.Name,
// Location: example.Location,
// OsType: pulumi.String("Linux"),
// Identifier: &compute.SharedImageIdentifierArgs{
// Publisher: pulumi.String("PublisherName"),
// Offer: pulumi.String("OfferName"),
// Sku: pulumi.String("ExampleSku"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-03
//
// ## Import
//
// Shared Images can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/sharedImage:SharedImage image1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/images/image1
// ```
type SharedImage struct {
pulumi.CustomResourceState
// Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
AcceleratedNetworkSupportEnabled pulumi.BoolPtrOutput `pulumi:"acceleratedNetworkSupportEnabled"`
// CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created.
Architecture pulumi.StringPtrOutput `pulumi:"architecture"`
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines. Changing this forces a new resource to be created.
//
// > **Note:** Only one of `trustedLaunchSupported`, `trustedLaunchEnabled`, `confidentialVmSupported` and `confidentialVmEnabled` can be specified.
ConfidentialVmEnabled pulumi.BoolPtrOutput `pulumi:"confidentialVmEnabled"`
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image. Changing this forces a new resource to be created.
ConfidentialVmSupported pulumi.BoolPtrOutput `pulumi:"confidentialVmSupported"`
// A description of this Shared Image.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Specifies if the Shared Image supports NVMe disks. Changing this forces a new resource to be created.
DiskControllerTypeNvmeEnabled pulumi.BoolPtrOutput `pulumi:"diskControllerTypeNvmeEnabled"`
// One or more Disk Types not allowed for the Image. Possible values include `Standard_LRS` and `Premium_LRS`.
DiskTypesNotAlloweds pulumi.StringArrayOutput `pulumi:"diskTypesNotAlloweds"`
// The end of life date in RFC3339 format of the Image.
EndOfLifeDate pulumi.StringPtrOutput `pulumi:"endOfLifeDate"`
// The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.
Eula pulumi.StringPtrOutput `pulumi:"eula"`
// Specifies the name of the Shared Image Gallery in which this Shared Image should exist. Changing this forces a new resource to be created.
GalleryName pulumi.StringOutput `pulumi:"galleryName"`
// Specifies if the Shared Image supports hibernation. Changing this forces a new resource to be created.
HibernationEnabled pulumi.BoolPtrOutput `pulumi:"hibernationEnabled"`
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrOutput `pulumi:"hyperVGeneration"`
// An `identifier` block as defined below.
Identifier SharedImageIdentifierOutput `pulumi:"identifier"`
// Specifies the supported Azure location where the Shared Image Gallery exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Maximum memory in GB recommended for the Image.
MaxRecommendedMemoryInGb pulumi.IntPtrOutput `pulumi:"maxRecommendedMemoryInGb"`
// Maximum count of vCPUs recommended for the Image.
MaxRecommendedVcpuCount pulumi.IntPtrOutput `pulumi:"maxRecommendedVcpuCount"`
// Minimum memory in GB recommended for the Image.
MinRecommendedMemoryInGb pulumi.IntPtrOutput `pulumi:"minRecommendedMemoryInGb"`
// Minimum count of vCPUs recommended for the Image.
MinRecommendedVcpuCount pulumi.IntPtrOutput `pulumi:"minRecommendedVcpuCount"`
// Specifies the name of the Shared Image. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The type of Operating System present in this Shared Image. Possible values are `Linux` and `Windows`. Changing this forces a new resource to be created.
OsType pulumi.StringOutput `pulumi:"osType"`
// The URI containing the Privacy Statement associated with this Shared Image. Changing this forces a new resource to be created.
PrivacyStatementUri pulumi.StringPtrOutput `pulumi:"privacyStatementUri"`
// A `purchasePlan` block as defined below.
PurchasePlan SharedImagePurchasePlanPtrOutput `pulumi:"purchasePlan"`
// The URI containing the Release Notes associated with this Shared Image.
ReleaseNoteUri pulumi.StringPtrOutput `pulumi:"releaseNoteUri"`
// The name of the resource group in which the Shared Image Gallery exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Changing this forces a new resource to be created.
//
// !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects.
Specialized pulumi.BoolPtrOutput `pulumi:"specialized"`
// A mapping of tags to assign to the Shared Image.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchEnabled pulumi.BoolPtrOutput `pulumi:"trustedLaunchEnabled"`
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchSupported pulumi.BoolPtrOutput `pulumi:"trustedLaunchSupported"`
}
// NewSharedImage registers a new resource with the given unique name, arguments, and options.
func NewSharedImage(ctx *pulumi.Context,
name string, args *SharedImageArgs, opts ...pulumi.ResourceOption) (*SharedImage, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GalleryName == nil {
return nil, errors.New("invalid value for required argument 'GalleryName'")
}
if args.Identifier == nil {
return nil, errors.New("invalid value for required argument 'Identifier'")
}
if args.OsType == nil {
return nil, errors.New("invalid value for required argument 'OsType'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SharedImage
err := ctx.RegisterResource("azure:compute/sharedImage:SharedImage", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSharedImage gets an existing SharedImage resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSharedImage(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SharedImageState, opts ...pulumi.ResourceOption) (*SharedImage, error) {
var resource SharedImage
err := ctx.ReadResource("azure:compute/sharedImage:SharedImage", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SharedImage resources.
type sharedImageState struct {
// Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
AcceleratedNetworkSupportEnabled *bool `pulumi:"acceleratedNetworkSupportEnabled"`
// CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created.
Architecture *string `pulumi:"architecture"`
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines. Changing this forces a new resource to be created.
//
// > **Note:** Only one of `trustedLaunchSupported`, `trustedLaunchEnabled`, `confidentialVmSupported` and `confidentialVmEnabled` can be specified.
ConfidentialVmEnabled *bool `pulumi:"confidentialVmEnabled"`
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image. Changing this forces a new resource to be created.
ConfidentialVmSupported *bool `pulumi:"confidentialVmSupported"`
// A description of this Shared Image.
Description *string `pulumi:"description"`
// Specifies if the Shared Image supports NVMe disks. Changing this forces a new resource to be created.
DiskControllerTypeNvmeEnabled *bool `pulumi:"diskControllerTypeNvmeEnabled"`
// One or more Disk Types not allowed for the Image. Possible values include `Standard_LRS` and `Premium_LRS`.
DiskTypesNotAlloweds []string `pulumi:"diskTypesNotAlloweds"`
// The end of life date in RFC3339 format of the Image.
EndOfLifeDate *string `pulumi:"endOfLifeDate"`
// The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.
Eula *string `pulumi:"eula"`
// Specifies the name of the Shared Image Gallery in which this Shared Image should exist. Changing this forces a new resource to be created.
GalleryName *string `pulumi:"galleryName"`
// Specifies if the Shared Image supports hibernation. Changing this forces a new resource to be created.
HibernationEnabled *bool `pulumi:"hibernationEnabled"`
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration *string `pulumi:"hyperVGeneration"`
// An `identifier` block as defined below.
Identifier *SharedImageIdentifier `pulumi:"identifier"`
// Specifies the supported Azure location where the Shared Image Gallery exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Maximum memory in GB recommended for the Image.
MaxRecommendedMemoryInGb *int `pulumi:"maxRecommendedMemoryInGb"`
// Maximum count of vCPUs recommended for the Image.
MaxRecommendedVcpuCount *int `pulumi:"maxRecommendedVcpuCount"`
// Minimum memory in GB recommended for the Image.
MinRecommendedMemoryInGb *int `pulumi:"minRecommendedMemoryInGb"`
// Minimum count of vCPUs recommended for the Image.
MinRecommendedVcpuCount *int `pulumi:"minRecommendedVcpuCount"`
// Specifies the name of the Shared Image. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The type of Operating System present in this Shared Image. Possible values are `Linux` and `Windows`. Changing this forces a new resource to be created.
OsType *string `pulumi:"osType"`
// The URI containing the Privacy Statement associated with this Shared Image. Changing this forces a new resource to be created.
PrivacyStatementUri *string `pulumi:"privacyStatementUri"`
// A `purchasePlan` block as defined below.
PurchasePlan *SharedImagePurchasePlan `pulumi:"purchasePlan"`
// The URI containing the Release Notes associated with this Shared Image.
ReleaseNoteUri *string `pulumi:"releaseNoteUri"`
// The name of the resource group in which the Shared Image Gallery exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Changing this forces a new resource to be created.
//
// !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects.
Specialized *bool `pulumi:"specialized"`
// A mapping of tags to assign to the Shared Image.
Tags map[string]string `pulumi:"tags"`
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchEnabled *bool `pulumi:"trustedLaunchEnabled"`
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchSupported *bool `pulumi:"trustedLaunchSupported"`
}
type SharedImageState struct {
// Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
AcceleratedNetworkSupportEnabled pulumi.BoolPtrInput
// CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created.
Architecture pulumi.StringPtrInput
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines. Changing this forces a new resource to be created.
//
// > **Note:** Only one of `trustedLaunchSupported`, `trustedLaunchEnabled`, `confidentialVmSupported` and `confidentialVmEnabled` can be specified.
ConfidentialVmEnabled pulumi.BoolPtrInput
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image. Changing this forces a new resource to be created.
ConfidentialVmSupported pulumi.BoolPtrInput
// A description of this Shared Image.
Description pulumi.StringPtrInput
// Specifies if the Shared Image supports NVMe disks. Changing this forces a new resource to be created.
DiskControllerTypeNvmeEnabled pulumi.BoolPtrInput
// One or more Disk Types not allowed for the Image. Possible values include `Standard_LRS` and `Premium_LRS`.
DiskTypesNotAlloweds pulumi.StringArrayInput
// The end of life date in RFC3339 format of the Image.
EndOfLifeDate pulumi.StringPtrInput
// The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.
Eula pulumi.StringPtrInput
// Specifies the name of the Shared Image Gallery in which this Shared Image should exist. Changing this forces a new resource to be created.
GalleryName pulumi.StringPtrInput
// Specifies if the Shared Image supports hibernation. Changing this forces a new resource to be created.
HibernationEnabled pulumi.BoolPtrInput
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrInput
// An `identifier` block as defined below.
Identifier SharedImageIdentifierPtrInput
// Specifies the supported Azure location where the Shared Image Gallery exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Maximum memory in GB recommended for the Image.
MaxRecommendedMemoryInGb pulumi.IntPtrInput
// Maximum count of vCPUs recommended for the Image.
MaxRecommendedVcpuCount pulumi.IntPtrInput
// Minimum memory in GB recommended for the Image.
MinRecommendedMemoryInGb pulumi.IntPtrInput
// Minimum count of vCPUs recommended for the Image.
MinRecommendedVcpuCount pulumi.IntPtrInput
// Specifies the name of the Shared Image. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The type of Operating System present in this Shared Image. Possible values are `Linux` and `Windows`. Changing this forces a new resource to be created.
OsType pulumi.StringPtrInput
// The URI containing the Privacy Statement associated with this Shared Image. Changing this forces a new resource to be created.
PrivacyStatementUri pulumi.StringPtrInput
// A `purchasePlan` block as defined below.
PurchasePlan SharedImagePurchasePlanPtrInput
// The URI containing the Release Notes associated with this Shared Image.
ReleaseNoteUri pulumi.StringPtrInput
// The name of the resource group in which the Shared Image Gallery exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Changing this forces a new resource to be created.
//
// !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects.
Specialized pulumi.BoolPtrInput
// A mapping of tags to assign to the Shared Image.
Tags pulumi.StringMapInput
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchEnabled pulumi.BoolPtrInput
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchSupported pulumi.BoolPtrInput
}
func (SharedImageState) ElementType() reflect.Type {
return reflect.TypeOf((*sharedImageState)(nil)).Elem()
}
type sharedImageArgs struct {
// Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
AcceleratedNetworkSupportEnabled *bool `pulumi:"acceleratedNetworkSupportEnabled"`
// CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created.
Architecture *string `pulumi:"architecture"`
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines. Changing this forces a new resource to be created.
//
// > **Note:** Only one of `trustedLaunchSupported`, `trustedLaunchEnabled`, `confidentialVmSupported` and `confidentialVmEnabled` can be specified.
ConfidentialVmEnabled *bool `pulumi:"confidentialVmEnabled"`
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image. Changing this forces a new resource to be created.
ConfidentialVmSupported *bool `pulumi:"confidentialVmSupported"`
// A description of this Shared Image.
Description *string `pulumi:"description"`
// Specifies if the Shared Image supports NVMe disks. Changing this forces a new resource to be created.
DiskControllerTypeNvmeEnabled *bool `pulumi:"diskControllerTypeNvmeEnabled"`
// One or more Disk Types not allowed for the Image. Possible values include `Standard_LRS` and `Premium_LRS`.
DiskTypesNotAlloweds []string `pulumi:"diskTypesNotAlloweds"`
// The end of life date in RFC3339 format of the Image.
EndOfLifeDate *string `pulumi:"endOfLifeDate"`
// The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.
Eula *string `pulumi:"eula"`
// Specifies the name of the Shared Image Gallery in which this Shared Image should exist. Changing this forces a new resource to be created.
GalleryName string `pulumi:"galleryName"`
// Specifies if the Shared Image supports hibernation. Changing this forces a new resource to be created.
HibernationEnabled *bool `pulumi:"hibernationEnabled"`
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration *string `pulumi:"hyperVGeneration"`
// An `identifier` block as defined below.
Identifier SharedImageIdentifier `pulumi:"identifier"`
// Specifies the supported Azure location where the Shared Image Gallery exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Maximum memory in GB recommended for the Image.
MaxRecommendedMemoryInGb *int `pulumi:"maxRecommendedMemoryInGb"`
// Maximum count of vCPUs recommended for the Image.
MaxRecommendedVcpuCount *int `pulumi:"maxRecommendedVcpuCount"`
// Minimum memory in GB recommended for the Image.
MinRecommendedMemoryInGb *int `pulumi:"minRecommendedMemoryInGb"`
// Minimum count of vCPUs recommended for the Image.
MinRecommendedVcpuCount *int `pulumi:"minRecommendedVcpuCount"`
// Specifies the name of the Shared Image. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The type of Operating System present in this Shared Image. Possible values are `Linux` and `Windows`. Changing this forces a new resource to be created.
OsType string `pulumi:"osType"`
// The URI containing the Privacy Statement associated with this Shared Image. Changing this forces a new resource to be created.
PrivacyStatementUri *string `pulumi:"privacyStatementUri"`
// A `purchasePlan` block as defined below.
PurchasePlan *SharedImagePurchasePlan `pulumi:"purchasePlan"`
// The URI containing the Release Notes associated with this Shared Image.
ReleaseNoteUri *string `pulumi:"releaseNoteUri"`
// The name of the resource group in which the Shared Image Gallery exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Changing this forces a new resource to be created.
//
// !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects.
Specialized *bool `pulumi:"specialized"`
// A mapping of tags to assign to the Shared Image.
Tags map[string]string `pulumi:"tags"`
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchEnabled *bool `pulumi:"trustedLaunchEnabled"`
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchSupported *bool `pulumi:"trustedLaunchSupported"`
}
// The set of arguments for constructing a SharedImage resource.
type SharedImageArgs struct {
// Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
AcceleratedNetworkSupportEnabled pulumi.BoolPtrInput
// CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created.
Architecture pulumi.StringPtrInput
// Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines. Changing this forces a new resource to be created.
//
// > **Note:** Only one of `trustedLaunchSupported`, `trustedLaunchEnabled`, `confidentialVmSupported` and `confidentialVmEnabled` can be specified.
ConfidentialVmEnabled pulumi.BoolPtrInput
// Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image. Changing this forces a new resource to be created.
ConfidentialVmSupported pulumi.BoolPtrInput
// A description of this Shared Image.
Description pulumi.StringPtrInput
// Specifies if the Shared Image supports NVMe disks. Changing this forces a new resource to be created.
DiskControllerTypeNvmeEnabled pulumi.BoolPtrInput
// One or more Disk Types not allowed for the Image. Possible values include `Standard_LRS` and `Premium_LRS`.
DiskTypesNotAlloweds pulumi.StringArrayInput
// The end of life date in RFC3339 format of the Image.
EndOfLifeDate pulumi.StringPtrInput
// The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.
Eula pulumi.StringPtrInput
// Specifies the name of the Shared Image Gallery in which this Shared Image should exist. Changing this forces a new resource to be created.
GalleryName pulumi.StringInput
// Specifies if the Shared Image supports hibernation. Changing this forces a new resource to be created.
HibernationEnabled pulumi.BoolPtrInput
// The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
HyperVGeneration pulumi.StringPtrInput
// An `identifier` block as defined below.
Identifier SharedImageIdentifierInput
// Specifies the supported Azure location where the Shared Image Gallery exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Maximum memory in GB recommended for the Image.
MaxRecommendedMemoryInGb pulumi.IntPtrInput
// Maximum count of vCPUs recommended for the Image.
MaxRecommendedVcpuCount pulumi.IntPtrInput
// Minimum memory in GB recommended for the Image.
MinRecommendedMemoryInGb pulumi.IntPtrInput
// Minimum count of vCPUs recommended for the Image.
MinRecommendedVcpuCount pulumi.IntPtrInput
// Specifies the name of the Shared Image. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The type of Operating System present in this Shared Image. Possible values are `Linux` and `Windows`. Changing this forces a new resource to be created.
OsType pulumi.StringInput
// The URI containing the Privacy Statement associated with this Shared Image. Changing this forces a new resource to be created.
PrivacyStatementUri pulumi.StringPtrInput
// A `purchasePlan` block as defined below.
PurchasePlan SharedImagePurchasePlanPtrInput
// The URI containing the Release Notes associated with this Shared Image.
ReleaseNoteUri pulumi.StringPtrInput
// The name of the resource group in which the Shared Image Gallery exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Changing this forces a new resource to be created.
//
// !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects.
Specialized pulumi.BoolPtrInput
// A mapping of tags to assign to the Shared Image.
Tags pulumi.StringMapInput
// Specifies if Trusted Launch has to be enabled for the Virtual Machine created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchEnabled pulumi.BoolPtrInput
// Specifies if supports creation of both Trusted Launch virtual machines and Gen2 virtual machines with standard security created from the Shared Image. Changing this forces a new resource to be created.
TrustedLaunchSupported pulumi.BoolPtrInput
}
func (SharedImageArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sharedImageArgs)(nil)).Elem()
}
type SharedImageInput interface {
pulumi.Input
ToSharedImageOutput() SharedImageOutput
ToSharedImageOutputWithContext(ctx context.Context) SharedImageOutput
}
func (*SharedImage) ElementType() reflect.Type {
return reflect.TypeOf((**SharedImage)(nil)).Elem()
}
func (i *SharedImage) ToSharedImageOutput() SharedImageOutput {
return i.ToSharedImageOutputWithContext(context.Background())
}
func (i *SharedImage) ToSharedImageOutputWithContext(ctx context.Context) SharedImageOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedImageOutput)
}
// SharedImageArrayInput is an input type that accepts SharedImageArray and SharedImageArrayOutput values.
// You can construct a concrete instance of `SharedImageArrayInput` via:
//
// SharedImageArray{ SharedImageArgs{...} }
type SharedImageArrayInput interface {
pulumi.Input
ToSharedImageArrayOutput() SharedImageArrayOutput
ToSharedImageArrayOutputWithContext(context.Context) SharedImageArrayOutput
}
type SharedImageArray []SharedImageInput
func (SharedImageArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SharedImage)(nil)).Elem()
}
func (i SharedImageArray) ToSharedImageArrayOutput() SharedImageArrayOutput {
return i.ToSharedImageArrayOutputWithContext(context.Background())
}
func (i SharedImageArray) ToSharedImageArrayOutputWithContext(ctx context.Context) SharedImageArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedImageArrayOutput)
}
// SharedImageMapInput is an input type that accepts SharedImageMap and SharedImageMapOutput values.
// You can construct a concrete instance of `SharedImageMapInput` via:
//
// SharedImageMap{ "key": SharedImageArgs{...} }
type SharedImageMapInput interface {
pulumi.Input
ToSharedImageMapOutput() SharedImageMapOutput
ToSharedImageMapOutputWithContext(context.Context) SharedImageMapOutput
}
type SharedImageMap map[string]SharedImageInput
func (SharedImageMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SharedImage)(nil)).Elem()
}
func (i SharedImageMap) ToSharedImageMapOutput() SharedImageMapOutput {
return i.ToSharedImageMapOutputWithContext(context.Background())
}
func (i SharedImageMap) ToSharedImageMapOutputWithContext(ctx context.Context) SharedImageMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedImageMapOutput)
}
type SharedImageOutput struct{ *pulumi.OutputState }
func (SharedImageOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SharedImage)(nil)).Elem()
}
func (o SharedImageOutput) ToSharedImageOutput() SharedImageOutput {
return o
}
func (o SharedImageOutput) ToSharedImageOutputWithContext(ctx context.Context) SharedImageOutput {
return o
}
// Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
func (o SharedImageOutput) AcceleratedNetworkSupportEnabled() pulumi.BoolPtrOutput {
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/diskAccess.go | sdk/go/azure/compute/diskAccess.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Disk Access.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := compute.NewDiskAccess(ctx, "example", &compute.DiskAccessArgs{
// Name: pulumi.String("example"),
// ResourceGroupName: pulumi.String("example"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-02
//
// ## Import
//
// Disk Access resource can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/diskAccess:DiskAccess example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/diskAccesses/diskAccess1
// ```
type DiskAccess struct {
pulumi.CustomResourceState
// The Azure Region where the Disk Access should exist. Changing this forces a new Disk to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The name which should be used for this Disk Access. Changing this forces a new Disk Access to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the Resource Group where the Disk Access should exist. Changing this forces a new Disk Access to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Disk Access.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewDiskAccess registers a new resource with the given unique name, arguments, and options.
func NewDiskAccess(ctx *pulumi.Context,
name string, args *DiskAccessArgs, opts ...pulumi.ResourceOption) (*DiskAccess, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DiskAccess
err := ctx.RegisterResource("azure:compute/diskAccess:DiskAccess", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDiskAccess gets an existing DiskAccess resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDiskAccess(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DiskAccessState, opts ...pulumi.ResourceOption) (*DiskAccess, error) {
var resource DiskAccess
err := ctx.ReadResource("azure:compute/diskAccess:DiskAccess", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DiskAccess resources.
type diskAccessState struct {
// The Azure Region where the Disk Access should exist. Changing this forces a new Disk to be created.
Location *string `pulumi:"location"`
// The name which should be used for this Disk Access. Changing this forces a new Disk Access to be created.
Name *string `pulumi:"name"`
// The name of the Resource Group where the Disk Access should exist. Changing this forces a new Disk Access to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Disk Access.
Tags map[string]string `pulumi:"tags"`
}
type DiskAccessState struct {
// The Azure Region where the Disk Access should exist. Changing this forces a new Disk to be created.
Location pulumi.StringPtrInput
// The name which should be used for this Disk Access. Changing this forces a new Disk Access to be created.
Name pulumi.StringPtrInput
// The name of the Resource Group where the Disk Access should exist. Changing this forces a new Disk Access to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags which should be assigned to the Disk Access.
Tags pulumi.StringMapInput
}
func (DiskAccessState) ElementType() reflect.Type {
return reflect.TypeOf((*diskAccessState)(nil)).Elem()
}
type diskAccessArgs struct {
// The Azure Region where the Disk Access should exist. Changing this forces a new Disk to be created.
Location *string `pulumi:"location"`
// The name which should be used for this Disk Access. Changing this forces a new Disk Access to be created.
Name *string `pulumi:"name"`
// The name of the Resource Group where the Disk Access should exist. Changing this forces a new Disk Access to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags which should be assigned to the Disk Access.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a DiskAccess resource.
type DiskAccessArgs struct {
// The Azure Region where the Disk Access should exist. Changing this forces a new Disk to be created.
Location pulumi.StringPtrInput
// The name which should be used for this Disk Access. Changing this forces a new Disk Access to be created.
Name pulumi.StringPtrInput
// The name of the Resource Group where the Disk Access should exist. Changing this forces a new Disk Access to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags which should be assigned to the Disk Access.
Tags pulumi.StringMapInput
}
func (DiskAccessArgs) ElementType() reflect.Type {
return reflect.TypeOf((*diskAccessArgs)(nil)).Elem()
}
type DiskAccessInput interface {
pulumi.Input
ToDiskAccessOutput() DiskAccessOutput
ToDiskAccessOutputWithContext(ctx context.Context) DiskAccessOutput
}
func (*DiskAccess) ElementType() reflect.Type {
return reflect.TypeOf((**DiskAccess)(nil)).Elem()
}
func (i *DiskAccess) ToDiskAccessOutput() DiskAccessOutput {
return i.ToDiskAccessOutputWithContext(context.Background())
}
func (i *DiskAccess) ToDiskAccessOutputWithContext(ctx context.Context) DiskAccessOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskAccessOutput)
}
// DiskAccessArrayInput is an input type that accepts DiskAccessArray and DiskAccessArrayOutput values.
// You can construct a concrete instance of `DiskAccessArrayInput` via:
//
// DiskAccessArray{ DiskAccessArgs{...} }
type DiskAccessArrayInput interface {
pulumi.Input
ToDiskAccessArrayOutput() DiskAccessArrayOutput
ToDiskAccessArrayOutputWithContext(context.Context) DiskAccessArrayOutput
}
type DiskAccessArray []DiskAccessInput
func (DiskAccessArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DiskAccess)(nil)).Elem()
}
func (i DiskAccessArray) ToDiskAccessArrayOutput() DiskAccessArrayOutput {
return i.ToDiskAccessArrayOutputWithContext(context.Background())
}
func (i DiskAccessArray) ToDiskAccessArrayOutputWithContext(ctx context.Context) DiskAccessArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskAccessArrayOutput)
}
// DiskAccessMapInput is an input type that accepts DiskAccessMap and DiskAccessMapOutput values.
// You can construct a concrete instance of `DiskAccessMapInput` via:
//
// DiskAccessMap{ "key": DiskAccessArgs{...} }
type DiskAccessMapInput interface {
pulumi.Input
ToDiskAccessMapOutput() DiskAccessMapOutput
ToDiskAccessMapOutputWithContext(context.Context) DiskAccessMapOutput
}
type DiskAccessMap map[string]DiskAccessInput
func (DiskAccessMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DiskAccess)(nil)).Elem()
}
func (i DiskAccessMap) ToDiskAccessMapOutput() DiskAccessMapOutput {
return i.ToDiskAccessMapOutputWithContext(context.Background())
}
func (i DiskAccessMap) ToDiskAccessMapOutputWithContext(ctx context.Context) DiskAccessMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskAccessMapOutput)
}
type DiskAccessOutput struct{ *pulumi.OutputState }
func (DiskAccessOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DiskAccess)(nil)).Elem()
}
func (o DiskAccessOutput) ToDiskAccessOutput() DiskAccessOutput {
return o
}
func (o DiskAccessOutput) ToDiskAccessOutputWithContext(ctx context.Context) DiskAccessOutput {
return o
}
// The Azure Region where the Disk Access should exist. Changing this forces a new Disk to be created.
func (o DiskAccessOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *DiskAccess) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The name which should be used for this Disk Access. Changing this forces a new Disk Access to be created.
func (o DiskAccessOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DiskAccess) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the Resource Group where the Disk Access should exist. Changing this forces a new Disk Access to be created.
func (o DiskAccessOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *DiskAccess) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags which should be assigned to the Disk Access.
func (o DiskAccessOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *DiskAccess) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type DiskAccessArrayOutput struct{ *pulumi.OutputState }
func (DiskAccessArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DiskAccess)(nil)).Elem()
}
func (o DiskAccessArrayOutput) ToDiskAccessArrayOutput() DiskAccessArrayOutput {
return o
}
func (o DiskAccessArrayOutput) ToDiskAccessArrayOutputWithContext(ctx context.Context) DiskAccessArrayOutput {
return o
}
func (o DiskAccessArrayOutput) Index(i pulumi.IntInput) DiskAccessOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DiskAccess {
return vs[0].([]*DiskAccess)[vs[1].(int)]
}).(DiskAccessOutput)
}
type DiskAccessMapOutput struct{ *pulumi.OutputState }
func (DiskAccessMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DiskAccess)(nil)).Elem()
}
func (o DiskAccessMapOutput) ToDiskAccessMapOutput() DiskAccessMapOutput {
return o
}
func (o DiskAccessMapOutput) ToDiskAccessMapOutputWithContext(ctx context.Context) DiskAccessMapOutput {
return o
}
func (o DiskAccessMapOutput) MapIndex(k pulumi.StringInput) DiskAccessOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DiskAccess {
return vs[0].(map[string]*DiskAccess)[vs[1].(string)]
}).(DiskAccessOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DiskAccessInput)(nil)).Elem(), &DiskAccess{})
pulumi.RegisterInputType(reflect.TypeOf((*DiskAccessArrayInput)(nil)).Elem(), DiskAccessArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DiskAccessMapInput)(nil)).Elem(), DiskAccessMap{})
pulumi.RegisterOutputType(DiskAccessOutput{})
pulumi.RegisterOutputType(DiskAccessArrayOutput{})
pulumi.RegisterOutputType(DiskAccessMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/sharedImageGallery.go | sdk/go/azure/compute/sharedImageGallery.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Shared Image Gallery.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// _, err = compute.NewSharedImageGallery(ctx, "example", &compute.SharedImageGalleryArgs{
// Name: pulumi.String("example_image_gallery"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// Description: pulumi.String("Shared images and things."),
// Tags: pulumi.StringMap{
// "Hello": pulumi.String("There"),
// "World": pulumi.String("Example"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2022-03-03
//
// ## Import
//
// Shared Image Galleries can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/sharedImageGallery:SharedImageGallery gallery1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1
// ```
type SharedImageGallery struct {
pulumi.CustomResourceState
// A description for this Shared Image Gallery.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of the Shared Image Gallery. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which to create the Shared Image Gallery. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `sharing` block as defined below. Changing this forces a new resource to be created.
Sharing SharedImageGallerySharingPtrOutput `pulumi:"sharing"`
// A mapping of tags to assign to the Shared Image Gallery.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The Unique Name for this Shared Image Gallery.
UniqueName pulumi.StringOutput `pulumi:"uniqueName"`
}
// NewSharedImageGallery registers a new resource with the given unique name, arguments, and options.
func NewSharedImageGallery(ctx *pulumi.Context,
name string, args *SharedImageGalleryArgs, opts ...pulumi.ResourceOption) (*SharedImageGallery, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SharedImageGallery
err := ctx.RegisterResource("azure:compute/sharedImageGallery:SharedImageGallery", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSharedImageGallery gets an existing SharedImageGallery resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSharedImageGallery(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SharedImageGalleryState, opts ...pulumi.ResourceOption) (*SharedImageGallery, error) {
var resource SharedImageGallery
err := ctx.ReadResource("azure:compute/sharedImageGallery:SharedImageGallery", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SharedImageGallery resources.
type sharedImageGalleryState struct {
// A description for this Shared Image Gallery.
Description *string `pulumi:"description"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Shared Image Gallery. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which to create the Shared Image Gallery. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A `sharing` block as defined below. Changing this forces a new resource to be created.
Sharing *SharedImageGallerySharing `pulumi:"sharing"`
// A mapping of tags to assign to the Shared Image Gallery.
Tags map[string]string `pulumi:"tags"`
// The Unique Name for this Shared Image Gallery.
UniqueName *string `pulumi:"uniqueName"`
}
type SharedImageGalleryState struct {
// A description for this Shared Image Gallery.
Description pulumi.StringPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Shared Image Gallery. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which to create the Shared Image Gallery. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A `sharing` block as defined below. Changing this forces a new resource to be created.
Sharing SharedImageGallerySharingPtrInput
// A mapping of tags to assign to the Shared Image Gallery.
Tags pulumi.StringMapInput
// The Unique Name for this Shared Image Gallery.
UniqueName pulumi.StringPtrInput
}
func (SharedImageGalleryState) ElementType() reflect.Type {
return reflect.TypeOf((*sharedImageGalleryState)(nil)).Elem()
}
type sharedImageGalleryArgs struct {
// A description for this Shared Image Gallery.
Description *string `pulumi:"description"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Shared Image Gallery. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which to create the Shared Image Gallery. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A `sharing` block as defined below. Changing this forces a new resource to be created.
Sharing *SharedImageGallerySharing `pulumi:"sharing"`
// A mapping of tags to assign to the Shared Image Gallery.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a SharedImageGallery resource.
type SharedImageGalleryArgs struct {
// A description for this Shared Image Gallery.
Description pulumi.StringPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Shared Image Gallery. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which to create the Shared Image Gallery. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A `sharing` block as defined below. Changing this forces a new resource to be created.
Sharing SharedImageGallerySharingPtrInput
// A mapping of tags to assign to the Shared Image Gallery.
Tags pulumi.StringMapInput
}
func (SharedImageGalleryArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sharedImageGalleryArgs)(nil)).Elem()
}
type SharedImageGalleryInput interface {
pulumi.Input
ToSharedImageGalleryOutput() SharedImageGalleryOutput
ToSharedImageGalleryOutputWithContext(ctx context.Context) SharedImageGalleryOutput
}
func (*SharedImageGallery) ElementType() reflect.Type {
return reflect.TypeOf((**SharedImageGallery)(nil)).Elem()
}
func (i *SharedImageGallery) ToSharedImageGalleryOutput() SharedImageGalleryOutput {
return i.ToSharedImageGalleryOutputWithContext(context.Background())
}
func (i *SharedImageGallery) ToSharedImageGalleryOutputWithContext(ctx context.Context) SharedImageGalleryOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedImageGalleryOutput)
}
// SharedImageGalleryArrayInput is an input type that accepts SharedImageGalleryArray and SharedImageGalleryArrayOutput values.
// You can construct a concrete instance of `SharedImageGalleryArrayInput` via:
//
// SharedImageGalleryArray{ SharedImageGalleryArgs{...} }
type SharedImageGalleryArrayInput interface {
pulumi.Input
ToSharedImageGalleryArrayOutput() SharedImageGalleryArrayOutput
ToSharedImageGalleryArrayOutputWithContext(context.Context) SharedImageGalleryArrayOutput
}
type SharedImageGalleryArray []SharedImageGalleryInput
func (SharedImageGalleryArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SharedImageGallery)(nil)).Elem()
}
func (i SharedImageGalleryArray) ToSharedImageGalleryArrayOutput() SharedImageGalleryArrayOutput {
return i.ToSharedImageGalleryArrayOutputWithContext(context.Background())
}
func (i SharedImageGalleryArray) ToSharedImageGalleryArrayOutputWithContext(ctx context.Context) SharedImageGalleryArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedImageGalleryArrayOutput)
}
// SharedImageGalleryMapInput is an input type that accepts SharedImageGalleryMap and SharedImageGalleryMapOutput values.
// You can construct a concrete instance of `SharedImageGalleryMapInput` via:
//
// SharedImageGalleryMap{ "key": SharedImageGalleryArgs{...} }
type SharedImageGalleryMapInput interface {
pulumi.Input
ToSharedImageGalleryMapOutput() SharedImageGalleryMapOutput
ToSharedImageGalleryMapOutputWithContext(context.Context) SharedImageGalleryMapOutput
}
type SharedImageGalleryMap map[string]SharedImageGalleryInput
func (SharedImageGalleryMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SharedImageGallery)(nil)).Elem()
}
func (i SharedImageGalleryMap) ToSharedImageGalleryMapOutput() SharedImageGalleryMapOutput {
return i.ToSharedImageGalleryMapOutputWithContext(context.Background())
}
func (i SharedImageGalleryMap) ToSharedImageGalleryMapOutputWithContext(ctx context.Context) SharedImageGalleryMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedImageGalleryMapOutput)
}
type SharedImageGalleryOutput struct{ *pulumi.OutputState }
func (SharedImageGalleryOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SharedImageGallery)(nil)).Elem()
}
func (o SharedImageGalleryOutput) ToSharedImageGalleryOutput() SharedImageGalleryOutput {
return o
}
func (o SharedImageGalleryOutput) ToSharedImageGalleryOutputWithContext(ctx context.Context) SharedImageGalleryOutput {
return o
}
// A description for this Shared Image Gallery.
func (o SharedImageGalleryOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SharedImageGallery) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
func (o SharedImageGalleryOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *SharedImageGallery) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of the Shared Image Gallery. Changing this forces a new resource to be created.
func (o SharedImageGalleryOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SharedImageGallery) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which to create the Shared Image Gallery. Changing this forces a new resource to be created.
func (o SharedImageGalleryOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *SharedImageGallery) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A `sharing` block as defined below. Changing this forces a new resource to be created.
func (o SharedImageGalleryOutput) Sharing() SharedImageGallerySharingPtrOutput {
return o.ApplyT(func(v *SharedImageGallery) SharedImageGallerySharingPtrOutput { return v.Sharing }).(SharedImageGallerySharingPtrOutput)
}
// A mapping of tags to assign to the Shared Image Gallery.
func (o SharedImageGalleryOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *SharedImageGallery) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The Unique Name for this Shared Image Gallery.
func (o SharedImageGalleryOutput) UniqueName() pulumi.StringOutput {
return o.ApplyT(func(v *SharedImageGallery) pulumi.StringOutput { return v.UniqueName }).(pulumi.StringOutput)
}
type SharedImageGalleryArrayOutput struct{ *pulumi.OutputState }
func (SharedImageGalleryArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SharedImageGallery)(nil)).Elem()
}
func (o SharedImageGalleryArrayOutput) ToSharedImageGalleryArrayOutput() SharedImageGalleryArrayOutput {
return o
}
func (o SharedImageGalleryArrayOutput) ToSharedImageGalleryArrayOutputWithContext(ctx context.Context) SharedImageGalleryArrayOutput {
return o
}
func (o SharedImageGalleryArrayOutput) Index(i pulumi.IntInput) SharedImageGalleryOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SharedImageGallery {
return vs[0].([]*SharedImageGallery)[vs[1].(int)]
}).(SharedImageGalleryOutput)
}
type SharedImageGalleryMapOutput struct{ *pulumi.OutputState }
func (SharedImageGalleryMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SharedImageGallery)(nil)).Elem()
}
func (o SharedImageGalleryMapOutput) ToSharedImageGalleryMapOutput() SharedImageGalleryMapOutput {
return o
}
func (o SharedImageGalleryMapOutput) ToSharedImageGalleryMapOutputWithContext(ctx context.Context) SharedImageGalleryMapOutput {
return o
}
func (o SharedImageGalleryMapOutput) MapIndex(k pulumi.StringInput) SharedImageGalleryOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SharedImageGallery {
return vs[0].(map[string]*SharedImageGallery)[vs[1].(string)]
}).(SharedImageGalleryOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SharedImageGalleryInput)(nil)).Elem(), &SharedImageGallery{})
pulumi.RegisterInputType(reflect.TypeOf((*SharedImageGalleryArrayInput)(nil)).Elem(), SharedImageGalleryArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SharedImageGalleryMapInput)(nil)).Elem(), SharedImageGalleryMap{})
pulumi.RegisterOutputType(SharedImageGalleryOutput{})
pulumi.RegisterOutputType(SharedImageGalleryArrayOutput{})
pulumi.RegisterOutputType(SharedImageGalleryMapOutput{})
}
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | false |
pulumi/pulumi-azure | https://github.com/pulumi/pulumi-azure/blob/b66e1472775a89cca43f5050fef806854a7c3fa3/sdk/go/azure/compute/virtualMachine.go | sdk/go/azure/compute/virtualMachine.go | // Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Virtual Machine.
//
// ## Disclaimers
//
// > **Note:** The `compute.VirtualMachine` resource has been superseded by the `compute.LinuxVirtualMachine` and `compute.WindowsVirtualMachine` resources. The existing `compute.VirtualMachine` resource will continue to be available throughout the 2.x releases however is in a feature-frozen state to maintain compatibility - new functionality will instead be added to the `compute.LinuxVirtualMachine` and `compute.WindowsVirtualMachine` resources.
//
// > **Note:** Data Disks can be attached either directly on the `compute.VirtualMachine` resource, or using the `compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur.
//
// ## Example Usage
//
// ### From An Azure Platform Image)
//
// This example provisions a Virtual Machine with Managed Disks.
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cfg := config.New(ctx, "")
// prefix := "tfvmex"
// if param := cfg.Get("prefix"); param != "" {
// prefix = param
// }
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.Sprintf("%v-resources", prefix),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// main, err := network.NewVirtualNetwork(ctx, "main", &network.VirtualNetworkArgs{
// Name: pulumi.Sprintf("%v-network", prefix),
// AddressSpaces: pulumi.StringArray{
// pulumi.String("10.0.0.0/16"),
// },
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{
// Name: pulumi.String("internal"),
// ResourceGroupName: example.Name,
// VirtualNetworkName: main.Name,
// AddressPrefixes: pulumi.StringArray{
// pulumi.String("10.0.2.0/24"),
// },
// })
// if err != nil {
// return err
// }
// mainNetworkInterface, err := network.NewNetworkInterface(ctx, "main", &network.NetworkInterfaceArgs{
// Name: pulumi.Sprintf("%v-nic", prefix),
// Location: example.Location,
// ResourceGroupName: example.Name,
// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
// &network.NetworkInterfaceIpConfigurationArgs{
// Name: pulumi.String("testconfiguration1"),
// SubnetId: internal.ID(),
// PrivateIpAddressAllocation: pulumi.String("Dynamic"),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = compute.NewVirtualMachine(ctx, "main", &compute.VirtualMachineArgs{
// Name: pulumi.Sprintf("%v-vm", prefix),
// Location: example.Location,
// ResourceGroupName: example.Name,
// NetworkInterfaceIds: pulumi.StringArray{
// mainNetworkInterface.ID(),
// },
// VmSize: pulumi.String("Standard_DS1_v2"),
// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{
// Publisher: pulumi.String("Canonical"),
// Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
// Sku: pulumi.String("22_04-lts"),
// Version: pulumi.String("latest"),
// },
// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{
// Name: pulumi.String("myosdisk1"),
// Caching: pulumi.String("ReadWrite"),
// CreateOption: pulumi.String("FromImage"),
// ManagedDiskType: pulumi.String("Standard_LRS"),
// },
// OsProfile: &compute.VirtualMachineOsProfileArgs{
// ComputerName: pulumi.String("hostname"),
// AdminUsername: pulumi.String("testadmin"),
// AdminPassword: pulumi.String("Password1234!"),
// },
// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{
// DisablePasswordAuthentication: pulumi.Bool(false),
// },
// Tags: pulumi.StringMap{
// "environment": pulumi.String("staging"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## API Providers
//
// <!-- This section is generated, changes will be overwritten -->
// This resource uses the following Azure API Providers:
//
// * `Microsoft.Compute` - 2024-03-01, 2023-04-02
//
// * `Microsoft.Network` - 2025-01-01
//
// ## Import
//
// Virtual Machines can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:compute/virtualMachine:VirtualMachine example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1
// ```
type VirtualMachine struct {
pulumi.CustomResourceState
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities VirtualMachineAdditionalCapabilitiesPtrOutput `pulumi:"additionalCapabilities"`
// The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId pulumi.StringOutput `pulumi:"availabilitySetId"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics VirtualMachineBootDiagnosticsPtrOutput `pulumi:"bootDiagnostics"`
// Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteDataDisksOnTermination pulumi.BoolPtrOutput `pulumi:"deleteDataDisksOnTermination"`
// Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteOsDiskOnTermination pulumi.BoolPtrOutput `pulumi:"deleteOsDiskOnTermination"`
// An `identity` block as defined below.
Identity VirtualMachineIdentityPtrOutput `pulumi:"identity"`
// Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
LicenseType pulumi.StringOutput `pulumi:"licenseType"`
// Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A list of Network Interface IDs which should be associated with the Virtual Machine.
NetworkInterfaceIds pulumi.StringArrayOutput `pulumi:"networkInterfaceIds"`
// An `osProfile` block as defined below. Required when `createOption` in the `storageOsDisk` block is set to `FromImage`.
OsProfile VirtualMachineOsProfilePtrOutput `pulumi:"osProfile"`
// (Required, when a Linux machine) An `osProfileLinuxConfig` block as defined below.
OsProfileLinuxConfig VirtualMachineOsProfileLinuxConfigPtrOutput `pulumi:"osProfileLinuxConfig"`
// One or more `osProfileSecrets` blocks as defined below.
OsProfileSecrets VirtualMachineOsProfileSecretArrayOutput `pulumi:"osProfileSecrets"`
// (Required, when a Windows machine) An `osProfileWindowsConfig` block as defined below.
OsProfileWindowsConfig VirtualMachineOsProfileWindowsConfigPtrOutput `pulumi:"osProfileWindowsConfig"`
// A `plan` block as defined below.
Plan VirtualMachinePlanPtrOutput `pulumi:"plan"`
// The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
PrimaryNetworkInterfaceId pulumi.StringPtrOutput `pulumi:"primaryNetworkInterfaceId"`
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId pulumi.StringPtrOutput `pulumi:"proximityPlacementGroupId"`
// Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// One or more `storageDataDisk` blocks as defined below.
//
// > **Please Note:** Data Disks can also be attached either using this block or the `compute.DataDiskAttachment` resource - but not both.
StorageDataDisks VirtualMachineStorageDataDiskArrayOutput `pulumi:"storageDataDisks"`
// A `storageImageReference` block as defined below. Changing this forces a new resource to be created.
StorageImageReference VirtualMachineStorageImageReferenceOutput `pulumi:"storageImageReference"`
// A `storageOsDisk` block as defined below.
StorageOsDisk VirtualMachineStorageOsDiskOutput `pulumi:"storageOsDisk"`
// A mapping of tags to assign to the Virtual Machine.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
VmSize pulumi.StringOutput `pulumi:"vmSize"`
// A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
//
// > **Please Note:** Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
//
// For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
Zones pulumi.StringPtrOutput `pulumi:"zones"`
}
// NewVirtualMachine registers a new resource with the given unique name, arguments, and options.
func NewVirtualMachine(ctx *pulumi.Context,
name string, args *VirtualMachineArgs, opts ...pulumi.ResourceOption) (*VirtualMachine, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.NetworkInterfaceIds == nil {
return nil, errors.New("invalid value for required argument 'NetworkInterfaceIds'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.StorageOsDisk == nil {
return nil, errors.New("invalid value for required argument 'StorageOsDisk'")
}
if args.VmSize == nil {
return nil, errors.New("invalid value for required argument 'VmSize'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource VirtualMachine
err := ctx.RegisterResource("azure:compute/virtualMachine:VirtualMachine", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVirtualMachine gets an existing VirtualMachine resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetVirtualMachine(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VirtualMachineState, opts ...pulumi.ResourceOption) (*VirtualMachine, error) {
var resource VirtualMachine
err := ctx.ReadResource("azure:compute/virtualMachine:VirtualMachine", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VirtualMachine resources.
type virtualMachineState struct {
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities *VirtualMachineAdditionalCapabilities `pulumi:"additionalCapabilities"`
// The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId *string `pulumi:"availabilitySetId"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics *VirtualMachineBootDiagnostics `pulumi:"bootDiagnostics"`
// Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteDataDisksOnTermination *bool `pulumi:"deleteDataDisksOnTermination"`
// Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteOsDiskOnTermination *bool `pulumi:"deleteOsDiskOnTermination"`
// An `identity` block as defined below.
Identity *VirtualMachineIdentity `pulumi:"identity"`
// Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
LicenseType *string `pulumi:"licenseType"`
// Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A list of Network Interface IDs which should be associated with the Virtual Machine.
NetworkInterfaceIds []string `pulumi:"networkInterfaceIds"`
// An `osProfile` block as defined below. Required when `createOption` in the `storageOsDisk` block is set to `FromImage`.
OsProfile *VirtualMachineOsProfile `pulumi:"osProfile"`
// (Required, when a Linux machine) An `osProfileLinuxConfig` block as defined below.
OsProfileLinuxConfig *VirtualMachineOsProfileLinuxConfig `pulumi:"osProfileLinuxConfig"`
// One or more `osProfileSecrets` blocks as defined below.
OsProfileSecrets []VirtualMachineOsProfileSecret `pulumi:"osProfileSecrets"`
// (Required, when a Windows machine) An `osProfileWindowsConfig` block as defined below.
OsProfileWindowsConfig *VirtualMachineOsProfileWindowsConfig `pulumi:"osProfileWindowsConfig"`
// A `plan` block as defined below.
Plan *VirtualMachinePlan `pulumi:"plan"`
// The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
PrimaryNetworkInterfaceId *string `pulumi:"primaryNetworkInterfaceId"`
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId *string `pulumi:"proximityPlacementGroupId"`
// Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// One or more `storageDataDisk` blocks as defined below.
//
// > **Please Note:** Data Disks can also be attached either using this block or the `compute.DataDiskAttachment` resource - but not both.
StorageDataDisks []VirtualMachineStorageDataDisk `pulumi:"storageDataDisks"`
// A `storageImageReference` block as defined below. Changing this forces a new resource to be created.
StorageImageReference *VirtualMachineStorageImageReference `pulumi:"storageImageReference"`
// A `storageOsDisk` block as defined below.
StorageOsDisk *VirtualMachineStorageOsDisk `pulumi:"storageOsDisk"`
// A mapping of tags to assign to the Virtual Machine.
Tags map[string]string `pulumi:"tags"`
// Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
VmSize *string `pulumi:"vmSize"`
// A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
//
// > **Please Note:** Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
//
// For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
Zones *string `pulumi:"zones"`
}
type VirtualMachineState struct {
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities VirtualMachineAdditionalCapabilitiesPtrInput
// The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId pulumi.StringPtrInput
// A `bootDiagnostics` block as defined below.
BootDiagnostics VirtualMachineBootDiagnosticsPtrInput
// Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteDataDisksOnTermination pulumi.BoolPtrInput
// Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteOsDiskOnTermination pulumi.BoolPtrInput
// An `identity` block as defined below.
Identity VirtualMachineIdentityPtrInput
// Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
LicenseType pulumi.StringPtrInput
// Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A list of Network Interface IDs which should be associated with the Virtual Machine.
NetworkInterfaceIds pulumi.StringArrayInput
// An `osProfile` block as defined below. Required when `createOption` in the `storageOsDisk` block is set to `FromImage`.
OsProfile VirtualMachineOsProfilePtrInput
// (Required, when a Linux machine) An `osProfileLinuxConfig` block as defined below.
OsProfileLinuxConfig VirtualMachineOsProfileLinuxConfigPtrInput
// One or more `osProfileSecrets` blocks as defined below.
OsProfileSecrets VirtualMachineOsProfileSecretArrayInput
// (Required, when a Windows machine) An `osProfileWindowsConfig` block as defined below.
OsProfileWindowsConfig VirtualMachineOsProfileWindowsConfigPtrInput
// A `plan` block as defined below.
Plan VirtualMachinePlanPtrInput
// The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
PrimaryNetworkInterfaceId pulumi.StringPtrInput
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId pulumi.StringPtrInput
// Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// One or more `storageDataDisk` blocks as defined below.
//
// > **Please Note:** Data Disks can also be attached either using this block or the `compute.DataDiskAttachment` resource - but not both.
StorageDataDisks VirtualMachineStorageDataDiskArrayInput
// A `storageImageReference` block as defined below. Changing this forces a new resource to be created.
StorageImageReference VirtualMachineStorageImageReferencePtrInput
// A `storageOsDisk` block as defined below.
StorageOsDisk VirtualMachineStorageOsDiskPtrInput
// A mapping of tags to assign to the Virtual Machine.
Tags pulumi.StringMapInput
// Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
VmSize pulumi.StringPtrInput
// A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
//
// > **Please Note:** Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
//
// For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
Zones pulumi.StringPtrInput
}
func (VirtualMachineState) ElementType() reflect.Type {
return reflect.TypeOf((*virtualMachineState)(nil)).Elem()
}
type virtualMachineArgs struct {
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities *VirtualMachineAdditionalCapabilities `pulumi:"additionalCapabilities"`
// The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId *string `pulumi:"availabilitySetId"`
// A `bootDiagnostics` block as defined below.
BootDiagnostics *VirtualMachineBootDiagnostics `pulumi:"bootDiagnostics"`
// Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteDataDisksOnTermination *bool `pulumi:"deleteDataDisksOnTermination"`
// Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteOsDiskOnTermination *bool `pulumi:"deleteOsDiskOnTermination"`
// An `identity` block as defined below.
Identity *VirtualMachineIdentity `pulumi:"identity"`
// Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
LicenseType *string `pulumi:"licenseType"`
// Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A list of Network Interface IDs which should be associated with the Virtual Machine.
NetworkInterfaceIds []string `pulumi:"networkInterfaceIds"`
// An `osProfile` block as defined below. Required when `createOption` in the `storageOsDisk` block is set to `FromImage`.
OsProfile *VirtualMachineOsProfile `pulumi:"osProfile"`
// (Required, when a Linux machine) An `osProfileLinuxConfig` block as defined below.
OsProfileLinuxConfig *VirtualMachineOsProfileLinuxConfig `pulumi:"osProfileLinuxConfig"`
// One or more `osProfileSecrets` blocks as defined below.
OsProfileSecrets []VirtualMachineOsProfileSecret `pulumi:"osProfileSecrets"`
// (Required, when a Windows machine) An `osProfileWindowsConfig` block as defined below.
OsProfileWindowsConfig *VirtualMachineOsProfileWindowsConfig `pulumi:"osProfileWindowsConfig"`
// A `plan` block as defined below.
Plan *VirtualMachinePlan `pulumi:"plan"`
// The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
PrimaryNetworkInterfaceId *string `pulumi:"primaryNetworkInterfaceId"`
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId *string `pulumi:"proximityPlacementGroupId"`
// Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// One or more `storageDataDisk` blocks as defined below.
//
// > **Please Note:** Data Disks can also be attached either using this block or the `compute.DataDiskAttachment` resource - but not both.
StorageDataDisks []VirtualMachineStorageDataDisk `pulumi:"storageDataDisks"`
// A `storageImageReference` block as defined below. Changing this forces a new resource to be created.
StorageImageReference *VirtualMachineStorageImageReference `pulumi:"storageImageReference"`
// A `storageOsDisk` block as defined below.
StorageOsDisk VirtualMachineStorageOsDisk `pulumi:"storageOsDisk"`
// A mapping of tags to assign to the Virtual Machine.
Tags map[string]string `pulumi:"tags"`
// Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
VmSize string `pulumi:"vmSize"`
// A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
//
// > **Please Note:** Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
//
// For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
Zones *string `pulumi:"zones"`
}
// The set of arguments for constructing a VirtualMachine resource.
type VirtualMachineArgs struct {
// An `additionalCapabilities` block as defined below.
AdditionalCapabilities VirtualMachineAdditionalCapabilitiesPtrInput
// The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
AvailabilitySetId pulumi.StringPtrInput
// A `bootDiagnostics` block as defined below.
BootDiagnostics VirtualMachineBootDiagnosticsPtrInput
// Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteDataDisksOnTermination pulumi.BoolPtrInput
// Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
//
// > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
DeleteOsDiskOnTermination pulumi.BoolPtrInput
// An `identity` block as defined below.
Identity VirtualMachineIdentityPtrInput
// Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
LicenseType pulumi.StringPtrInput
// Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A list of Network Interface IDs which should be associated with the Virtual Machine.
NetworkInterfaceIds pulumi.StringArrayInput
// An `osProfile` block as defined below. Required when `createOption` in the `storageOsDisk` block is set to `FromImage`.
OsProfile VirtualMachineOsProfilePtrInput
// (Required, when a Linux machine) An `osProfileLinuxConfig` block as defined below.
OsProfileLinuxConfig VirtualMachineOsProfileLinuxConfigPtrInput
// One or more `osProfileSecrets` blocks as defined below.
OsProfileSecrets VirtualMachineOsProfileSecretArrayInput
// (Required, when a Windows machine) An `osProfileWindowsConfig` block as defined below.
OsProfileWindowsConfig VirtualMachineOsProfileWindowsConfigPtrInput
// A `plan` block as defined below.
Plan VirtualMachinePlanPtrInput
// The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
PrimaryNetworkInterfaceId pulumi.StringPtrInput
// The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
ProximityPlacementGroupId pulumi.StringPtrInput
// Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// One or more `storageDataDisk` blocks as defined below.
//
// > **Please Note:** Data Disks can also be attached either using this block or the `compute.DataDiskAttachment` resource - but not both.
StorageDataDisks VirtualMachineStorageDataDiskArrayInput
// A `storageImageReference` block as defined below. Changing this forces a new resource to be created.
StorageImageReference VirtualMachineStorageImageReferencePtrInput
// A `storageOsDisk` block as defined below.
StorageOsDisk VirtualMachineStorageOsDiskInput
// A mapping of tags to assign to the Virtual Machine.
Tags pulumi.StringMapInput
// Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
VmSize pulumi.StringInput
// A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
//
// > **Please Note:** Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
//
// For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
Zones pulumi.StringPtrInput
}
func (VirtualMachineArgs) ElementType() reflect.Type {
return reflect.TypeOf((*virtualMachineArgs)(nil)).Elem()
}
type VirtualMachineInput interface {
pulumi.Input
ToVirtualMachineOutput() VirtualMachineOutput
ToVirtualMachineOutputWithContext(ctx context.Context) VirtualMachineOutput
}
func (*VirtualMachine) ElementType() reflect.Type {
return reflect.TypeOf((**VirtualMachine)(nil)).Elem()
}
func (i *VirtualMachine) ToVirtualMachineOutput() VirtualMachineOutput {
return i.ToVirtualMachineOutputWithContext(context.Background())
}
func (i *VirtualMachine) ToVirtualMachineOutputWithContext(ctx context.Context) VirtualMachineOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualMachineOutput)
}
// VirtualMachineArrayInput is an input type that accepts VirtualMachineArray and VirtualMachineArrayOutput values.
// You can construct a concrete instance of `VirtualMachineArrayInput` via:
//
// VirtualMachineArray{ VirtualMachineArgs{...} }
type VirtualMachineArrayInput interface {
pulumi.Input
ToVirtualMachineArrayOutput() VirtualMachineArrayOutput
ToVirtualMachineArrayOutputWithContext(context.Context) VirtualMachineArrayOutput
}
type VirtualMachineArray []VirtualMachineInput
func (VirtualMachineArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*VirtualMachine)(nil)).Elem()
}
func (i VirtualMachineArray) ToVirtualMachineArrayOutput() VirtualMachineArrayOutput {
| go | Apache-2.0 | b66e1472775a89cca43f5050fef806854a7c3fa3 | 2026-01-07T09:44:27.619514Z | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.