AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing CodeDeploy

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:

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

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.CodeDeploy.AmazonCodeDeployClient

Namespace: Amazon.CodeDeploy
Assembly: AWSSDK.CodeDeploy.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonCodeDeployClient : AmazonServiceClient
         IAmazonCodeDeploy, IAmazonService, IDisposable

The AmazonCodeDeployClient type exposes the following members

Constructors

NameDescription
Public Method AmazonCodeDeployClient()

Constructs AmazonCodeDeployClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonCodeDeployClient(RegionEndpoint)

Constructs AmazonCodeDeployClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonCodeDeployClient(AmazonCodeDeployConfig)

Constructs AmazonCodeDeployClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonCodeDeployClient(AWSCredentials)

Constructs AmazonCodeDeployClient with AWS Credentials

Public Method AmazonCodeDeployClient(AWSCredentials, RegionEndpoint)

Constructs AmazonCodeDeployClient with AWS Credentials

Public Method AmazonCodeDeployClient(AWSCredentials, AmazonCodeDeployConfig)

Constructs AmazonCodeDeployClient with AWS Credentials and an AmazonCodeDeployClient Configuration object.

Public Method AmazonCodeDeployClient(string, string)

Constructs AmazonCodeDeployClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCodeDeployClient(string, string, RegionEndpoint)

Constructs AmazonCodeDeployClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCodeDeployClient(string, string, AmazonCodeDeployConfig)

Constructs AmazonCodeDeployClient with AWS Access Key ID, AWS Secret Key and an AmazonCodeDeployClient Configuration object.

Public Method AmazonCodeDeployClient(string, string, string)

Constructs AmazonCodeDeployClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCodeDeployClient(string, string, string, RegionEndpoint)

Constructs AmazonCodeDeployClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCodeDeployClient(string, string, string, AmazonCodeDeployConfig)

Constructs AmazonCodeDeployClient with AWS Access Key ID, AWS Secret Key and an AmazonCodeDeployClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.
Public Property Paginators Amazon.CodeDeploy.Model.ICodeDeployPaginatorFactory

Paginators for the service

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method AddTagsToOnPremisesInstances(AddTagsToOnPremisesInstancesRequest)

Adds tags to on-premises instances.

Public Method AddTagsToOnPremisesInstancesAsync(AddTagsToOnPremisesInstancesRequest, CancellationToken)

Adds tags to on-premises instances.

Public Method BatchGetApplicationRevisions(BatchGetApplicationRevisionsRequest)

Gets information about one or more application revisions. The maximum number of application revisions that can be returned is 25.

Public Method BatchGetApplicationRevisionsAsync(BatchGetApplicationRevisionsRequest, CancellationToken)

Gets information about one or more application revisions. The maximum number of application revisions that can be returned is 25.

Public Method BatchGetApplications(BatchGetApplicationsRequest)

Gets information about one or more applications. The maximum number of applications that can be returned is 100.

Public Method BatchGetApplicationsAsync(BatchGetApplicationsRequest, CancellationToken)

Gets information about one or more applications. The maximum number of applications that can be returned is 100.

Public Method BatchGetDeploymentGroups(BatchGetDeploymentGroupsRequest)

Gets information about one or more deployment groups.

Public Method BatchGetDeploymentGroupsAsync(BatchGetDeploymentGroupsRequest, CancellationToken)

Gets information about one or more deployment groups.

Public Method BatchGetDeploymentInstances(BatchGetDeploymentInstancesRequest)

This method works, but is deprecated. Use BatchGetDeploymentTargets instead.

Returns an array of one or more instances associated with a deployment. This method works with EC2/On-premises and Lambda compute platforms. The newer BatchGetDeploymentTargets works with all compute platforms. The maximum number of instances that can be returned is 25.

Public Method BatchGetDeploymentInstancesAsync(BatchGetDeploymentInstancesRequest, CancellationToken)

This method works, but is deprecated. Use BatchGetDeploymentTargets instead.

Returns an array of one or more instances associated with a deployment. This method works with EC2/On-premises and Lambda compute platforms. The newer BatchGetDeploymentTargets works with all compute platforms. The maximum number of instances that can be returned is 25.

Public Method BatchGetDeployments(BatchGetDeploymentsRequest)

Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.

Public Method BatchGetDeploymentsAsync(BatchGetDeploymentsRequest, CancellationToken)

Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.

