# ConsumableResourceProps

Properties for defining a Batch Consumable Resource.

Used as props by: [ConsumableResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.ConsumableResource.html)

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

## Example

TypeScript:

```ts
const licenseResource = new batch.ConsumableResource(this, 'LicenseResource', {
  totalQuantity: 100,
});

const user = new iam.User(this, 'MyUser');

// Describe the resource and list the jobs that use it
licenseResource.grants.read(user);

// Change the total quantity, e.g. to replenish a NON_REPLENISHABLE pool
licenseResource.grants.update(user);
```

Python:

```python
license_resource = batch.ConsumableResource(self, "LicenseResource",
    total_quantity=100
)

user = iam.User(self, "MyUser")

# Describe the resource and list the jobs that use it
license_resource.grants.read(user)

# Change the total quantity, e.g. to replenish a NON_REPLENISHABLE pool
license_resource.grants.update(user)
```

Java:

```java
ConsumableResource licenseResource = ConsumableResource.Builder.create(this, "LicenseResource")
        .totalQuantity(100)
        .build();

User user = new User(this, "MyUser");

// Describe the resource and list the jobs that use it
licenseResource.grants.read(user);

// Change the total quantity, e.g. to replenish a NON_REPLENISHABLE pool
licenseResource.grants.update(user);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var licenseResource = new ConsumableResource(this, "LicenseResource", new ConsumableResourceProps {
    TotalQuantity = 100
});

var user = new User(this, "MyUser");

// Describe the resource and list the jobs that use it
licenseResource.Grants.Read(user);

// Change the total quantity, e.g. to replenish a NON_REPLENISHABLE pool
licenseResource.Grants.Update(user);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
licenseResource := batch.NewConsumableResource(this, jsii.String("LicenseResource"), &ConsumableResourceProps{
	TotalQuantity: jsii.Number(100),
})

user := iam.NewUser(this, jsii.String("MyUser"))

// Describe the resource and list the jobs that use it
licenseResource.grants.Read(user)

// Change the total quantity, e.g. to replenish a NON_REPLENISHABLE pool
licenseResource.grants.Update(user)
```

## Properties

- `consumableResourceName`: string — The name of the consumable resource.

  **Default:** CloudFormation-generated name

  The name must be unique within the account and Region. Changing it replaces
  the resource.

- `resourceType`: [ConsumableResourceType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.ConsumableResourceType.html) — The type of consumable resource.

  **Default:** ConsumableResourceType.REPLENISHABLE

  Changing this property replaces the resource. Because the name must be unique
  within the account and Region, changing the type of a resource that has a
  `consumableResourceName` fails the deployment unless the name is changed as well.

- `tags`: { [key: string]: string } — Tags to apply to the consumable resource.

  **Default:** no tags

- `totalQuantity`: number (required) — The total quantity of the consumable resource.

  Must be a non-negative integer.
