create_deployment
async
¶
create_deployment(
application_name: ApplicationName,
*,
config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
deployment_group_name: Optional[DeploymentGroupName] = None,
revision: Optional[RevisionLocation] = None,
deployment_config_name: Optional[DeploymentConfigName] = None,
description: Optional[Description] = None,
ignore_application_stop_failures: Optional[Boolean] = None,
target_instances: Optional[TargetInstances] = None,
auto_rollback_configuration: Optional[AutoRollbackConfiguration] = None,
update_outdated_instances_only: Optional[Boolean] = None,
file_exists_behavior: Optional[FileExistsBehavior] = None,
deployment_mode: Optional[DeploymentMode] = None,
override_alarm_configuration: Optional[AlarmConfiguration] = None,
ec2_deployment_options: Optional[EC2DeploymentOptions] = None,
) -> CreateDeploymentOutput
Deploys an application revision through the specified deployment group.
Parameters:
-
application_name(ApplicationName) –The name of an CodeDeploy application associated with the user or Amazon Web Services account.
-
deployment_group_name(Optional[DeploymentGroupName], default:None) –The name of the deployment group.
-
revision(Optional[RevisionLocation], default:None) –The type and location of the revision to deploy.
-
deployment_config_name(Optional[DeploymentConfigName], default:None) –The name of a deployment configuration associated with the user or Amazon Web Services account.
If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it,
CodeDeployDefault.OneAtATimeis used by default. -
description(Optional[Description], default:None) –A comment about the deployment.
-
ignore_application_stop_failures(Optional[Boolean], default:None) –If true, then if an
ApplicationStop,BeforeBlockTraffic, orAfterBlockTrafficdeployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, ifApplicationStopfails, the deployment continues withDownloadBundle. IfBeforeBlockTrafficfails, the deployment continues withBlockTraffic. IfAfterBlockTrafficfails, the deployment continues withApplicationStop.If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.
During a deployment, the CodeDeploy agent runs the scripts specified for
ApplicationStop,BeforeBlockTraffic, andAfterBlockTrafficin the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use
ignoreApplicationStopFailuresto specify that theApplicationStop,BeforeBlockTraffic, andAfterBlockTrafficfailures should be ignored. -
target_instances(Optional[TargetInstances], default:None) –Information about the instances that belong to the replacement environment in a blue/green deployment.
-
auto_rollback_configuration(Optional[AutoRollbackConfiguration], default:None) –Configuration information for an automatic rollback that is added when a deployment is created.
-
update_outdated_instances_only(Optional[Boolean], default:None) –Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.
-
file_exists_behavior(Optional[FileExistsBehavior], default:None) –Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.
The
fileExistsBehaviorparameter takes any of the following values:-
DISALLOW: The deployment fails. This is also the default behavior if no option is specified.
-
OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.
-
RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
-
-
deployment_mode(Optional[DeploymentMode], default:None) –The type of deployment to create. Valid values are:
-
STANDARD: Deploys the specified revision. This is the default behavior ifdeploymentModeis not specified. -
RESTART: Restarts the application on the target instances using the revision from the deployment group's last successful deployment, without downloading a new revision.RESTARTis supported only for EC2/On-premises in-place deployments.When
deploymentModeisRESTART, the following apply:-
The call is rejected for Amazon ECS and Lambda deployments.
-
The
revisionparameter (including itss3LocationandgitHubLocation) must not be specified, and is rejected if provided. The revision is resolved by the service from the deployment group's last successful deployment. -
The
updateOutdatedInstancesOnlyparameter must not be set totrue, and is rejected if provided.
-
-
-
override_alarm_configuration(Optional[AlarmConfiguration], default:None) –Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call
CreateDeploymentto create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.If you specify an
overrideAlarmConfiguration, you need theUpdateDeploymentGroupIAM permission when callingCreateDeployment.
Raises:
-
AlarmsLimitExceededException–The maximum number of alarms for a deployment group (10) was exceeded.
-
ApplicationDoesNotExistException–The application does not exist with the user or Amazon Web Services account.
-
ApplicationNameRequiredException–The minimum number of required application names was not specified.
-
DeploymentConfigDoesNotExistException–The deployment configuration does not exist with the user or Amazon Web Services account.
-
DeploymentGroupDoesNotExistException–The named deployment group with the user or Amazon Web Services account does not exist.
-
DeploymentGroupNameRequiredException–The deployment group name was not specified.
-
DeploymentLimitExceededException–The number of allowed deployments was exceeded.
-
DescriptionTooLongException–The description is too long.
-
InvalidAlarmConfigException–The format of the alarm configuration is invalid. Possible causes include:
-
The alarm list is null.
-
The alarm object is null.
-
The alarm name is empty or null or exceeds the limit of 255 characters.
-
Two alarms with the same name have been specified.
-
The alarm configuration is enabled, but the alarm list is empty.
-
-
InvalidApplicationNameException–The application name was specified in an invalid format.
-
InvalidAutoRollbackConfigException–The automatic rollback configuration was specified in an invalid format. For example, automatic rollback is enabled, but an invalid triggering event type or no event types were listed.
-
InvalidAutoScalingGroupException–The Auto Scaling group was specified in an invalid format or does not exist.
-
InvalidAutoScalingGroupProcessToSuspendException–The
autoScalingGroupProcessesToSuspendlist inec2DeploymentOptionscontains a process that is not valid. Valid values areTerminate,AZRebalance,InstanceRefresh, andScheduledActions. Process names are case sensitive. -
InvalidComputePlatformException–The computePlatform is invalid. The computePlatform should be
Lambda,Server, orECS. -
InvalidDeploymentConfigNameException–The deployment configuration name was specified in an invalid format.
-
InvalidDeploymentGroupNameException–The deployment group name was specified in an invalid format.
-
InvalidECSServiceException–The Amazon ECS service identifier is not valid.
-
InvalidFileExistsBehaviorException–An invalid fileExistsBehavior option was specified to determine how CodeDeploy handles files or directories that already exist in a deployment target location, but weren't part of the previous successful deployment. Valid values include "DISALLOW," "OVERWRITE," and "RETAIN."
-
InvalidGitHubAccountTokenException–The GitHub token is not valid.
-
InvalidIgnoreApplicationStopFailuresValueException–The IgnoreApplicationStopFailures value is invalid. For Lambda deployments,
falseis expected. For EC2/On-premises deployments,trueorfalseis expected. -
InvalidInputException–The input was specified in an invalid format.
-
InvalidLoadBalancerInfoException–An invalid load balancer name, or no load balancer name, was specified.
-
InvalidRevisionException–The revision was specified in an invalid format.
-
InvalidRoleException–The service role ARN was specified in an invalid format. Or, if an Auto Scaling group was specified, the specified service role does not grant the appropriate permissions to Amazon EC2 Auto Scaling.
-
InvalidTargetInstancesException–The target instance configuration is invalid. Possible causes include:
-
Configuration data for target instances was entered for an in-place deployment.
-
The limit of 10 tags for a tag type was exceeded.
-
The combined length of the tag names exceeded the limit.
-
A specified tag is not currently applied to any instances.
-
-
InvalidTrafficRoutingConfigurationException–The configuration that specifies how traffic is routed during a deployment is invalid.
-
InvalidUpdateOutdatedInstancesOnlyValueException–The UpdateOutdatedInstancesOnly value is invalid. For Lambda deployments,
falseis expected. For EC2/On-premises deployments,trueorfalseis expected. -
RevisionDoesNotExistException–The named revision does not exist with the user or Amazon Web Services account.
-
RevisionRequiredException–The revision ID was not specified.
-
ThrottlingException–An API function was called too frequently.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codedeploy/_services/async_code_deploy.py
971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | |