> For the complete documentation index, see [llms.txt](https://docs.apono.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apono.io/docs/aws-environment/apono-connector-for-aws/updating-a-connector-in-aws.md).

# Updating a connector in AWS

Learn how to update a connector through the AWS CLI

Periodically, you may need to update your AWS connector to help maintain functionality, performance, and security.

This article explains how to update a connector through the AWS Management Console or AWS CLI and redeploy the CloudFormation stack with the latest connector template.

***

### Prerequisites

<table><thead><tr><th width="209">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>AWS Stack Name</strong></td><td><p>In AWS CloudFormation, name of a collection of AWS resources managed as a single unit<br><br>Use the following steps to retrieve the stack name:</p><ol><li>Go to the <a href="https://console.aws.amazon.com/cloudformation/home/stacks"><strong>Stacks</strong></a> page.</li><li>Under the <strong>Stack name</strong> column, copy the stack name.</li></ol><p><img src="https://1094436629-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv6MBfUGvblSdAz31yJXm%2Fuploads%2Fgit-blob-a9bc4c8d06fe5ddba80dac6a35f56b9be2ac8540%2Fimage%20(2)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><br></p></td></tr><tr><td><strong>AWS Command Line Interface (AWS CLI)</strong></td><td>(CLI updates only) <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">Open-source tool</a> enabling interaction with AWS services using your command-line shell</td></tr><tr><td><strong>AWS Permissions</strong></td><td><a href="https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AdministratorAccess.html">Permissions</a> enabling the ability to update the CloudFormation stack</td></tr></tbody></table>

***

### Update a connector

{% hint style="warning" %}
If you're updating an Organization-level connector, follow these steps for connectors installed in the Management account.

If updating a connector with [assumable permissions to the Management account](https://docs.apono.io/docs/aws-environment/apono-connector-for-aws#connector-with-assumable-permissions-to-the-aws-management-account), reach out to your Apono Customer Success representative.
{% endhint %}

#### AWS Management Console

Follow these steps to update the connector directly from the AWS CloudFormation console:

1. [Directly update the stack](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-direct.html) where the Apono connector is running.
2. When you replace the existing template, specify the template location for your connector type.

<table><thead><tr><th width="190.79339599609375">Connector type</th><th>Template location</th></tr></thead><tbody><tr><td>Account level</td><td><em>https://apono-public.s3.amazonaws.com/cloudformation/aws_integration_with_connector_template.yml</em></td></tr><tr><td>Organizational level - non-dual stack</td><td><em>https://apono-public.s3.amazonaws.com/cloudformation/aws_organization_integration_template.yml</em></td></tr><tr><td>Organizational level - dual stack</td><td><em>https://apono-public.s3.amazonaws.com/cloudformation/aws_organization_roles_only_integration_template.yml</em></td></tr></tbody></table>

#### AWS CLI

Follow these steps to update a connector:

1. Copy the following Account level or Organization level AWS update script. Be sure to replace `AWS_STACK_NAME` with your AWS stack name.

{% tabs %}
{% tab title="Account Level" %}
{% code overflow="wrap" %}

```sh
aws cloudformation update-stack --stack-name AWS_STACK_NAME \
    --template-url https://apono-public.s3.amazonaws.com/cloudformation/aws_integration_with_connector_template.yml \
    --parameters ParameterKey=AponoConnectorId,UsePreviousValue=true \
                 ParameterKey=AponoConnectorToken,UsePreviousValue=true \
                 ParameterKey=ExternalID,UsePreviousValue=true \
                 ParameterKey=SubnetIDs,UsePreviousValue=true \
                 ParameterKey=VpcId,UsePreviousValue=true \
                 ParameterKey=S3AWSLogsScanning,ParameterValue=Enabled \
    --capabilities CAPABILITY_NAMED_IAM
```

{% endcode %}
{% endtab %}

{% tab title="Organizational Level - Non-Dual Stack" %}
Use this command for an Organizational-level connector deployed directly in the AWS Management account.

{% code overflow="wrap" %}

```sh
aws cloudformation update-stack --stack-name AWS_STACK_NAME \
      --template-url https://apono-public.s3.amazonaws.com/cloudformation/aws_organization_integration_template.yml \
      --parameters ParameterKey=AponoConnectorId,UsePreviousValue=true \
                   ParameterKey=AponoConnectorToken,UsePreviousValue=true \
                   ParameterKey=AssignPublicIp,UsePreviousValue=true \
                   ParameterKey=ExternalID,UsePreviousValue=true \
                   ParameterKey=OrganizationalUnitId,UsePreviousValue=true \
                   ParameterKey=OrganizationId,UsePreviousValue=true \
                   ParameterKey=SubnetIDs,UsePreviousValue=true \
                   ParameterKey=VpcId,UsePreviousValue=true \
                   ParameterKey=Permissions,UsePreviousValue=true \
                   ParameterKey=EnableResourceExplorerDiscovery,UsePreviousValue=true \
                   ParameterKey=StackSetFailureTolerancePercentage,UsePreviousValue=true \
                   ParameterKey=S3AWSLogsScanning,ParameterValue=Enabled \
      --capabilities CAPABILITY_NAMED_IAM
```

{% endcode %}
{% endtab %}

{% tab title="Organizational Level - Dual Stack" %}
Use this command for the Management-account stack of a dual-stack Organizational-level connector.

{% code overflow="wrap" expandable="true" %}

```shellscript
aws cloudformation update-stack --stack-name AWS_STACK_NAME \
      --template-url https://apono-public.s3.amazonaws.com/cloudformation/aws_organization_roles_only_integration_template.yml \
      --parameters ParameterKey=AponoConnectorId,UsePreviousValue=true \
                   ParameterKey=AponoConnectorToken,UsePreviousValue=true \
                   ParameterKey=AssignPublicIp,UsePreviousValue=true \
                   ParameterKey=ExternalID,UsePreviousValue=true \
                   ParameterKey=OrganizationalUnitId,UsePreviousValue=true \
                   ParameterKey=OrganizationId,UsePreviousValue=true \
                   ParameterKey=SubnetIDs,UsePreviousValue=true \
                   ParameterKey=VpcId,UsePreviousValue=true \
                   ParameterKey=Permissions,UsePreviousValue=true \
                   ParameterKey=EnableResourceExplorerDiscovery,UsePreviousValue=true \
                   ParameterKey=StackSetFailureTolerancePercentage,UsePreviousValue=true \
                   ParameterKey=S3AWSLogsScanning,ParameterValue=Enabled \
      --capabilities CAPABILITY_NAMED_IAM

```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you have not defined a default region and [default profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html), you must specify the region and profile in the script:

```shell
--profile AWS_PROFILE --region AWS_SERVER_REGION
```

Be sure to replace `AWS_PROFILE` and `AWS_SERVER_REGION` with your profile and region values.
{% endhint %}

2. At your AWS CLI prompt, enter the updated script from the previous step to initiate the update. The AWS CLI will return an object containing the `StackId`.
3. In CloudFormation, on the **Stack Info** tab, confirm that the update has completed:
   1. Go to the [Stacks](https://console.aws.amazon.com/cloudformation/home/stacks) page. A list of the stacks in the account are displayed.
   2. Under the **Stack name** column, click the stack name.
   3. On the **Stack info** tab, check the **Status**.

***

### Troubleshooting

This section details common errors that can occur during the updating process. If an error occurs that is not listed below, please contact your Apono representative.

<details>

<summary><strong>An error occurred (ValidationError) when calling the UpdateStack operation: Stack [stack name] does not exist.</strong></summary>

This occurs when the incorrect stack name has been included in the update script.

Use the following steps to correct this error:

1. Locate and copy the stack name under the **Stack name** column of the [**Stacks**](https://console.aws.amazon.com/cloudformation/home/stacks) page.
2. Repeat the [update process](#update-a-connector).

</details>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.apono.io/docs/aws-environment/apono-connector-for-aws/updating-a-connector-in-aws.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
