managementresource

package
v3.56.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

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.LookupSubscription(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

func (*ManangementLock) ToManangementLockPtrOutput added in v3.47.1

func (i *ManangementLock) ToManangementLockPtrOutput() ManangementLockPtrOutput

func (*ManangementLock) ToManangementLockPtrOutputWithContext added in v3.47.1

func (i *ManangementLock) ToManangementLockPtrOutputWithContext(ctx context.Context) ManangementLockPtrOutput

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 ManangementLockArray added in v3.47.1

type ManangementLockArray []ManangementLockInput

func (ManangementLockArray) ElementType added in v3.47.1

func (ManangementLockArray) ElementType() reflect.Type

func (ManangementLockArray) ToManangementLockArrayOutput added in v3.47.1

func (i ManangementLockArray) ToManangementLockArrayOutput() ManangementLockArrayOutput

func (ManangementLockArray) ToManangementLockArrayOutputWithContext added in v3.47.1

func (i ManangementLockArray) ToManangementLockArrayOutputWithContext(ctx context.Context) ManangementLockArrayOutput

type ManangementLockArrayInput added in v3.47.1

type ManangementLockArrayInput interface {
	pulumi.Input

	ToManangementLockArrayOutput() ManangementLockArrayOutput
	ToManangementLockArrayOutputWithContext(context.Context) ManangementLockArrayOutput
}

ManangementLockArrayInput is an input type that accepts ManangementLockArray and ManangementLockArrayOutput values. You can construct a concrete instance of `ManangementLockArrayInput` via:

ManangementLockArray{ ManangementLockArgs{...} }

type ManangementLockArrayOutput added in v3.47.1

type ManangementLockArrayOutput struct{ *pulumi.OutputState }

func (ManangementLockArrayOutput) ElementType added in v3.47.1

func (ManangementLockArrayOutput) ElementType() reflect.Type

func (ManangementLockArrayOutput) Index added in v3.47.1

func (ManangementLockArrayOutput) ToManangementLockArrayOutput added in v3.47.1

func (o ManangementLockArrayOutput) ToManangementLockArrayOutput() ManangementLockArrayOutput

func (ManangementLockArrayOutput) ToManangementLockArrayOutputWithContext added in v3.47.1

func (o ManangementLockArrayOutput) ToManangementLockArrayOutputWithContext(ctx context.Context) ManangementLockArrayOutput

type ManangementLockInput added in v3.31.1

type ManangementLockInput interface {
	pulumi.Input

	ToManangementLockOutput() ManangementLockOutput
	ToManangementLockOutputWithContext(ctx context.Context) ManangementLockOutput
}

type ManangementLockMap added in v3.47.1

type ManangementLockMap map[string]ManangementLockInput

func (ManangementLockMap) ElementType added in v3.47.1

func (ManangementLockMap) ElementType() reflect.Type

func (ManangementLockMap) ToManangementLockMapOutput added in v3.47.1

func (i ManangementLockMap) ToManangementLockMapOutput() ManangementLockMapOutput

func (ManangementLockMap) ToManangementLockMapOutputWithContext added in v3.47.1

func (i ManangementLockMap) ToManangementLockMapOutputWithContext(ctx context.Context) ManangementLockMapOutput

type ManangementLockMapInput added in v3.47.1

type ManangementLockMapInput interface {
	pulumi.Input

	ToManangementLockMapOutput() ManangementLockMapOutput
	ToManangementLockMapOutputWithContext(context.Context) ManangementLockMapOutput
}

ManangementLockMapInput is an input type that accepts ManangementLockMap and ManangementLockMapOutput values. You can construct a concrete instance of `ManangementLockMapInput` via:

ManangementLockMap{ "key": ManangementLockArgs{...} }

type ManangementLockMapOutput added in v3.47.1

type ManangementLockMapOutput struct{ *pulumi.OutputState }

func (ManangementLockMapOutput) ElementType added in v3.47.1

func (ManangementLockMapOutput) ElementType() reflect.Type

func (ManangementLockMapOutput) MapIndex added in v3.47.1

func (ManangementLockMapOutput) ToManangementLockMapOutput added in v3.47.1

func (o ManangementLockMapOutput) ToManangementLockMapOutput() ManangementLockMapOutput

func (ManangementLockMapOutput) ToManangementLockMapOutputWithContext added in v3.47.1

func (o ManangementLockMapOutput) ToManangementLockMapOutputWithContext(ctx context.Context) ManangementLockMapOutput

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

func (ManangementLockOutput) ToManangementLockPtrOutput added in v3.47.1

func (o ManangementLockOutput) ToManangementLockPtrOutput() ManangementLockPtrOutput

func (ManangementLockOutput) ToManangementLockPtrOutputWithContext added in v3.47.1

func (o ManangementLockOutput) ToManangementLockPtrOutputWithContext(ctx context.Context) ManangementLockPtrOutput

type ManangementLockPtrInput added in v3.47.1

type ManangementLockPtrInput interface {
	pulumi.Input

	ToManangementLockPtrOutput() ManangementLockPtrOutput
	ToManangementLockPtrOutputWithContext(ctx context.Context) ManangementLockPtrOutput
}

type ManangementLockPtrOutput added in v3.47.1

type ManangementLockPtrOutput struct {
	*pulumi.OutputState
}

func (ManangementLockPtrOutput) ElementType added in v3.47.1

func (ManangementLockPtrOutput) ElementType() reflect.Type

func (ManangementLockPtrOutput) ToManangementLockPtrOutput added in v3.47.1

func (o ManangementLockPtrOutput) ToManangementLockPtrOutput() ManangementLockPtrOutput

func (ManangementLockPtrOutput) ToManangementLockPtrOutputWithContext added in v3.47.1

func (o ManangementLockPtrOutput) ToManangementLockPtrOutputWithContext(ctx context.Context) ManangementLockPtrOutput

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

Jump to

Keyboard shortcuts

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