CodeDeploy class

CodeDeploy is a deployment service that automates application deployments to Amazon EC2 instances, on-premises instances running in your own facility, serverless Lambda functions, or applications in an Amazon ECS service.

You can deploy a nearly unlimited variety of application content, such as an updated Lambda function, updated applications in an Amazon ECS service, code, web and configuration files, executables, packages, scripts, multimedia files, and so on. CodeDeploy can deploy application content stored in Amazon S3 buckets, GitHub repositories, or Bitbucket repositories. You do not need to make changes to your existing code before you can use CodeDeploy.

CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications, without many of the risks associated with error-prone manual deployments.

CodeDeploy Components

Use the information in this guide to help you work with the following CodeDeploy components:

  • Application: A name that uniquely identifies the application you want to deploy. CodeDeploy uses this name, which functions as a container, to ensure the correct combination of revision, deployment configuration, and deployment group are referenced during a deployment.
  • Deployment group: A set of individual instances, CodeDeploy Lambda deployment configuration settings, or an Amazon ECS service and network details. A Lambda deployment group specifies how to route traffic to a new version of a Lambda function. An Amazon ECS deployment group specifies the service created in Amazon ECS to deploy, a load balancer, and a listener to reroute production traffic to an updated containerized application. An Amazon EC2/On-premises deployment group contains individually tagged instances, Amazon EC2 instances in Amazon EC2 Auto Scaling groups, or both. All deployment groups can specify optional trigger, alarm, and rollback settings.
  • Deployment configuration: A set of deployment rules and deployment success and failure conditions used by CodeDeploy during a deployment.
  • Deployment: The process and the components used when updating a Lambda function, a containerized application in an Amazon ECS service, or of installing content on one or more instances.
  • Application revisions: For an Lambda deployment, this is an AppSpec file that specifies the Lambda function to be updated and one or more functions to validate deployment lifecycle events. For an Amazon ECS deployment, this is an AppSpec file that specifies the Amazon ECS task definition, container, and port where production traffic is rerouted. For an EC2/On-premises deployment, this is an archive file that contains source content—source code, webpages, executable files, and deployment scripts—along with an AppSpec file. Revisions are stored in Amazon S3 buckets or GitHub repositories. For Amazon S3, a revision is uniquely identified by its Amazon S3 object key and its ETag, version, or both. For GitHub, a revision is uniquely identified by its commit ID.
This guide also contains information to help you get details about the instances in your deployments, to make on-premises instances available for CodeDeploy deployments, to get details about a Lambda function deployment, and to get details about Amazon ECS service deployments.

CodeDeploy Information Resources

Constructors

