ConsumableResourceProps Struct
Properties for defining a Batch Consumable Resource.
| Source | aws-batch/lib/consumable-resource.ts |
|---|---|
| Type last changed |
Example
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
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
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);
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);
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
consumableResourceNameoptionalstringconsumable_resource_nameoptionalstrconsumableResourceNameoptionalStringConsumableResourceNameoptionalstringConsumableResourceNameoptional*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.
resourceTypeoptionalConsumableResourceTyperesource_typeoptionalConsumableResourceTyperesourceTypeoptionalConsumableResourceTypeResourceTypeoptionalConsumableResourceTypeResourceTypeoptionalConsumableResourceType #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.
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #Tags to apply to the consumable resource.
Default: no tags
totalQuantitynumbertotal_quantityint | floattotalQuantityNumberTotalQuantitydoubleTotalQuantity*float64 required #The total quantity of the consumable resource.
Must be a non-negative integer.