1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ApiGateway
  5. UsagePlan
Oracle Cloud Infrastructure v1.33.0 published on Thursday, Apr 25, 2024 by Pulumi

oci.ApiGateway.UsagePlan

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.33.0 published on Thursday, Apr 25, 2024 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",
        },
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_usage_plan = oci.api_gateway.UsagePlan("test_usage_plan",
        compartment_id=compartment_id,
        entitlements=[oci.api_gateway.UsagePlanEntitlementArgs(
            name=usage_plan_entitlements_name,
            description=usage_plan_entitlements_description,
            quota=oci.api_gateway.UsagePlanEntitlementQuotaArgs(
                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=oci.api_gateway.UsagePlanEntitlementRateLimitArgs(
                unit=usage_plan_entitlements_rate_limit_unit,
                value=usage_plan_entitlements_rate_limit_value,
            ),
            targets=[oci.api_gateway.UsagePlanEntitlementTargetArgs(
                deployment_id=test_deployment["id"],
            )],
        )],
        defined_tags={
            "Operations.CostCenter": "42",
        },
        display_name=usage_plan_display_name,
        freeform_tags={
            "Department": "Finance",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/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.Map{
    				"Operations.CostCenter": pulumi.Any("42"),
    			},
    			DisplayName: pulumi.Any(usagePlanDisplayName),
    			FreeformTags: pulumi.Map{
    				"Department": pulumi.Any("Finance"),
    			},
    		})
    		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" },
            },
        });
    
    });
    
    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 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"))
                .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
    

    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[_apigateway.UsagePlanEntitlementArgs]] = None,
                  defined_tags: Optional[Mapping[str, Any]] = None,
                  display_name: Optional[str] = None,
                  freeform_tags: Optional[Mapping[str, Any]] = 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.

    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", "any" },
        },
        DisplayName = "string",
        FreeformTags = 
        {
            { "string", "any" },
        },
    });
    
    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.Map{
    		"string": pulumi.Any("any"),
    	},
    	DisplayName: pulumi.String("string"),
    	FreeformTags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    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", "any"))
        .displayName("string")
        .freeformTags(Map.of("string", "any"))
        .build());
    
    usage_plan_resource = oci.api_gateway.UsagePlan("usagePlanResource",
        compartment_id="string",
        entitlements=[oci.api_gateway.UsagePlanEntitlementArgs(
            name="string",
            description="string",
            quota=oci.api_gateway.UsagePlanEntitlementQuotaArgs(
                operation_on_breach="string",
                reset_policy="string",
                unit="string",
                value=0,
            ),
            rate_limit=oci.api_gateway.UsagePlanEntitlementRateLimitArgs(
                unit="string",
                value=0,
            ),
            targets=[oci.api_gateway.UsagePlanEntitlementTargetArgs(
                deployment_id="string",
            )],
        )],
        defined_tags={
            "string": "any",
        },
        display_name="string",
        freeform_tags={
            "string": "any",
        })
    
    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: "any",
        },
        displayName: "string",
        freeformTags: {
            string: "any",
        },
    });
    
    type: oci:ApiGateway:UsagePlan
    properties:
        compartmentId: string
        definedTags:
            string: any
        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: any
    

    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

    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, object>
    (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, object>

    (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"}

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

    CompartmentId 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]interface{}
    (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]interface{}

    (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"}

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

    compartmentId 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,Object>
    (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,Object>

    (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"}

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

    compartmentId 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]: any}
    (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]: any}

    (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"}

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

    compartment_id str
    (Updatable) The OCID of the compartment in which the resource is created.
    entitlements Sequence[apigateway.UsagePlanEntitlementArgs]
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    defined_tags Mapping[str, Any]
    (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, Any]

    (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"}

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

    compartmentId 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<Any>
    (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<Any>

    (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"}

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

    Outputs

    All input properties are implicitly available as output properties. Additionally, the 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.
    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.
    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.
    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.
    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.
    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.
    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, Any]] = None,
            display_name: Optional[str] = None,
            entitlements: Optional[Sequence[_apigateway.UsagePlanEntitlementArgs]] = None,
            freeform_tags: Optional[Mapping[str, Any]] = None,
            lifecycle_details: Optional[str] = None,
            state: Optional[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)
    Resource lookup is not supported in YAML
    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, object>
    (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, object>

    (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"}

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

    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.
    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]interface{}
    (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]interface{}

    (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"}

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

    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.
    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,Object>
    (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,Object>

    (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"}

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

    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.
    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]: any}
    (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]: any}

    (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"}

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

    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.
    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, Any]
    (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[apigateway.UsagePlanEntitlementArgs]
    (Updatable) A collection of entitlements to assign to the newly created usage plan.
    freeform_tags Mapping[str, Any]

    (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"}

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

    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.
    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<Any>
    (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<Any>

    (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"}

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

    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.
    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 apigateway.UsagePlanEntitlementQuota
    (Updatable) Quota policy for a usage plan.
    rate_limit apigateway.UsagePlanEntitlementRateLimit
    (Updatable) Rate-limiting policy for a usage plan.
    targets Sequence[apigateway.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 rate limits are calculated. Example: SECOND
    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 rate limits are calculated. Example: SECOND
    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 rate limits are calculated. Example: SECOND
    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 rate limits are calculated. Example: SECOND
    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 rate limits are calculated. Example: SECOND
    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 rate limits are calculated. Example: SECOND
    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.

    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 v1.33.0 published on Thursday, Apr 25, 2024 by Pulumi