Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Configure a Terraform Backend State

  2. Create a Terraform Workspace

  3. Create a Terraform Blueprint

Configure a Backend State

...

To provision, your Terraform requires a backend state configured via the HyperCloud™ Platform(HCP). The backend state in Terraform preserves A Terraform backend allows for abstraction and determines how a state is loaded, and operations executed. Terraform uses the local backend by default. In the HCP portal, a Terraform Backend state stores the current state of the deployment. (Refer Note [1) You can use the following steps to configure your ]

To create a Terraform Backend State:

  1. Login Log in to HyperCloudTM with your credentialsyour HCP portal account.

  2. Click Service Orchestration > Select AppStore > Click Terraform

  3. Click on Terraform Blueprint to open your Blueprint Azure Postgres (PaaS)

  4. On the Overview page, review details and click Next

  5. On the Workspace page:

    Select the Workspace type as New:

  6. Enter the name for your new workspace.

  7. Enter the brief description for your new workspace.

  8. Select the environment type

    Click Service Orchestration and navigate to Services > Infra as Code > Backend State > Click + New Backend State.

  9. Enter the following details in the New backend State dialog:

    1. Enter a Name for your Backend State.

    2. Select the Cloud Type from the drop-down list

      e

      .

      g: Dev.

    3. Select

      the Cloud type

      your Resource Pool from the drop-down list.

    4. Select the Resource pool e.g: RP.ARM.Australia Central.atest

    5. Select the backend state for your new workspace
    6. Enter a brief Description of your Backend State.

    7. To

      entitled users

      entitle users to your Backend State, select:

      Select
      • Only Me:

      If this template is not meant to be shared.
    8. Select Everyone If this template is to be shared with everyone in the.

    9. Select
      • if you do not want anyone to access your backend state.

      • Everyone: if you want to share your backend state with everyone.

      • Groups & Users: if

      the template is to be shared
      • you want to share the backend state with specific users or groups.

    10. Click Create Workspace and Validate

    11. Select the workspace type as Existing and Select the existing workspace e.g. hgprodazurewks1 and click Validate

  10. On the Define Variables page, click on the Action button and update the following values:

    • rg_name: "hgprod-tf-rg"

    • pg_name: "hgprod-psqlsrv01"

    • client_startip: "your system's public ip address"

    • client_endip: "your system's public ip address"

  11. Click on Plan

  12. Review the Successful Plan Output.

  13. Click on Apply

  14. Click on the Workspace for e.g hgprodazurewks1

  15. Click on Timeline Tab to monitor the status of the Terraform provisioning.

  16. Once the Terraform template has successfully provisioned, click on the Resource Tab to view the resources created via Terraform template

To create additional templates refer to the Terraform documentation.

Note

...

All values must be enclosed in double-quotes.

...

Terraform Template provides the information regarding, Overlapping the Existing Workspace that may destroy the existing deployment.

...

If this is the first time a Terraform template is being deployed, ensure no resources are updated or deleted.

...

        1. Enter the first three alphabets of the username in the Users drop-down and select the username.

        2. Type the first three alphabets of the Group Name in the Groups drop-down and select the group name.

  1. Click Save Changes.

Note

  • [1] If the backend state has no state saved previously, the Terraform plan will provide you an information object which will be created.

    • Otherwise, the Terraform output will show updates and delete tasks too, which means existing resources will change if ignored.

Create your Terraform Workspace

...

The Workspaces are collections of infrastructure when you that run locally, Terraform manages . In other words, a workspace is an isolated instance of state data for a Terraform CLI. A Terraform workspace manages each collection of infrastructure with a persistent working directory, which contains a configuration, state data, and variables. The . You can create multiple workspaces to manage various sets of discrete infrastructure from a single configuration in a single directory. The Terraform cloud manages infrastructure collections with workspaces instead through workspaces instead of directories. The terraform workspace organizes your infrastructure in a good manner into groups. You can create your new a workspace to manage your collection of infrastructure resources.

You can use the following steps to Create your To create a Terraform Workspace: [1]

...

  1. Login to the HyperCloud™ Platform(HCP) with your credentials.Click Services Orchestration > Select Services > Click on Infra your HCP account.

  2. Click Service Orchestration and navigate to Infra as Code > Click on Workspace > Click on + New workspaceWorkspace.

  3. Enter the following details in your new the New Workspace dialog:

    1. Enter the name Example: hgprodawswks1your workspace Name.

    2. Enter a brief description of your new workspaceWorkspace.

    3. Select a suitable environment for your new workspace , Example: devEnvironment.

    4. Select the Cloud Type from the drop-down list, Example: AWS.

    5. Select the Resource pool, Example: RP.AWS.ap-southeast-1a.<RP-Name>(Refer Note (1))

    6. Backend State: select a backend state for Example: hgprodawsbs1.

    7. To your Entitled Users:

      • Select Only Me: If this template is not meant to be shared

      • Select Everyone: If this template is to be shared with everyone in the Tenant

      • Select Groups & Users: if the template is to be shared with specific users or groups

  4. Click New Workspace.

