Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManangementLock
deprecated
type ManangementLock 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:managementresource/manangementLock:ManangementLock lock1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Authorization/locks/lock1
```
Deprecated: azure.managementresource.ManangementLock has been deprecated in favor of azure.management.Lock
func GetManangementLock ¶
func GetManangementLock(ctx *pulumi.Context, name string, id pulumi.IDInput, state *ManangementLockState, opts ...pulumi.ResourceOption) (*ManangementLock, error)
GetManangementLock gets an existing ManangementLock 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 NewManangementLock ¶
func NewManangementLock(ctx *pulumi.Context, name string, args *ManangementLockArgs, opts ...pulumi.ResourceOption) (*ManangementLock, error)
NewManangementLock registers a new resource with the given unique name, arguments, and options.
func (ManangementLock) ElementType ¶ added in v3.31.1
func (ManangementLock) ElementType() reflect.Type
func (ManangementLock) ToManangementLockOutput ¶ added in v3.31.1
func (i ManangementLock) ToManangementLockOutput() ManangementLockOutput
func (ManangementLock) ToManangementLockOutputWithContext ¶ added in v3.31.1
func (i ManangementLock) ToManangementLockOutputWithContext(ctx context.Context) ManangementLockOutput
type ManangementLockArgs ¶
type ManangementLockArgs 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 ManangementLock resource.
func (ManangementLockArgs) ElementType ¶
func (ManangementLockArgs) ElementType() reflect.Type
type ManangementLockInput ¶ added in v3.31.1
type ManangementLockInput interface { pulumi.Input ToManangementLockOutput() ManangementLockOutput ToManangementLockOutputWithContext(ctx context.Context) ManangementLockOutput }
type ManangementLockOutput ¶ added in v3.31.1
type ManangementLockOutput struct {
*pulumi.OutputState
}
func (ManangementLockOutput) ElementType ¶ added in v3.31.1
func (ManangementLockOutput) ElementType() reflect.Type
func (ManangementLockOutput) ToManangementLockOutput ¶ added in v3.31.1
func (o ManangementLockOutput) ToManangementLockOutput() ManangementLockOutput
func (ManangementLockOutput) ToManangementLockOutputWithContext ¶ added in v3.31.1
func (o ManangementLockOutput) ToManangementLockOutputWithContext(ctx context.Context) ManangementLockOutput
type ManangementLockState ¶
type ManangementLockState 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 (ManangementLockState) ElementType ¶
func (ManangementLockState) ElementType() reflect.Type