1. Packages
  2. UpCloud
  3. API Docs
  4. ManagedObjectStorageUserPolicy
UpCloud v0.1.0 published on Friday, Mar 14, 2025 by UpCloudLtd

upcloud.ManagedObjectStorageUserPolicy

Explore with Pulumi AI

This resource represents an UpCloud Managed Object Storage user policy attachment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";

const _this = new upcloud.ManagedObjectStorage("this", {
    name: "example",
    region: "europe-1",
    configuredStatus: "started",
});
const thisManagedObjectStoragePolicy = new upcloud.ManagedObjectStoragePolicy("this", {
    name: "example",
    description: "example description",
    document: "%7B%22Version%22%3A%20%222012-10-17%22%2C%20%20%22Statement%22%3A%20%5B%7B%22Action%22%3A%20%5B%22iam%3AGetUser%22%5D%2C%20%22Resource%22%3A%20%22%2A%22%2C%20%22Effect%22%3A%20%22Allow%22%2C%20%22Sid%22%3A%20%22editor%22%7D%5D%7D",
    serviceUuid: _this.id,
});
const thisManagedObjectStorageUser = new upcloud.ManagedObjectStorageUser("this", {
    username: "example",
    serviceUuid: _this.id,
});
const thisManagedObjectStorageUserPolicy = new upcloud.ManagedObjectStorageUserPolicy("this", {
    username: thisManagedObjectStorageUser.username,
    serviceUuid: _this.id,
    name: thisManagedObjectStoragePolicy.name,
});
Copy
import pulumi
import pulumi_upcloud as upcloud

this = upcloud.ManagedObjectStorage("this",
    name="example",
    region="europe-1",
    configured_status="started")
this_managed_object_storage_policy = upcloud.ManagedObjectStoragePolicy("this",
    name="example",
    description="example description",
    document="%7B%22Version%22%3A%20%222012-10-17%22%2C%20%20%22Statement%22%3A%20%5B%7B%22Action%22%3A%20%5B%22iam%3AGetUser%22%5D%2C%20%22Resource%22%3A%20%22%2A%22%2C%20%22Effect%22%3A%20%22Allow%22%2C%20%22Sid%22%3A%20%22editor%22%7D%5D%7D",
    service_uuid=this.id)
this_managed_object_storage_user = upcloud.ManagedObjectStorageUser("this",
    username="example",
    service_uuid=this.id)
this_managed_object_storage_user_policy = upcloud.ManagedObjectStorageUserPolicy("this",
    username=this_managed_object_storage_user.username,
    service_uuid=this.id,
    name=this_managed_object_storage_policy.name)
Copy
package main