Note

(1)In this release, the resource pool is only required to obtain the cloud provider information.

    1. your Resource Pool from the drop-down list.

    2. Select your Backend State from the drop-down list.

    3. To entitle users to your new Workspace, select: 

      • Only Me: if you do not want anyone to access your Workspace.

      • Everyone: if you want to share your Workspace with everyone.

      • Groups & Users: if you want to share the Workspace with specific users or groups.

        1. Enter the first three alphabets of the username in the Users drop-down and select the username.

        2. Type the first three alphabets of the Group Name in the Groups drop-down and select the group name.

  1. Click New Workspace.

Notes

  • [1] Resource pool contains cloud provider information. Therefore, a Terraform deployment does not affect the quota limit of the resource pool.

Create a Terraform Blueprint

...

Your Terraform-based blueprints help let you to create an Infrastructure of infrastructure on your cloud environment using a template.

Download the Sample Terraform Template

...

Tip

Before you begin
If you want to upload a Terraform-based template, follow these steps:

  1. Download the Sample Terraform Template.

...

  1. Zip the downloaded files

...

  1. .
    Example: aws-s3-bucket-tf.zip

...

  1. Follow Step 2c below to upload your Terraform template to the HCP portal.

Follow these steps to create a Terraform based HyperCloud™ Platform(HCP) Blueprint-based blueprint:

  1. Login Log in to the your HCP portal account with your credentials.

  2. Click  Services Orchestration > Select Service Orchestration and navigate to AppStore > Click on New > Select Terraform from the drop-down list.

  3. Enter the Following these details in your the New Terraform blueprintdialog:

    1. Enter a Name for the your Terraform Template,
      Example: AWS S3 Bucket.

    2. Enter a brief description of your Terraform Template. This is an optional step, enter a brief Description, for Example: Terraform Template to AWS S3 bucket.

    3. Click on Choose File and upload the aws-s3-bucket-tf.zip file

    4. field.

    5. You can create a Terraform template using a template file in .zip format. Click Choose File to upload a Terraform template file.

    6. Configure your Terraform template version. This is an optional step, configure a version, Example: 1.0

    7. Select AWS from the Cloud Type from the drop-down : select AWSlist.

    8. To your entitled usersentitle users to your Terraform template, select:

      Select
      • Only Me:

      If this template is not meant to be shared.
    9. Select Everyone: If this template is to be shared with everyone in the Tenant.

    10. Select
      • if you do not want anyone to access your Terraform template.

      • Everyone: if you want to share your Terraform template with everyone.

      • Groups & Users: if

      the template is to be shared
      • you want to share your Terraform template with specific users or groups

      .Select All Tenants (Only available to Cloud Admins): if the template is to be shared with all
      • .

        1. Enter the first three alphabets of the username in the Users drop-down and select the username.

        2. Type the first three alphabets of the Group Name in the Groups drop-down and select the group name.

      • If you are a Cloud Administrator, you can choose All Tenants to make the template available to all the tenants.

  4. Click Create.

Provision your Terraform Blueprint

...

  1. Login to your HyperCloudTM Platform(HCP) with your credentials.

  2. Click on Service Orchestration > Select AppStore > Click on Terraform > Click on the Blueprint Azure Postgres (PaaS).

  3. Click on Terraform Blueprint to open your Blueprint Azure Postgres (PaaS)

    1. On the Overviewpage, review details and click Next.

    2. On the Workspace page:

      1. Select the Workspace type as New:

        1. Enter the name for your new workspace.

        2. Enter the brief description for your new workspace.

        3. Select the environment type from the drop-down list Example: Dev.

        4. Select the Cloud type from the drop-down list.

        5. Select the Resource pool Example: RP.ARM.Australia Central.atest.

        6. Select the backend state for your new workspace.

        7. To entitled users:

          • Select Only Me: If this template is not meant to be shared.

          • Select Everyone If this template is to be shared with everyone in the.

          • Select Groups & Users: if the template is to be shared with specific users or groups.

        8. Click Create Workspace and Validate.

      2. Select the workspace type as Existing and Select the existing workspace e.g. hgprodazurewks1 and click Validate.

    3. On the Define Variables page, click on the Action button and update the following values.

      1. Bucket_name: for e.g "hg-prod-bk1"(Refer Note1)

  1. Click on Plan and

Review the Successful Plan Output. (Please refer note 2)

  1. Click on

Apply.

  1. Click on the Workspace for

...

  1. Login to your HCP portal account.

  2. Click Service Orchestration and navigate to AppStore > Terraform > Click open your Terraform Blueprint > Click Edit.

  3. Select your Workspace and click Validate.

  4. Check your Terraform variables for syntax errors by clicking Validate.

  5. Click Plan to create a plan of execution and review the changes to your deployed resource.

  6. Click Apply to deploy your Blueprint and configure your resources in the cloud provider.