> For the complete documentation index, see [llms.txt](https://docs.stacksync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacksync.com/two-way-sync/connectors/postgres/authorize-postgres/amazon-lightsail.md).

# Amazon Lightsail

Get your database endpoint and port information from the Lightsail console. You use these later when configuring your client to connect to your database.

#### 1. To get your database connection details

#### 2. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

#### 3. On the Lightsail home page, choose the Databases tab.

#### 4. Choose the name of the database that you want to connect to.

#### 5. Get the Hostname and Port

On the Connect tab, under the **Endpoint and port** section, note the endpoint and port information.

<figure><img src="https://d9yljz1nd5001.cloudfront.net/en_us/2b894762c8e4d8e91e7f44a16ed9b990/images/amazon-lightsail-postgres-database-endpoint-and-port.png" alt=""><figcaption></figcaption></figure>

#### 6. Get username and password

On the Connect tab, under the "User name" and "passwords" section, make note of the user name, then choose "Show" under the "Password" section to view the current database password.

Because managed passwords are complex, we also recommend copying and pasting it to avoid entering it incorrectly. Highlight the managed password and press Ctrl+C if you’re using Windows, or Cmd+C if you’re using macOS, to copy it to your clipboard. Then, press Ctrl+V or Cmd+V as appropriate to paste it.

{% hint style="info" %}
For the Amazon Lightsail connector, the user is required to have the **Create** privilege on the database.

This privilege can be enabled for the user using the following SQL query:

```sql
GRANT CREATE ON DATABASE database_name TO user_name;
```

{% endhint %}

#### 7. Paste all of this information into the Stacksync UI

For the database type, enter `postgresql`

<figure><img src="/files/wQg8llISjf2oIfmhQsgF" alt=""><figcaption><p>Past the credentials in the Stacksync UI</p></figcaption></figure>

{% hint style="info" %}
Enter `postgres` if you can’t remember the name of your primary database. Every PostgreSQL managed database has a `postgres` database that you can connect to, after which you’ll be able to access all other databases on the PostgreSQL managed database.
{% endhint %}

{% hint style="info" %}
The connection string on top of the credentials setup box will autofill as you past your credentials in the designated fields (Host, Post, Username, Password, Database and Database type). You can ignore it, it is done automatically for you! Just fill up the other credential boxes.
{% endhint %}

Finally, click "Authorize App" to connect your database.

That's it, your database should be connected! 🎉

### Other useful sources

Amazon connection tutorial: <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-connecting-to-your-postgres-database>


---

# 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.stacksync.com/two-way-sync/connectors/postgres/authorize-postgres/amazon-lightsail.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.
