1. Packages
  2. Packages
  3. Oracle Cloud Infrastructure
  4. API Docs
  5. oci
  6. getCostadCostAlertSubscriptions
Viewing docs for Oracle Cloud Infrastructure v4.15.0
published on Thursday, Jun 11, 2026 by Pulumi
oci logo
Viewing docs for Oracle Cloud Infrastructure v4.15.0
published on Thursday, Jun 11, 2026 by Pulumi

    This data source provides the list of Cost Alert Subscriptions in Oracle Cloud Infrastructure Costad service.

    Gets a list of Cost Alert Subscription in a compartment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testCostAlertSubscriptions = oci.oci.getCostadCostAlertSubscriptions({
        compartmentId: compartmentId,
        name: costAlertSubscriptionName,
        state: costAlertSubscriptionState,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_cost_alert_subscriptions = oci.oci.get_costad_cost_alert_subscriptions(compartment_id=compartment_id,
        name=cost_alert_subscription_name,
        state=cost_alert_subscription_state)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v4/go/oci/oci"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := oci.GetCostadCostAlertSubscriptions(ctx, &oci.GetCostadCostAlertSubscriptionsArgs{
    			CompartmentId: compartmentId,
    			Name:          pulumi.StringRef(costAlertSubscriptionName),
    			State:         pulumi.StringRef(costAlertSubscriptionState),
    		}, 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 testCostAlertSubscriptions = Oci.Oci.GetCostadCostAlertSubscriptions.Invoke(new()
        {
            CompartmentId = compartmentId,
            Name = costAlertSubscriptionName,
            State = costAlertSubscriptionState,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.oci.OciFunctions;
    import com.pulumi.oci.oci.inputs.GetCostadCostAlertSubscriptionsArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 testCostAlertSubscriptions = OciFunctions.getCostadCostAlertSubscriptions(GetCostadCostAlertSubscriptionsArgs.builder()
                .compartmentId(compartmentId)
                .name(costAlertSubscriptionName)
                .state(costAlertSubscriptionState)
                .build());
    
        }
    }
    
    variables:
      testCostAlertSubscriptions:
        fn::invoke:
          function: oci:oci:getCostadCostAlertSubscriptions
          arguments:
            compartmentId: ${compartmentId}
            name: ${costAlertSubscriptionName}
            state: ${costAlertSubscriptionState}
    
    pulumi {
      required_providers {
        oci = {
          source = "pulumi/oci"
        }
      }
    }
    
    data "oci_oci_getcostadcostalertsubscriptions" "testCostAlertSubscriptions" {
      compartment_id = compartmentId
      name           = costAlertSubscriptionName
      state          = costAlertSubscriptionState
    }
    

    Using getCostadCostAlertSubscriptions

    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 getCostadCostAlertSubscriptions(args: GetCostadCostAlertSubscriptionsArgs, opts?: InvokeOptions): Promise<GetCostadCostAlertSubscriptionsResult>
    function getCostadCostAlertSubscriptionsOutput(args: GetCostadCostAlertSubscriptionsOutputArgs, opts?: InvokeOptions): Output<GetCostadCostAlertSubscriptionsResult>
    def get_costad_cost_alert_subscriptions(compartment_id: Optional[str] = None,
                                            filters: Optional[Sequence[GetCostadCostAlertSubscriptionsFilter]] = None,
                                            name: Optional[str] = None,
                                            state: Optional[str] = None,
                                            opts: Optional[InvokeOptions] = None) -> GetCostadCostAlertSubscriptionsResult
    def get_costad_cost_alert_subscriptions_output(compartment_id: pulumi.Input[Optional[str]] = None,
                                            filters: pulumi.Input[Optional[Sequence[pulumi.Input[GetCostadCostAlertSubscriptionsFilterArgs]]]] = None,
                                            name: pulumi.Input[Optional[str]] = None,
                                            state: pulumi.Input[Optional[str]] = None,
                                            opts: Optional[InvokeOptions] = None) -> Output[GetCostadCostAlertSubscriptionsResult]
    func GetCostadCostAlertSubscriptions(ctx *Context, args *GetCostadCostAlertSubscriptionsArgs, opts ...InvokeOption) (*GetCostadCostAlertSubscriptionsResult, error)
    func GetCostadCostAlertSubscriptionsOutput(ctx *Context, args *GetCostadCostAlertSubscriptionsOutputArgs, opts ...InvokeOption) GetCostadCostAlertSubscriptionsResultOutput

    > Note: This function is named GetCostadCostAlertSubscriptions in the Go SDK.

    public static class GetCostadCostAlertSubscriptions 
    {
        public static Task<GetCostadCostAlertSubscriptionsResult> InvokeAsync(GetCostadCostAlertSubscriptionsArgs args, InvokeOptions? opts = null)
        public static Output<GetCostadCostAlertSubscriptionsResult> Invoke(GetCostadCostAlertSubscriptionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCostadCostAlertSubscriptionsResult> getCostadCostAlertSubscriptions(GetCostadCostAlertSubscriptionsArgs args, InvokeOptions options)
    public static Output<GetCostadCostAlertSubscriptionsResult> getCostadCostAlertSubscriptions(GetCostadCostAlertSubscriptionsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:oci/getCostadCostAlertSubscriptions:getCostadCostAlertSubscriptions
      arguments:
        # arguments dictionary
    data "oci_oci_getcostadcostalertsubscriptions" "name" {
        # arguments
    }

    The following arguments are supported:

    CompartmentId string
    The ID of the compartment in which to list resources.
    Filters List<GetCostadCostAlertSubscriptionsFilter>
    Name string
    Unique, non-changeable resource name.
    State string
    The current state of the cost alert subscription.
    CompartmentId string
    The ID of the compartment in which to list resources.
    Filters []GetCostadCostAlertSubscriptionsFilter
    Name string
    Unique, non-changeable resource name.
    State string
    The current state of the cost alert subscription.
    compartment_id string
    The ID of the compartment in which to list resources.
    filters list(object)
    name string
    Unique, non-changeable resource name.
    state string
    The current state of the cost alert subscription.
    compartmentId String
    The ID of the compartment in which to list resources.
    filters List<GetCostadCostAlertSubscriptionsFilter>
    name String
    Unique, non-changeable resource name.
    state String
    The current state of the cost alert subscription.
    compartmentId string
    The ID of the compartment in which to list resources.
    filters GetCostadCostAlertSubscriptionsFilter[]
    name string
    Unique, non-changeable resource name.
    state string
    The current state of the cost alert subscription.
    compartment_id str
    The ID of the compartment in which to list resources.
    filters Sequence[GetCostadCostAlertSubscriptionsFilter]
    name str
    Unique, non-changeable resource name.
    state str
    The current state of the cost alert subscription.
    compartmentId String
    The ID of the compartment in which to list resources.
    filters List<Property Map>
    name String
    Unique, non-changeable resource name.
    state String
    The current state of the cost alert subscription.

    getCostadCostAlertSubscriptions Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment which hold the cost alert subscription resource.
    CostAlertSubscriptionCollections List<GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollection>
    The list of cost_alert_subscription_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters List<GetCostadCostAlertSubscriptionsFilter>
    Name string
    The name of the cost alert subscription. Avoid entering confidential information.
    State string
    The current state of the cost alert subscription.
    CompartmentId string
    The OCID of the compartment which hold the cost alert subscription resource.
    CostAlertSubscriptionCollections []GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollection
    The list of cost_alert_subscription_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters []GetCostadCostAlertSubscriptionsFilter
    Name string
    The name of the cost alert subscription. Avoid entering confidential information.
    State string
    The current state of the cost alert subscription.
    compartment_id string
    The OCID of the compartment which hold the cost alert subscription resource.
    cost_alert_subscription_collections list(object)
    The list of cost_alert_subscription_collection.
    id string
    The provider-assigned unique ID for this managed resource.
    filters list(object)
    name string
    The name of the cost alert subscription. Avoid entering confidential information.
    state string
    The current state of the cost alert subscription.
    compartmentId String
    The OCID of the compartment which hold the cost alert subscription resource.
    costAlertSubscriptionCollections List<GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollection>
    The list of cost_alert_subscription_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<GetCostadCostAlertSubscriptionsFilter>
    name String
    The name of the cost alert subscription. Avoid entering confidential information.
    state String
    The current state of the cost alert subscription.
    compartmentId string
    The OCID of the compartment which hold the cost alert subscription resource.
    costAlertSubscriptionCollections GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollection[]
    The list of cost_alert_subscription_collection.
    id string
    The provider-assigned unique ID for this managed resource.
    filters GetCostadCostAlertSubscriptionsFilter[]
    name string
    The name of the cost alert subscription. Avoid entering confidential information.
    state string
    The current state of the cost alert subscription.
    compartment_id str
    The OCID of the compartment which hold the cost alert subscription resource.
    cost_alert_subscription_collections Sequence[GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollection]
    The list of cost_alert_subscription_collection.
    id str
    The provider-assigned unique ID for this managed resource.
    filters Sequence[GetCostadCostAlertSubscriptionsFilter]
    name str
    The name of the cost alert subscription. Avoid entering confidential information.
    state str
    The current state of the cost alert subscription.
    compartmentId String
    The OCID of the compartment which hold the cost alert subscription resource.
    costAlertSubscriptionCollections List<Property Map>
    The list of cost_alert_subscription_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<Property Map>
    name String
    The name of the cost alert subscription. Avoid entering confidential information.
    state String
    The current state of the cost alert subscription.

    Supporting Types

    GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollection

    GetCostadCostAlertSubscriptionsCostAlertSubscriptionCollectionItem

    Channels string
    The notification channels string.
    CompartmentId string
    The ID of the compartment in which to list resources.
    CostAnomalyMonitors string
    List of monitor identifiers
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    The description of the cost alert subscription.
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the Cost Alert Subscription.
    Name string
    Unique, non-changeable resource name.
    State string
    The current state of the cost alert subscription.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time that the cost alert subscription was created.
    TimeUpdated string
    The time that the cost alert subscription was updated.
    Channels string
    The notification channels string.
    CompartmentId string
    The ID of the compartment in which to list resources.
    CostAnomalyMonitors string
    List of monitor identifiers
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    The description of the cost alert subscription.
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the Cost Alert Subscription.
    Name string
    Unique, non-changeable resource name.
    State string
    The current state of the cost alert subscription.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time that the cost alert subscription was created.
    TimeUpdated string
    The time that the cost alert subscription was updated.
    channels string
    The notification channels string.
    compartment_id string
    The ID of the compartment in which to list resources.
    cost_anomaly_monitors string
    List of monitor identifiers
    defined_tags map(string)
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description string
    The description of the cost alert subscription.
    freeform_tags map(string)
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the Cost Alert Subscription.
    name string
    Unique, non-changeable resource name.
    state string
    The current state of the cost alert subscription.
    system_tags map(string)
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created string
    The time that the cost alert subscription was created.
    time_updated string
    The time that the cost alert subscription was updated.
    channels String
    The notification channels string.
    compartmentId String
    The ID of the compartment in which to list resources.
    costAnomalyMonitors String
    List of monitor identifiers
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    The description of the cost alert subscription.
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the Cost Alert Subscription.
    name String
    Unique, non-changeable resource name.
    state String
    The current state of the cost alert subscription.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time that the cost alert subscription was created.
    timeUpdated String
    The time that the cost alert subscription was updated.
    channels string
    The notification channels string.
    compartmentId string
    The ID of the compartment in which to list resources.
    costAnomalyMonitors string
    List of monitor identifiers
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description string
    The description of the cost alert subscription.
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the Cost Alert Subscription.
    name string
    Unique, non-changeable resource name.
    state string
    The current state of the cost alert subscription.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time that the cost alert subscription was created.
    timeUpdated string
    The time that the cost alert subscription was updated.
    channels str
    The notification channels string.
    compartment_id str
    The ID of the compartment in which to list resources.
    cost_anomaly_monitors str
    List of monitor identifiers
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description str
    The description of the cost alert subscription.
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID of the Cost Alert Subscription.
    name str
    Unique, non-changeable resource name.
    state str
    The current state of the cost alert subscription.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time that the cost alert subscription was created.
    time_updated str
    The time that the cost alert subscription was updated.
    channels String
    The notification channels string.
    compartmentId String
    The ID of the compartment in which to list resources.
    costAnomalyMonitors String
    List of monitor identifiers
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    The description of the cost alert subscription.
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the Cost Alert Subscription.
    name String
    Unique, non-changeable resource name.
    state String
    The current state of the cost alert subscription.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time that the cost alert subscription was created.
    timeUpdated String
    The time that the cost alert subscription was updated.

    GetCostadCostAlertSubscriptionsFilter

    Name string
    Unique, non-changeable resource name.
    Values List<string>
    Regex bool
    Name string
    Unique, non-changeable resource name.
    Values []string
    Regex bool
    name string
    Unique, non-changeable resource name.
    values list(string)
    regex bool
    name String
    Unique, non-changeable resource name.
    values List<String>
    regex Boolean
    name string
    Unique, non-changeable resource name.
    values string[]
    regex boolean
    name str
    Unique, non-changeable resource name.
    values Sequence[str]
    regex bool
    name String
    Unique, non-changeable resource name.
    values List<String>
    regex Boolean

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Viewing docs for Oracle Cloud Infrastructure v4.15.0
    published on Thursday, Jun 11, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial