Create a Google-integrated custom cloud
Create a custom cloud for BYOC in your Aiven organization to better address your specific business needs or project requirements.
To configure a custom cloud in your Aiven organization and prepare your Google Cloud account so that Aiven can access it:
-
In the Aiven Console or with the Aiven CLI client, you specify new cloud details to generate a Terraform infrastructure-as-code template.
-
You download the generated template and deploy it in your Google Cloud account to acquire a privilege-bearing service account, which Aiven needs for accessing your Google Cloud account only with permissions that are required.
notePrivilege-bearing service account is an identifier of the service account created when running the infrastructure template in your Google Cloud account. Aiven impersonates this service account and runs operations, such as creating VMs for service nodes, in your BYOC account.
-
You deploy your custom cloud resources supplying the generated privilege-bearing service account to the Aiven platform, which gives Aiven the permissions to securely access your Google Cloud account, create resources, and manage them onward.
-
You select Aiven projects that can use your new custom clouds for creating services.
-
You add contact details for individuals from your organization that Aiven can reach out to in case of technical issues with the new cloud.
Before you start
Prerequisites
- You have enabled the BYOC feature.
- You have an active account with your cloud provider.
- Depending on the tool to use for creating a custom cloud:
- Console: Access to the Aiven Console or
- CLI:
- Aiven CLI client installed
- Aiven organization ID from the output of the
avn organization list
command or from the Aiven Console > User information > Organizations.
- You have the organization admin role in your Aiven organization.
- You have Terraform installed.
- You have required IAM permissions.
IAM permissions
You need cloud account credentials set up on your machine so that your user or role has required Terraform permissions to integrate with your cloud provider.
Show permissions needed by your service account that will run the Terraform script in your
Google project
roles/iam.serviceAccountAdmin
(sets up impersonation to the privilege-bearing service account)roles/resourcemanager.projectIamAdmin
(provides permissions to the privilege-bearing service account to use your project)roles/compute.instanceAdmin.v1
(manages networks and instances)roles/compute.securityAdmin
(creates firewall rules)- Enable Identity and Access Management (IAM) API to create the privilege-bearing service account
- Enable Cloud Resource Manager (CRM) API to set IAM policies to the privilege-bearing service account
- Enable Compute Engine API.
For more information on Google Cloud roles, see IAM basic and predefined roles reference in the Goodle Cloud documentation.
Create a custom cloud
Create a custom cloud either in the Aiven Console or with the Aiven CLI.
- Aiven Console
- Aiven CLI
Launch the BYOC setup
- Log in to the Aiven Console, and go to an organization.
- Click Admin in the top navigation, and click Bring your own cloud in the sidebar.
- In the Bring your own cloud view, select Create custom cloud.
Generate an infrastructure template
In this step, an IaC template is generated in the Terraform format. In the next step, you'll deploy this template in your Google Cloud account to acquire a privilege-bearing service account (SA), which Aiven needs for accessing your Google Cloud account.
In the Create custom cloud wizard:
-
Specify cloud details:
- Cloud provider
- Region
- Custom cloud name
- Infrastructure tags
Click Next.
-
Specify deployment and storage details:
-
Choose between:
- Private model, which routes traffic through a proxy for additional security utilizing a bastion host logically separated from the Aiven services.
- Public model, which allows the Aiven control plane to connect to the service nodes via the public internet.
-
CIDR
The CIDR block defines the IP address range of the VPC that Aiven creates in your own cloud account. Any Aiven service created in the custom cloud will be placed in the VPC and will get an IP address within this address range.
In the CIDR field, specify an IP address range for the BYOC VPC using a CIDR block notation, for example:
10.0.0.0/16
,172.31.0.0/16
, or192.168.0.0/20
.Make sure that an IP address range you use meets the following requirements:
-
IP address range is within the private IP address ranges allowed in RFC 1918.
-
CIDR block size is between
/16
(65536 IP addresses) and/24
(256 IP addresses). -
CIDR block is large enough to host the desired number of services after splitting it into per-availability-zone subnets.
For example, the smallest
/24
CIDR block might be enough for a few services but can pose challenges during node replacements or maintenance upgrades if running low on available free IP addresses. -
CIDR block of your BYOC VCP doesn't overlap with the CIDR blocks of VPCs you plan to peer your BYOC VPC with. You cannot change the BYOC VPC CIDR block after your custom cloud is created.
-
Click Generate template.
-
Your infrastructure Terraform template gets generated based on your inputs. You can view, copy, or download it. Now, you can use the template to acquire a privilege-bearing service account.
Deploy the template
Use the generated Terraform template to create a privilege-bearing service account by deploying the template in your Google Cloud account.
Continue working in the Create custom cloud wizard:
-
Copy or download the template and the variables file from the Create custom cloud wizard.
-
Optionally, modify the template as needed.
noteTo connect to a custom-cloud service from different security groups (other than the one dedicated for the custom cloud) or from IP address ranges, add specific ingress rules before you apply the Terraform infrastructure template in your Google Cloud account in the process of creating a custom cloud resources.
Before adding ingress rules, see the examples provided in the Terraform template you generated and downloaded from Aiven Console.
-
Use Terraform to deploy the infrastructure template in your Google Cloud account with the provided variables.
importantWhen running
terraform plan
andterraform apply
, add-var-file=FILE_NAME.tfvars
as an option. -
Find a privilege-bearing service account in the output script after running the template.
-
Supply the privilege-bearing service account into the Create custom cloud wizard.
-
Click Next to proceed or park your cloud setup and save your current configuration as a draft by selecting Save draft. You can resume creating your cloud later.
Set up your custom cloud's availability
Select in which projects you'll be able to use your new custom cloud as a hosting cloud for services. In the projects where you enable your custom cloud, you can create new services in the custom cloud or migrate your existing services to the custom cloud if your service and networking configuration allows it. For more information on migrating your existing services to the custom cloud, contact your account team.
Your cloud can be available in:
- All the projects in your organization
- Selected organizational units
- Specific projects only
To set up your cloud's availability in the Create custom cloud wizard > the Assign BYOC to projects section, select one of the two following options:
- By default for all projects to make your custom cloud available in all existing and future projects in the organization
- By selection to pick specific projects or organizational units where you want your custom cloud to be available.
By selecting an organizational unit, you make your custom cloud available from all the projects in this unit.
Add customer contacts
Select at least one person whom Aiven can contact in case of any technical issues with your custom cloud.
Admin is a mandatory role, which is required as a primary support contact.
In the Create custom cloud wizard > the Customer contacts section:
- Select a contact person's role using the Job title menu, and provide their email address in the Email field.
- Use + Add another contact to add as many customer contacts as needed for your custom cloud.
- Click Save and validate.
The custom cloud process has been initiated.
Complete the cloud setup
Select Done to close the Create custom cloud wizard.
The deployment of your new custom cloud might take a few minutes. As soon as it's over, and your custom cloud is ready to use, you'll be able to see it in the list of your custom clouds in the Bring your own cloud view.
Your new custom cloud is ready to use only after its status changes to Active.
-
Generate an IaC template by running avn byoc create.
avn byoc create \
--organization-id "ORGANIZATION_ID" \
--deployment-model "DEPLOYMENT_MODEL_NAME" \
--cloud-provider "google" \
--cloud-region "CLOUD_REGION_NAME" \
--reserved-cidr "CIDR_BLOCK" \
--display-name "CUSTOM_CLOUD_DISPLAY_NAME"Replace the following:
ORGANIZATION_ID
with the ID of your Aiven organization to connect with your own cloud account to create the custom cloud, for exampleorg123a456b789
. Get yourORGANIZATION_ID
from the Aiven Console or CLI.DEPLOYMENT_MODEL_NAME
with the type of network architecture your custom cloud uses:standard_public
(public) model: The nodes have public IPs and can be configured to be publicly accessible for authenticated users. The Aiven control plane can connect to the service nodes via the public internet.standard
(private) model: The nodes reside in a VPC without public IP addresses and are by default not accessible from outside. Traffic is routed through a proxy for additional security utilizing a bastion host logically separated from the Aiven services.
CLOUD_REGION_NAME
with the name of a Google region where to create your custom cloud, for exampleeurope-north1
. See all available options in Google Cloud regions.CIDR_BLOCK
with a CIDR block defining the IP address range of the VPC that Aiven creates in your own cloud account, for example:10.0.0.0/16
,172.31.0.0/16
, or192.168.0.0/20
.CUSTOM_CLOUD_DISPLAY_NAME
with the name of your custom cloud, which you can set arbitrarily.
Show sample output
{
"custom_cloud_environment": {
"cloud_provider": "google",
"cloud_region": "europe-north1",
"contact_emails": [
{
"email": "firstname.secondname@domain.com",
"real_name": "Test User",
"role": "Admin"
}
],
"custom_cloud_environment_id": "018b6442-c602-42bc-b63d-438026133f60",
"deployment_model": "standard",
"display_name": "My BYOC Cloud on Google",
"errors": [],
"reserved_cidr": "10.0.0.0/16",
"state": "draft",
"tags": {},
"update_time": "2024-05-07T14:24:18Z"
}
} -
Deploy the IaC template.
-
Download the template and the variable file:
-
avn byoc template terraform get-template
avn byoc template terraform get-template \
--organization-id "ORGANIZATION_ID" \
--byoc-id "CUSTOM_CLOUD_ID" >| "tf_dir/tf_file.tf"Replace the following:
ORGANIZATION_ID
with the ID of your Aiven organization to connect with your own cloud account to create the custom cloud, for exampleorg123a456b789
. Get yourORGANIZATION_ID
from the Aiven Console or CLI.CUSTOM_CLOUD_ID
with the identifier of your custom cloud, which you can extract from the output of the avn byoc list command, for example018b6442-c602-42bc-b63d-438026133f60
.
-
avn byoc template terraform get-vars
avn byoc template terraform get-vars \
--organization-id "ORGANIZATION_ID" \
--byoc-id "CUSTOM_CLOUD_ID" >| "tf_dir/tf_file.tfvars"Replace the following:
ORGANIZATION_ID
with the ID of your Aiven organization to connect with your own cloud account to create the custom cloud, for exampleorg123a456b789
. Get yourORGANIZATION_ID
from the Aiven Console or CLI.CUSTOM_CLOUD_ID
with the identifier of your custom cloud, which you can extract from the output of the avn byoc list command, for example018b6442-c602-42bc-b63d-438026133f60
.
-
-
Optionally, modify the template as needed.
noteTo connect to a custom-cloud service from different security groups (other than the one dedicated for the custom cloud) or from IP address ranges, add specific ingress firewall rules before you apply the Terraform infrastructure template in your Google Cloud account in the process of creating a custom cloud resources.
Before adding ingress rules, see the examples provided in the Terraform template you generated and downloaded from the Aiven Console.
-
Use Terraform to deploy the infrastructure template with the provided variables in your Google Cloud account. This will generate a privilege-bearing service account (SA).
importantWhen running
terraform plan
andterraform apply
, add-var-file=FILE_NAME.tfvars
as an option. -
Find
privilege_bearing_service_account_id
in the output script after running the template.
-
-
Provision resources by running avn byoc provision and passing the generated
google-privilege-bearing-service-account-id
as an option.avn byoc provision \
--organization-id "ORGANIZATION_ID" \
--byoc-id "CUSTOM_CLOUD_ID" \
--google-privilege-bearing-service-account-id "GENERATED_SERVICE_ACCOUNT_ID"Replace the following:
ORGANIZATION_ID
with the ID of your Aiven organization to connect with your own cloud account to create the custom cloud, for exampleorg123a456b789
. Get yourORGANIZATION_ID
from the Aiven Console or CLI.CUSTOM_CLOUD_ID
with the identifier of your custom cloud, which you can extract from the output of the avn byoc list command, for example018b6442-c602-42bc-b63d-438026133f60
.GENERATED_SERVICE_ACCOUNT_ID
with the identifier of the service account created when running the infrastructure template in your Google Cloud account, for exampleprojects/your-project/serviceAccounts/cce-cce0123456789a@your-project.iam.gserviceaccount.com
. You can extractGENERATED_SERVICE_ACCOUNT_ID
from the output of theterraform apply
command orterraform output
command.
-
Enable your custom cloud in organizations, projects, or units by running avn byoc cloud permissions add.
avn byoc cloud permissions add \
--organization-id "ORGANIZATION_ID" \
--byoc-id "CUSTOM_CLOUD_ID" \
--account "ACCOUNT_ID"Replace the following:
ORGANIZATION_ID
with the ID of your Aiven organization to connect with your own cloud account to create the custom cloud, for exampleorg123a456b789
. Get yourORGANIZATION_ID
from the Aiven Console or CLI.CUSTOM_CLOUD_ID
with the identifier of your custom cloud, which you can extract from the output of the avn byoc list command, for example018b6442-c602-42bc-b63d-438026133f60
.ACCOUNT_ID
with the identifier of your account (organizational unit) in Aiven, for examplea484338c34d7
. You can extractACCOUNT_ID
from the output of theavn organization list
command.
-
Add customer contacts for the new cloud by running avn byoc update.
avn byoc update \
--organization-id "ORGANIZATION_ID" \
--byoc-id "CUSTOM_CLOUD_ID" \
'
{
"contact_emails": [
{
"email": "EMAIL_ADDRESS",
"real_name": "John Doe",
"role": "Admin"
}
]
}
'Replace the following:
ORGANIZATION_ID
with the ID of your Aiven organization to connect with your own cloud account to create the custom cloud, for exampleorg123a456b789
. Get yourORGANIZATION_ID
from the Aiven Console or CLI.CUSTOM_CLOUD_ID
with the identifier of your custom cloud, which you can extract from the output of the avn byoc list command, for example018b6442-c602-42bc-b63d-438026133f60
.