1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ApiGateway
  5. UsagePlan
Oracle Cloud Infrastructure v3.8.0 published on Thursday, Sep 18, 2025 by Pulumi

oci.ApiGateway.UsagePlan

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v3.8.0 published on Thursday, Sep 18, 2025 by Pulumi

    This resource provides the Usage Plan resource in Oracle Cloud Infrastructure API Gateway service.

    Creates a new usage plan.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testUsagePlan = new oci.apigateway.UsagePlan("test_usage_plan", {
        compartmentId: compartmentId,
        entitlements: [{
            name: usagePlanEntitlementsName,
            description: usagePlanEntitlementsDescription,
            quota: {
                operationOnBreach: usagePlanEntitlementsQuotaOperationOnBreach,
                resetPolicy: usagePlanEntitlementsQuotaResetPolicy,
                unit: usagePlanEntitlementsQuotaUnit,
                value: usagePlanEntitlementsQuotaValue,
            },
            rateLimit: {
                unit: usagePlanEntitlementsRateLimitUnit,
                value: usagePlanEntitlementsRateLimitValue,
            },
            targets: [{
                deploymentId: testDeployment.id,
            }],
        }],
        definedTags: {
            "Operations.CostCenter": "42",
        },
        displayName: usagePlanDisplayName,
        freeformTags: {
            Department: "Finance",
        },
        locks: [{
            type: usagePlanLocksType,
            message: usagePlanLocksMessage,
        }],
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_usage_plan = oci.apigateway.UsagePlan("test_usage_plan",
        compartment_id=compartment_id,
        entitlements=[{
            "name": usage_plan_entitlements_name,
            "description": usage_plan_entitlements_description,
            "quota": {
                "operation_on_breach": usage_plan_entitlements_quota_operation_on_breach,
                "reset_policy": usage_plan_entitlements_quota_reset_policy,
                "unit": usage_plan_entitlements_quota_unit,
                "value": usage_plan_entitlements_quota_value,
            },
            "rate_limit": {
                "unit": usage_plan_entitlements_rate_limit_unit,
                "value": usage_plan_entitlements_rate_limit_value,
            },
            "targets": [{
                "deployment_id": test_deployment["id"],
            }],
        }],
        defined_tags={
            "Operations.CostCenter": "42",
        },
        display_name=usage_plan_display_name,
        freeform_tags={
            "Department": "Finance",
        },
        locks=[{
            "type": usage_plan_locks_type,
            "message": usage_plan_locks_message,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := apigateway.NewUsagePlan(ctx, "test_usage_plan", &apigateway.UsagePlanArgs{
    			CompartmentId: pulumi.Any(compartmentId),
    			Entitlements: apigateway.UsagePlanEntitlementArray{
    				&apigateway.UsagePlanEntitlementArgs{
    					Name:        pulumi.Any(usagePlanEntitlementsName),
    					Description: pulumi.Any(usagePlanEntitlementsDescription),
    					Quota: &apigateway.UsagePlanEntitlementQuotaArgs{
    						OperationOnBreach: pulumi.Any(usagePlanEntitlementsQuotaOperationOnBreach),
    						ResetPolicy:       pulumi.Any(usagePlanEntitlementsQuotaResetPolicy),
    						Unit:              pulumi.Any(usagePlanEntitlementsQuotaUnit),
    						Value:             pulumi.Any(usagePlanEntitlementsQuotaValue),
    					},
    					RateLimit: &apigateway.UsagePlanEntitlementRateLimitArgs{
    						Unit:  pulumi.Any(usagePlanEntitlementsRateLimitUnit),
    						Value: pulumi.Any(usagePlanEntitlementsRateLimitValue),
    					},
    					Targets: apigateway.UsagePlanEntitlementTargetArray{
    						&apigateway.UsagePlanEntitlementTargetArgs{
    							DeploymentId: pulumi.Any(testDeployment.Id),
    						},
    					},
    				},
    			},
    			DefinedTags: pulumi.StringMap{
    				"Operations.CostCenter": pulumi.String("42"),
    			},
    			DisplayName: pulumi.Any(usagePlanDisplayName),
    			FreeformTags: pulumi.StringMap{
    				"Department": pulumi.String("Finance"),
    			},
    			Locks: apigateway.UsagePlanLockArray{
    				&apigateway.UsagePlanLockArgs{
    					Type:    pulumi.Any(usagePlanLocksType),
    					Message: pulumi.Any(usagePlanLocksMessage),
    				},
    			},
    		})
    		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 testUsagePlan = new Oci.ApiGateway.UsagePlan("test_usage_plan", new()
        {
            CompartmentId = compartmentId,
            Entitlements = new[]
            {
                new Oci.ApiGateway.Inputs.UsagePlanEntitlementArgs
                {
                    Name = usagePlanEntitlementsName,
                    Description = usagePlanEntitlementsDescription,
                    Quota = new Oci.ApiGateway.Inputs.UsagePlanEntitlementQuotaArgs
                    {
                        OperationOnBreach = usagePlanEntitlementsQuotaOperationOnBreach,
                        ResetPolicy = usagePlanEntitlementsQuotaResetPolicy,
                        Unit = usagePlanEntitlementsQuotaUnit,
                        Value = usagePlanEntitlementsQuotaValue,
                    },
                    RateLimit = new Oci.ApiGateway.Inputs.UsagePlanEntitlementRateLimitArgs
                    {
                        Unit = usagePlanEntitlementsRateLimitUnit,
                        Value = usagePlanEntitlementsRateLimitValue,
                    },
                    Targets = new[]
                    {
                        new Oci.ApiGateway.Inputs.UsagePlanEntitlementTargetArgs
                        {
                            DeploymentId = testDeployment.Id,
                        },
                    },
                },
            },
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            DisplayName = usagePlanDisplayName,
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
            Locks = new[]
            {
                new Oci.ApiGateway.Inputs.UsagePlanLockArgs
                {
                    Type = usagePlanLocksType,
                    Message = usagePlanLocksMessage,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ApiGateway.UsagePlan;
    import com.pulumi.oci.ApiGateway.UsagePlanArgs;
    import com.pulumi.oci.ApiGateway.inputs.UsagePlanEntitlementArgs;
    import com.pulumi.oci.ApiGateway.inputs.UsagePlanEntitlementQuotaArgs;
    import com.pulumi.oci.ApiGateway.inputs.UsagePlanEntitlementRateLimitArgs;
    import com.pulumi.oci.ApiGateway.inputs.UsagePlanLockArgs;
    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 testUsagePlan = new UsagePlan("testUsagePlan", UsagePlanArgs.builder()
                .compartmentId(compartmentId)
                .entitlements(UsagePlanEntitlementArgs.builder()
                    .name(usagePlanEntitlementsName)
                    .description(usagePlanEntitlementsDescription)
                    .quota(UsagePlanEntitlementQuotaArgs.builder()
                        .operationOnBreach(usagePlanEntitlementsQuotaOperationOnBreach)
                        .resetPolicy(usagePlanEntitlementsQuotaResetPolicy)
                        .unit(usagePlanEntitlementsQuotaUnit)
                        .value(usagePlanEntitlementsQuotaValue)
                        .build())
                    .rateLimit(UsagePlanEntitlementRateLimitArgs.builder()
                        .unit(usagePlanEntitlementsRateLimitUnit)
                        .value(usagePlanEntitlementsRateLimitValue)
                        .build())
                    .targets(UsagePlanEntitlementTargetArgs.builder()
                        .deploymentId(testDeployment.id())
                        .build())
                    .build())
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .displayName(usagePlanDisplayName)
                .freeformTags(Map.of("Department", "Finance"))
                .locks(UsagePlanLockArgs.builder()
                    .type(usagePlanLocksType)
                    .message(usagePlanLocksMessage)
                    .build())
                .build());
    
        }
    }
    
    resources:
      testUsagePlan:
        type: oci:ApiGateway:UsagePlan
        name: test_usage_plan
        properties:
          compartmentId: ${compartmentId}
          entitlements:
            - name: ${usagePlanEntitlementsName}
              description: ${usagePlanEntitlementsDescription}
              quota:
                operationOnBreach: ${usagePlanEntitlementsQuotaOperationOnBreach}
                resetPolicy: ${usagePlanEntitlementsQuotaResetPolicy}
                unit: ${usagePlanEntitlementsQuotaUnit}
                value: ${usagePlanEntitlementsQuotaValue}
              rateLimit:
                unit: ${usagePlanEntitlementsRateLimitUnit}
                value: ${usagePlanEntitlementsRateLimitValue}
              targets:
                - deploymentId: ${testDeployment.id}
          definedTags:
            Operations.CostCenter: '42'
          displayName: ${usagePlanDisplayName}
          freeformTags:
            Department: Finance
          locks:
            - type: ${usagePlanLocksType}
              message: ${usagePlanLocksMessage}
    

    Create UsagePlan Resource

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

    Constructor syntax

    new UsagePlan(name: string, args: UsagePlanArgs, opts?: CustomResourceOptions);
    @overload
    def UsagePlan(resource_name: str,
                  args: UsagePlanArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def UsagePlan(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  compartment_id: Optional[str] = None,
                  entitlements: Optional[Sequence[UsagePlanEntitlementArgs]] = None,
                  defined_tags: Optional[Mapping[str, str]] = None,
                  display_name: Optional[str] = None,
                  freeform_tags: Optional[Mapping[str, str]] = None,
                  is_lock_override: Optional[bool] = None,
                  locks: Optional[Sequence[UsagePlanLockArgs]] = None)
    func NewUsagePlan(ctx *Context, name string, args UsagePlanArgs, opts ...ResourceOption) (*UsagePlan, error)
    public UsagePlan(string name, UsagePlanArgs args, CustomResourceOptions? opts = null)
    public UsagePlan(String name, UsagePlanArgs args)
    public UsagePlan(String name, UsagePlanArgs args, CustomResourceOptions options)
    
    type: oci:ApiGateway:UsagePlan
    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 UsagePlanArgs
    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 UsagePlanArgs
    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 UsagePlanArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UsagePlanArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UsagePlanArgs
    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 usagePlanResource = new Oci.ApiGateway.UsagePlan("usagePlanResource", new()
    {
        CompartmentId = "string",
        Entitlements = new[]
        {
            new Oci.ApiGateway.Inputs.UsagePlanEntitlementArgs
            {
                Name = "string",
                Description = "string",
                Quota = new Oci.ApiGateway.Inputs.UsagePlanEntitlementQuotaArgs
                {
                    OperationOnBreach = "string",
                    ResetPolicy = "string",
                    Unit = "string",
                    Value = 0,
                },
                RateLimit = new Oci.ApiGateway.Inputs.UsagePlanEntitlementRateLimitArgs
                {
                    Unit = "string",
                    Value = 0,
                },
                Targets = new[]
                {
                    new Oci.ApiGateway.Inputs.UsagePlanEntitlementTargetArgs
                    {
                        DeploymentId = "string",
                    },
                },
            },
        },
        DefinedTags = 
        {
            { "string", "string" },
        },
        DisplayName = "string",
        FreeformTags = 
        {
            { "string", "string" },
        },
        IsLockOverride = false,
        Locks = new[]
        {
            new Oci.ApiGateway.Inputs.UsagePlanLockArgs
            {
                Type = "string",
                Message = "string",
                RelatedResourceId = "string",
                TimeCreated = "string",
            },
        },
    });
    
    example, err := apigateway.NewUsagePlan(ctx, "usagePlanResource", &apigateway.UsagePlanArgs{
    	CompartmentId: pulumi.String("string"),
    	Entitlements: apigateway.UsagePlanEntitlementArray{
    		&apigateway.UsagePlanEntitlementArgs{
    			Name:        pulumi.String("string"),
    			Description: pulumi.String("string"),
    			Quota: &apigateway.UsagePlanEntitlementQuotaArgs{
    				OperationOnBreach: pulumi.String("string"),
    				ResetPolicy:       pulumi.String("string"),
    				Unit:              pulumi.String("string"),
    				Value:             pulumi.Int(0),
    			},
    			RateLimit: &apigateway.UsagePlanEntitlementRateLimitArgs{
    				Unit:  pulumi.String("string"),
    				Value: pulumi.Int(0),
    			},
    			Targets: apigateway.UsagePlanEntitlementTargetArray{
    				&apigateway.UsagePlanEntitlementTargetArgs{
    					DeploymentId: pulumi.String("string"),
    				},
    			},
    		},
    	},
    	DefinedTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	DisplayName: pulumi.String("string"),
    	FreeformTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	IsLockOverride: pulumi.Bool(false),
    	Locks: apigateway.UsagePlanLockArray{
    		&apigateway.UsagePlanLockArgs{
    			Type:              pulumi.String("string"),
    			Message:           pulumi.String("string"),
    			RelatedResourceId: pulumi.String("string"),
    			TimeCreated:       pulumi.String("string"),
    		},
    	},
    })
    
    var usagePlanResource = new UsagePlan("usagePlanResource", UsagePlanArgs.builder()
        .compartmentId("string")
        .entitlements(UsagePlanEntitlementArgs.builder()
            .name("string")
            .description("string")
            .quota(UsagePlanEntitlementQuotaArgs.builder()
                .operationOnBreach("string")
                .resetPolicy("string")
                .unit("string")
                .value(0)
                .build())
            .rateLimit(UsagePlanEntitlementRateLimitArgs.builder()
                .unit("string")
                .value(0)
                .build())
            .targets(UsagePlanEntitlementTargetArgs.builder()
                .deploymentId("string")
                .build())
            .build())
        .definedTags(Map.of("string", "string"))
        .displayName("string")
        .freeformTags(Map.of("string", "string"))
        .isLockOverride(false)
        .locks(UsagePlanLockArgs.builder()
            .type("string")
            .message("string")
            .relatedResourceId("string")
            .timeCreated("string")
            .build())
        .build());
    
    usage_plan_resource = oci.apigateway.UsagePlan("usagePlanResource",
        compartment_id="string",
        entitlements=[{
            "name": "string",
            "description": "string",
            "quota": {
                "operation_on_breach": "string",
                "reset_policy": "string",
                "unit": "string",
                "value": 0,
            },
            "rate_limit": {
                "unit": "string",
                "value": 0,
            },
            "targets": [{
                "deployment_id": "string",
            }],
        }],
        defined_tags={
            "string": "string",
        },
        display_name="string",
        freeform_tags={
            "string": "string",
        },
        is_lock_override=False,
        locks=[{
            "type": "string",
            "message": "string",
            "related_resource_id": "string",
            "time_created": "string",
        }])
    
    const usagePlanResource = new oci.apigateway.UsagePlan("usagePlanResource", {
        compartmentId: "string",
        entitlements: [{
            name: "string",
            description: "string",
            quota: {
                operationOnBreach: "string",
                resetPolicy: "string",
                unit: "string",
                value: 0,
            },
            rateLimit: {
                unit: "string",
                value: 0,
            },
            targets: [{
                deploymentId: "string",
            }],
        }],
        definedTags: {
            string: "string",
        },
        displayName: "string",
        freeformTags: {
            string: "string",
        },
        isLockOverride: false,
        locks: [{
            type: "string",
            message: "string",
            relatedResourceId: "string",
            timeCreated: "string",
        }],
    });
    
    type: oci:ApiGateway:UsagePlan
    properties:
        compartmentId: string
        definedTags:
            string: string
        displayName: string
        entitlements:
            - description: string
              name: string
              quota:
                operationOnBreach: string
                resetPolicy: string
                unit: string
                value: 0
              rateLimit:
                unit: string
                value: 0
              targets:
                - deploymentId: string
        freeformTags:
            string: string
        isLockOverride: false
        locks:
            - message: string
              relatedResourceId: string
              timeCreated: string
              type: string
    

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

    CompartmentId string
    (Updatable) The OCID of the compartment in which the resource is created.
    Entitlements List<UsagePlanEntitlement>
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    DefinedTags Dictionary<string, string>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    FreeformTags Dictionary<string, string>
    (Updatable) 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"}
    IsLockOverride bool
    Locks List<UsagePlanLock>
    Locks associated with this resource.
    CompartmentId string
    (Updatable) The OCID of the compartment in which the resource is created.
    Entitlements []UsagePlanEntitlementArgs
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    DefinedTags map[string]string
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    FreeformTags map[string]string
    (Updatable) 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"}
    IsLockOverride bool
    Locks []UsagePlanLockArgs
    Locks associated with this resource.
    compartmentId String
    (Updatable) The OCID of the compartment in which the resource is created.
    entitlements List<UsagePlanEntitlement>
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    definedTags Map<String,String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeformTags Map<String,String>
    (Updatable) 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"}
    isLockOverride Boolean
    locks List<UsagePlanLock>
    Locks associated with this resource.
    compartmentId string
    (Updatable) The OCID of the compartment in which the resource is created.
    entitlements UsagePlanEntitlement[]
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    definedTags {[key: string]: string}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeformTags {[key: string]: string}
    (Updatable) 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"}
    isLockOverride boolean
    locks UsagePlanLock[]
    Locks associated with this resource.
    compartment_id str
    (Updatable) The OCID of the compartment in which the resource is created.
    entitlements Sequence[UsagePlanEntitlementArgs]
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    defined_tags Mapping[str, str]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    display_name str
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeform_tags Mapping[str, str]
    (Updatable) 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"}
    is_lock_override bool
    locks Sequence[UsagePlanLockArgs]
    Locks associated with this resource.
    compartmentId String
    (Updatable) The OCID of the compartment in which the resource is created.
    entitlements List<Property Map>
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    definedTags Map<String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeformTags Map<String>
    (Updatable) 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"}
    isLockOverride Boolean
    locks List<Property Map>
    Locks associated with this resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    State string
    The current state of the usage plan.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    Id string
    The provider-assigned unique ID for this managed resource.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    State string
    The current state of the usage plan.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    id String
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state String
    The current state of the usage plan.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.
    id string
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state string
    The current state of the usage plan.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    id str
    The provider-assigned unique ID for this managed resource.
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state str
    The current state of the usage plan.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time this resource was created. An RFC3339 formatted datetime string.
    time_updated str
    The time this resource was last updated. An RFC3339 formatted datetime string.
    id String
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state String
    The current state of the usage plan.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.

    Look up Existing UsagePlan Resource

    Get an existing UsagePlan 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?: UsagePlanState, opts?: CustomResourceOptions): UsagePlan
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_id: Optional[str] = None,
            defined_tags: Optional[Mapping[str, str]] = None,
            display_name: Optional[str] = None,
            entitlements: Optional[Sequence[UsagePlanEntitlementArgs]] = None,
            freeform_tags: Optional[Mapping[str, str]] = None,
            is_lock_override: Optional[bool] = None,
            lifecycle_details: Optional[str] = None,
            locks: Optional[Sequence[UsagePlanLockArgs]] = None,
            state: Optional[str] = None,
            system_tags: Optional[Mapping[str, str]] = None,
            time_created: Optional[str] = None,
            time_updated: Optional[str] = None) -> UsagePlan
    func GetUsagePlan(ctx *Context, name string, id IDInput, state *UsagePlanState, opts ...ResourceOption) (*UsagePlan, error)
    public static UsagePlan Get(string name, Input<string> id, UsagePlanState? state, CustomResourceOptions? opts = null)
    public static UsagePlan get(String name, Output<String> id, UsagePlanState state, CustomResourceOptions options)
    resources:  _:    type: oci:ApiGateway:UsagePlan    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.
    The following state arguments are supported:
    CompartmentId string
    (Updatable) The OCID of the compartment in which the resource is created.
    DefinedTags Dictionary<string, string>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    Entitlements List<UsagePlanEntitlement>
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    FreeformTags Dictionary<string, string>
    (Updatable) 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"}
    IsLockOverride bool
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    Locks List<UsagePlanLock>
    Locks associated with this resource.
    State string
    The current state of the usage plan.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    CompartmentId string
    (Updatable) The OCID of the compartment in which the resource is created.
    DefinedTags map[string]string
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    Entitlements []UsagePlanEntitlementArgs
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    FreeformTags map[string]string
    (Updatable) 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"}
    IsLockOverride bool
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    Locks []UsagePlanLockArgs
    Locks associated with this resource.
    State string
    The current state of the usage plan.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    compartmentId String
    (Updatable) The OCID of the compartment in which the resource is created.
    definedTags Map<String,String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements List<UsagePlanEntitlement>
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    freeformTags Map<String,String>
    (Updatable) 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"}
    isLockOverride Boolean
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks List<UsagePlanLock>
    Locks associated with this resource.
    state String
    The current state of the usage plan.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.
    compartmentId string
    (Updatable) The OCID of the compartment in which the resource is created.
    definedTags {[key: string]: string}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements UsagePlanEntitlement[]
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    freeformTags {[key: string]: string}
    (Updatable) 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"}
    isLockOverride boolean
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks UsagePlanLock[]
    Locks associated with this resource.
    state string
    The current state of the usage plan.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    compartment_id str
    (Updatable) The OCID of the compartment in which the resource is created.
    defined_tags Mapping[str, str]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    display_name str
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements Sequence[UsagePlanEntitlementArgs]
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    freeform_tags Mapping[str, str]
    (Updatable) 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"}
    is_lock_override bool
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks Sequence[UsagePlanLockArgs]
    Locks associated with this resource.
    state str
    The current state of the usage plan.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time this resource was created. An RFC3339 formatted datetime string.
    time_updated str
    The time this resource was last updated. An RFC3339 formatted datetime string.
    compartmentId String
    (Updatable) The OCID of the compartment in which the resource is created.
    definedTags Map<String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements List<Property Map>
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    freeformTags Map<String>
    (Updatable) 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"}
    isLockOverride Boolean
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks List<Property Map>
    Locks associated with this resource.
    state String
    The current state of the usage plan.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.

    Supporting Types

    UsagePlanEntitlement, UsagePlanEntitlementArgs

    Name string
    (Updatable) An entitlement name, unique within a usage plan.
    Description string
    (Updatable) A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    Quota UsagePlanEntitlementQuota
    (Updatable) Quota policy for a usage plan.
    RateLimit UsagePlanEntitlementRateLimit
    (Updatable) Rate-limiting policy for a usage plan.
    Targets List<UsagePlanEntitlementTarget>
    (Updatable) A collection of targeted deployments that the entitlement will be applied to.
    Name string
    (Updatable) An entitlement name, unique within a usage plan.
    Description string
    (Updatable) A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    Quota UsagePlanEntitlementQuota
    (Updatable) Quota policy for a usage plan.
    RateLimit UsagePlanEntitlementRateLimit
    (Updatable) Rate-limiting policy for a usage plan.
    Targets []UsagePlanEntitlementTarget
    (Updatable) A collection of targeted deployments that the entitlement will be applied to.
    name String
    (Updatable) An entitlement name, unique within a usage plan.
    description String
    (Updatable) A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    quota UsagePlanEntitlementQuota
    (Updatable) Quota policy for a usage plan.
    rateLimit UsagePlanEntitlementRateLimit
    (Updatable) Rate-limiting policy for a usage plan.
    targets List<UsagePlanEntitlementTarget>
    (Updatable) A collection of targeted deployments that the entitlement will be applied to.
    name string
    (Updatable) An entitlement name, unique within a usage plan.
    description string
    (Updatable) A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    quota UsagePlanEntitlementQuota
    (Updatable) Quota policy for a usage plan.
    rateLimit UsagePlanEntitlementRateLimit
    (Updatable) Rate-limiting policy for a usage plan.
    targets UsagePlanEntitlementTarget[]
    (Updatable) A collection of targeted deployments that the entitlement will be applied to.
    name str
    (Updatable) An entitlement name, unique within a usage plan.
    description str
    (Updatable) A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    quota UsagePlanEntitlementQuota
    (Updatable) Quota policy for a usage plan.
    rate_limit UsagePlanEntitlementRateLimit
    (Updatable) Rate-limiting policy for a usage plan.
    targets Sequence[UsagePlanEntitlementTarget]
    (Updatable) A collection of targeted deployments that the entitlement will be applied to.
    name String
    (Updatable) An entitlement name, unique within a usage plan.
    description String
    (Updatable) A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    quota Property Map
    (Updatable) Quota policy for a usage plan.
    rateLimit Property Map
    (Updatable) Rate-limiting policy for a usage plan.
    targets List<Property Map>
    (Updatable) A collection of targeted deployments that the entitlement will be applied to.

    UsagePlanEntitlementQuota, UsagePlanEntitlementQuotaArgs

    OperationOnBreach string
    (Updatable) What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    ResetPolicy string
    (Updatable) The policy that controls when quotas will reset. Example: CALENDAR
    Unit string
    (Updatable) The unit of time over which quotas are calculated. Example: MINUTE or MONTH
    Value int
    (Updatable) The number of requests that can be made per time period.
    OperationOnBreach string
    (Updatable) What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    ResetPolicy string
    (Updatable) The policy that controls when quotas will reset. Example: CALENDAR
    Unit string
    (Updatable) The unit of time over which quotas are calculated. Example: MINUTE or MONTH
    Value int
    (Updatable) The number of requests that can be made per time period.
    operationOnBreach String
    (Updatable) What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    resetPolicy String
    (Updatable) The policy that controls when quotas will reset. Example: CALENDAR
    unit String
    (Updatable) The unit of time over which quotas are calculated. Example: MINUTE or MONTH
    value Integer
    (Updatable) The number of requests that can be made per time period.
    operationOnBreach string
    (Updatable) What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    resetPolicy string
    (Updatable) The policy that controls when quotas will reset. Example: CALENDAR
    unit string
    (Updatable) The unit of time over which quotas are calculated. Example: MINUTE or MONTH
    value number
    (Updatable) The number of requests that can be made per time period.
    operation_on_breach str
    (Updatable) What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    reset_policy str
    (Updatable) The policy that controls when quotas will reset. Example: CALENDAR
    unit str
    (Updatable) The unit of time over which quotas are calculated. Example: MINUTE or MONTH
    value int
    (Updatable) The number of requests that can be made per time period.
    operationOnBreach String
    (Updatable) What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    resetPolicy String
    (Updatable) The policy that controls when quotas will reset. Example: CALENDAR
    unit String
    (Updatable) The unit of time over which quotas are calculated. Example: MINUTE or MONTH
    value Number
    (Updatable) The number of requests that can be made per time period.

    UsagePlanEntitlementRateLimit, UsagePlanEntitlementRateLimitArgs

    Unit string
    (Updatable) The unit of time over which rate limits are calculated. Example: SECOND
    Value int
    (Updatable) The number of requests that can be made per time period.
    Unit string
    (Updatable) The unit of time over which rate limits are calculated. Example: SECOND
    Value int
    (Updatable) The number of requests that can be made per time period.
    unit String
    (Updatable) The unit of time over which rate limits are calculated. Example: SECOND
    value Integer
    (Updatable) The number of requests that can be made per time period.
    unit string
    (Updatable) The unit of time over which rate limits are calculated. Example: SECOND
    value number
    (Updatable) The number of requests that can be made per time period.
    unit str
    (Updatable) The unit of time over which rate limits are calculated. Example: SECOND
    value int
    (Updatable) The number of requests that can be made per time period.
    unit String
    (Updatable) The unit of time over which rate limits are calculated. Example: SECOND
    value Number
    (Updatable) The number of requests that can be made per time period.

    UsagePlanEntitlementTarget, UsagePlanEntitlementTargetArgs

    DeploymentId string
    (Updatable) The OCID of a deployment resource.
    DeploymentId string
    (Updatable) The OCID of a deployment resource.
    deploymentId String
    (Updatable) The OCID of a deployment resource.
    deploymentId string
    (Updatable) The OCID of a deployment resource.
    deployment_id str
    (Updatable) The OCID of a deployment resource.
    deploymentId String
    (Updatable) The OCID of a deployment resource.

    UsagePlanLock, UsagePlanLockArgs

    Type string

    Type of the lock.

    ** 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

    Message string
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    RelatedResourceId string
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    Type string

    Type of the lock.

    ** 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

    Message string
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    RelatedResourceId string
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    type String

    Type of the lock.

    ** 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

    message String
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    relatedResourceId String
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    type string

    Type of the lock.

    ** 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

    message string
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    relatedResourceId string
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    timeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    type str

    Type of the lock.

    ** 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

    message str
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    related_resource_id str
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    time_created str
    The time this resource was created. An RFC3339 formatted datetime string.
    type String

    Type of the lock.

    ** 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

    message String
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    relatedResourceId String
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.

    Import

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

    $ pulumi import oci:ApiGateway/usagePlan:UsagePlan test_usage_plan "id"
    

    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.
    oci logo
    Oracle Cloud Infrastructure v3.8.0 published on Thursday, Sep 18, 2025 by Pulumi