# Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
from . import AWSObject, AWSProperty, PropsDictType
from .validators import boolean, double, integer
from .validators.batch import (
validate_allocation_strategy,
validate_environment_state,
validate_launch_template_specification,
validate_queue_state,
)
[docs]class Ec2ConfigurationObject(AWSProperty):
"""
`Ec2ConfigurationObject <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-ec2configurationobject.html>`__
"""
props: PropsDictType = {
"ImageIdOverride": (str, False),
"ImageKubernetesVersion": (str, False),
"ImageType": (str, True),
}
[docs]class LaunchTemplateSpecification(AWSProperty):
"""
`LaunchTemplateSpecification <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-launchtemplatespecification.html>`__
"""
props: PropsDictType = {
"LaunchTemplateId": (str, False),
"LaunchTemplateName": (str, False),
"Version": (str, False),
}
[docs] def validate(self):
validate_launch_template_specification(self)
[docs]class ComputeResources(AWSProperty):
"""
`ComputeResources <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-computeresources.html>`__
"""
props: PropsDictType = {
"AllocationStrategy": (validate_allocation_strategy, False),
"BidPercentage": (integer, False),
"DesiredvCpus": (integer, False),
"Ec2Configuration": ([Ec2ConfigurationObject], False),
"Ec2KeyPair": (str, False),
"ImageId": (str, False),
"InstanceRole": (str, False),
"InstanceTypes": ([str], False),
"LaunchTemplate": (LaunchTemplateSpecification, False),
"MaxvCpus": (integer, True),
"MinvCpus": (integer, False),
"PlacementGroup": (str, False),
"SecurityGroupIds": ([str], False),
"SpotIamFleetRole": (str, False),
"Subnets": ([str], True),
"Tags": (dict, False),
"Type": (str, True),
"UpdateToLatestImageVersion": (boolean, False),
}
[docs]class EksConfiguration(AWSProperty):
"""
`EksConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-eksconfiguration.html>`__
"""
props: PropsDictType = {
"EksClusterArn": (str, True),
"KubernetesNamespace": (str, True),
}
[docs]class UpdatePolicy(AWSProperty):
"""
`UpdatePolicy <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-updatepolicy.html>`__
"""
props: PropsDictType = {
"JobExecutionTimeoutMinutes": (integer, False),
"TerminateJobsOnUpdate": (boolean, False),
}
[docs]class ComputeEnvironment(AWSObject):
"""
`ComputeEnvironment <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-computeenvironment.html>`__
"""
resource_type = "AWS::Batch::ComputeEnvironment"
props: PropsDictType = {
"ComputeEnvironmentName": (str, False),
"ComputeResources": (ComputeResources, False),
"EksConfiguration": (EksConfiguration, False),
"ReplaceComputeEnvironment": (boolean, False),
"ServiceRole": (str, False),
"State": (validate_environment_state, False),
"Tags": (dict, False),
"Type": (str, True),
"UnmanagedvCpus": (integer, False),
"UpdatePolicy": (UpdatePolicy, False),
}
[docs]class Environment(AWSProperty):
"""
`Environment <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-environment.html>`__
"""
props: PropsDictType = {
"Name": (str, False),
"Value": (str, False),
}
[docs]class EphemeralStorage(AWSProperty):
"""
`EphemeralStorage <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ecstaskproperties-ephemeralstorage.html>`__
"""
props: PropsDictType = {
"SizeInGiB": (integer, True),
}
[docs]class Device(AWSProperty):
"""
`Device <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-device.html>`__
"""
props: PropsDictType = {
"ContainerPath": (str, False),
"HostPath": (str, False),
"Permissions": ([str], False),
}
[docs]class Tmpfs(AWSProperty):
"""
`Tmpfs <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-tmpfs.html>`__
"""
props: PropsDictType = {
"ContainerPath": (str, True),
"MountOptions": ([str], False),
"Size": (integer, True),
}
[docs]class LinuxParameters(AWSProperty):
"""
`LinuxParameters <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-taskcontainerproperties-linuxparameters.html>`__
"""
props: PropsDictType = {
"Devices": ([Device], False),
"InitProcessEnabled": (boolean, False),
"MaxSwap": (integer, False),
"SharedMemorySize": (integer, False),
"Swappiness": (integer, False),
"Tmpfs": ([Tmpfs], False),
}
[docs]class Secret(AWSProperty):
"""
`Secret <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-secret.html>`__
"""
props: PropsDictType = {
"Name": (str, True),
"ValueFrom": (str, True),
}
[docs]class LogConfiguration(AWSProperty):
"""
`LogConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-taskcontainerproperties-logconfiguration.html>`__
"""
props: PropsDictType = {
"LogDriver": (str, True),
"Options": (dict, False),
"SecretOptions": ([Secret], False),
}
[docs]class MountPoints(AWSProperty):
"""
`MountPoints <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-mountpoints.html>`__
"""
props: PropsDictType = {
"ContainerPath": (str, False),
"ReadOnly": (boolean, False),
"SourceVolume": (str, False),
}
[docs]class NetworkConfiguration(AWSProperty):
"""
`NetworkConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ecstaskproperties-networkconfiguration.html>`__
"""
props: PropsDictType = {
"AssignPublicIp": (str, False),
}
[docs]class RepositoryCredentials(AWSProperty):
"""
`RepositoryCredentials <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-taskcontainerproperties-repositorycredentials.html>`__
"""
props: PropsDictType = {
"CredentialsParameter": (str, True),
}
[docs]class ResourceRequirement(AWSProperty):
"""
`ResourceRequirement <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-resourcerequirement.html>`__
"""
props: PropsDictType = {
"Type": (str, False),
"Value": (str, False),
}
[docs]class Ulimit(AWSProperty):
"""
`Ulimit <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ulimit.html>`__
"""
props: PropsDictType = {
"HardLimit": (integer, True),
"Name": (str, True),
"SoftLimit": (integer, True),
}
[docs]class AuthorizationConfig(AWSProperty):
"""
`AuthorizationConfig <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-authorizationconfig.html>`__
"""
props: PropsDictType = {
"AccessPointId": (str, False),
"Iam": (str, False),
}
[docs]class EfsVolumeConfiguration(AWSProperty):
"""
`EfsVolumeConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-efsvolumeconfiguration.html>`__
"""
props: PropsDictType = {
"AuthorizationConfig": (AuthorizationConfig, False),
"FileSystemId": (str, True),
"RootDirectory": (str, False),
"TransitEncryption": (str, False),
"TransitEncryptionPort": (integer, False),
}
[docs]class VolumesHost(AWSProperty):
"""
`VolumesHost <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumeshost.html>`__
"""
props: PropsDictType = {
"SourcePath": (str, False),
}
[docs]class Volumes(AWSProperty):
"""
`Volumes <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-volumes.html>`__
"""
props: PropsDictType = {
"EfsVolumeConfiguration": (EfsVolumeConfiguration, False),
"Host": (VolumesHost, False),
"Name": (str, False),
}
[docs]class ContainerProperties(AWSProperty):
"""
`ContainerProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html>`__
"""
props: PropsDictType = {
"Command": ([str], False),
"Environment": ([Environment], False),
"EphemeralStorage": (EphemeralStorage, False),
"ExecutionRoleArn": (str, False),
"FargatePlatformConfiguration": (FargatePlatformConfiguration, False),
"Image": (str, True),
"InstanceType": (str, False),
"JobRoleArn": (str, False),
"LinuxParameters": (LinuxParameters, False),
"LogConfiguration": (LogConfiguration, False),
"Memory": (integer, False),
"MountPoints": ([MountPoints], False),
"NetworkConfiguration": (NetworkConfiguration, False),
"Privileged": (boolean, False),
"ReadonlyRootFilesystem": (boolean, False),
"RepositoryCredentials": (RepositoryCredentials, False),
"ResourceRequirements": ([ResourceRequirement], False),
"RuntimePlatform": (RuntimePlatform, False),
"Secrets": ([Secret], False),
"Ulimits": ([Ulimit], False),
"User": (str, False),
"Vcpus": (integer, False),
"Volumes": ([Volumes], False),
}
[docs]class TaskContainerDependency(AWSProperty):
"""
`TaskContainerDependency <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-taskcontainerdependency.html>`__
"""
props: PropsDictType = {
"Condition": (str, True),
"ContainerName": (str, True),
}
[docs]class TaskContainerProperties(AWSProperty):
"""
`TaskContainerProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-taskcontainerproperties.html>`__
"""
props: PropsDictType = {
"Command": ([str], False),
"DependsOn": ([TaskContainerDependency], False),
"Environment": ([Environment], False),
"Essential": (boolean, False),
"Image": (str, True),
"LinuxParameters": (LinuxParameters, False),
"LogConfiguration": (LogConfiguration, False),
"MountPoints": ([MountPoints], False),
"Name": (str, False),
"Privileged": (boolean, False),
"ReadonlyRootFilesystem": (boolean, False),
"RepositoryCredentials": (RepositoryCredentials, False),
"ResourceRequirements": ([ResourceRequirement], False),
"Secrets": ([Secret], False),
"Ulimits": ([Ulimit], False),
"User": (str, False),
}
[docs]class EcsTaskProperties(AWSProperty):
"""
`EcsTaskProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ecstaskproperties.html>`__
"""
props: PropsDictType = {
"Containers": ([TaskContainerProperties], False),
"EphemeralStorage": (EphemeralStorage, False),
"ExecutionRoleArn": (str, False),
"IpcMode": (str, False),
"NetworkConfiguration": (NetworkConfiguration, False),
"PidMode": (str, False),
"PlatformVersion": (str, False),
"RuntimePlatform": (RuntimePlatform, False),
"TaskRoleArn": (str, False),
"Volumes": ([Volumes], False),
}
[docs]class EcsProperties(AWSProperty):
"""
`EcsProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ecsproperties.html>`__
"""
props: PropsDictType = {
"TaskProperties": ([EcsTaskProperties], True),
}
[docs]class EksContainerEnvironmentVariable(AWSProperty):
"""
`EksContainerEnvironmentVariable <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekscontainerenvironmentvariable.html>`__
"""
props: PropsDictType = {
"Name": (str, True),
"Value": (str, False),
}
[docs]class EksContainerResourceRequirements(AWSProperty):
"""
`EksContainerResourceRequirements <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekscontainerresourcerequirements.html>`__
"""
props: PropsDictType = {
"Limits": (dict, False),
"Requests": (dict, False),
}
[docs]class EksContainerSecurityContext(AWSProperty):
"""
`EksContainerSecurityContext <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekscontainersecuritycontext.html>`__
"""
props: PropsDictType = {
"Privileged": (boolean, False),
"ReadOnlyRootFilesystem": (boolean, False),
"RunAsGroup": (integer, False),
"RunAsNonRoot": (boolean, False),
"RunAsUser": (integer, False),
}
[docs]class EksContainerVolumeMount(AWSProperty):
"""
`EksContainerVolumeMount <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekscontainervolumemount.html>`__
"""
props: PropsDictType = {
"MountPath": (str, False),
"Name": (str, False),
"ReadOnly": (boolean, False),
}
[docs]class EksContainer(AWSProperty):
"""
`EksContainer <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekscontainer.html>`__
"""
props: PropsDictType = {
"Args": ([str], False),
"Command": ([str], False),
"Env": ([EksContainerEnvironmentVariable], False),
"Image": (str, True),
"ImagePullPolicy": (str, False),
"Name": (str, False),
"Resources": (EksContainerResourceRequirements, False),
"SecurityContext": (EksContainerSecurityContext, False),
"VolumeMounts": ([EksContainerVolumeMount], False),
}
[docs]class EksEmptyDir(AWSProperty):
"""
`EksEmptyDir <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-eksemptydir.html>`__
"""
props: PropsDictType = {
"Medium": (str, False),
"SizeLimit": (str, False),
}
[docs]class EksHostPath(AWSProperty):
"""
`EksHostPath <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekshostpath.html>`__
"""
props: PropsDictType = {
"Path": (str, False),
}
[docs]class EksSecret(AWSProperty):
"""
`EksSecret <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-ekssecret.html>`__
"""
props: PropsDictType = {
"Optional": (boolean, False),
"SecretName": (str, True),
}
[docs]class EksVolume(AWSProperty):
"""
`EksVolume <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-eksvolume.html>`__
"""
props: PropsDictType = {
"EmptyDir": (EksEmptyDir, False),
"HostPath": (EksHostPath, False),
"Name": (str, True),
"Secret": (EksSecret, False),
}
[docs]class PodProperties(AWSProperty):
"""
`PodProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-podproperties.html>`__
"""
props: PropsDictType = {
"Containers": ([EksContainer], False),
"DnsPolicy": (str, False),
"HostNetwork": (boolean, False),
"InitContainers": ([EksContainer], False),
"Metadata": (Metadata, False),
"ServiceAccountName": (str, False),
"ShareProcessNamespace": (boolean, False),
"Volumes": ([EksVolume], False),
}
[docs]class EksProperties(AWSProperty):
"""
`EksProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-eksproperties.html>`__
"""
props: PropsDictType = {
"PodProperties": (PodProperties, False),
}
[docs]class NodeRangeProperty(AWSProperty):
"""
`NodeRangeProperty <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-noderangeproperty.html>`__
"""
props: PropsDictType = {
"Container": (ContainerProperties, False),
"EcsProperties": (EcsProperties, False),
"InstanceTypes": ([str], False),
"TargetNodes": (str, True),
}
[docs]class NodeProperties(AWSProperty):
"""
`NodeProperties <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-nodeproperties.html>`__
"""
props: PropsDictType = {
"MainNode": (integer, True),
"NodeRangeProperties": ([NodeRangeProperty], True),
"NumNodes": (integer, True),
}
[docs]class EvaluateOnExit(AWSProperty):
"""
`EvaluateOnExit <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-evaluateonexit.html>`__
"""
props: PropsDictType = {
"Action": (str, True),
"OnExitCode": (str, False),
"OnReason": (str, False),
"OnStatusReason": (str, False),
}
[docs]class RetryStrategy(AWSProperty):
"""
`RetryStrategy <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-retrystrategy.html>`__
"""
props: PropsDictType = {
"Attempts": (integer, False),
"EvaluateOnExit": ([EvaluateOnExit], False),
}
[docs]class Timeout(AWSProperty):
"""
`Timeout <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-timeout.html>`__
"""
props: PropsDictType = {
"AttemptDurationSeconds": (integer, False),
}
[docs]class JobDefinition(AWSObject):
"""
`JobDefinition <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html>`__
"""
resource_type = "AWS::Batch::JobDefinition"
props: PropsDictType = {
"ContainerProperties": (ContainerProperties, False),
"EcsProperties": (EcsProperties, False),
"EksProperties": (EksProperties, False),
"JobDefinitionName": (str, False),
"NodeProperties": (NodeProperties, False),
"Parameters": (dict, False),
"PlatformCapabilities": ([str], False),
"PropagateTags": (boolean, False),
"RetryStrategy": (RetryStrategy, False),
"SchedulingPriority": (integer, False),
"Tags": (dict, False),
"Timeout": (Timeout, False),
"Type": (str, True),
}
[docs]class ComputeEnvironmentOrder(AWSProperty):
"""
`ComputeEnvironmentOrder <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobqueue-computeenvironmentorder.html>`__
"""
props: PropsDictType = {
"ComputeEnvironment": (str, True),
"Order": (integer, True),
}
[docs]class JobStateTimeLimitAction(AWSProperty):
"""
`JobStateTimeLimitAction <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobqueue-jobstatetimelimitaction.html>`__
"""
props: PropsDictType = {
"Action": (str, True),
"MaxTimeSeconds": (integer, True),
"Reason": (str, True),
"State": (str, True),
}
[docs]class JobQueue(AWSObject):
"""
`JobQueue <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobqueue.html>`__
"""
resource_type = "AWS::Batch::JobQueue"
props: PropsDictType = {
"ComputeEnvironmentOrder": ([ComputeEnvironmentOrder], True),
"JobQueueName": (str, False),
"JobStateTimeLimitActions": ([JobStateTimeLimitAction], False),
"Priority": (integer, True),
"SchedulingPolicyArn": (str, False),
"State": (validate_queue_state, False),
"Tags": (dict, False),
}
[docs]class ShareAttributes(AWSProperty):
"""
`ShareAttributes <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html>`__
"""
props: PropsDictType = {
"ShareIdentifier": (str, False),
"WeightFactor": (double, False),
}
[docs]class FairsharePolicy(AWSProperty):
"""
`FairsharePolicy <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-fairsharepolicy.html>`__
"""
props: PropsDictType = {
"ComputeReservation": (double, False),
"ShareDecaySeconds": (double, False),
"ShareDistribution": ([ShareAttributes], False),
}
[docs]class SchedulingPolicy(AWSObject):
"""
`SchedulingPolicy <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-schedulingpolicy.html>`__
"""
resource_type = "AWS::Batch::SchedulingPolicy"
props: PropsDictType = {
"FairsharePolicy": (FairsharePolicy, False),
"Name": (str, False),
"Tags": (dict, False),
}