Skip to content

Commit

Permalink
delete vpc peering
Browse files Browse the repository at this point in the history
  • Loading branch information
wojcik-dorota committed Jan 27, 2025
1 parent d84b912 commit f7d81d9
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 57 deletions.
2 changes: 1 addition & 1 deletion docs/platform/howto/manage-org-vpc-peering-aws.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Set up an organization VPC peering with AWS
title: Manage an organization VPC peering with AWS
sidebar_label: AWS peering
---

Expand Down
2 changes: 1 addition & 1 deletion docs/platform/howto/manage-org-vpc-peering-azure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Set up an organization VPC peering with Microsoft Azure
title: Manage an organization VPC peering with Microsoft Azure
sidebar_label: Azure peering
---

Expand Down
8 changes: 3 additions & 5 deletions docs/platform/howto/manage-organization-vpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ Replace the following placeholders with meaningful data:
## Delete an organization VPC

:::important

- Before deleting an organization VPC, move all services out of this VPC.
- Once an organization VPC is deleted, the cloud-provider side of the peering connections
becomes `inactive` or `deleted`.

Remove all services from your VCP before you delete it. To remove the services from the VCP,
either migrate them out of the VCP or delete them. Deleting the VPC terminates its peering
connections, if any.
:::

Delete an organization VPC using a tool of your choice:
Expand Down
8 changes: 3 additions & 5 deletions docs/platform/howto/manage-project-vpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,9 @@ Replace the following placeholders with meaningful data:
## Delete a project VPC

:::important

- Before you delete a project VPC, move all services out of this VPC.
- Once a project VPC is deleted, the cloud-provider side of the peering connections
becomes `inactive` or `deleted`.

Remove all services from your VCP before you delete it. To remove the services from the VCP,
either migrate them out of the VCP or delete them. Deleting the VPC terminates its peering
connections, if any.
:::

Delete a project VPC using a tool of your choice:
Expand Down
2 changes: 1 addition & 1 deletion docs/platform/howto/vnet-peering-azure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Set up a project VPC peering with Microsoft Azure
title: Manage a project VPC peering with Microsoft Azure
sidebar_label: Azure peering
---

Expand Down
2 changes: 1 addition & 1 deletion docs/platform/howto/vpc-peering-aws.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Set up a project VPC peering with AWS
title: Manage a project VPC peering with AWS
sidebar_label: AWS peering
---

Expand Down
2 changes: 1 addition & 1 deletion docs/platform/howto/vpc-peering-gcp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Set up a project VPC peering with Google Cloud
title: Manage a project VPC peering with Google Cloud
sidebar_label: Google Cloud peering
---

Expand Down
2 changes: 1 addition & 1 deletion docs/platform/howto/vpc-peering-upcloud.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Set up a project VPC peering with UpCloud
title: Manage a project VPC peering with UpCloud
sidebar_label: UpCloud peering
---

Expand Down
46 changes: 26 additions & 20 deletions static/includes/vpc/delete-org-peering.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:::important

- Before deleting an organization VPC, move all services out of this VPC.
- Once an organization VPC is deleted, the cloud-provider side of the peering connections
becomes `inactive` or `deleted`.

Once you delete your VPC peering on the Aiven Platform, the cloud-provider side of the
peering connection becomes `inactive` or `deleted`, and the traffic between the disconnected
VPCs is terminated.
:::