Public Method BatchGetDeploymentTargets(BatchGetDeploymentTargetsRequest)

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.

The type of targets returned depends on the deployment's compute platform or deployment method:

  • EC2/On-premises: Information about Amazon EC2 instance targets.

  • Lambda: Information about Lambda functions targets.

  • Amazon ECS: Information about Amazon ECS service targets.

  • CloudFormation: Information about targets of blue/green deployments initiated by a CloudFormation stack update.

Public Method BatchGetDeploymentTargetsAsync(BatchGetDeploymentTargetsRequest, CancellationToken)

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.

The type of targets returned depends on the deployment's compute platform or deployment method:

  • EC2/On-premises: Information about Amazon EC2 instance targets.

  • Lambda: Information about Lambda functions targets.

  • Amazon ECS: Information about Amazon ECS service targets.

  • CloudFormation: Information about targets of blue/green deployments initiated by a CloudFormation stack update.

Public Method BatchGetOnPremisesInstances(BatchGetOnPremisesInstancesRequest)

Gets information about one or more on-premises instances. The maximum number of on-premises instances that can be returned is 25.

Public Method BatchGetOnPremisesInstancesAsync(BatchGetOnPremisesInstancesRequest, CancellationToken)

Gets information about one or more on-premises instances. The maximum number of on-premises instances that can be returned is 25.

Public Method ContinueDeployment(ContinueDeploymentRequest)

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.)

Public Method ContinueDeploymentAsync(ContinueDeploymentRequest, CancellationToken)

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.)

Public Method CreateApplication(CreateApplicationRequest)

Creates an application.

Public Method CreateApplicationAsync(CreateApplicationRequest, CancellationToken)

Creates an application.

Public Method CreateDeployment(CreateDeploymentRequest)

Deploys an application revision through the specified deployment group.

Public Method CreateDeploymentAsync(CreateDeploymentRequest, CancellationToken)

Deploys an application revision through the specified deployment group.

Public Method CreateDeploymentConfig(CreateDeploymentConfigRequest)

Creates a deployment configuration.

Public Method CreateDeploymentConfigAsync(CreateDeploymentConfigRequest, CancellationToken)

Creates a deployment configuration.

Public Method CreateDeploymentGroup(CreateDeploymentGroupRequest)

Creates a deployment group to which application revisions are deployed.

Public Method CreateDeploymentGroupAsync(CreateDeploymentGroupRequest, CancellationToken)

Creates a deployment group to which application revisions are deployed.

Public Method DeleteApplication(DeleteApplicationRequest)

Deletes an application.

Public Method DeleteApplicationAsync(DeleteApplicationRequest, CancellationToken)

Deletes an application.

Public Method DeleteDeploymentConfig(DeleteDeploymentConfigRequest)

Deletes a deployment configuration.

A deployment configuration cannot be deleted if it is currently in use. Predefined configurations cannot be deleted.

Public Method DeleteDeploymentConfigAsync(DeleteDeploymentConfigRequest, CancellationToken)

Deletes a deployment configuration.

A deployment configuration cannot be deleted if it is currently in use. Predefined configurations cannot be deleted.

Public Method DeleteDeploymentGroup(DeleteDeploymentGroupRequest)

Deletes a deployment group.

Public Method DeleteDeploymentGroupAsync(DeleteDeploymentGroupRequest, CancellationToken)

Deletes a deployment group.

Public Method DeleteGitHubAccountToken(DeleteGitHubAccountTokenRequest)

Deletes a GitHub account connection.

Public Method DeleteGitHubAccountTokenAsync(DeleteGitHubAccountTokenRequest, CancellationToken)

Deletes a GitHub account connection.

Public Method DeleteResourcesByExternalId(DeleteResourcesByExternalIdRequest)

Deletes resources linked to an external ID. This action only applies if you have configured blue/green deployments through CloudFormation.

It is not necessary to call this action directly. CloudFormation calls it on your behalf when it needs to delete stack resources. This action is offered publicly in case you need to delete resources to comply with General Data Protection Regulation (GDPR) requirements.

Public Method DeleteResourcesByExternalIdAsync(DeleteResourcesByExternalIdRequest, CancellationToken)

Deletes resources linked to an external ID. This action only applies if you have configured blue/green deployments through CloudFormation.

