Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Tenantmanagercontrolplane.getSubscriptionMappings
Explore with Pulumi AI
This data source provides the list of Subscription Mappings in Oracle Cloud Infrastructure Tenantmanagercontrolplane service.
Lists the subscription mappings for all the subscriptions owned by a given compartmentId. Only the root compartment is allowed.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testSubscriptionMappings = oci.Tenantmanagercontrolplane.getSubscriptionMappings({
    subscriptionId: testSubscription.id,
    compartmentId: compartmentId,
    state: subscriptionMappingState,
    subscriptionMappingId: testSubscriptionMapping.id,
});
import pulumi
import pulumi_oci as oci
test_subscription_mappings = oci.Tenantmanagercontrolplane.get_subscription_mappings(subscription_id=test_subscription["id"],
    compartment_id=compartment_id,
    state=subscription_mapping_state,
    subscription_mapping_id=test_subscription_mapping["id"])
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.GetSubscriptionMappings(ctx, &tenantmanagercontrolplane.GetSubscriptionMappingsArgs{
			SubscriptionId:        testSubscription.Id,
			CompartmentId:         pulumi.StringRef(compartmentId),
			State:                 pulumi.StringRef(subscriptionMappingState),
			SubscriptionMappingId: pulumi.StringRef(testSubscriptionMapping.Id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testSubscriptionMappings = Oci.Tenantmanagercontrolplane.GetSubscriptionMappings.Invoke(new()
    {
        SubscriptionId = testSubscription.Id,
        CompartmentId = compartmentId,
        State = subscriptionMappingState,
        SubscriptionMappingId = testSubscriptionMapping.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Tenantmanagercontrolplane.TenantmanagercontrolplaneFunctions;
import com.pulumi.oci.Tenantmanagercontrolplane.inputs.GetSubscriptionMappingsArgs;
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 testSubscriptionMappings = TenantmanagercontrolplaneFunctions.getSubscriptionMappings(GetSubscriptionMappingsArgs.builder()
            .subscriptionId(testSubscription.id())
            .compartmentId(compartmentId)
            .state(subscriptionMappingState)
            .subscriptionMappingId(testSubscriptionMapping.id())
            .build());
    }
}
variables:
  testSubscriptionMappings:
    fn::invoke:
      function: oci:Tenantmanagercontrolplane:getSubscriptionMappings
      arguments:
        subscriptionId: ${testSubscription.id}
        compartmentId: ${compartmentId}
        state: ${subscriptionMappingState}
        subscriptionMappingId: ${testSubscriptionMapping.id}
Using getSubscriptionMappings
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSubscriptionMappings(args: GetSubscriptionMappingsArgs, opts?: InvokeOptions): Promise<GetSubscriptionMappingsResult>
function getSubscriptionMappingsOutput(args: GetSubscriptionMappingsOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionMappingsResult>def get_subscription_mappings(compartment_id: Optional[str] = None,
                              filters: Optional[Sequence[GetSubscriptionMappingsFilter]] = None,
                              state: Optional[str] = None,
                              subscription_id: Optional[str] = None,
                              subscription_mapping_id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetSubscriptionMappingsResult
def get_subscription_mappings_output(compartment_id: Optional[pulumi.Input[str]] = None,
                              filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSubscriptionMappingsFilterArgs]]]] = None,
                              state: Optional[pulumi.Input[str]] = None,
                              subscription_id: Optional[pulumi.Input[str]] = None,
                              subscription_mapping_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetSubscriptionMappingsResult]func GetSubscriptionMappings(ctx *Context, args *GetSubscriptionMappingsArgs, opts ...InvokeOption) (*GetSubscriptionMappingsResult, error)
func GetSubscriptionMappingsOutput(ctx *Context, args *GetSubscriptionMappingsOutputArgs, opts ...InvokeOption) GetSubscriptionMappingsResultOutput> Note: This function is named GetSubscriptionMappings in the Go SDK.
public static class GetSubscriptionMappings 
{
    public static Task<GetSubscriptionMappingsResult> InvokeAsync(GetSubscriptionMappingsArgs args, InvokeOptions? opts = null)
    public static Output<GetSubscriptionMappingsResult> Invoke(GetSubscriptionMappingsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSubscriptionMappingsResult> getSubscriptionMappings(GetSubscriptionMappingsArgs args, InvokeOptions options)
public static Output<GetSubscriptionMappingsResult> getSubscriptionMappings(GetSubscriptionMappingsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Tenantmanagercontrolplane/getSubscriptionMappings:getSubscriptionMappings
  arguments:
    # arguments dictionaryThe following arguments are supported:
- SubscriptionId string
- OCID of the subscription.
- CompartmentId string
- The ID of the compartment in which to list resources.
- Filters
List<GetSubscription Mappings Filter> 
- State string
- The lifecycle state of the resource.
- SubscriptionMapping stringId 
- A unique ID for subscription and tenancy mapping.
- SubscriptionId string
- OCID of the subscription.
- CompartmentId string
- The ID of the compartment in which to list resources.
- Filters
[]GetSubscription Mappings Filter 
- State string
- The lifecycle state of the resource.
- SubscriptionMapping stringId 
- A unique ID for subscription and tenancy mapping.
- subscriptionId String
- OCID of the subscription.
- compartmentId String
- The ID of the compartment in which to list resources.
- filters
List<GetSubscription Mappings Filter> 
- state String
- The lifecycle state of the resource.
- subscriptionMapping StringId 
- A unique ID for subscription and tenancy mapping.
- subscriptionId string
- OCID of the subscription.
- compartmentId string
- The ID of the compartment in which to list resources.
- filters
GetSubscription Mappings Filter[] 
- state string
- The lifecycle state of the resource.
- subscriptionMapping stringId 
- A unique ID for subscription and tenancy mapping.
- subscription_id str
- OCID of the subscription.
- compartment_id str
- The ID of the compartment in which to list resources.
- filters
Sequence[GetSubscription Mappings Filter] 
- state str
- The lifecycle state of the resource.
- subscription_mapping_ strid 
- A unique ID for subscription and tenancy mapping.
- subscriptionId String
- OCID of the subscription.
- compartmentId String
- The ID of the compartment in which to list resources.
- filters List<Property Map>
- state String
- The lifecycle state of the resource.
- subscriptionMapping StringId 
- A unique ID for subscription and tenancy mapping.
getSubscriptionMappings Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- SubscriptionId string
- OCID of the subscription.
- SubscriptionMapping List<GetCollections Subscription Mappings Subscription Mapping Collection> 
- The list of subscription_mapping_collection.
- CompartmentId string
- OCID of the compartment. Always a tenancy OCID.
- Filters
List<GetSubscription Mappings Filter> 
- State string
- Lifecycle state of the subscriptionMapping.
- SubscriptionMapping stringId 
- Id string
- The provider-assigned unique ID for this managed resource.
- SubscriptionId string
- OCID of the subscription.
- SubscriptionMapping []GetCollections Subscription Mappings Subscription Mapping Collection 
- The list of subscription_mapping_collection.
- CompartmentId string
- OCID of the compartment. Always a tenancy OCID.
- Filters
[]GetSubscription Mappings Filter 
- State string
- Lifecycle state of the subscriptionMapping.
- SubscriptionMapping stringId 
- id String
- The provider-assigned unique ID for this managed resource.
- subscriptionId String
- OCID of the subscription.
- subscriptionMapping List<GetCollections Subscription Mappings Subscription Mapping Collection> 
- The list of subscription_mapping_collection.
- compartmentId String
- OCID of the compartment. Always a tenancy OCID.
- filters
List<GetSubscription Mappings Filter> 
- state String
- Lifecycle state of the subscriptionMapping.
- subscriptionMapping StringId 
- id string
- The provider-assigned unique ID for this managed resource.
- subscriptionId string
- OCID of the subscription.
- subscriptionMapping GetCollections Subscription Mappings Subscription Mapping Collection[] 
- The list of subscription_mapping_collection.
- compartmentId string
- OCID of the compartment. Always a tenancy OCID.
- filters
GetSubscription Mappings Filter[] 
- state string
- Lifecycle state of the subscriptionMapping.
- subscriptionMapping stringId 
- id str
- The provider-assigned unique ID for this managed resource.
- subscription_id str
- OCID of the subscription.
- subscription_mapping_ Sequence[Getcollections Subscription Mappings Subscription Mapping Collection] 
- The list of subscription_mapping_collection.
- compartment_id str
- OCID of the compartment. Always a tenancy OCID.
- filters
Sequence[GetSubscription Mappings Filter] 
- state str
- Lifecycle state of the subscriptionMapping.
- subscription_mapping_ strid 
- id String
- The provider-assigned unique ID for this managed resource.
- subscriptionId String
- OCID of the subscription.
- subscriptionMapping List<Property Map>Collections 
- The list of subscription_mapping_collection.
- compartmentId String
- OCID of the compartment. Always a tenancy OCID.
- filters List<Property Map>
- state String
- Lifecycle state of the subscriptionMapping.
- subscriptionMapping StringId 
Supporting Types
GetSubscriptionMappingsFilter   
GetSubscriptionMappingsSubscriptionMappingCollection     
GetSubscriptionMappingsSubscriptionMappingCollectionItem      
- CompartmentId string
- The ID of the compartment in which to list resources.
- Id string
- OCID of the mapping between subscription and compartment identified by the tenancy.
- IsExplicitly boolAssigned 
- Denotes if the subscription is explicity assigned to the root compartment or tenancy.
- State string
- The lifecycle state of the resource.
- SubscriptionId string
- OCID of the subscription.
- 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 string
- The ID of the compartment in which to list resources.
- Id string
- OCID of the mapping between subscription and compartment identified by the tenancy.
- IsExplicitly boolAssigned 
- Denotes if the subscription is explicity assigned to the root compartment or tenancy.
- State string
- The lifecycle state of the resource.
- SubscriptionId string
- OCID of the subscription.
- 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 String
- The ID of the compartment in which to list resources.
- id String
- OCID of the mapping between subscription and compartment identified by the tenancy.
- isExplicitly BooleanAssigned 
- Denotes if the subscription is explicity assigned to the root compartment or tenancy.
- state String
- The lifecycle state of the resource.
- subscriptionId String
- OCID of the subscription.
- 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 string
- The ID of the compartment in which to list resources.
- id string
- OCID of the mapping between subscription and compartment identified by the tenancy.
- isExplicitly booleanAssigned 
- Denotes if the subscription is explicity assigned to the root compartment or tenancy.
- state string
- The lifecycle state of the resource.
- subscriptionId string
- OCID of the subscription.
- 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 str
- The ID of the compartment in which to list resources.
- id str
- OCID of the mapping between subscription and compartment identified by the tenancy.
- is_explicitly_ boolassigned 
- Denotes if the subscription is explicity assigned to the root compartment or tenancy.
- state str
- The lifecycle state of the resource.
- subscription_id str
- OCID of the subscription.
- 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 String
- The ID of the compartment in which to list resources.
- id String
- OCID of the mapping between subscription and compartment identified by the tenancy.
- isExplicitly BooleanAssigned 
- Denotes if the subscription is explicity assigned to the root compartment or tenancy.
- state String
- The lifecycle state of the resource.
- subscriptionId String
- OCID of the subscription.
- 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.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.