managementresource

package
v5.85.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 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.
	//
	// > **Note:** `CanNotDelete` means authorized users are able to read and modify the resources, but not delete. `ReadOnly` means authorized users can only read from a resource, but they can't modify or delete it.
	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/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
"github.com/pulumi/pulumi/sdk/v3/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{
			Name:      pulumi.String("subscription-level"),
			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
	})
}

```

### Resource Group Level Lock)

```go package main

import (

"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
"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("locked-resource-group"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		_, err = management.NewLock(ctx, "resource-group-level", &management.LockArgs{
			Name:      pulumi.String("resource-group-level"),
			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/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
"github.com/pulumi/pulumi-azure/sdk/v5/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("locked-resource-group"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
			Name:                 pulumi.String("locked-publicip"),
			Location:             example.Location,
			ResourceGroupName:    example.Name,
			AllocationMethod:     pulumi.String("Static"),
			IdleTimeoutInMinutes: pulumi.Int(30),
		})
		if err != nil {
			return err
		}
		_, err = management.NewLock(ctx, "public-ip", &management.LockArgs{
			Name:      pulumi.String("resource-ip"),
			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

func (*ManangementLock) ElementType() reflect.Type

func (*ManangementLock) ToManangementLockOutput

func (i *ManangementLock) ToManangementLockOutput() ManangementLockOutput

func (*ManangementLock) ToManangementLockOutputWithContext

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.
	//
	// > **Note:** `CanNotDelete` means authorized users are able to read and modify the resources, but not delete. `ReadOnly` means authorized users can only read from a resource, but they can't modify or delete it.
	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

type ManangementLockArray []ManangementLockInput

func (ManangementLockArray) ElementType

func (ManangementLockArray) ElementType() reflect.Type

func (ManangementLockArray) ToManangementLockArrayOutput

func (i ManangementLockArray) ToManangementLockArrayOutput() ManangementLockArrayOutput

func (ManangementLockArray) ToManangementLockArrayOutputWithContext

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

type ManangementLockArrayInput

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

type ManangementLockArrayOutput struct{ *pulumi.OutputState }

func (ManangementLockArrayOutput) ElementType

func (ManangementLockArrayOutput) ElementType() reflect.Type

func (ManangementLockArrayOutput) Index

func (ManangementLockArrayOutput) ToManangementLockArrayOutput

func (o ManangementLockArrayOutput) ToManangementLockArrayOutput() ManangementLockArrayOutput

func (ManangementLockArrayOutput) ToManangementLockArrayOutputWithContext

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

type ManangementLockInput

type ManangementLockInput interface {
	pulumi.Input

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

type ManangementLockMap

type ManangementLockMap map[string]ManangementLockInput

func (ManangementLockMap) ElementType

func (ManangementLockMap) ElementType() reflect.Type

func (ManangementLockMap) ToManangementLockMapOutput

func (i ManangementLockMap) ToManangementLockMapOutput() ManangementLockMapOutput

func (ManangementLockMap) ToManangementLockMapOutputWithContext

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

type ManangementLockMapInput

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

type ManangementLockMapOutput struct{ *pulumi.OutputState }

func (ManangementLockMapOutput) ElementType

func (ManangementLockMapOutput) ElementType() reflect.Type

func (ManangementLockMapOutput) MapIndex

func (ManangementLockMapOutput) ToManangementLockMapOutput

func (o ManangementLockMapOutput) ToManangementLockMapOutput() ManangementLockMapOutput

func (ManangementLockMapOutput) ToManangementLockMapOutputWithContext

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

type ManangementLockOutput

type ManangementLockOutput struct{ *pulumi.OutputState }

func (ManangementLockOutput) ElementType

func (ManangementLockOutput) ElementType() reflect.Type

func (ManangementLockOutput) LockLevel added in v5.5.0

Specifies the Level to be used for this Lock. Possible values are `CanNotDelete` and `ReadOnly`. Changing this forces a new resource to be created.

> **Note:** `CanNotDelete` means authorized users are able to read and modify the resources, but not delete. `ReadOnly` means authorized users can only read from a resource, but they can't modify or delete it.

func (ManangementLockOutput) Name added in v5.5.0

Specifies the name of the Management Lock. Changing this forces a new resource to be created.

func (ManangementLockOutput) Notes added in v5.5.0

Specifies some notes about the lock. Maximum of 512 characters. Changing this forces a new resource to be created.

func (ManangementLockOutput) Scope added in v5.5.0

Specifies the scope at which the Management Lock should be created. Changing this forces a new resource to be created.

func (ManangementLockOutput) ToManangementLockOutput

func (o ManangementLockOutput) ToManangementLockOutput() ManangementLockOutput

func (ManangementLockOutput) ToManangementLockOutputWithContext

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.
	//
	// > **Note:** `CanNotDelete` means authorized users are able to read and modify the resources, but not delete. `ReadOnly` means authorized users can only read from a resource, but they can't modify or delete it.
	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