Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { pulumi.CustomResourceState // A friendly name for this Management Group. If not specified, this'll be the same as the `name`. DisplayName pulumi.StringOutput `pulumi:"displayName"` // The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created. // // Deprecated: Deprecated in favour of `name` GroupId pulumi.StringOutput `pulumi:"groupId"` // The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created. Name pulumi.StringOutput `pulumi:"name"` // The ID of the Parent Management Group. Changing this forces a new resource to be created. ParentManagementGroupId pulumi.StringOutput `pulumi:"parentManagementGroupId"` // A list of Subscription GUIDs which should be assigned to the Management Group. SubscriptionIds pulumi.StringArrayOutput `pulumi:"subscriptionIds"` }
Manages a Management Group.
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core" "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/management" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { current, err := core.GetSubscription(ctx, nil, nil) if err != nil { return err } exampleParent, err := management.NewGroup(ctx, "exampleParent", &management.GroupArgs{ DisplayName: pulumi.String("ParentGroup"), SubscriptionIds: pulumi.StringArray{ pulumi.String(current.SubscriptionId), }, }) if err != nil { return err } _, err = management.NewGroup(ctx, "exampleChild", &management.GroupArgs{ DisplayName: pulumi.String("ChildGroup"), ParentManagementGroupId: exampleParent.ID(), SubscriptionIds: pulumi.StringArray{ pulumi.String(current.SubscriptionId), }, }) if err != nil { return err } return nil }) }
```
## Import
Management Groups can be imported using the `management group resource id`, e.g.
```sh
$ pulumi import azure:management/group:Group example /providers/Microsoft.Management/managementGroups/group1
```
func GetGroup ¶
func GetGroup(ctx *pulumi.Context, name string, id pulumi.IDInput, state *GroupState, opts ...pulumi.ResourceOption) (*Group, error)
GetGroup gets an existing Group 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 NewGroup ¶
func NewGroup(ctx *pulumi.Context, name string, args *GroupArgs, opts ...pulumi.ResourceOption) (*Group, error)
NewGroup registers a new resource with the given unique name, arguments, and options.
func (Group) ElementType ¶ added in v3.31.1
func (Group) ToGroupOutput ¶ added in v3.31.1
func (i Group) ToGroupOutput() GroupOutput
func (Group) ToGroupOutputWithContext ¶ added in v3.31.1
func (i Group) ToGroupOutputWithContext(ctx context.Context) GroupOutput
type GroupArgs ¶
type GroupArgs struct { // A friendly name for this Management Group. If not specified, this'll be the same as the `name`. DisplayName pulumi.StringPtrInput // The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created. // // Deprecated: Deprecated in favour of `name` GroupId pulumi.StringPtrInput // The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created. Name pulumi.StringPtrInput // The ID of the Parent Management Group. Changing this forces a new resource to be created. ParentManagementGroupId pulumi.StringPtrInput // A list of Subscription GUIDs which should be assigned to the Management Group. SubscriptionIds pulumi.StringArrayInput }
The set of arguments for constructing a Group resource.
func (GroupArgs) ElementType ¶
type GroupInput ¶ added in v3.31.1
type GroupInput interface { pulumi.Input ToGroupOutput() GroupOutput ToGroupOutputWithContext(ctx context.Context) GroupOutput }
type GroupOutput ¶ added in v3.31.1
type GroupOutput struct {
*pulumi.OutputState
}
func (GroupOutput) ElementType ¶ added in v3.31.1
func (GroupOutput) ElementType() reflect.Type
func (GroupOutput) ToGroupOutput ¶ added in v3.31.1
func (o GroupOutput) ToGroupOutput() GroupOutput
func (GroupOutput) ToGroupOutputWithContext ¶ added in v3.31.1
func (o GroupOutput) ToGroupOutputWithContext(ctx context.Context) GroupOutput
type GroupState ¶
type GroupState struct { // A friendly name for this Management Group. If not specified, this'll be the same as the `name`. DisplayName pulumi.StringPtrInput // The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created. // // Deprecated: Deprecated in favour of `name` GroupId pulumi.StringPtrInput // The name or UUID for this Management Group, which needs to be unique across your tenant. A new UUID will be generated if not provided. Changing this forces a new resource to be created. Name pulumi.StringPtrInput // The ID of the Parent Management Group. Changing this forces a new resource to be created. ParentManagementGroupId pulumi.StringPtrInput // A list of Subscription GUIDs which should be assigned to the Management Group. SubscriptionIds pulumi.StringArrayInput }
func (GroupState) ElementType ¶
func (GroupState) ElementType() reflect.Type
type Lock ¶
type Lock struct { pulumi.CustomResourceState // Specifies the Level to be used for this Lock. Possible values are `CanNotDelete` and `ReadOnly`. Changing this forces a new resource to be created. LockLevel pulumi.StringOutput `pulumi:"lockLevel"` // Specifies the name of the Management Lock. Changing this forces a new resource to be created. Name pulumi.StringOutput `pulumi:"name"` // Specifies some notes about the lock. Maximum of 512 characters. Changing this forces a new resource to be created. Notes pulumi.StringPtrOutput `pulumi:"notes"` // Specifies the scope at which the Management Lock should be created. Changing this forces a new resource to be created. Scope pulumi.StringOutput `pulumi:"scope"` }
Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource.
## Example Usage ### Subscription Level Lock)
```go package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core" "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/management" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { current, err := core.GetSubscription(ctx, nil, nil) if err != nil { return err } _, err = management.NewLock(ctx, "subscription_level", &management.LockArgs{ Scope: pulumi.String(current.Id), LockLevel: pulumi.String("CanNotDelete"), Notes: pulumi.String("Items can't be deleted in this subscription!"), }) if err != nil { return err } return nil }) }
```
## Example Usage (Resource Group Level Lock)
```go package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core" "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/management" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ Location: pulumi.String("West Europe"), }) if err != nil { return err } _, err = management.NewLock(ctx, "resource_group_level", &management.LockArgs{ Scope: example.ID(), LockLevel: pulumi.String("ReadOnly"), Notes: pulumi.String("This Resource Group is Read-Only"), }) if err != nil { return err } return nil }) }
``` ### Resource Level Lock)
```go package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core" "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/management" "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/network" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ Location: pulumi.String("West Europe"), }) if err != nil { return err } examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ Location: exampleResourceGroup.Location, ResourceGroupName: exampleResourceGroup.Name, AllocationMethod: pulumi.String("Static"), IdleTimeoutInMinutes: pulumi.Int(30), }) if err != nil { return err } _, err = management.NewLock(ctx, "public_ip", &management.LockArgs{ Scope: examplePublicIp.ID(), LockLevel: pulumi.String("CanNotDelete"), Notes: pulumi.String("Locked because it's needed by a third-party"), }) if err != nil { return err } return nil }) }
```
## Import
Management Locks can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:management/lock:Lock lock1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Authorization/locks/lock1
```
func GetLock ¶
func GetLock(ctx *pulumi.Context, name string, id pulumi.IDInput, state *LockState, opts ...pulumi.ResourceOption) (*Lock, error)
GetLock gets an existing Lock 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 NewLock ¶
func NewLock(ctx *pulumi.Context, name string, args *LockArgs, opts ...pulumi.ResourceOption) (*Lock, error)
NewLock registers a new resource with the given unique name, arguments, and options.
func (Lock) ElementType ¶ added in v3.31.1
func (Lock) ToLockOutput ¶ added in v3.31.1
func (i Lock) ToLockOutput() LockOutput
func (Lock) ToLockOutputWithContext ¶ added in v3.31.1
func (i Lock) ToLockOutputWithContext(ctx context.Context) LockOutput
type LockArgs ¶
type LockArgs struct { // Specifies the Level to be used for this Lock. Possible values are `CanNotDelete` and `ReadOnly`. Changing this forces a new resource to be created. LockLevel pulumi.StringInput // Specifies the name of the Management Lock. Changing this forces a new resource to be created. Name pulumi.StringPtrInput // Specifies some notes about the lock. Maximum of 512 characters. Changing this forces a new resource to be created. Notes pulumi.StringPtrInput // Specifies the scope at which the Management Lock should be created. Changing this forces a new resource to be created. Scope pulumi.StringInput }
The set of arguments for constructing a Lock resource.
func (LockArgs) ElementType ¶
type LockInput ¶ added in v3.31.1
type LockInput interface { pulumi.Input ToLockOutput() LockOutput ToLockOutputWithContext(ctx context.Context) LockOutput }
type LockOutput ¶ added in v3.31.1
type LockOutput struct {
*pulumi.OutputState
}
func (LockOutput) ElementType ¶ added in v3.31.1
func (LockOutput) ElementType() reflect.Type
func (LockOutput) ToLockOutput ¶ added in v3.31.1
func (o LockOutput) ToLockOutput() LockOutput
func (LockOutput) ToLockOutputWithContext ¶ added in v3.31.1
func (o LockOutput) ToLockOutputWithContext(ctx context.Context) LockOutput
type LockState ¶
type LockState struct { // Specifies the Level to be used for this Lock. Possible values are `CanNotDelete` and `ReadOnly`. Changing this forces a new resource to be created. LockLevel pulumi.StringPtrInput // Specifies the name of the Management Lock. Changing this forces a new resource to be created. Name pulumi.StringPtrInput // Specifies some notes about the lock. Maximum of 512 characters. Changing this forces a new resource to be created. Notes pulumi.StringPtrInput // Specifies the scope at which the Management Lock should be created. Changing this forces a new resource to be created. Scope pulumi.StringPtrInput }
func (LockState) ElementType ¶
type LookupGroupArgs ¶
type LookupGroupArgs struct { // Specifies the display name of this Management Group. DisplayName *string `pulumi:"displayName"` // Specifies the name or UUID of this Management Group. // // Deprecated: Deprecated in favour of `name` GroupId *string `pulumi:"groupId"` // Specifies the name or UUID of this Management Group. Name *string `pulumi:"name"` }
A collection of arguments for invoking getGroup.
type LookupGroupResult ¶
type LookupGroupResult struct { DisplayName string `pulumi:"displayName"` // Deprecated: Deprecated in favour of `name` GroupId string `pulumi:"groupId"` // The provider-assigned unique ID for this managed resource. Id string `pulumi:"id"` Name string `pulumi:"name"` // The ID of any Parent Management Group. ParentManagementGroupId string `pulumi:"parentManagementGroupId"` // A list of Subscription IDs which are assigned to the Management Group. SubscriptionIds []string `pulumi:"subscriptionIds"` }
A collection of values returned by getGroup.
func LookupGroup ¶
func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.InvokeOption) (*LookupGroupResult, error)
Use this data source to access information about an existing Management Group.
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/management" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { opt0 := "00000000-0000-0000-0000-000000000000" example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ Name: &opt0, }, nil) if err != nil { return err } ctx.Export("displayName", example.DisplayName) return nil }) }
```