> For the complete documentation index, see [llms.txt](https://awsnotes.dendron.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://awsnotes.dendron.so/developer-tools/aws-codedeploy/topics/working-with-deployments.md).

# Working with deployments

{% hint style="info" %}
This page was generated from content adapted from the [AWS Developer Guide](https://github.com/awsdocs/aws-codedeploy-user-guide.git)
{% endhint %}

## View deployment details

* **Note**\
  You can view EC2/On-Premises deployment logs on your instances in the following locations:\
  Amazon Linux, RHEL, and Ubuntu Server: `/opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent-deployments.log` Windows Server: C:\ProgramData\Amazon\CodeDeploy\<DEPLOYMENT-GROUP-ID>\<DEPLOYMENT-ID>\logs\scripts.log For more information, see [Analyzing log files to investigate deployment failures on instances](https://github.com/kevinslin/aws-reference-notes/blob/main/services/aws_code_deploy/troubleshooting-ec2-instances.md#troubleshooting-deploy-failures).

## View deployment log data

* **Note**\
  Logs are not supported for AWS Lambda or Amazon ECS deployments. They can be created for EC2/On-Premises deployments only.

## Stop a deployment

* **Note**\
  If your deployment is a blue/green deployment through AWS CloudFormation, you cannot perform this task in the CodeDeploy console. Go to the AWS CloudFormation console to perform this task.

## Redeploy and roll back a deployment

* **Note**\
  You can use Amazon Simple Notification Service to receive a notification whenever a deployment is rolled back automatically. For information, see [Monitoring deployments with Amazon SNS event notifications](https://github.com/kevinslin/aws-reference-notes/blob/main/services/aws_code_deploy/monitoring-sns-event-notifications.md).
* **Note**\
  If you remove an instance from a deployment group, CodeDeploy does not uninstall anything that might have already been installed on that instance.

## Deploy an application in a different AWS account

* **Important**\
  As you create the cross-account IAM role, make a note of the details you will need to gain access to the production account.\
  To use the AWS Management Console to switch roles, you will need to supply either of the following:\
  A URL for accessing the production account with the assumed role's credentials. You will find the URL on the **Review** page, which is displayed at the end of the cross-account role creation process. The name of the cross-account role and either the account ID number or alias. To use the AWS CLI to switch roles, you will need to supply the following:\
  The ARN of the cross-account role you will assume.

## Validate a deployment package on a local machine

* **Note**\
  The codedeploy-local command is installed in the following locations:\
  On Amazon Linux, RHEL, or Ubuntu Server: `/opt/codedeploy-agent/bin`. On Windows Server: `C:\ProgramData\Amazon\CodeDeploy\bin`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://awsnotes.dendron.so/developer-tools/aws-codedeploy/topics/working-with-deployments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
