# ConsumableResourceType

The type of consumable resource.

- Source: [`aws-batch/lib/consumable-resource.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-batch/lib/consumable-resource.ts#L39)
- Type last changed: v2.273.0 · 8 Oct 2026

## Example

TypeScript:

```ts
// Create a replenishable consumable resource (e.g., software licenses)
const licenseResource = new batch.ConsumableResource(this, 'LicenseResource', {
  consumableResourceName: 'my-software-license',
  resourceType: batch.ConsumableResourceType.REPLENISHABLE,
  totalQuantity: 100,
});

// Create a non-replenishable consumable resource (e.g., API rate limits)
const apiRateLimitResource = new batch.ConsumableResource(this, 'ApiRateLimitResource', {
  consumableResourceName: 'api-rate-limit',
  resourceType: batch.ConsumableResourceType.NON_REPLENISHABLE,
  totalQuantity: 1000,
});
```

Python:

```python
# Create a replenishable consumable resource (e.g., software licenses)
license_resource = batch.ConsumableResource(self, "LicenseResource",
    consumable_resource_name="my-software-license",
    resource_type=batch.ConsumableResourceType.REPLENISHABLE,
    total_quantity=100
)

# Create a non-replenishable consumable resource (e.g., API rate limits)
api_rate_limit_resource = batch.ConsumableResource(self, "ApiRateLimitResource",
    consumable_resource_name="api-rate-limit",
    resource_type=batch.ConsumableResourceType.NON_REPLENISHABLE,
    total_quantity=1000
)
```

Java:

```java
// Create a replenishable consumable resource (e.g., software licenses)
ConsumableResource licenseResource = ConsumableResource.Builder.create(this, "LicenseResource")
        .consumableResourceName("my-software-license")
        .resourceType(ConsumableResourceType.REPLENISHABLE)
        .totalQuantity(100)
        .build();

// Create a non-replenishable consumable resource (e.g., API rate limits)
ConsumableResource apiRateLimitResource = ConsumableResource.Builder.create(this, "ApiRateLimitResource")
        .consumableResourceName("api-rate-limit")
        .resourceType(ConsumableResourceType.NON_REPLENISHABLE)
        .totalQuantity(1000)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// Create a replenishable consumable resource (e.g., software licenses)
var licenseResource = new ConsumableResource(this, "LicenseResource", new ConsumableResourceProps {
    ConsumableResourceName = "my-software-license",
    ResourceType = ConsumableResourceType.REPLENISHABLE,
    TotalQuantity = 100
});

// Create a non-replenishable consumable resource (e.g., API rate limits)
var apiRateLimitResource = new ConsumableResource(this, "ApiRateLimitResource", new ConsumableResourceProps {
    ConsumableResourceName = "api-rate-limit",
    ResourceType = ConsumableResourceType.NON_REPLENISHABLE,
    TotalQuantity = 1000
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Create a replenishable consumable resource (e.g., software licenses)
licenseResource := batch.NewConsumableResource(this, jsii.String("LicenseResource"), &ConsumableResourceProps{
	ConsumableResourceName: jsii.String("my-software-license"),
	ResourceType: batch.ConsumableResourceType_REPLENISHABLE,
	TotalQuantity: jsii.Number(100),
})

// Create a non-replenishable consumable resource (e.g., API rate limits)
apiRateLimitResource := batch.NewConsumableResource(this, jsii.String("ApiRateLimitResource"), &ConsumableResourceProps{
	ConsumableResourceName: jsii.String("api-rate-limit"),
	ResourceType: batch.ConsumableResourceType_NON_REPLENISHABLE,
	TotalQuantity: jsii.Number(1000),
})
```

## Members

| Member | Description |
| --- | --- |
| `REPLENISHABLE` | Resource can be re-used after a job completes. |
| `NON_REPLENISHABLE` | Resource cannot be re-used after a job completes. |

## Referenced by

- [`ConsumableResourceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.ConsumableResourceProps.html).resourceType
