alicloud.resourcemanager.ResourceShare
Provides a Resource Manager Resource Share resource.
RS resource sharing.
For information about Resource Manager Resource Share and how to use it, see What is Resource Share.
NOTE: Available since v1.111.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const example = new alicloud.resourcemanager.ResourceShare("example", {resourceShareName: name});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
example = alicloud.resourcemanager.ResourceShare("example", resource_share_name=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := resourcemanager.NewResourceShare(ctx, "example", &resourcemanager.ResourceShareArgs{
ResourceShareName: pulumi.String(name),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var example = new AliCloud.ResourceManager.ResourceShare("example", new()
{
ResourceShareName = name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.ResourceShare;
import com.pulumi.alicloud.resourcemanager.ResourceShareArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var example = new ResourceShare("example", ResourceShareArgs.builder()
.resourceShareName(name)
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
example:
type: alicloud:resourcemanager:ResourceShare
properties:
resourceShareName: ${name}
Create ResourceShare Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ResourceShare(name: string, args: ResourceShareArgs, opts?: CustomResourceOptions);@overload
def ResourceShare(resource_name: str,
args: ResourceShareArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ResourceShare(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_share_name: Optional[str] = None,
allow_external_targets: Optional[bool] = None,
permission_names: Optional[Sequence[str]] = None,
resource_group_id: Optional[str] = None,
resources: Optional[Sequence[ResourceShareResourceArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
targets: Optional[Sequence[str]] = None)func NewResourceShare(ctx *Context, name string, args ResourceShareArgs, opts ...ResourceOption) (*ResourceShare, error)public ResourceShare(string name, ResourceShareArgs args, CustomResourceOptions? opts = null)
public ResourceShare(String name, ResourceShareArgs args)
public ResourceShare(String name, ResourceShareArgs args, CustomResourceOptions options)
type: alicloud:resourcemanager:ResourceShare
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 ResourceShareArgs
- 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 ResourceShareArgs
- 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 ResourceShareArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceShareArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResourceShareArgs
- 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 resourceShareResource = new AliCloud.ResourceManager.ResourceShare("resourceShareResource", new()
{
ResourceShareName = "string",
AllowExternalTargets = false,
PermissionNames = new[]
{
"string",
},
ResourceGroupId = "string",
Resources = new[]
{
new AliCloud.ResourceManager.Inputs.ResourceShareResourceArgs
{
ResourceId = "string",
ResourceType = "string",
},
},
Tags =
{
{ "string", "string" },
},
Targets = new[]
{
"string",
},
});
example, err := resourcemanager.NewResourceShare(ctx, "resourceShareResource", &resourcemanager.ResourceShareArgs{
ResourceShareName: pulumi.String("string"),
AllowExternalTargets: pulumi.Bool(false),
PermissionNames: pulumi.StringArray{
pulumi.String("string"),
},
ResourceGroupId: pulumi.String("string"),
Resources: resourcemanager.ResourceShareResourceArray{
&resourcemanager.ResourceShareResourceArgs{
ResourceId: pulumi.String("string"),
ResourceType: pulumi.String("string"),
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Targets: pulumi.StringArray{
pulumi.String("string"),
},
})
var resourceShareResource = new ResourceShare("resourceShareResource", ResourceShareArgs.builder()
.resourceShareName("string")
.allowExternalTargets(false)
.permissionNames("string")
.resourceGroupId("string")
.resources(ResourceShareResourceArgs.builder()
.resourceId("string")
.resourceType("string")
.build())
.tags(Map.of("string", "string"))
.targets("string")
.build());
resource_share_resource = alicloud.resourcemanager.ResourceShare("resourceShareResource",
resource_share_name="string",
allow_external_targets=False,
permission_names=["string"],
resource_group_id="string",
resources=[{
"resource_id": "string",
"resource_type": "string",
}],
tags={
"string": "string",
},
targets=["string"])
const resourceShareResource = new alicloud.resourcemanager.ResourceShare("resourceShareResource", {
resourceShareName: "string",
allowExternalTargets: false,
permissionNames: ["string"],
resourceGroupId: "string",
resources: [{
resourceId: "string",
resourceType: "string",
}],
tags: {
string: "string",
},
targets: ["string"],
});
type: alicloud:resourcemanager:ResourceShare
properties:
allowExternalTargets: false
permissionNames:
- string
resourceGroupId: string
resourceShareName: string
resources:
- resourceId: string
resourceType: string
tags:
string: string
targets:
- string
ResourceShare 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 ResourceShare resource accepts the following input properties:
- string
- The name of resource share.
- Allow
External boolTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- Permission
Names List<string> - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- Resource
Group stringId - The ID of the resource group
- Resources
List<Pulumi.
Ali Cloud. Resource Manager. Inputs. Resource Share Resource> - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - Dictionary<string, string>
- The tag of the resource
- Targets List<string>
- Resource user.
- string
- The name of resource share.
- Allow
External boolTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- Permission
Names []string - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- Resource
Group stringId - The ID of the resource group
- Resources
[]Resource
Share Resource Args - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - map[string]string
- The tag of the resource
- Targets []string
- Resource user.
- String
- The name of resource share.
- allow
External BooleanTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- permission
Names List<String> - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource
Group StringId - The ID of the resource group
- resources
List<Resource
Share Resource> - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - Map<String,String>
- The tag of the resource
- targets List<String>
- Resource user.
- string
- The name of resource share.
- allow
External booleanTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- permission
Names string[] - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource
Group stringId - The ID of the resource group
- resources
Resource
Share Resource[] - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - {[key: string]: string}
- The tag of the resource
- targets string[]
- Resource user.
- str
- The name of resource share.
- allow_
external_ booltargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- permission_
names Sequence[str] - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource_
group_ strid - The ID of the resource group
- resources
Sequence[Resource
Share Resource Args] - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - Mapping[str, str]
- The tag of the resource
- targets Sequence[str]
- Resource user.
- String
- The name of resource share.
- allow
External BooleanTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- permission
Names List<String> - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource
Group StringId - The ID of the resource group
- resources List<Property Map>
- List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - Map<String>
- The tag of the resource
- targets List<String>
- Resource user.
Outputs
All input properties are implicitly available as output properties. Additionally, the ResourceShare resource produces the following output properties:
- Create
Time string - The create time of resource share.
- Id string
- The provider-assigned unique ID for this managed resource.
- string
- The owner of resource share,
SelfandOtherAccounts. - Status string
- The status of resource share.
Active,DeletedandDeleting.
- Create
Time string - The create time of resource share.
- Id string
- The provider-assigned unique ID for this managed resource.
- string
- The owner of resource share,
SelfandOtherAccounts. - Status string
- The status of resource share.
Active,DeletedandDeleting.
- create
Time String - The create time of resource share.
- id String
- The provider-assigned unique ID for this managed resource.
- String
- The owner of resource share,
SelfandOtherAccounts. - status String
- The status of resource share.
Active,DeletedandDeleting.
- create
Time string - The create time of resource share.
- id string
- The provider-assigned unique ID for this managed resource.
- string
- The owner of resource share,
SelfandOtherAccounts. - status string
- The status of resource share.
Active,DeletedandDeleting.
- create_
time str - The create time of resource share.
- id str
- The provider-assigned unique ID for this managed resource.
- str
- The owner of resource share,
SelfandOtherAccounts. - status str
- The status of resource share.
Active,DeletedandDeleting.
- create
Time String - The create time of resource share.
- id String
- The provider-assigned unique ID for this managed resource.
- String
- The owner of resource share,
SelfandOtherAccounts. - status String
- The status of resource share.
Active,DeletedandDeleting.
Look up Existing ResourceShare Resource
Get an existing ResourceShare 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?: ResourceShareState, opts?: CustomResourceOptions): ResourceShare@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allow_external_targets: Optional[bool] = None,
create_time: Optional[str] = None,
permission_names: Optional[Sequence[str]] = None,
resource_group_id: Optional[str] = None,
resource_share_name: Optional[str] = None,
resource_share_owner: Optional[str] = None,
resources: Optional[Sequence[ResourceShareResourceArgs]] = None,
status: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
targets: Optional[Sequence[str]] = None) -> ResourceSharefunc GetResourceShare(ctx *Context, name string, id IDInput, state *ResourceShareState, opts ...ResourceOption) (*ResourceShare, error)public static ResourceShare Get(string name, Input<string> id, ResourceShareState? state, CustomResourceOptions? opts = null)public static ResourceShare get(String name, Output<String> id, ResourceShareState state, CustomResourceOptions options)resources: _: type: alicloud:resourcemanager:ResourceShare 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.
- Allow
External boolTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- Create
Time string - The create time of resource share.
- Permission
Names List<string> - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- Resource
Group stringId - The ID of the resource group
- string
- The name of resource share.
- string
- The owner of resource share,
SelfandOtherAccounts. - Resources
List<Pulumi.
Ali Cloud. Resource Manager. Inputs. Resource Share Resource> - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - Status string
- The status of resource share.
Active,DeletedandDeleting. - Dictionary<string, string>
- The tag of the resource
- Targets List<string>
- Resource user.
- Allow
External boolTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- Create
Time string - The create time of resource share.
- Permission
Names []string - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- Resource
Group stringId - The ID of the resource group
- string
- The name of resource share.
- string
- The owner of resource share,
SelfandOtherAccounts. - Resources
[]Resource
Share Resource Args - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - Status string
- The status of resource share.
Active,DeletedandDeleting. - map[string]string
- The tag of the resource
- Targets []string
- Resource user.
- allow
External BooleanTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- create
Time String - The create time of resource share.
- permission
Names List<String> - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource
Group StringId - The ID of the resource group
- String
- The name of resource share.
- String
- The owner of resource share,
SelfandOtherAccounts. - resources
List<Resource
Share Resource> - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - status String
- The status of resource share.
Active,DeletedandDeleting. - Map<String,String>
- The tag of the resource
- targets List<String>
- Resource user.
- allow
External booleanTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- create
Time string - The create time of resource share.
- permission
Names string[] - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource
Group stringId - The ID of the resource group
- string
- The name of resource share.
- string
- The owner of resource share,
SelfandOtherAccounts. - resources
Resource
Share Resource[] - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - status string
- The status of resource share.
Active,DeletedandDeleting. - {[key: string]: string}
- The tag of the resource
- targets string[]
- Resource user.
- allow_
external_ booltargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- create_
time str - The create time of resource share.
- permission_
names Sequence[str] - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource_
group_ strid - The ID of the resource group
- str
- The name of resource share.
- str
- The owner of resource share,
SelfandOtherAccounts. - resources
Sequence[Resource
Share Resource Args] - List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - status str
- The status of resource share.
Active,DeletedandDeleting. - Mapping[str, str]
- The tag of the resource
- targets Sequence[str]
- Resource user.
- allow
External BooleanTargets - Whether to allow sharing to accounts outside the resource directory. Value:
- false (default): Only sharing within the resource directory is allowed.
- true: Allow sharing to any account.
- create
Time String - The create time of resource share.
- permission
Names List<String> - Share permission name. When it is empty, the system automatically binds the default permissions associated with the resource type. For more information, see Permission Library.
- resource
Group StringId - The ID of the resource group
- String
- The name of resource share.
- String
- The owner of resource share,
SelfandOtherAccounts. - resources List<Property Map>
- List of shared resources. Note: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation. See
resourcesbelow. - status String
- The status of resource share.
Active,DeletedandDeleting. - Map<String>
- The tag of the resource
- targets List<String>
- Resource user.
Supporting Types
ResourceShareResource, ResourceShareResourceArgs
- Resource
Id string - The ID of the shared resource.
- Resource
Type string - Shared resource type. For the types of resources that support sharing, see Cloud services that support sharing.
- Resource
Id string - The ID of the shared resource.
- Resource
Type string - Shared resource type. For the types of resources that support sharing, see Cloud services that support sharing.
- resource
Id String - The ID of the shared resource.
- resource
Type String - Shared resource type. For the types of resources that support sharing, see Cloud services that support sharing.
- resource
Id string - The ID of the shared resource.
- resource
Type string - Shared resource type. For the types of resources that support sharing, see Cloud services that support sharing.
- resource_
id str - The ID of the shared resource.
- resource_
type str - Shared resource type. For the types of resources that support sharing, see Cloud services that support sharing.
- resource
Id String - The ID of the shared resource.
- resource
Type String - Shared resource type. For the types of resources that support sharing, see Cloud services that support sharing.
Import
Resource Manager Resource Share can be imported using the id, e.g.
$ pulumi import alicloud:resourcemanager/resourceShare:ResourceShare example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