Delete an organization VPC peering using a tool of your choice:
Expand All @@ -18,48 +16,56 @@ Delete an organization VPC peering using a tool of your choice:
1. Log in to the [Aiven Console](https://console.aiven.io/), and click **Admin** in the
top navigation bar.
1. Click <ConsoleLabel name="organizationvpcs"/> in the sidebar.
1. On the **Organization VPCs** page, find a VPC to be deleted and click
<ConsoleLabel name="actions"/> > <ConsoleLabel name="delete"/>.
1. In the **Confirmation** window, click **Delete VPC**.
1. On the **Organization VPCs** page, select an organization VPC.
1. On the **Organization VPC details** page, go to the **VPC peering connection** section,
find the peering to be deleted, and click <ConsoleLabel name="actions"/> >
<ConsoleLabel name="delete"/>.
1. In the **Confirmation** window, click **Delete VPC peering**.

</TabItem>
<TabItem value="cli" label="Aiven CLI">

Run the `avn organization vpc delete` command:
Run the `avn organization vpc peering-connection delete` command:

```bash
avn organization vpc delete \
--organization-id ORGANIZATION_ID \
--project-vpc-id ORGANIZATION_VPC_ID
avn organization vpc peering-connection delete \
--organization-id ORGANIZATION_ID \
--vpc-id ORGANIZATION_VPC_ID \
--peering-connection-id ORGANIZATION_VPC_PEERING_ID
```

Replace the following:

- `ORGANIZATION_ID` with the ID of your Aiven organization, for example, `org1a2b3c4d5e6`
- `ORGANIZATION_VPC_ID` with the ID of your Aiven organization VPC, for example,
`12345678-1a2b-3c4d-5f6g-1a2b3c4d5e6f`
- `ORGANIZATION_VPC_PEERING_ID` with the ID of your peering connection, for example
`1a2b3c4d-1234-a1b2-c3d4-1a2b3c4d5e6f`

</TabItem>
<TabItem value="api" label="Aiven API">

Make an API call to the `OrganizationVpcDelete` endpoint:
Make an API call to the `OrganizationVpcPeeringConnectionDelete` endpoint:

```bash
curl --request DELETE \
--url https://api.aiven.io/v1/organization/ORGANIZATION_ID/vpcs/VPC_ID \
--header 'Authorization: Bearer BEARER_TOKEN' \
--url https://api.aiven.io/v1/organization/ORGANIZATION_ID/vpcs/ORGANIZATION_VPC_ID/peering-connections/peer-accounts/PEER_CLOUD_ACCOUNT/peer-vpcs/PEER_VPC \
--header 'Authorization: Bearer BEARER_TOKEN'
```

Replace the following placeholders with meaningful data:

- `ORGANIZATION_ID`
- `VPC_ID`
- `ORGANIZATION_ID`: Aiven organization ID
- `ORGANIZATION_VPC_ID`: Aiven organization VPC ID
- `PEER_CLOUD_ACCOUNT`: your cloud provider account ID or name
- `PEER_VPC`: your cloud provider VPC ID or name
- `BEARER_TOKEN`

</TabItem>
<TabItem value="tf" label="Aiven Provider for Terraform">
To delete your
[aiven_organization_vpc](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/project_vpc)
resource, run `terraform destroy`.
To delete your Aiven organization VPC peering connection resource, run `terraform destroy`.
See the
[Aiven Provider for Terraform documentation](https://registry.terraform.io/providers/aiven/aiven/latest/docs)
for details.
</TabItem>
</Tabs>
59 changes: 38 additions & 21 deletions static/includes/vpc/delete-pj-peering.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,76 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:::important

- Before you delete a project VPC, move all services out of this VPC.
- Once a project VPC is deleted, the cloud-provider side of the peering connections
becomes `inactive` or `deleted`.

Once you delete your VPC peering on the Aiven Platform, the cloud-provider side of the
peering connection becomes `inactive` or `deleted`, and the traffic between the disconnected
VPCs is terminated.
:::

Delete a project VPC using a tool of your choice:
Delete a project VPC peering using a tool of your choice:

<Tabs groupId="group1">
<TabItem value="console" label="Aiven Console" default>

1. Log in to [Aiven Console](https://console.aiven.io/), and go to your project.
1. Log in to the [Aiven Console](https://console.aiven.io/), and go to your project page.
1. Click <ConsoleLabel name="vpcs"/> in the sidebar.
1. On the **Virtual private clouds** page, find a VPC to be deleted and click
<ConsoleLabel name="actions"/> > <ConsoleLabel name="delete"/>.
1. In the **Confirmation** window, click **Delete VPC**.
1. On the **Virtual private clouds** page, select a project VPC.
1. On the **VPC details** page, go to the **VPC peering connection** section,
find the peering to be deleted, and click <ConsoleLabel name="actions"/> >
<ConsoleLabel name="delete"/>.
1. In the **Confirmation** window, click **Delete VPC peering**.

</TabItem>
<TabItem value="cli" label="Aiven CLI">

Run the [avn vpc delete](/docs/tools/cli/vpc#avn-vpc-delete) command:
Run the
[avn vpc peering-connection delete](/docs/tools/cli/vpc#avn-vpc-peering-connection-delete)
command:

```bash
avn vpc delete \
--project-vpc-id PROJECT_VPC_ID
avn vpc peering-connection delete \
--project-vpc-id PROJECT_VPC_ID \
--peer-cloud-account PEER_CLOUD_ACCOUNT \
--peer-vpc PEER_VPC_ID
```

Replace `PROJECT_VPC_ID` with the ID of your Aiven project VPC, for example,
`12345678-1a2b-3c4d-5f6g-1a2b3c4d5e6f`.
Replace the following with meaningful values:

- `PROJECT_VPC_ID`, for example `12345678-1a2b-3c4d-5f6g-1a2b3c4d5e6f`
- `PEER_CLOUD_ACCOUNT`, for example `012345678901`
- `PEER_VPC_ID`, for example `vpc-abcdef01234567890`

</TabItem>
<TabItem value="api" label="Aiven API">

Make an API call to the
[VpcDelete](https://api.aiven.io/doc/#tag/Project/operation/VpcDelete) endpoint:
[VpcPeeringConnectionDelete](https://api.aiven.io/doc/#tag/Project/operation/VpcPeeringConnectionDelete)
endpoint:

```bash
curl --request DELETE \
--url https://api.aiven.io/v1/project/PROJECT_ID/vpcs/PROJECT_VPC_ID \
--header 'Authorization: Bearer BEARER_TOKEN' \
```

```bash
curl --request DELETE \
--url https://api.aiven.io/v1/project/PROJECT_ID/vpcs/PROJECT_VPC_ID/peering-connections/peer-accounts/PEER_CLOUD_ACCOUNT/peer-vpcs/PEER_VPC \
--header 'Authorization: Bearer BEARER_TOKEN'
```

Replace the following placeholders with meaningful data:

- `PROJECT_ID` (Aiven project name)
- `PROJECT_VPC_ID` (Aiven project VPC ID)
- `PROJECT_ID`: Aiven project name
- `PROJECT_VPC_ID`: Aiven project VPC ID
- `PEER_CLOUD_ACCOUNT`: your cloud provider account ID or name
- `PEER_VPC`: your cloud provider VPC ID or name
- `BEARER_TOKEN`

</TabItem>
<TabItem value="tf" label="Aiven Provider for Terraform">
To delete your
[aiven_project_vpc](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/project_vpc)
resource, run `terraform destroy`.
To delete your Aiven project VPC peering connection resource, run `terraform destroy`.
See the
[Aiven Provider for Terraform documentation](https://registry.terraform.io/providers/aiven/aiven/latest/docs)
for details.
</TabItem>
</Tabs>

0 comments on commit f7d81d9

Please sign in to comment.