Use this template to provision AWX on Virtual Private Cloud (VPC) Infrastructure in IBM Cloud by using [Terraform][] or IBM Clouds hosted Terraform solution, [Schematics][]. The AWX instance is automatically configured along with security groups so that it can be readily accessible after installation using your virtual server instance's floating IP address.
If you are deploying this template via IBM Cloud Schematics, you can skip this section and move on to the deployment section.
If you are running this code from your local machine, you will need to ensure you have the following software installed:
- IBM Cloud API Key. See here for instructions on how to create one via the Portal.
- Recent version of Terraform installed. This guide was tested on
terraform 1.5.3
. (Optional)
- tfswitch installed. Thetfswitch
utility allows you to run multiple versions of Terraform on the same system. If you do not have a particular version of terraform installed, tfswitch will download the version you select from an interactive menu.
The Terraform performs the following deployment Steps
- Provision VPC Infrastructure with one VSI
- Deploy AWX on the provisioned VSI
The deployment of AWX on IBM Cloud VPC can be done in two ways
- TODO - Add Schematics instructions
- TODO - Add Schematics deploy button
With our local prerequisites installed, we can now deploy the AWX template. The following steps will walk you through the deployment process.
-
Clone this repo and
cd
into theterraform-ibm-awx
directory.git clone https://github.com/greyhoundforty/terraform-ibm-awx.git cd terraform-ibm-awx
-
Copy the
tfvars-example
toterraform.tfvars
file and update the values as needed. See the Required Variables section for .cp tfvars-example terraform.tfvars
-
Initialize Terraform:
terraform init -upgrade
-
Run a Terraform plan:
terraform plan -out default.tfplan
-
Run Terraform apply:
terraform apply default.tfplan
-
Once the apply completes, you will see the URL for the deployed AWX instance in the Terraform output:
Apply complete! Resources: 13 added, 0 changed, 0 destroyed. Outputs: awx_access = "Access AWX via browser https://<your-floating-ip>"
Name | Description | Type |
---|---|---|
owner | Owner declaration for resource tags. e.g. 'ryantiffany' | string |
project_prefix | Represents a name of the VPC that awx will be deployed into. Resources associated with awx will be prepended with this name. | string |
region | The region to create your VPC in, such as us-south . To get a list of all regions, run ibmcloud is regions . |
string |
Name | Description |
---|---|
awx_access | The AWX web server address |
Using below command the deployed Infrastructure and AWX can be destroyed
terraform destroy
Select option Actions in the created workspace and choose Destroy Resources/Destroy workspace.
- TODO - Add Schematics destroy button image/gif
https://www.ibm.com/cloud/garage/tutorials/public-cloud-infrastructure
https://github.com/ibm-cloud-architecture/refarch-vsi-on-vpc
https://cloud.ibm.com/docs/tutorials?topic=solution-tutorials-strategies-for-resilient-applications
https://github.com/ansible/awx/blob/devel/INSTALL.md
https://github.com/Crazy450/terraform-aws-awx
https://cloud.ibm.com/docs/vpc-on-classic?topic=vpc-on-classic-about&locale=en
https://github.com/IBM-Cloud/vpc-tutorials
When you apply template, the infrastructure resources that you create incur charges as follows. To clean up the resources, you can delete your Schematics workspace or your instance. Removing the workspace or the instance cannot be undone. Make sure that you back up any data that you must keep before you start the deletion process.
- VPC: VPC charges are incurred for the infrastructure resources within the VPC, as well as network traffic for internet data transfer. For more information, see Pricing for VPC.
- VPC virtual servers: The price for your virtual server instances depends on the flavor of the instances, how many you provision, and how long the instances are run. For more information, see Pricing for Virtual Servers for VPC.