import (
	"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		this, err := upcloud.NewManagedObjectStorage(ctx, "this", &upcloud.ManagedObjectStorageArgs{
			Name:             pulumi.String("example"),
			Region:           pulumi.String("europe-1"),
			ConfiguredStatus: pulumi.String("started"),
		})
		if err != nil {
			return err
		}
		thisManagedObjectStoragePolicy, err := upcloud.NewManagedObjectStoragePolicy(ctx, "this", &upcloud.ManagedObjectStoragePolicyArgs{
			Name:        pulumi.String("example"),
			Description: pulumi.String("example description"),
			Document:    pulumi.String("%7B%22Version%22%3A%20%222012-10-17%22%2C%20%20%22Statement%22%3A%20%5B%7B%22Action%22%3A%20%5B%22iam%3AGetUser%22%5D%2C%20%22Resource%22%3A%20%22%2A%22%2C%20%22Effect%22%3A%20%22Allow%22%2C%20%22Sid%22%3A%20%22editor%22%7D%5D%7D"),
			ServiceUuid: this.ID(),
		})
		if err != nil {
			return err
		}
		thisManagedObjectStorageUser, err := upcloud.NewManagedObjectStorageUser(ctx, "this", &upcloud.ManagedObjectStorageUserArgs{
			Username:    pulumi.String("example"),
			ServiceUuid: this.ID(),
		})
		if err != nil {
			return err
		}
		_, err = upcloud.NewManagedObjectStorageUserPolicy(ctx, "this", &upcloud.ManagedObjectStorageUserPolicyArgs{
			Username:    thisManagedObjectStorageUser.Username,
			ServiceUuid: this.ID(),
			Name:        thisManagedObjectStoragePolicy.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;

return await Deployment.RunAsync(() => 
{
    var @this = new UpCloud.ManagedObjectStorage("this", new()
    {
        Name = "example",
        Region = "europe-1",
        ConfiguredStatus = "started",
    });

    var thisManagedObjectStoragePolicy = new UpCloud.ManagedObjectStoragePolicy("this", new()
    {
        Name = "example",
        Description = "example description",
        Document = "%7B%22Version%22%3A%20%222012-10-17%22%2C%20%20%22Statement%22%3A%20%5B%7B%22Action%22%3A%20%5B%22iam%3AGetUser%22%5D%2C%20%22Resource%22%3A%20%22%2A%22%2C%20%22Effect%22%3A%20%22Allow%22%2C%20%22Sid%22%3A%20%22editor%22%7D%5D%7D",
        ServiceUuid = @this.Id,
    });

    var thisManagedObjectStorageUser = new UpCloud.ManagedObjectStorageUser("this", new()
    {
        Username = "example",
        ServiceUuid = @this.Id,
    });

    var thisManagedObjectStorageUserPolicy = new UpCloud.ManagedObjectStorageUserPolicy("this", new()
    {
        Username = thisManagedObjectStorageUser.Username,
        ServiceUuid = @this.Id,
        Name = thisManagedObjectStoragePolicy.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.ManagedObjectStorage;
import com.pulumi.upcloud.ManagedObjectStorageArgs;
import com.pulumi.upcloud.ManagedObjectStoragePolicy;
import com.pulumi.upcloud.ManagedObjectStoragePolicyArgs;
import com.pulumi.upcloud.ManagedObjectStorageUser;
import com.pulumi.upcloud.ManagedObjectStorageUserArgs;
import com.pulumi.upcloud.ManagedObjectStorageUserPolicy;
import com.pulumi.upcloud.ManagedObjectStorageUserPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var this_ = new ManagedObjectStorage("this", ManagedObjectStorageArgs.builder()
            .name("example")
            .region("europe-1")
            .configuredStatus("started")
            .build());

        var thisManagedObjectStoragePolicy = new ManagedObjectStoragePolicy("thisManagedObjectStoragePolicy", ManagedObjectStoragePolicyArgs.builder()
            .name("example")
            .description("example description")
            .document("%7B%22Version%22%3A%20%222012-10-17%22%2C%20%20%22Statement%22%3A%20%5B%7B%22Action%22%3A%20%5B%22iam%3AGetUser%22%5D%2C%20%22Resource%22%3A%20%22%2A%22%2C%20%22Effect%22%3A%20%22Allow%22%2C%20%22Sid%22%3A%20%22editor%22%7D%5D%7D")
            .serviceUuid(this_.id())
            .build());

        var thisManagedObjectStorageUser = new ManagedObjectStorageUser("thisManagedObjectStorageUser", ManagedObjectStorageUserArgs.builder()
            .username("example")
            .serviceUuid(this_.id())
            .build());

        var thisManagedObjectStorageUserPolicy = new ManagedObjectStorageUserPolicy("thisManagedObjectStorageUserPolicy", ManagedObjectStorageUserPolicyArgs.builder()
            .username(thisManagedObjectStorageUser.username())
            .serviceUuid(this_.id())
            .name(thisManagedObjectStoragePolicy.name())
            .build());

    }
}
Copy
resources:
  this:
    type: upcloud:ManagedObjectStorage
    properties:
      name: example
      region: europe-1
      configuredStatus: started
  thisManagedObjectStoragePolicy:
    type: upcloud:ManagedObjectStoragePolicy
    name: this
    properties:
      name: example
      description: example description
      document: '%7B%22Version%22%3A%20%222012-10-17%22%2C%20%20%22Statement%22%3A%20%5B%7B%22Action%22%3A%20%5B%22iam%3AGetUser%22%5D%2C%20%22Resource%22%3A%20%22%2A%22%2C%20%22Effect%22%3A%20%22Allow%22%2C%20%22Sid%22%3A%20%22editor%22%7D%5D%7D'
      serviceUuid: ${this.id}
  thisManagedObjectStorageUser:
    type: upcloud:ManagedObjectStorageUser
    name: this
    properties:
      username: example
      serviceUuid: ${this.id}
  thisManagedObjectStorageUserPolicy:
    type: upcloud:ManagedObjectStorageUserPolicy
    name: this
    properties:
      username: ${thisManagedObjectStorageUser.username}
      serviceUuid: ${this.id}
      name: ${thisManagedObjectStoragePolicy.name}
Copy

Create ManagedObjectStorageUserPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ManagedObjectStorageUserPolicy(name: string, args: ManagedObjectStorageUserPolicyArgs, opts?: CustomResourceOptions);
@overload
def ManagedObjectStorageUserPolicy(resource_name: str,
                                   args: ManagedObjectStorageUserPolicyArgs,
                                   opts: Optional[ResourceOptions] = None)

@overload
def ManagedObjectStorageUserPolicy(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   service_uuid: Optional[str] = None,
                                   username: Optional[str] = None,
                                   name: Optional[str] = None)
func NewManagedObjectStorageUserPolicy(ctx *Context, name string, args ManagedObjectStorageUserPolicyArgs, opts ...ResourceOption) (*ManagedObjectStorageUserPolicy, error)
public ManagedObjectStorageUserPolicy(string name, ManagedObjectStorageUserPolicyArgs args, CustomResourceOptions? opts = null)
public ManagedObjectStorageUserPolicy(String name, ManagedObjectStorageUserPolicyArgs args)
public ManagedObjectStorageUserPolicy(String name, ManagedObjectStorageUserPolicyArgs args, CustomResourceOptions options)
type: upcloud:ManagedObjectStorageUserPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ManagedObjectStorageUserPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ManagedObjectStorageUserPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ManagedObjectStorageUserPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ManagedObjectStorageUserPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ManagedObjectStorageUserPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var managedObjectStorageUserPolicyResource = new UpCloud.ManagedObjectStorageUserPolicy("managedObjectStorageUserPolicyResource", new()
{
    ServiceUuid = "string",
    Username = "string",
    Name = "string",
});
Copy
example, err := upcloud.NewManagedObjectStorageUserPolicy(ctx, "managedObjectStorageUserPolicyResource", &upcloud.ManagedObjectStorageUserPolicyArgs{
	ServiceUuid: pulumi.String("string"),
	Username:    pulumi.String("string"),
	Name:        pulumi.String("string"),
})
Copy
var managedObjectStorageUserPolicyResource = new ManagedObjectStorageUserPolicy("managedObjectStorageUserPolicyResource", ManagedObjectStorageUserPolicyArgs.builder()
    .serviceUuid("string")
    .username("string")
    .name("string")
    .build());
Copy
managed_object_storage_user_policy_resource = upcloud.ManagedObjectStorageUserPolicy("managedObjectStorageUserPolicyResource",
    service_uuid="string",
    username="string",
    name="string")
Copy
const managedObjectStorageUserPolicyResource = new upcloud.ManagedObjectStorageUserPolicy("managedObjectStorageUserPolicyResource", {
    serviceUuid: "string",
    username: "string",
    name: "string",
});
Copy
type: upcloud:ManagedObjectStorageUserPolicy
properties:
    name: string
    serviceUuid: string
    username: string
Copy

ManagedObjectStorageUserPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ManagedObjectStorageUserPolicy resource accepts the following input properties:

ServiceUuid
This property is required.
Changes to this property will trigger replacement.
string
Managed Object Storage service UUID.
Username
This property is required.
Changes to this property will trigger replacement.
string
Username.
Name Changes to this property will trigger replacement. string
Policy name.
ServiceUuid
This property is required.
Changes to this property will trigger replacement.
string
Managed Object Storage service UUID.
Username
This property is required.
Changes to this property will trigger replacement.
string
Username.
Name Changes to this property will trigger replacement. string
Policy name.
serviceUuid
This property is required.
Changes to this property will trigger replacement.
String
Managed Object Storage service UUID.
username
This property is required.
Changes to this property will trigger replacement.
String
Username.
name Changes to this property will trigger replacement. String
Policy name.
serviceUuid
This property is required.
Changes to this property will trigger replacement.
string
Managed Object Storage service UUID.
username
This property is required.
Changes to this property will trigger replacement.
string
Username.
name Changes to this property will trigger replacement. string
Policy name.
service_uuid
This property is required.
Changes to this property will trigger replacement.
str
Managed Object Storage service UUID.
username
This property is required.
Changes to this property will trigger replacement.
str
Username.
name Changes to this property will trigger replacement. str
Policy name.
serviceUuid
This property is required.
Changes to this property will trigger replacement.
String
Managed Object Storage service UUID.
username
This property is required.
Changes to this property will trigger replacement.
String
Username.
name Changes to this property will trigger replacement. String
Policy name.

Outputs

All input properties are implicitly available as output properties. Additionally, the ManagedObjectStorageUserPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ManagedObjectStorageUserPolicy Resource

Get an existing ManagedObjectStorageUserPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ManagedObjectStorageUserPolicyState, opts?: CustomResourceOptions): ManagedObjectStorageUserPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        service_uuid: Optional[str] = None,
        username: Optional[str] = None) -> ManagedObjectStorageUserPolicy
func GetManagedObjectStorageUserPolicy(ctx *Context, name string, id IDInput, state *ManagedObjectStorageUserPolicyState, opts ...ResourceOption) (*ManagedObjectStorageUserPolicy, error)
public static ManagedObjectStorageUserPolicy Get(string name, Input<string> id, ManagedObjectStorageUserPolicyState? state, CustomResourceOptions? opts = null)
public static ManagedObjectStorageUserPolicy get(String name, Output<String> id, ManagedObjectStorageUserPolicyState state, CustomResourceOptions options)
resources:  _:    type: upcloud:ManagedObjectStorageUserPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Name Changes to this property will trigger replacement. string
Policy name.
ServiceUuid Changes to this property will trigger replacement. string
Managed Object Storage service UUID.
Username Changes to this property will trigger replacement. string
Username.
Name Changes to this property will trigger replacement. string
Policy name.
ServiceUuid Changes to this property will trigger replacement. string
Managed Object Storage service UUID.
Username Changes to this property will trigger replacement. string
Username.
name Changes to this property will trigger replacement. String
Policy name.
serviceUuid Changes to this property will trigger replacement. String
Managed Object Storage service UUID.
username Changes to this property will trigger replacement. String
Username.
name Changes to this property will trigger replacement. string
Policy name.
serviceUuid Changes to this property will trigger replacement. string
Managed Object Storage service UUID.
username Changes to this property will trigger replacement. string
Username.
name Changes to this property will trigger replacement. str
Policy name.
service_uuid Changes to this property will trigger replacement. str
Managed Object Storage service UUID.
username Changes to this property will trigger replacement. str
Username.
name Changes to this property will trigger replacement. String
Policy name.
serviceUuid Changes to this property will trigger replacement. String
Managed Object Storage service UUID.
username Changes to this property will trigger replacement. String
Username.

Package Details

Repository
upcloud UpCloudLtd/pulumi-upcloud
License
Apache-2.0
Notes
This Pulumi package is based on the upcloud Terraform Provider.