It is not necessary to call this action directly. CloudFormation calls it on your behalf when it needs to delete stack resources. This action is offered publicly in case you need to delete resources to comply with General Data Protection Regulation (GDPR) requirements.

Public Method DeregisterOnPremisesInstance(DeregisterOnPremisesInstanceRequest)

Deregisters an on-premises instance.

Public Method DeregisterOnPremisesInstanceAsync(DeregisterOnPremisesInstanceRequest, CancellationToken)

Deregisters an on-premises instance.

Public Method DetermineServiceOperationEndpoint(AmazonWebServiceRequest)

Returns the endpoint that will be used for a particular request.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetApplication(GetApplicationRequest)

Gets information about an application.

Public Method GetApplicationAsync(GetApplicationRequest, CancellationToken)

Gets information about an application.

Public Method GetApplicationRevision(GetApplicationRevisionRequest)

Gets information about an application revision.

Public Method GetApplicationRevisionAsync(GetApplicationRevisionRequest, CancellationToken)

Gets information about an application revision.

Public Method GetDeployment(GetDeploymentRequest)

Gets information about a deployment.

The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256 property of the returned appSpecContent object to get the content of the deployment’s AppSpec file.

Public Method GetDeploymentAsync(GetDeploymentRequest, CancellationToken)

Gets information about a deployment.

The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256 property of the returned appSpecContent object to get the content of the deployment’s AppSpec file.

Public Method GetDeploymentConfig(GetDeploymentConfigRequest)

Gets information about a deployment configuration.

Public Method GetDeploymentConfigAsync(GetDeploymentConfigRequest, CancellationToken)

Gets information about a deployment configuration.

Public Method GetDeploymentGroup(GetDeploymentGroupRequest)

Gets information about a deployment group.

Public Method GetDeploymentGroupAsync(GetDeploymentGroupRequest, CancellationToken)

Gets information about a deployment group.

Public Method GetDeploymentInstance(GetDeploymentInstanceRequest)

Gets information about an instance as part of a deployment.

Public Method GetDeploymentInstanceAsync(GetDeploymentInstanceRequest, CancellationToken)

Gets information about an instance as part of a deployment.

Public Method GetDeploymentTarget(GetDeploymentTargetRequest)

Returns information about a deployment target.

Public Method GetDeploymentTargetAsync(GetDeploymentTargetRequest, CancellationToken)

Returns information about a deployment target.

Public Method GetOnPremisesInstance(GetOnPremisesInstanceRequest)

Gets information about an on-premises instance.

Public Method GetOnPremisesInstanceAsync(GetOnPremisesInstanceRequest, CancellationToken)

Gets information about an on-premises instance.

Public Method ListApplicationRevisions(ListApplicationRevisionsRequest)

Lists information about revisions for an application.

Public Method ListApplicationRevisionsAsync(ListApplicationRevisionsRequest, CancellationToken)

Lists information about revisions for an application.

Public Method ListApplications()

Lists the applications registered with the user or Amazon Web Services account.

Public Method ListApplications(ListApplicationsRequest)

Lists the applications registered with the user or Amazon Web Services account.

Public Method ListApplicationsAsync(CancellationToken)

Lists the applications registered with the user or Amazon Web Services account.

Public Method ListApplicationsAsync(ListApplicationsRequest, CancellationToken)

Lists the applications registered with the user or Amazon Web Services account.

Public Method ListDeploymentConfigs()

Lists the deployment configurations with the user or Amazon Web Services account.

Public Method ListDeploymentConfigs(ListDeploymentConfigsRequest)

Lists the deployment configurations with the user or Amazon Web Services account.

Public Method ListDeploymentConfigsAsync(CancellationToken)

Lists the deployment configurations with the user or Amazon Web Services account.

Public Method ListDeploymentConfigsAsync(ListDeploymentConfigsRequest, CancellationToken)

Lists the deployment configurations with the user or Amazon Web Services account.

Public Method ListDeploymentGroups(ListDeploymentGroupsRequest)

Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.

Public Method ListDeploymentGroupsAsync(ListDeploymentGroupsRequest, CancellationToken)

Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.

Public Method ListDeploymentInstances(ListDeploymentInstancesRequest)

The newer BatchGetDeploymentTargets should be used instead because it works with all compute types. ListDeploymentInstances throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.

Lists the instance for a deployment associated with the user or Amazon Web Services account.

Public Method ListDeploymentInstancesAsync(ListDeploymentInstancesRequest, CancellationToken)