CodeDeploy({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addTagsToOnPremisesInstances({required List<String> instanceNames, required List<Tag> tags}) Future<void>
Adds tags to on-premises instances.
batchGetApplicationRevisions({required String applicationName, required List<RevisionLocation> revisions}) Future<BatchGetApplicationRevisionsOutput>
Gets information about one or more application revisions. The maximum number of application revisions that can be returned is 25.
batchGetApplications({required List<String> applicationNames}) Future<BatchGetApplicationsOutput>
Gets information about one or more applications. The maximum number of applications that can be returned is 100.
batchGetDeploymentGroups({required String applicationName, required List<String> deploymentGroupNames}) Future<BatchGetDeploymentGroupsOutput>
Gets information about one or more deployment groups.
batchGetDeploymentInstances({required String deploymentId, required List<String> instanceIds}) Future<BatchGetDeploymentInstancesOutput>
BatchGetDeploymentTargets
batchGetDeployments({required List<String> deploymentIds}) Future<BatchGetDeploymentsOutput>
Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.
batchGetDeploymentTargets({required String deploymentId, required List<String> targetIds}) Future<BatchGetDeploymentTargetsOutput>
Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated BatchGetDeploymentInstances. The maximum number of targets that can be returned is 25.
batchGetOnPremisesInstances({required List<String> instanceNames}) Future<BatchGetOnPremisesInstancesOutput>
Gets information about one or more on-premises instances. The maximum number of on-premises instances that can be returned is 25.
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
continueDeployment({String? deploymentId, DeploymentWaitType? deploymentWaitType}) Future<void>
For a blue/green deployment, starts the process of rerouting traffic from instances in the original environment to instances in the replacement environment without waiting for a specified wait time to elapse. (Traffic rerouting, which is achieved by registering instances in the replacement environment with the load balancer, can start as soon as all instances have a status of Ready.)
createApplication({required String applicationName, ComputePlatform? computePlatform, List<Tag>? tags}) Future<CreateApplicationOutput>
Creates an application.
createDeployment({required String applicationName, AutoRollbackConfiguration? autoRollbackConfiguration, String? deploymentConfigName, String? deploymentGroupName, String? description, FileExistsBehavior? fileExistsBehavior, bool? ignoreApplicationStopFailures, AlarmConfiguration? overrideAlarmConfiguration, RevisionLocation? revision, TargetInstances? targetInstances, bool? updateOutdatedInstancesOnly}) Future<CreateDeploymentOutput>
Deploys an application revision through the specified deployment group.
createDeploymentConfig({required String deploymentConfigName, ComputePlatform? computePlatform, MinimumHealthyHosts? minimumHealthyHosts, TrafficRoutingConfig? trafficRoutingConfig, ZonalConfig? zonalConfig}) Future<CreateDeploymentConfigOutput>
Creates a deployment configuration.
createDeploymentGroup({required String applicationName, required String deploymentGroupName, required String serviceRoleArn, AlarmConfiguration? alarmConfiguration, AutoRollbackConfiguration? autoRollbackConfiguration, List<String>? autoScalingGroups, BlueGreenDeploymentConfiguration? blueGreenDeploymentConfiguration, String? deploymentConfigName, DeploymentStyle? deploymentStyle, List<EC2TagFilter>? ec2TagFilters, EC2TagSet? ec2TagSet, List<ECSService>? ecsServices, LoadBalancerInfo? loadBalancerInfo, List<TagFilter>? onPremisesInstanceTagFilters, OnPremisesTagSet? onPremisesTagSet, OutdatedInstancesStrategy? outdatedInstancesStrategy, List<Tag>? tags, bool? terminationHookEnabled, List<TriggerConfig>? triggerConfigurations}) Future<CreateDeploymentGroupOutput>
Creates a deployment group to which application revisions are deployed.
deleteApplication({required String applicationName}) Future<void>
Deletes an application.
deleteDeploymentConfig({required String deploymentConfigName}) Future<void>
Deletes a deployment configuration.
deleteDeploymentGroup({required String applicationName, required String deploymentGroupName}) Future<DeleteDeploymentGroupOutput>
Deletes a deployment group.
deleteGitHubAccountToken({String? tokenName}) Future<DeleteGitHubAccountTokenOutput>
Deletes a GitHub account connection.
deleteResourcesByExternalId({String? externalId}) Future<void>
Deletes resources linked to an external ID. This action only applies if you have configured blue/green deployments through CloudFormation.
deregisterOnPremisesInstance({required String instanceName}) Future<void>
Deregisters an on-premises instance.
getApplication({required String applicationName}) Future<GetApplicationOutput>
Gets information about an application.
getApplicationRevision({required String applicationName, required RevisionLocation revision}) Future<GetApplicationRevisionOutput>
Gets information about an application revision.
getDeployment({required String deploymentId}) Future<GetDeploymentOutput>
Gets information about a deployment.
getDeploymentConfig({required String deploymentConfigName}) Future<GetDeploymentConfigOutput>
Gets information about a deployment configuration.
getDeploymentGroup({required String applicationName, required String deploymentGroupName}) Future<GetDeploymentGroupOutput>
Gets information about a deployment group.
getDeploymentInstance({required String deploymentId, required String instanceId}) Future<GetDeploymentInstanceOutput>
Gets information about an instance as part of a deployment.
getDeploymentTarget({required String deploymentId, required String targetId}) Future<GetDeploymentTargetOutput>
Returns information about a deployment target.
getOnPremisesInstance({required String instanceName}) Future<GetOnPremisesInstanceOutput>
Gets information about an on-premises instance.
listApplicationRevisions({required String applicationName, ListStateFilterAction? deployed, String? nextToken, String? s3Bucket, String? s3KeyPrefix, ApplicationRevisionSortBy? sortBy, SortOrder? sortOrder}) Future<ListApplicationRevisionsOutput>
Lists information about revisions for an application.
listApplications({String? nextToken}) Future<ListApplicationsOutput>
Lists the applications registered with the user or Amazon Web Services account.
listDeploymentConfigs({String? nextToken}) Future<ListDeploymentConfigsOutput>
Lists the deployment configurations with the user or Amazon Web Services account.
listDeploymentGroups({required String applicationName, String? nextToken}) Future<ListDeploymentGroupsOutput>
Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.
listDeploymentInstances({required String deploymentId, List<InstanceStatus>? instanceStatusFilter, List<InstanceType>? instanceTypeFilter, String? nextToken}) Future<ListDeploymentInstancesOutput>
May throw DeploymentDoesNotExistException. May throw DeploymentIdRequiredException. May throw DeploymentNotStartedException. May throw InvalidComputePlatformException. May throw InvalidDeploymentIdException. May throw InvalidDeploymentInstanceTypeException. May throw InvalidInstanceStatusException. May throw InvalidInstanceTypeException. May throw InvalidNextTokenException. May throw InvalidTargetFilterNameException.
listDeployments({String? applicationName, TimeRange? createTimeRange, String? deploymentGroupName, String? externalId, List<DeploymentStatus>? includeOnlyStatuses, String? nextToken}) Future<ListDeploymentsOutput>
Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.
listDeploymentTargets({required String deploymentId, String? nextToken, Map<TargetFilterName, List<String>>? targetFilters}) Future<ListDeploymentTargetsOutput>
Returns an array of target IDs that are associated a deployment.
listGitHubAccountTokenNames({String? nextToken}) Future<ListGitHubAccountTokenNamesOutput>
Lists the names of stored connections to GitHub accounts.
listOnPremisesInstances({String? nextToken, RegistrationStatus? registrationStatus, List<TagFilter>? tagFilters}) Future<ListOnPremisesInstancesOutput>
Gets a list of names for one or more on-premises instances.
listTagsForResource({required String resourceArn, String? nextToken}) Future<ListTagsForResourceOutput>
Returns a list of tags for the resource identified by a specified Amazon Resource Name (ARN). Tags are used to organize and categorize your CodeDeploy resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putLifecycleEventHookExecutionStatus({String? deploymentId, String? lifecycleEventHookExecutionId, LifecycleEventStatus? status}) Future<PutLifecycleEventHookExecutionStatusOutput>
Sets the result of a Lambda validation function. The function validates lifecycle hooks during a deployment that uses the Lambda or Amazon ECS compute platform. For Lambda deployments, the available lifecycle hooks are BeforeAllowTraffic and AfterAllowTraffic. For Amazon ECS deployments, the available lifecycle hooks are BeforeInstall, AfterInstall, AfterAllowTestTraffic, BeforeAllowTraffic, and AfterAllowTraffic. Lambda validation functions return Succeeded or Failed. For more information, see AppSpec 'hooks' Section for an Lambda Deployment and AppSpec 'hooks' Section for an Amazon ECS Deployment.
registerApplicationRevision({required String applicationName, required RevisionLocation revision, String? description}) Future<void>
Registers with CodeDeploy a revision for the specified application.
registerOnPremisesInstance({required String instanceName, String? iamSessionArn, String? iamUserArn}) Future<void>
Registers an on-premises instance.
removeTagsFromOnPremisesInstances({required List<String> instanceNames, required List<Tag> tags}) Future<void>
Removes one or more tags from one or more on-premises instances.
skipWaitTimeForInstanceTermination({String? deploymentId}) Future<void>
In a blue/green deployment, overrides any specified wait time and starts terminating instances immediately after the traffic routing is complete.
stopDeployment({required String deploymentId, bool? autoRollbackEnabled}) Future<StopDeploymentOutput>
Attempts to stop an ongoing deployment.
tagResource({required String resourceArn, required List<Tag> tags}) Future<void>
Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.
toString() String
A string representation of this object.
inherited
untagResource({required String resourceArn, required List<String> tagKeys}) Future<void>
Disassociates a resource from a list of tags. The resource is identified by the ResourceArn input parameter. The tags are identified by the list of keys in the TagKeys input parameter.
updateApplication({String? applicationName, String? newApplicationName}) Future<void>
Changes the name of an application.
updateDeploymentGroup({required String applicationName, required String currentDeploymentGroupName, AlarmConfiguration? alarmConfiguration, AutoRollbackConfiguration? autoRollbackConfiguration, List<String>? autoScalingGroups, BlueGreenDeploymentConfiguration? blueGreenDeploymentConfiguration, String? deploymentConfigName, DeploymentStyle? deploymentStyle, List<EC2TagFilter>? ec2TagFilters, EC2TagSet? ec2TagSet, List<ECSService>? ecsServices, LoadBalancerInfo? loadBalancerInfo, String? newDeploymentGroupName, List<TagFilter>? onPremisesInstanceTagFilters, OnPremisesTagSet? onPremisesTagSet, OutdatedInstancesStrategy? outdatedInstancesStrategy, String? serviceRoleArn, bool? terminationHookEnabled, List<TriggerConfig>? triggerConfigurations}) Future<UpdateDeploymentGroupOutput>
Changes information about a deployment group.

Operators

operator ==(Object other) bool
The equality operator.
inherited