1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Tenantmanagercontrolplane
  5. SubscriptionMapping
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.Tenantmanagercontrolplane.SubscriptionMapping

Explore with Pulumi AI

This resource provides the Subscription Mapping resource in Oracle Cloud Infrastructure Tenantmanagercontrolplane service.

Assign the tenancy record identified by the compartment ID to the given subscription ID.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testSubscriptionMapping = new oci.tenantmanagercontrolplane.SubscriptionMapping("test_subscription_mapping", {
    compartmentId: compartmentId,
    subscriptionId: testSubscription.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_subscription_mapping = oci.tenantmanagercontrolplane.SubscriptionMapping("test_subscription_mapping",
    compartment_id=compartment_id,
    subscription_id=test_subscription["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/tenantmanagercontrolplane"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tenantmanagercontrolplane.NewSubscriptionMapping(ctx, "test_subscription_mapping", &tenantmanagercontrolplane.SubscriptionMappingArgs{
			CompartmentId:  pulumi.Any(compartmentId),
			SubscriptionId: pulumi.Any(testSubscription.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testSubscriptionMapping = new Oci.Tenantmanagercontrolplane.SubscriptionMapping("test_subscription_mapping", new()
    {
        CompartmentId = compartmentId,
        SubscriptionId = testSubscription.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Tenantmanagercontrolplane.SubscriptionMapping;
import com.pulumi.oci.Tenantmanagercontrolplane.SubscriptionMappingArgs;
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 testSubscriptionMapping = new SubscriptionMapping("testSubscriptionMapping", SubscriptionMappingArgs.builder()
            .compartmentId(compartmentId)
            .subscriptionId(testSubscription.id())
            .build());

    }
}
Copy
resources:
  testSubscriptionMapping:
    type: oci:Tenantmanagercontrolplane:SubscriptionMapping
    name: test_subscription_mapping
    properties:
      compartmentId: ${compartmentId}
      subscriptionId: ${testSubscription.id}
Copy

Create SubscriptionMapping Resource

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

Constructor syntax

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

@overload
def SubscriptionMapping(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        compartment_id: Optional[str] = None,
                        subscription_id: Optional[str] = None)
func NewSubscriptionMapping(ctx *Context, name string, args SubscriptionMappingArgs, opts ...ResourceOption) (*SubscriptionMapping, error)
public SubscriptionMapping(string name, SubscriptionMappingArgs args, CustomResourceOptions? opts = null)
public SubscriptionMapping(String name, SubscriptionMappingArgs args)
public SubscriptionMapping(String name, SubscriptionMappingArgs args, CustomResourceOptions options)
type: oci:Tenantmanagercontrolplane:SubscriptionMapping
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. SubscriptionMappingArgs
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. SubscriptionMappingArgs
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. SubscriptionMappingArgs
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. SubscriptionMappingArgs
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. SubscriptionMappingArgs
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 subscriptionMappingResource = new Oci.Tenantmanagercontrolplane.SubscriptionMapping("subscriptionMappingResource", new()
{
    CompartmentId = "string",
    SubscriptionId = "string",
});
Copy
example, err := Tenantmanagercontrolplane.NewSubscriptionMapping(ctx, "subscriptionMappingResource", &Tenantmanagercontrolplane.SubscriptionMappingArgs{
	CompartmentId:  pulumi.String("string"),
	SubscriptionId: pulumi.String("string"),
})
Copy
var subscriptionMappingResource = new SubscriptionMapping("subscriptionMappingResource", SubscriptionMappingArgs.builder()
    .compartmentId("string")
    .subscriptionId("string")
    .build());
Copy
subscription_mapping_resource = oci.tenantmanagercontrolplane.SubscriptionMapping("subscriptionMappingResource",
    compartment_id="string",
    subscription_id="string")
Copy
const subscriptionMappingResource = new oci.tenantmanagercontrolplane.SubscriptionMapping("subscriptionMappingResource", {
    compartmentId: "string",
    subscriptionId: "string",
});
Copy
type: oci:Tenantmanagercontrolplane:SubscriptionMapping
properties:
    compartmentId: string
    subscriptionId: string
Copy

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

CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
OCID of the compartment. Always a tenancy OCID.
SubscriptionId
This property is required.
Changes to this property will trigger replacement.
string

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
OCID of the compartment. Always a tenancy OCID.
SubscriptionId
This property is required.
Changes to this property will trigger replacement.
string

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId
This property is required.
Changes to this property will trigger replacement.
String
OCID of the compartment. Always a tenancy OCID.
subscriptionId
This property is required.
Changes to this property will trigger replacement.
String

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId
This property is required.
Changes to this property will trigger replacement.
string
OCID of the compartment. Always a tenancy OCID.
subscriptionId
This property is required.
Changes to this property will trigger replacement.
string

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartment_id
This property is required.
Changes to this property will trigger replacement.
str
OCID of the compartment. Always a tenancy OCID.
subscription_id
This property is required.
Changes to this property will trigger replacement.
str

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId
This property is required.
Changes to this property will trigger replacement.
String
OCID of the compartment. Always a tenancy OCID.
subscriptionId
This property is required.
Changes to this property will trigger replacement.
String

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
IsExplicitlyAssigned bool
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
State string
Lifecycle state of the subscriptionMapping.
TimeCreated string
Date-time when subscription mapping was created.
TimeTerminated string
Date-time when subscription mapping was terminated.
TimeUpdated string
Date-time when subscription mapping was updated.
Id string
The provider-assigned unique ID for this managed resource.
IsExplicitlyAssigned bool
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
State string
Lifecycle state of the subscriptionMapping.
TimeCreated string
Date-time when subscription mapping was created.
TimeTerminated string
Date-time when subscription mapping was terminated.
TimeUpdated string
Date-time when subscription mapping was updated.
id String
The provider-assigned unique ID for this managed resource.
isExplicitlyAssigned Boolean
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state String
Lifecycle state of the subscriptionMapping.
timeCreated String
Date-time when subscription mapping was created.
timeTerminated String
Date-time when subscription mapping was terminated.
timeUpdated String
Date-time when subscription mapping was updated.
id string
The provider-assigned unique ID for this managed resource.
isExplicitlyAssigned boolean
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state string
Lifecycle state of the subscriptionMapping.
timeCreated string
Date-time when subscription mapping was created.
timeTerminated string
Date-time when subscription mapping was terminated.
timeUpdated string
Date-time when subscription mapping was updated.
id str
The provider-assigned unique ID for this managed resource.
is_explicitly_assigned bool
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state str
Lifecycle state of the subscriptionMapping.
time_created str
Date-time when subscription mapping was created.
time_terminated str
Date-time when subscription mapping was terminated.
time_updated str
Date-time when subscription mapping was updated.
id String
The provider-assigned unique ID for this managed resource.
isExplicitlyAssigned Boolean
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state String
Lifecycle state of the subscriptionMapping.
timeCreated String
Date-time when subscription mapping was created.
timeTerminated String
Date-time when subscription mapping was terminated.
timeUpdated String
Date-time when subscription mapping was updated.

Look up Existing SubscriptionMapping Resource

Get an existing SubscriptionMapping 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?: SubscriptionMappingState, opts?: CustomResourceOptions): SubscriptionMapping
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        is_explicitly_assigned: Optional[bool] = None,
        state: Optional[str] = None,
        subscription_id: Optional[str] = None,
        time_created: Optional[str] = None,
        time_terminated: Optional[str] = None,
        time_updated: Optional[str] = None) -> SubscriptionMapping
func GetSubscriptionMapping(ctx *Context, name string, id IDInput, state *SubscriptionMappingState, opts ...ResourceOption) (*SubscriptionMapping, error)
public static SubscriptionMapping Get(string name, Input<string> id, SubscriptionMappingState? state, CustomResourceOptions? opts = null)
public static SubscriptionMapping get(String name, Output<String> id, SubscriptionMappingState state, CustomResourceOptions options)
resources:  _:    type: oci:Tenantmanagercontrolplane:SubscriptionMapping    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:
CompartmentId Changes to this property will trigger replacement. string
OCID of the compartment. Always a tenancy OCID.
IsExplicitlyAssigned bool
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
State string
Lifecycle state of the subscriptionMapping.
SubscriptionId Changes to this property will trigger replacement. string

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

TimeCreated string
Date-time when subscription mapping was created.
TimeTerminated string
Date-time when subscription mapping was terminated.
TimeUpdated string
Date-time when subscription mapping was updated.
CompartmentId Changes to this property will trigger replacement. string
OCID of the compartment. Always a tenancy OCID.
IsExplicitlyAssigned bool
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
State string
Lifecycle state of the subscriptionMapping.
SubscriptionId Changes to this property will trigger replacement. string

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

TimeCreated string
Date-time when subscription mapping was created.
TimeTerminated string
Date-time when subscription mapping was terminated.
TimeUpdated string
Date-time when subscription mapping was updated.
compartmentId Changes to this property will trigger replacement. String
OCID of the compartment. Always a tenancy OCID.
isExplicitlyAssigned Boolean
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state String
Lifecycle state of the subscriptionMapping.
subscriptionId Changes to this property will trigger replacement. String

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

timeCreated String
Date-time when subscription mapping was created.
timeTerminated String
Date-time when subscription mapping was terminated.
timeUpdated String
Date-time when subscription mapping was updated.
compartmentId Changes to this property will trigger replacement. string
OCID of the compartment. Always a tenancy OCID.
isExplicitlyAssigned boolean
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state string
Lifecycle state of the subscriptionMapping.
subscriptionId Changes to this property will trigger replacement. string

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

timeCreated string
Date-time when subscription mapping was created.
timeTerminated string
Date-time when subscription mapping was terminated.
timeUpdated string
Date-time when subscription mapping was updated.
compartment_id Changes to this property will trigger replacement. str
OCID of the compartment. Always a tenancy OCID.
is_explicitly_assigned bool
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state str
Lifecycle state of the subscriptionMapping.
subscription_id Changes to this property will trigger replacement. str

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

time_created str
Date-time when subscription mapping was created.
time_terminated str
Date-time when subscription mapping was terminated.
time_updated str
Date-time when subscription mapping was updated.
compartmentId Changes to this property will trigger replacement. String
OCID of the compartment. Always a tenancy OCID.
isExplicitlyAssigned Boolean
Denotes if the subscription is explicity assigned to the root compartment or tenancy.
state String
Lifecycle state of the subscriptionMapping.
subscriptionId Changes to this property will trigger replacement. String

OCID of Subscription.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

timeCreated String
Date-time when subscription mapping was created.
timeTerminated String
Date-time when subscription mapping was terminated.
timeUpdated String
Date-time when subscription mapping was updated.

Import

SubscriptionMappings can be imported using the id, e.g.

$ pulumi import oci:Tenantmanagercontrolplane/subscriptionMapping:SubscriptionMapping test_subscription_mapping "id"
Copy

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

Package Details

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