1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. Share
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.Share

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    Manages Shares and list shares permissions granted to the group members for each shared resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const exampleDatacenter = new ionoscloud.Datacenter("exampleDatacenter", {
        location: "us/las",
        description: "Datacenter Description",
        secAuthProtection: false,
    });
    const exampleGroup = new ionoscloud.Group("exampleGroup", {
        createDatacenter: true,
        createSnapshot: true,
        reserveIp: true,
        accessActivityLog: true,
        createPcc: true,
        s3Privilege: true,
        createBackupUnit: true,
        createInternetAccess: true,
        createK8sCluster: true,
    });
    const exampleShare = new ionoscloud.Share("exampleShare", {
        groupId: exampleGroup.groupId,
        resourceId: exampleDatacenter.datacenterId,
        editPrivilege: true,
        sharePrivilege: false,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example_datacenter = ionoscloud.Datacenter("exampleDatacenter",
        location="us/las",
        description="Datacenter Description",
        sec_auth_protection=False)
    example_group = ionoscloud.Group("exampleGroup",
        create_datacenter=True,
        create_snapshot=True,
        reserve_ip=True,
        access_activity_log=True,
        create_pcc=True,
        s3_privilege=True,
        create_backup_unit=True,
        create_internet_access=True,
        create_k8s_cluster=True)
    example_share = ionoscloud.Share("exampleShare",
        group_id=example_group.group_id,
        resource_id=example_datacenter.datacenter_id,
        edit_privilege=True,
        share_privilege=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleDatacenter, err := ionoscloud.NewDatacenter(ctx, "exampleDatacenter", &ionoscloud.DatacenterArgs{
    			Location:          pulumi.String("us/las"),
    			Description:       pulumi.String("Datacenter Description"),
    			SecAuthProtection: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		exampleGroup, err := ionoscloud.NewGroup(ctx, "exampleGroup", &ionoscloud.GroupArgs{
    			CreateDatacenter:     pulumi.Bool(true),
    			CreateSnapshot:       pulumi.Bool(true),
    			ReserveIp:            pulumi.Bool(true),
    			AccessActivityLog:    pulumi.Bool(true),
    			CreatePcc:            pulumi.Bool(true),
    			S3Privilege:          pulumi.Bool(true),
    			CreateBackupUnit:     pulumi.Bool(true),
    			CreateInternetAccess: pulumi.Bool(true),
    			CreateK8sCluster:     pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ionoscloud.NewShare(ctx, "exampleShare", &ionoscloud.ShareArgs{
    			GroupId:        exampleGroup.GroupId,
    			ResourceId:     exampleDatacenter.DatacenterId,
    			EditPrivilege:  pulumi.Bool(true),
    			SharePrivilege: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleDatacenter = new Ionoscloud.Datacenter("exampleDatacenter", new()
        {
            Location = "us/las",
            Description = "Datacenter Description",
            SecAuthProtection = false,
        });
    
        var exampleGroup = new Ionoscloud.Group("exampleGroup", new()
        {
            CreateDatacenter = true,
            CreateSnapshot = true,
            ReserveIp = true,
            AccessActivityLog = true,
            CreatePcc = true,
            S3Privilege = true,
            CreateBackupUnit = true,
            CreateInternetAccess = true,
            CreateK8sCluster = true,
        });
    
        var exampleShare = new Ionoscloud.Share("exampleShare", new()
        {
            GroupId = exampleGroup.GroupId,
            ResourceId = exampleDatacenter.DatacenterId,
            EditPrivilege = true,
            SharePrivilege = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.Datacenter;
    import com.pulumi.ionoscloud.DatacenterArgs;
    import com.pulumi.ionoscloud.Group;
    import com.pulumi.ionoscloud.GroupArgs;
    import com.pulumi.ionoscloud.Share;
    import com.pulumi.ionoscloud.ShareArgs;
    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 exampleDatacenter = new Datacenter("exampleDatacenter", DatacenterArgs.builder()
                .location("us/las")
                .description("Datacenter Description")
                .secAuthProtection(false)
                .build());
    
            var exampleGroup = new Group("exampleGroup", GroupArgs.builder()
                .createDatacenter(true)
                .createSnapshot(true)
                .reserveIp(true)
                .accessActivityLog(true)
                .createPcc(true)
                .s3Privilege(true)
                .createBackupUnit(true)
                .createInternetAccess(true)
                .createK8sCluster(true)
                .build());
    
            var exampleShare = new Share("exampleShare", ShareArgs.builder()
                .groupId(exampleGroup.groupId())
                .resourceId(exampleDatacenter.datacenterId())
                .editPrivilege(true)
                .sharePrivilege(false)
                .build());
    
        }
    }
    
    resources:
      exampleDatacenter:
        type: ionoscloud:Datacenter
        properties:
          location: us/las
          description: Datacenter Description
          secAuthProtection: false
      exampleGroup:
        type: ionoscloud:Group
        properties:
          createDatacenter: true
          createSnapshot: true
          reserveIp: true
          accessActivityLog: true
          createPcc: true
          s3Privilege: true
          createBackupUnit: true
          createInternetAccess: true
          createK8sCluster: true
      exampleShare:
        type: ionoscloud:Share
        properties:
          groupId: ${exampleGroup.groupId}
          resourceId: ${exampleDatacenter.datacenterId}
          editPrivilege: true
          sharePrivilege: false
    

    Create Share Resource

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

    Constructor syntax

    new Share(name: string, args: ShareArgs, opts?: CustomResourceOptions);
    @overload
    def Share(resource_name: str,
              args: ShareArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Share(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              group_id: Optional[str] = None,
              resource_id: Optional[str] = None,
              edit_privilege: Optional[bool] = None,
              share_id: Optional[str] = None,
              share_privilege: Optional[bool] = None,
              timeouts: Optional[ShareTimeoutsArgs] = None)
    func NewShare(ctx *Context, name string, args ShareArgs, opts ...ResourceOption) (*Share, error)
    public Share(string name, ShareArgs args, CustomResourceOptions? opts = null)
    public Share(String name, ShareArgs args)
    public Share(String name, ShareArgs args, CustomResourceOptions options)
    
    type: ionoscloud:Share
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ShareArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ShareArgs
    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 shareResource = new Ionoscloud.Share("shareResource", new()
    {
        GroupId = "string",
        ResourceId = "string",
        EditPrivilege = false,
        ShareId = "string",
        SharePrivilege = false,
        Timeouts = new Ionoscloud.Inputs.ShareTimeoutsArgs
        {
            Create = "string",
            Default = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ionoscloud.NewShare(ctx, "shareResource", &ionoscloud.ShareArgs{
    	GroupId:        pulumi.String("string"),
    	ResourceId:     pulumi.String("string"),
    	EditPrivilege:  pulumi.Bool(false),
    	ShareId:        pulumi.String("string"),
    	SharePrivilege: pulumi.Bool(false),
    	Timeouts: &ionoscloud.ShareTimeoutsArgs{
    		Create:  pulumi.String("string"),
    		Default: pulumi.String("string"),
    		Delete:  pulumi.String("string"),
    		Update:  pulumi.String("string"),
    	},
    })
    
    var shareResource = new Share("shareResource", ShareArgs.builder()
        .groupId("string")
        .resourceId("string")
        .editPrivilege(false)
        .shareId("string")
        .sharePrivilege(false)
        .timeouts(ShareTimeoutsArgs.builder()
            .create("string")
            .default_("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    share_resource = ionoscloud.Share("shareResource",
        group_id="string",
        resource_id="string",
        edit_privilege=False,
        share_id="string",
        share_privilege=False,
        timeouts={
            "create": "string",
            "default": "string",
            "delete": "string",
            "update": "string",
        })
    
    const shareResource = new ionoscloud.Share("shareResource", {
        groupId: "string",
        resourceId: "string",
        editPrivilege: false,
        shareId: "string",
        sharePrivilege: false,
        timeouts: {
            create: "string",
            "default": "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ionoscloud:Share
    properties:
        editPrivilege: false
        groupId: string
        resourceId: string
        shareId: string
        sharePrivilege: false
        timeouts:
            create: string
            default: string
            delete: string
            update: string
    

    Share 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 Share resource accepts the following input properties:

    GroupId string
    [string] The ID of the specific group containing the resource to update.
    ResourceId string
    [string] The ID of the specific resource to update.
    EditPrivilege bool
    [Boolean] The group has permission to edit privileges on this resource.
    ShareId string
    SharePrivilege bool

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    Timeouts ShareTimeouts
    GroupId string
    [string] The ID of the specific group containing the resource to update.
    ResourceId string
    [string] The ID of the specific resource to update.
    EditPrivilege bool
    [Boolean] The group has permission to edit privileges on this resource.
    ShareId string
    SharePrivilege bool

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    Timeouts ShareTimeoutsArgs
    groupId String
    [string] The ID of the specific group containing the resource to update.
    resourceId String
    [string] The ID of the specific resource to update.
    editPrivilege Boolean
    [Boolean] The group has permission to edit privileges on this resource.
    shareId String
    sharePrivilege Boolean

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts ShareTimeouts
    groupId string
    [string] The ID of the specific group containing the resource to update.
    resourceId string
    [string] The ID of the specific resource to update.
    editPrivilege boolean
    [Boolean] The group has permission to edit privileges on this resource.
    shareId string
    sharePrivilege boolean

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts ShareTimeouts
    group_id str
    [string] The ID of the specific group containing the resource to update.
    resource_id str
    [string] The ID of the specific resource to update.
    edit_privilege bool
    [Boolean] The group has permission to edit privileges on this resource.
    share_id str
    share_privilege bool

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts ShareTimeoutsArgs
    groupId String
    [string] The ID of the specific group containing the resource to update.
    resourceId String
    [string] The ID of the specific resource to update.
    editPrivilege Boolean
    [Boolean] The group has permission to edit privileges on this resource.
    shareId String
    sharePrivilege Boolean

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Share 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 Share Resource

    Get an existing Share 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?: ShareState, opts?: CustomResourceOptions): Share
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            edit_privilege: Optional[bool] = None,
            group_id: Optional[str] = None,
            resource_id: Optional[str] = None,
            share_id: Optional[str] = None,
            share_privilege: Optional[bool] = None,
            timeouts: Optional[ShareTimeoutsArgs] = None) -> Share
    func GetShare(ctx *Context, name string, id IDInput, state *ShareState, opts ...ResourceOption) (*Share, error)
    public static Share Get(string name, Input<string> id, ShareState? state, CustomResourceOptions? opts = null)
    public static Share get(String name, Output<String> id, ShareState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:Share    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    EditPrivilege bool
    [Boolean] The group has permission to edit privileges on this resource.
    GroupId string
    [string] The ID of the specific group containing the resource to update.
    ResourceId string
    [string] The ID of the specific resource to update.
    ShareId string
    SharePrivilege bool

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    Timeouts ShareTimeouts
    EditPrivilege bool
    [Boolean] The group has permission to edit privileges on this resource.
    GroupId string
    [string] The ID of the specific group containing the resource to update.
    ResourceId string
    [string] The ID of the specific resource to update.
    ShareId string
    SharePrivilege bool

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    Timeouts ShareTimeoutsArgs
    editPrivilege Boolean
    [Boolean] The group has permission to edit privileges on this resource.
    groupId String
    [string] The ID of the specific group containing the resource to update.
    resourceId String
    [string] The ID of the specific resource to update.
    shareId String
    sharePrivilege Boolean

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts ShareTimeouts
    editPrivilege boolean
    [Boolean] The group has permission to edit privileges on this resource.
    groupId string
    [string] The ID of the specific group containing the resource to update.
    resourceId string
    [string] The ID of the specific resource to update.
    shareId string
    sharePrivilege boolean

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts ShareTimeouts
    edit_privilege bool
    [Boolean] The group has permission to edit privileges on this resource.
    group_id str
    [string] The ID of the specific group containing the resource to update.
    resource_id str
    [string] The ID of the specific resource to update.
    share_id str
    share_privilege bool

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts ShareTimeoutsArgs
    editPrivilege Boolean
    [Boolean] The group has permission to edit privileges on this resource.
    groupId String
    [string] The ID of the specific group containing the resource to update.
    resourceId String
    [string] The ID of the specific resource to update.
    shareId String
    sharePrivilege Boolean

    [Boolean] The group has permission to share this resource.

    ⚠️ Note: There is a limitation due to which the creation of several shares at the same time leads to an error. To avoid this, parallelism=1 can be used when running pulumi up command in order to create the resources in a sequential manner. Another solution involves the usage of depends_on attributes inside the ionoscloud.Share resource to enforce the sequential creation of the shares.

    timeouts Property Map

    Supporting Types

    ShareTimeouts, ShareTimeoutsArgs

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Import

    Resource Share can be imported using the resource id, e.g.

    $ pulumi import ionoscloud:index/share:Share myshare group uuid/resource uuid
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud