ConsumableResourceType Enum
The type of consumable resource.
Example
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
# 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
// 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();
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
});
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.resourceTyperesource_typeresourceTypeResourceTypeResourceType