SharedResource

class SharedResource : KotlinCustomResource

Provides a Resource Manager Shared Resource resource. For information about Resource Manager Shared Resource and how to use it, see What is Shared Resource.

NOTE: Available since v1.111.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.resourcemanager.ResourceShare;
import com.pulumi.alicloud.resourcemanager.ResourceShareArgs;
import com.pulumi.alicloud.resourcemanager.SharedResource;
import com.pulumi.alicloud.resourcemanager.SharedResourceArgs;
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("tfexample");
final var exampleZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("192.168.0.0/16")
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.cidrBlock("192.168.0.0/16")
.vpcId(exampleNetwork.id())
.vswitchName(name)
.build());
var exampleResourceShare = new ResourceShare("exampleResourceShare", ResourceShareArgs.builder()
.resourceShareName(name)
.build());
var exampleSharedResource = new SharedResource("exampleSharedResource", SharedResourceArgs.builder()
.resourceId(exampleSwitch.id())
.resourceShareId(exampleResourceShare.id())
.resourceType("VSwitch")
.build());
}
}

Import

Resource Manager Shared Resource can be imported using the id, e.g.

$ pulumi import alicloud:resourcemanager/sharedResource:SharedResource example <resource_share_id>:<resource_id>:<resource_type>

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceId: Output<String>

The resource ID need shared.

Link copied to clipboard
val resourceShareId: Output<String>

The resource share ID of resource manager.

Link copied to clipboard
val resourceType: Output<String>

The resource type of should shared. Valid values:

Link copied to clipboard
val status: Output<String>

The status of the Shared Resource.

Link copied to clipboard
val urn: Output<String>