« blib/lib/Paws/Batch/ComputeEnvironmentOrder.pm
↑ Summary
blib/lib/Paws/Batch/ComputeResourceUpdate.pm »
| 1 | # Generated by default/object.tt | ||
| 2 | package Paws::Batch::ComputeResource; | ||
| 3 | use Moose; | ||
| 4 | has AllocationStrategy => (is => 'ro', isa => 'Str', request_name => 'allocationStrategy', traits => ['NameInRequest']); | ||
| 5 | has BidPercentage => (is => 'ro', isa => 'Int', request_name => 'bidPercentage', traits => ['NameInRequest']); | ||
| 6 | has DesiredvCpus => (is => 'ro', isa => 'Int', request_name => 'desiredvCpus', traits => ['NameInRequest']); | ||
| 7 | has Ec2Configuration => (is => 'ro', isa => 'ArrayRef[Paws::Batch::Ec2Configuration]', request_name => 'ec2Configuration', traits => ['NameInRequest']); | ||
| 8 | has Ec2KeyPair => (is => 'ro', isa => 'Str', request_name => 'ec2KeyPair', traits => ['NameInRequest']); | ||
| 9 | has ImageId => (is => 'ro', isa => 'Str', request_name => 'imageId', traits => ['NameInRequest']); | ||
| 10 | has InstanceRole => (is => 'ro', isa => 'Str', request_name => 'instanceRole', traits => ['NameInRequest']); | ||
| 11 | has InstanceTypes => (is => 'ro', isa => 'ArrayRef[Str|Undef]', request_name => 'instanceTypes', traits => ['NameInRequest']); | ||
| 12 | has LaunchTemplate => (is => 'ro', isa => 'Paws::Batch::LaunchTemplateSpecification', request_name => 'launchTemplate', traits => ['NameInRequest']); | ||
| 13 | has MaxvCpus => (is => 'ro', isa => 'Int', request_name => 'maxvCpus', traits => ['NameInRequest'], required => 1); | ||
| 14 | has MinvCpus => (is => 'ro', isa => 'Int', request_name => 'minvCpus', traits => ['NameInRequest']); | ||
| 15 | has PlacementGroup => (is => 'ro', isa => 'Str', request_name => 'placementGroup', traits => ['NameInRequest']); | ||
| 16 | has SecurityGroupIds => (is => 'ro', isa => 'ArrayRef[Str|Undef]', request_name => 'securityGroupIds', traits => ['NameInRequest']); | ||
| 17 | has SpotIamFleetRole => (is => 'ro', isa => 'Str', request_name => 'spotIamFleetRole', traits => ['NameInRequest']); | ||
| 18 | has Subnets => (is => 'ro', isa => 'ArrayRef[Str|Undef]', request_name => 'subnets', traits => ['NameInRequest'], required => 1); | ||
| 19 | has Tags => (is => 'ro', isa => 'Paws::Batch::TagsMap', request_name => 'tags', traits => ['NameInRequest']); | ||
| 20 | has Type => (is => 'ro', isa => 'Str', request_name => 'type', traits => ['NameInRequest'], required => 1); | ||
| 21 | |||
| 22 | 1; | ||
| 23 | |||
| 24 | ### main pod documentation begin ### | ||
| 25 | |||
| 26 | =head1 NAME | ||
| 27 | |||
| 28 | Paws::Batch::ComputeResource | ||
| 29 | |||
| 30 | =head1 USAGE | ||
| 31 | |||
| 32 | This class represents one of two things: | ||
| 33 | |||
| 34 | =head3 Arguments in a call to a service | ||
| 35 | |||
| 36 | Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. | ||
| 37 | Each attribute should be used as a named argument in the calls that expect this type of object. | ||
| 38 | |||
| 39 | As an example, if Att1 is expected to be a Paws::Batch::ComputeResource object: | ||
| 40 | |||
| 41 | $service_obj->Method(Att1 => { AllocationStrategy => $value, ..., Type => $value }); | ||
| 42 | |||
| 43 | =head3 Results returned from an API call | ||
| 44 | |||
| 45 | Use accessors for each attribute. If Att1 is expected to be an Paws::Batch::ComputeResource object: | ||
| 46 | |||
| 47 | $result = $service_obj->Method(...); | ||
| 48 | $result->Att1->AllocationStrategy | ||
| 49 | |||
| 50 | =head1 DESCRIPTION | ||
| 51 | |||
| 52 | An object representing an AWS Batch compute resource. For more | ||
| 53 | information, see Compute Environments | ||
| 54 | (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) | ||
| 55 | in the I<AWS Batch User Guide>. | ||
| 56 | |||
| 57 | =head1 ATTRIBUTES | ||
| 58 | |||
| 59 | |||
| 60 | =head2 AllocationStrategy => Str | ||
| 61 | |||
| 62 | The allocation strategy to use for the compute resource if not enough | ||
| 63 | instances of the best fitting instance type can be allocated. This | ||
| 64 | might be because of availability of the instance type in the Region or | ||
| 65 | Amazon EC2 service limits | ||
| 66 | (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html). | ||
| 67 | For more information, see Allocation Strategies | ||
| 68 | (https://docs.aws.amazon.com/batch/latest/userguide/allocation-strategies.html) | ||
| 69 | in the I<AWS Batch User Guide>. | ||
| 70 | |||
| 71 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 72 | and shouldn't be specified. | ||
| 73 | |||
| 74 | =over | ||
| 75 | |||
| 76 | =item BEST_FIT (default) | ||
| 77 | |||
| 78 | AWS Batch selects an instance type that best fits the needs of the jobs | ||
| 79 | with a preference for the lowest-cost instance type. If additional | ||
| 80 | instances of the selected instance type aren't available, AWS Batch | ||
| 81 | waits for the additional instances to be available. If there aren't | ||
| 82 | enough instances available, or if the user is hitting Amazon EC2 | ||
| 83 | service limits | ||
| 84 | (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) | ||
| 85 | then additional jobs aren't run until the currently running jobs have | ||
| 86 | completed. This allocation strategy keeps costs lower but can limit | ||
| 87 | scaling. If you are using Spot Fleets with C<BEST_FIT> then the Spot | ||
| 88 | Fleet IAM Role must be specified. | ||
| 89 | |||
| 90 | =item BEST_FIT_PROGRESSIVE | ||
| 91 | |||
| 92 | AWS Batch will select additional instance types that are large enough | ||
| 93 | to meet the requirements of the jobs in the queue, with a preference | ||
| 94 | for instance types with a lower cost per unit vCPU. If additional | ||
| 95 | instances of the previously selected instance types aren't available, | ||
| 96 | AWS Batch will select new instance types. | ||
| 97 | |||
| 98 | =item SPOT_CAPACITY_OPTIMIZED | ||
| 99 | |||
| 100 | AWS Batch will select one or more instance types that are large enough | ||
| 101 | to meet the requirements of the jobs in the queue, with a preference | ||
| 102 | for instance types that are less likely to be interrupted. This | ||
| 103 | allocation strategy is only available for Spot Instance compute | ||
| 104 | resources. | ||
| 105 | |||
| 106 | =back | ||
| 107 | |||
| 108 | With both C<BEST_FIT_PROGRESSIVE> and C<SPOT_CAPACITY_OPTIMIZED> | ||
| 109 | strategies, AWS Batch might need to go above C<maxvCpus> to meet your | ||
| 110 | capacity requirements. In this event, AWS Batch never exceeds | ||
| 111 | C<maxvCpus> by more than a single instance. | ||
| 112 | |||
| 113 | |||
| 114 | =head2 BidPercentage => Int | ||
| 115 | |||
| 116 | The maximum percentage that a Spot Instance price can be when compared | ||
| 117 | with the On-Demand price for that instance type before instances are | ||
| 118 | launched. For example, if your maximum percentage is 20%, then the Spot | ||
| 119 | price must be less than 20% of the current On-Demand price for that | ||
| 120 | Amazon EC2 instance. You always pay the lowest (market) price and never | ||
| 121 | more than your maximum percentage. If you leave this field empty, the | ||
| 122 | default value is 100% of the On-Demand price. | ||
| 123 | |||
| 124 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 125 | and shouldn't be specified. | ||
| 126 | |||
| 127 | |||
| 128 | =head2 DesiredvCpus => Int | ||
| 129 | |||
| 130 | The desired number of Amazon EC2 vCPUS in the compute environment. AWS | ||
| 131 | Batch modifies this value between the minimum and maximum values, based | ||
| 132 | on job queue demand. | ||
| 133 | |||
| 134 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 135 | and shouldn't be specified. | ||
| 136 | |||
| 137 | |||
| 138 | =head2 Ec2Configuration => ArrayRef[L<Paws::Batch::Ec2Configuration>] | ||
| 139 | |||
| 140 | Provides information used to select Amazon Machine Images (AMIs) for | ||
| 141 | EC2 instances in the compute environment. If C<Ec2Configuration> isn't | ||
| 142 | specified, the default is C<ECS_AL1>. | ||
| 143 | |||
| 144 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 145 | and shouldn't be specified. | ||
| 146 | |||
| 147 | |||
| 148 | =head2 Ec2KeyPair => Str | ||
| 149 | |||
| 150 | The Amazon EC2 key pair that's used for instances launched in the | ||
| 151 | compute environment. You can use this key pair to log in to your | ||
| 152 | instances with SSH. | ||
| 153 | |||
| 154 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 155 | and shouldn't be specified. | ||
| 156 | |||
| 157 | |||
| 158 | =head2 ImageId => Str | ||
| 159 | |||
| 160 | The Amazon Machine Image (AMI) ID used for instances launched in the | ||
| 161 | compute environment. This parameter is overridden by the | ||
| 162 | C<imageIdOverride> member of the C<Ec2Configuration> structure. | ||
| 163 | |||
| 164 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 165 | and shouldn't be specified. | ||
| 166 | |||
| 167 | The AMI that you choose for a compute environment must match the | ||
| 168 | architecture of the instance types that you intend to use for that | ||
| 169 | compute environment. For example, if your compute environment uses A1 | ||
| 170 | instance types, the compute resource AMI that you choose must support | ||
| 171 | ARM instances. Amazon ECS vends both x86 and ARM versions of the Amazon | ||
| 172 | ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon | ||
| 173 | ECS-optimized Amazon Linux 2 AMI | ||
| 174 | (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux-variants.html) | ||
| 175 | in the I<Amazon Elastic Container Service Developer Guide>. | ||
| 176 | |||
| 177 | |||
| 178 | =head2 InstanceRole => Str | ||
| 179 | |||
| 180 | The Amazon ECS instance profile applied to Amazon EC2 instances in a | ||
| 181 | compute environment. You can specify the short name or full Amazon | ||
| 182 | Resource Name (ARN) of an instance profile. For example, C< | ||
| 183 | I<ecsInstanceRole> > or | ||
| 184 | C<arn:aws:iam::I<E<lt>aws_account_idE<gt>>:instance-profile/I<ecsInstanceRole> | ||
| 185 | >. For more information, see Amazon ECS Instance Role | ||
| 186 | (https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html) | ||
| 187 | in the I<AWS Batch User Guide>. | ||
| 188 | |||
| 189 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 190 | and shouldn't be specified. | ||
| 191 | |||
| 192 | |||
| 193 | =head2 InstanceTypes => ArrayRef[Str|Undef] | ||
| 194 | |||
| 195 | The instances types that can be launched. You can specify instance | ||
| 196 | families to launch any instance type within those families (for | ||
| 197 | example, C<c5> or C<p3>), or you can specify specific sizes within a | ||
| 198 | family (such as C<c5.8xlarge>). You can also choose C<optimal> to | ||
| 199 | select instance types (from the C4, M4, and R4 instance families) that | ||
| 200 | match the demand of your job queues. | ||
| 201 | |||
| 202 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 203 | and shouldn't be specified. | ||
| 204 | |||
| 205 | When you create a compute environment, the instance types that you | ||
| 206 | select for the compute environment must share the same architecture. | ||
| 207 | For example, you can't mix x86 and ARM instances in the same compute | ||
| 208 | environment. | ||
| 209 | |||
| 210 | Currently, C<optimal> uses instance types from the C4, M4, and R4 | ||
| 211 | instance families. In Regions that don't have instance types from those | ||
| 212 | instance families, instance types from the C5, M5. and R5 instance | ||
| 213 | families are used. | ||
| 214 | |||
| 215 | |||
| 216 | =head2 LaunchTemplate => L<Paws::Batch::LaunchTemplateSpecification> | ||
| 217 | |||
| 218 | The launch template to use for your compute resources. Any other | ||
| 219 | compute resource parameters that you specify in a | ||
| 220 | CreateComputeEnvironment API operation override the same parameters in | ||
| 221 | the launch template. You must specify either the launch template ID or | ||
| 222 | launch template name in the request, but not both. For more | ||
| 223 | information, see Launch Template Support | ||
| 224 | (https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html) | ||
| 225 | in the I<AWS Batch User Guide>. | ||
| 226 | |||
| 227 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 228 | and shouldn't be specified. | ||
| 229 | |||
| 230 | |||
| 231 | =head2 B<REQUIRED> MaxvCpus => Int | ||
| 232 | |||
| 233 | The maximum number of Amazon EC2 vCPUs that a compute environment can | ||
| 234 | reach. | ||
| 235 | |||
| 236 | With both C<BEST_FIT_PROGRESSIVE> and C<SPOT_CAPACITY_OPTIMIZED> | ||
| 237 | allocation strategies, AWS Batch might need to exceed C<maxvCpus> to | ||
| 238 | meet your capacity requirements. In this event, AWS Batch never exceeds | ||
| 239 | C<maxvCpus> by more than a single instance. For example, no more than a | ||
| 240 | single instance from among those specified in your compute environment | ||
| 241 | is allocated. | ||
| 242 | |||
| 243 | |||
| 244 | =head2 MinvCpus => Int | ||
| 245 | |||
| 246 | The minimum number of Amazon EC2 vCPUs that an environment should | ||
| 247 | maintain (even if the compute environment is C<DISABLED>). | ||
| 248 | |||
| 249 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 250 | and shouldn't be specified. | ||
| 251 | |||
| 252 | |||
| 253 | =head2 PlacementGroup => Str | ||
| 254 | |||
| 255 | The Amazon EC2 placement group to associate with your compute | ||
| 256 | resources. If you intend to submit multi-node parallel jobs to your | ||
| 257 | compute environment, you should consider creating a cluster placement | ||
| 258 | group and associate it with your compute resources. This keeps your | ||
| 259 | multi-node parallel job on a logical grouping of instances within a | ||
| 260 | single Availability Zone with high network flow potential. For more | ||
| 261 | information, see Placement Groups | ||
| 262 | (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) | ||
| 263 | in the I<Amazon EC2 User Guide for Linux Instances>. | ||
| 264 | |||
| 265 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 266 | and shouldn't be specified. | ||
| 267 | |||
| 268 | |||
| 269 | =head2 SecurityGroupIds => ArrayRef[Str|Undef] | ||
| 270 | |||
| 271 | The Amazon EC2 security groups associated with instances launched in | ||
| 272 | the compute environment. One or more security groups must be specified, | ||
| 273 | either in C<securityGroupIds> or using a launch template referenced in | ||
| 274 | C<launchTemplate>. This parameter is required for jobs running on | ||
| 275 | Fargate resources and must contain at least one security group. Fargate | ||
| 276 | doesn't support launch templates. If security groups are specified | ||
| 277 | using both C<securityGroupIds> and C<launchTemplate>, the values in | ||
| 278 | C<securityGroupIds> is used. | ||
| 279 | |||
| 280 | |||
| 281 | =head2 SpotIamFleetRole => Str | ||
| 282 | |||
| 283 | The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role | ||
| 284 | applied to a C<SPOT> compute environment. This role is required if the | ||
| 285 | allocation strategy set to C<BEST_FIT> or if the allocation strategy | ||
| 286 | isn't specified. For more information, see Amazon EC2 Spot Fleet Role | ||
| 287 | (https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html) | ||
| 288 | in the I<AWS Batch User Guide>. | ||
| 289 | |||
| 290 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 291 | and shouldn't be specified. | ||
| 292 | |||
| 293 | To tag your Spot Instances on creation, the Spot Fleet IAM role | ||
| 294 | specified here must use the newer B<AmazonEC2SpotFleetTaggingRole> | ||
| 295 | managed policy. The previously recommended B<AmazonEC2SpotFleetRole> | ||
| 296 | managed policy doesn't have the required permissions to tag Spot | ||
| 297 | Instances. For more information, see Spot Instances not tagged on | ||
| 298 | creation | ||
| 299 | (https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#spot-instance-no-tag) | ||
| 300 | in the I<AWS Batch User Guide>. | ||
| 301 | |||
| 302 | |||
| 303 | =head2 B<REQUIRED> Subnets => ArrayRef[Str|Undef] | ||
| 304 | |||
| 305 | The VPC subnets into which the compute resources are launched. These | ||
| 306 | subnets must be within the same VPC. Fargate compute resources can | ||
| 307 | contain up to 16 subnets. For more information, see VPCs and Subnets | ||
| 308 | (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html) in | ||
| 309 | the I<Amazon VPC User Guide>. | ||
| 310 | |||
| 311 | |||
| 312 | =head2 Tags => L<Paws::Batch::TagsMap> | ||
| 313 | |||
| 314 | Key-value pair tags to be applied to EC2 resources that are launched in | ||
| 315 | the compute environment. For AWS Batch, these take the form of | ||
| 316 | "String1": "String2", where String1 is the tag key and String2 is the | ||
| 317 | tag valueE<minus>for example, { "Name": "AWS Batch Instance - | ||
| 318 | C4OnDemand" }. This is helpful for recognizing your AWS Batch instances | ||
| 319 | in the Amazon EC2 console. These tags can't be updated or removed after | ||
| 320 | the compute environment has been created; any changes require creating | ||
| 321 | a new compute environment and removing the old compute environment. | ||
| 322 | These tags aren't seen when using the AWS Batch C<ListTagsForResource> | ||
| 323 | API operation. | ||
| 324 | |||
| 325 | This parameter isn't applicable to jobs running on Fargate resources, | ||
| 326 | and shouldn't be specified. | ||
| 327 | |||
| 328 | |||
| 329 | =head2 B<REQUIRED> Type => Str | ||
| 330 | |||
| 331 | The type of compute environment: C<EC2>, C<SPOT>, C<FARGATE>, or | ||
| 332 | C<FARGATE_SPOT>. For more information, see Compute Environments | ||
| 333 | (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) | ||
| 334 | in the I<AWS Batch User Guide>. | ||
| 335 | |||
| 336 | If you choose C<SPOT>, you must also specify an Amazon EC2 Spot Fleet | ||
| 337 | role with the C<spotIamFleetRole> parameter. For more information, see | ||
| 338 | Amazon EC2 Spot Fleet role | ||
| 339 | (https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html) | ||
| 340 | in the I<AWS Batch User Guide>. | ||
| 341 | |||
| 342 | |||
| 343 | |||
| 344 | =head1 SEE ALSO | ||
| 345 | |||
| 346 | This class forms part of L<Paws>, describing an object used in L<Paws::Batch> | ||
| 347 | |||
| 348 | =head1 BUGS and CONTRIBUTIONS | ||
| 349 | |||
| 350 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 351 | |||
| 352 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 353 | |||
| 354 | =cut | ||
| 355 |