Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Current »

Overview


Amazon Web Services (AWS) is a subsidiary of Amazon that provides these metered pay-as-you-go services:

  • On-demand cloud computing platforms

  • APIs to individuals, companies, and governments

Deploying an AWS Terraform Blueprint is a three-step process where you’ll need to:

  1. Create a Terraform Blueprint

  2. Provision your Resource using Terraform Blueprint

  3. Deploy your Terraform Blueprint

Before you begin
Ensure that you have access to at least one resource pool.

Create a Terraform Blueprint


Create a Terraform-based Blueprint is a three-step process. You’ll need to:

  1. Configure a Terraform Backend State

  2. Create a Terraform Workspace

  3. Create a Terraform Blueprint

Configure a Backend State


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. [1]

To create a Terraform Backend State:

  1. Log in to your HCP portal account.

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

  3. 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.

    3. Select your Resource Pool from the drop-down list.

    4. Enter a brief Description of your Backend State.

    5. To entitle users to your Backend State, select:

      • Only Me: 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 you want to share the backend state 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.

  4. 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


Workspaces are collections of infrastructure that run locally. 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. 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 through workspaces instead of directories. The terraform workspace organizes your infrastructure into groups. You can create a workspace to manage your collection of infrastructure resources.

To create a Terraform Workspace: [1]

  1. Login to your HCP account.

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

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

    1. Enter your workspace Name.

    2. Enter a brief description of your Workspace.

    3. Select your workspace Environment.

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

    5. Select your Resource Pool from the drop-down list.

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

    7. 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.

  4. 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


Terraform-based blueprints let you create infrastructure on your cloud environment using a template.

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

  1. Download the Sample Terraform Template.

  2. Zip the downloaded files.
    Example: aws-s3-bucket-tf.zip

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

Follow these steps to create a Terraform-based blueprint:

  1. Log in to your HCP portal account.

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

  3. Enter these details in the New Terraform dialog:

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

    2. Enter a brief description of your Terraform Template. This is an optional field.

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

    4. Configure your Terraform template version. This is an optional step.

    5. Select AWS from the Cloud Type drop-down list.

    6. To entitle users to your Terraform template, select:

      • Only Me: 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 you want to share your Terraform template 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.

      • 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


You can provision your Terreform Blueprints in the Amazon Web Service(AWS) resource once you have created Terraform workspace.

You can use the following steps to 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 Overview page, 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

Example: hgprodawswks1.

  1. Click on

Timeline Tab to monitor the status of the Terraform provisioning.

  1. Once the Terraform template has successfully provisioned, click on the

Resource Tab to view the resources created via the Terraform template.

More Terraform templates can be created by referring to Terraform Templates.

Note

  • (1) All values must be enclosed in double-quotes.

  • (2)The Terraform template ensures that there are no resources are being updated or deleted in its first deployment.

    • If so, then verifies that this is intentional and then proceed to the next step.


Deploy your Terraform Blueprint


Once you’ve provisioned a Terraform Blueprint, you’ll need to deploy it. Follow these steps to deploy your Terraform Blueprint:

  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.

  • No labels