The newer BatchGetDeploymentTargets should be used instead because it works with all compute types. ListDeploymentInstances throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.

Lists the instance for a deployment associated with the user or Amazon Web Services account.

Public Method ListDeployments(ListDeploymentsRequest)

Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.

Public Method ListDeploymentsAsync(ListDeploymentsRequest, CancellationToken)

Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.

Public Method ListDeploymentTargets(ListDeploymentTargetsRequest)

Returns an array of target IDs that are associated a deployment.

Public Method ListDeploymentTargetsAsync(ListDeploymentTargetsRequest, CancellationToken)

Returns an array of target IDs that are associated a deployment.

Public Method ListGitHubAccountTokenNames(ListGitHubAccountTokenNamesRequest)

Lists the names of stored connections to GitHub accounts.

Public Method ListGitHubAccountTokenNamesAsync(ListGitHubAccountTokenNamesRequest, CancellationToken)

Lists the names of stored connections to GitHub accounts.

Public Method ListOnPremisesInstances(ListOnPremisesInstancesRequest)

Gets a list of names for one or more on-premises instances.

Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.

Public Method ListOnPremisesInstancesAsync(ListOnPremisesInstancesRequest, CancellationToken)

Gets a list of names for one or more on-premises instances.

Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.

Public Method ListTagsForResource(ListTagsForResourceRequest)

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.

Public Method ListTagsForResourceAsync(ListTagsForResourceRequest, CancellationToken)

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.

Public Method PutLifecycleEventHookExecutionStatus(PutLifecycleEventHookExecutionStatusRequest)

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.

Public Method PutLifecycleEventHookExecutionStatusAsync(PutLifecycleEventHookExecutionStatusRequest, CancellationToken)

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.

Public Method RegisterApplicationRevision(RegisterApplicationRevisionRequest)

Registers with CodeDeploy a revision for the specified application.

Public Method RegisterApplicationRevisionAsync(RegisterApplicationRevisionRequest, CancellationToken)

Registers with CodeDeploy a revision for the specified application.

Public Method RegisterOnPremisesInstance(RegisterOnPremisesInstanceRequest)

Registers an on-premises instance.

Only one IAM ARN (an IAM session ARN or IAM user ARN) is supported in the request. You cannot use both.

Public Method RegisterOnPremisesInstanceAsync(RegisterOnPremisesInstanceRequest, CancellationToken)

Registers an on-premises instance.

Only one IAM ARN (an IAM session ARN or IAM user ARN) is supported in the request. You cannot use both.

Public Method RemoveTagsFromOnPremisesInstances(RemoveTagsFromOnPremisesInstancesRequest)

Removes one or more tags from one or more on-premises instances.

Public Method RemoveTagsFromOnPremisesInstancesAsync(RemoveTagsFromOnPremisesInstancesRequest, CancellationToken)

Removes one or more tags from one or more on-premises instances.

Public Method SkipWaitTimeForInstanceTermination(SkipWaitTimeForInstanceTerminationRequest)

In a blue/green deployment, overrides any specified wait time and starts terminating instances immediately after the traffic routing is complete.

Public Method SkipWaitTimeForInstanceTerminationAsync(SkipWaitTimeForInstanceTerminationRequest, CancellationToken)

In a blue/green deployment, overrides any specified wait time and starts terminating instances immediately after the traffic routing is complete.

Public Method StopDeployment(StopDeploymentRequest)

Attempts to stop an ongoing deployment.

Public Method StopDeploymentAsync(StopDeploymentRequest, CancellationToken)

Attempts to stop an ongoing deployment.

Public Method TagResource(TagResourceRequest)

Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.

Public Method TagResourceAsync(TagResourceRequest, CancellationToken)

Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.

Public Method UntagResource(UntagResourceRequest)

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.

Public Method UntagResourceAsync(UntagResourceRequest, CancellationToken)

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.

Public Method UpdateApplication(UpdateApplicationRequest)

Changes the name of an application.

Public Method UpdateApplicationAsync(UpdateApplicationRequest, CancellationToken)

Changes the name of an application.

Public Method UpdateDeploymentGroup(UpdateDeploymentGroupRequest)

Changes information about a deployment group.

Public Method UpdateDeploymentGroupAsync(UpdateDeploymentGroupRequest, CancellationToken)

Changes information about a deployment group.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5